diff --git a/coreapi/callbacks.c b/coreapi/callbacks.c index 3c1717904..5c66826bb 100644 --- a/coreapi/callbacks.c +++ b/coreapi/callbacks.c @@ -62,6 +62,7 @@ static void call_received(SalCallOp *h) { if (linphone_core_get_global_state(lc) != LinphoneGlobalOn) { h->decline(SalReasonServiceUnavailable, nullptr); + h->release(); return; } @@ -101,6 +102,7 @@ static void call_received(SalCallOp *h) { list identAddresses = ServerGroupChatRoom::parseResourceLists(h->get_remote_body()); if (identAddresses.size() != 1) { h->decline(SalReasonNotAcceptable, nullptr); + h->release(); return; } IdentityAddress confAddr = L_GET_PRIVATE_FROM_C_OBJECT(lc)->mainDb->findOneToOneConferenceChatRoomAddress(from, identAddresses.front()); @@ -126,6 +128,7 @@ static void call_received(SalCallOp *h) { } else { //invite is for an unknown chatroom h->decline(SalReasonNotFound, nullptr); + h->release(); } } else { shared_ptr chatRoom = L_GET_CPP_PTR_FROM_C_OBJECT(lc)->findChatRoom( diff --git a/src/chat/chat-room/client-group-chat-room.cpp b/src/chat/chat-room/client-group-chat-room.cpp index 0635c833b..ced42e15e 100644 --- a/src/chat/chat-room/client-group-chat-room.cpp +++ b/src/chat/chat-room/client-group-chat-room.cpp @@ -170,7 +170,7 @@ void ClientGroupChatRoomPrivate::onCallSessionStateChanged ( } else if (q->getState() == ChatRoom::State::TerminationPending) qConference->getPrivate()->focus->getPrivate()->getSession()->terminate(); } else if (newState == CallSession::State::End) { - q->onConferenceTerminated(q->getConferenceAddress()); + setState(ChatRoom::State::TerminationPending); } else if (newState == CallSession::State::Released) { if (q->getState() == ChatRoom::State::TerminationPending) { if (session->getReason() == LinphoneReasonNone) { @@ -548,6 +548,11 @@ void ClientGroupChatRoom::onConferenceTerminated (const IdentityAddress &addr) { void ClientGroupChatRoom::onFirstNotifyReceived (const IdentityAddress &addr) { L_D(); + if (getState() != ChatRoom::State::Created) { + lWarning() << "First notify received in ClientGroupChatRoom that is not in the Created state, ignoring it!"; + return; + } + bool performMigration = false; shared_ptr chatRoom; if (getParticipantCount() == 1) {