...
 
Commits (70)
......@@ -2112,6 +2112,7 @@ static void linphone_core_register_default_codecs(LinphoneCore *lc){
/*default enabled video codecs, in order of preference*/
linphone_core_register_payload_type(lc,&payload_type_vp8,NULL,TRUE);
linphone_core_register_payload_type(lc,&payload_type_h264,"profile-level-id=42801F",TRUE);
linphone_core_register_payload_type(lc,&payload_type_h265,NULL,TRUE);
linphone_core_register_payload_type(lc,&payload_type_mp4v,"profile-level-id=3",TRUE);
linphone_core_register_payload_type(lc,&payload_type_h263_1998,"CIF=1;QCIF=1",FALSE);
linphone_core_register_payload_type(lc,&payload_type_h263,NULL,FALSE);
......
......@@ -236,9 +236,7 @@ LinphoneChatMessage *linphone_chat_room_get_last_message_in_history(LinphoneChat
if (!cppPtr)
return nullptr;
LinphoneChatMessage *object = L_INIT(ChatMessage);
L_SET_CPP_PTR_FROM_C_OBJECT(object, cppPtr);
return object;
return linphone_chat_message_ref(L_GET_C_BACK_PTR(cppPtr));
}
LinphoneChatMessage *linphone_chat_room_find_message (LinphoneChatRoom *cr, const char *message_id) {
......
......@@ -2231,8 +2231,10 @@ void MediaSessionPrivate::handleIceEvents (OrtpEvent *ev) {
}
iceAgent->updateIceStateInCallStats();
} else if (evt == ORTP_EVENT_ICE_GATHERING_FINISHED) {
if (!evd->info.ice_processing_successful)
lWarning() << "No STUN answer from [" << linphone_core_get_stun_server(q->getCore()->getCCore()) << "], continuing without STUN";
if (!evd->info.ice_processing_successful) {
std::string stunServer(linphone_core_get_stun_server(q->getCore()->getCCore())?linphone_core_get_stun_server(q->getCore()->getCCore()):"not-set");
lWarning() << "No STUN answer from [" << stunServer << "], continuing without STUN";
}
iceAgent->gatheringFinished();
switch (state) {
case CallSession::State::Updating:
......@@ -3729,7 +3731,7 @@ void MediaSessionPrivate::accept (const MediaSessionParams *msp, bool wasRinging
L_Q();
if (msp) {
setParams(new MediaSessionParams(*msp));
iceAgent->prepare(localDesc, true);
iceAgent->prepare(localDesc, true, false /*we don't allow gathering now, it must have been done before*/);
makeLocalMediaDescription();
op->setLocalMediaDescription(localDesc);
}
......
......@@ -127,7 +127,7 @@ bool IceAgent::isControlling () const {
return ice_session_role(iceSession) == IR_Controlling;
}
bool IceAgent::prepare (const SalMediaDescription *localDesc, bool incomingOffer) {
bool IceAgent::prepare (const SalMediaDescription *localDesc, bool incomingOffer, bool allowGathering) {
if (!iceSession)
return false;
......@@ -147,10 +147,11 @@ bool IceAgent::prepare (const SalMediaDescription *localDesc, bool incomingOffer
prepareIceForStream(mediaSession.getPrivate()->getMediaStream(LinphoneStreamTypeText), true);
// Start ICE gathering.
if (incomingOffer)
if (incomingOffer){
// This may delete the ice session.
updateFromRemoteMediaDescription(localDesc, remoteDesc, true);
if (iceSession && !ice_session_candidates_gathered(iceSession)) {
}
if (iceSession && allowGathering && !ice_session_candidates_gathered(iceSession)) {
mediaSession.getPrivate()->prepareStreamsForIceGathering(hasVideo);
int err = gatherIceCandidates();
if (err == 0) {
......
......@@ -57,7 +57,7 @@ public:
}
bool isControlling () const;
bool prepare (const SalMediaDescription *localDesc, bool incomingOffer);
bool prepare (const SalMediaDescription *localDesc, bool incomingOffer, bool allowGathering = true);
void prepareIceForStream (MediaStream *ms, bool createChecklist);
void resetSession (IceRole role);
void restartSession (IceRole role);
......
......@@ -459,11 +459,17 @@ int SalOp::getAddressFamily() const {
if (mRefresher) {
belle_sip_response_t *resp = belle_sip_transaction_get_response(tr);
belle_sip_header_via_t *via = resp ?belle_sip_message_get_header_by_type(resp,belle_sip_header_via_t):NULL;
const char *host;
if (!via){
ms_error("Unable to determine IP version from signaling operation, no via header found.");
return AF_UNSPEC;
}
return (strchr(belle_sip_header_via_get_host(via),':') != NULL) ? AF_INET6 : AF_INET;
host = belle_sip_header_via_get_host(via);
if (!host){
ms_error("Unable to determine IP version from signaling operation, no via header is not yet completed.");
return AF_UNSPEC;
}
return (strchr(host,':') != NULL) ? AF_INET6 : AF_INET;
} else {
belle_sip_request_t *req = belle_sip_transaction_get_request(tr);
contact=(belle_sip_header_address_t*)belle_sip_message_get_header_by_type(req,belle_sip_header_contact_t);
......