From d2e8f7d23903a26842e7d51f146648cff9544ce3 Mon Sep 17 00:00:00 2001 From: Simon Morlat Date: Fri, 22 Mar 2013 12:05:48 +0100 Subject: [PATCH 1/6] update ms2 --- mediastreamer2 | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/mediastreamer2 b/mediastreamer2 index 430cc1376..dc277cd95 160000 --- a/mediastreamer2 +++ b/mediastreamer2 @@ -1 +1 @@ -Subproject commit 430cc1376d68b1a8d82799357abea9e3e1c536f8 +Subproject commit dc277cd95ec334066948c91dd9bf024c1ff1d933 From 939c0f4ce0fe8c6a15ffc6de2fca43302e8876cc Mon Sep 17 00:00:00 2001 From: Sylvain Berfini Date: Fri, 22 Mar 2013 16:34:09 +0100 Subject: [PATCH 2/6] Revert "Send ZRTP hello hash in SIP SDP." This reverts commit 71f31347fcddaa5f0e9e329a7320efe60bc7c281. Conflicts: coreapi/linphonecall.c mediastreamer2 --- coreapi/linphonecall.c | 41 +++++++++------------------------------ coreapi/linphonecore.c | 8 +------- coreapi/offeranswer.c | 1 - coreapi/sal.h | 3 +-- coreapi/sal_eXosip2_sdp.c | 28 +++----------------------- oRTP | 2 +- 6 files changed, 15 insertions(+), 68 deletions(-) diff --git a/coreapi/linphonecall.c b/coreapi/linphonecall.c index 2770d4ada..6c01c65bd 100644 --- a/coreapi/linphonecall.c +++ b/coreapi/linphonecall.c @@ -254,14 +254,6 @@ void linphone_call_make_local_media_description(LinphoneCore *lc, LinphoneCall * l=ms_list_append(l,pt); md->streams[0].payloads=l; - // if ZRTP is enabled, put the hello hash into the audiostream's desc - if (call->audiostream && call->audiostream->ms.zrtp_context!=NULL){ - ortp_zrtp_get_hello_hash(call->audiostream->ms.zrtp_context, - md->streams[0].zrtp_hello_hash, - sizeof(md->streams[0].zrtp_hello_hash)); - ms_message("Audio stream zrtp hash: %s", md->streams[0].zrtp_hello_hash); - } - if (call->params.has_video){ md->n_active_streams++; md->streams[1].rtp_port=call->video_port; @@ -270,13 +262,6 @@ void linphone_call_make_local_media_description(LinphoneCore *lc, LinphoneCall * md->streams[1].type=SalVideo; l=make_codec_list(lc,lc->codecs_conf.video_codecs,0,NULL,-1); md->streams[1].payloads=l; - // if ZRTP is enabled, put the hello hash into the audiostream's desc - if (call->videostream && call->videostream->ms.zrtp_context!=NULL){ - ortp_zrtp_get_hello_hash(call->videostream->ms.zrtp_context, - md->streams[1].zrtp_hello_hash, - sizeof(md->streams[1].zrtp_hello_hash)); - ms_message("Video stream zrtp hash: %s", md->streams[1].zrtp_hello_hash); - } } if (md->n_total_streams < md->n_active_streams) md->n_total_streams = md->n_active_streams; @@ -1309,20 +1294,6 @@ void linphone_call_init_video_stream(LinphoneCall *call){ void linphone_call_init_media_streams(LinphoneCall *call){ linphone_call_init_audio_stream(call); linphone_call_init_video_stream(call); - - // moved from linphone_call_start_media_streams, because ZRTP needs to be - // at least partially initialized so that the SDP can contain 'zrtp-hash' - if (call->params.media_encryption==LinphoneMediaEncryptionZRTP) { - OrtpZrtpParams params; - /*will be set later when zrtp is activated*/ - call->current_params.media_encryption=LinphoneMediaEncryptionNone; - - params.zid_file=call->core->zrtp_secrets_cache; - audio_stream_enable_zrtp(call->audiostream,¶ms); - } else if (call->params.media_encryption==LinphoneMediaEncryptionSRTP){ - call->current_params.media_encryption=linphone_call_are_all_streams_encrypted(call) ? - LinphoneMediaEncryptionSRTP : LinphoneMediaEncryptionNone; - } } @@ -1765,10 +1736,16 @@ void linphone_call_start_media_streams(LinphoneCall *call, bool_t all_inputs_mut call->playing_ringbacktone=send_ringbacktone; call->up_bw=linphone_core_get_upload_bandwidth(lc); - // ZRTP was initialized in linphone_call_init_media_streams with a - // partially iniitalized RtpSession, and now needs to get an update if (call->params.media_encryption==LinphoneMediaEncryptionZRTP) { - ortp_zrtp_start_engine(call->audiostream->ms.zrtp_context,call->audiostream->ms.session); + OrtpZrtpParams params; + /*will be set later when zrtp is activated*/ + call->current_params.media_encryption=LinphoneMediaEncryptionNone; + + params.zid_file=lc->zrtp_secrets_cache; + audio_stream_enable_zrtp(call->audiostream,¶ms); + }else if (call->params.media_encryption==LinphoneMediaEncryptionSRTP){ + call->current_params.media_encryption=linphone_call_are_all_streams_encrypted(call) ? + LinphoneMediaEncryptionSRTP : LinphoneMediaEncryptionNone; } /*also reflect the change if the "wished" params, in order to avoid to propose SAVP or video again diff --git a/coreapi/linphonecore.c b/coreapi/linphonecore.c index 542241262..0089dd0fb 100644 --- a/coreapi/linphonecore.c +++ b/coreapi/linphonecore.c @@ -3126,14 +3126,8 @@ int linphone_core_accept_call_with_params(LinphoneCore *lc, LinphoneCall *call, sal_call_set_local_media_description(call->op,call->localdesc); } - if (call->audiostream==NULL){ + if (call->audiostream==NULL) linphone_call_init_media_streams(call); - // the local media description must be regenerated after the audiostream - // is initialized, otherwise the ZRTP hello hash will not be available - linphone_call_make_local_media_description(lc,call); - sal_call_set_local_media_description(call->op,call->localdesc); - } - if (!was_ringing && call->audiostream->ms.ticker==NULL){ audio_stream_prepare_sound(call->audiostream,lc->sound_conf.play_sndcard,lc->sound_conf.capt_sndcard); } diff --git a/coreapi/offeranswer.c b/coreapi/offeranswer.c index eefe34d45..9823c24a6 100644 --- a/coreapi/offeranswer.c +++ b/coreapi/offeranswer.c @@ -261,7 +261,6 @@ static void initiate_incoming(const SalStreamDescription *local_cap, result->ice_completed = local_cap->ice_completed; memcpy(result->ice_candidates, local_cap->ice_candidates, sizeof(result->ice_candidates)); memcpy(result->ice_remote_candidates, local_cap->ice_remote_candidates, sizeof(result->ice_remote_candidates)); - memcpy(result->zrtp_hello_hash,local_cap->zrtp_hello_hash, sizeof(result->zrtp_hello_hash)); } /** diff --git a/coreapi/sal.h b/coreapi/sal.h index 5f38c15ab..25d8d20bc 100644 --- a/coreapi/sal.h +++ b/coreapi/sal.h @@ -140,7 +140,7 @@ typedef struct SalIceRemoteCandidate { } SalIceRemoteCandidate; #define SAL_MEDIA_DESCRIPTION_MAX_ICE_REMOTE_CANDIDATES 2 -#define SAL_MEDIA_DESCRIPTION_MAX_ZRTP_HELLO_HASH 128 + #define SAL_MEDIA_DESCRIPTION_MAX_ICE_UFRAG_LEN 256 #define SAL_MEDIA_DESCRIPTION_MAX_ICE_PWD_LEN 256 @@ -172,7 +172,6 @@ typedef struct SalStreamDescription{ SalIceRemoteCandidate ice_remote_candidates[SAL_MEDIA_DESCRIPTION_MAX_ICE_REMOTE_CANDIDATES]; char ice_ufrag[SAL_MEDIA_DESCRIPTION_MAX_ICE_UFRAG_LEN]; char ice_pwd[SAL_MEDIA_DESCRIPTION_MAX_ICE_PWD_LEN]; - char zrtp_hello_hash[SAL_MEDIA_DESCRIPTION_MAX_ZRTP_HELLO_HASH]; bool_t ice_mismatch; bool_t ice_completed; } SalStreamDescription; diff --git a/coreapi/sal_eXosip2_sdp.c b/coreapi/sal_eXosip2_sdp.c index 139446448..debd8550f 100644 --- a/coreapi/sal_eXosip2_sdp.c +++ b/coreapi/sal_eXosip2_sdp.c @@ -108,17 +108,6 @@ static int _sdp_message_get_a_ptime(sdp_message_t *sdp, int mline){ return 0; } -static char * _sdp_message_get_a_zrtp_hash(sdp_message_t *sdp, int mline){ - int i; - sdp_attribute_t *attr; - for (i=0;(attr=sdp_message_attribute_get(sdp,mline,i))!=NULL;i++){ - if (keywordcmp("zrtp-hash",attr->a_att_field)==0){ - return attr->a_att_value; - } - } - return NULL; -} - static int _sdp_message_get_mline_dir(sdp_message_t *sdp, int mline){ int i; sdp_attribute_t *attr; @@ -348,11 +337,6 @@ static void add_line(sdp_message_t *msg, int lineno, const SalStreamDescription int_2char(desc->bandwidth)); if (desc->ptime>0) sdp_message_a_attribute_add(msg,lineno,osip_strdup("ptime"), int_2char(desc->ptime)); - - // if the ZRTP hello hash is available, create an a attribute for it - if (desc->zrtp_hello_hash[0]) - sdp_message_a_attribute_add(msg,lineno,osip_strdup("zrtp-hash"), osip_strdup(desc->zrtp_hello_hash)); - strip_well_known_rtpmaps=ms_list_size(desc->payloads)>5; if (desc->payloads){ for(elem=desc->payloads;elem!=NULL;elem=elem->next){ @@ -449,7 +433,7 @@ static int payload_type_fill_from_rtpmap(PayloadType *pt, const char *rtpmap){ int sdp_to_media_description(sdp_message_t *msg, SalMediaDescription *desc){ int i,j; - const char *mtype,*proto,*rtp_port,*rtp_addr,*number,*zrtp_info; + const char *mtype,*proto,*rtp_port,*rtp_addr,*number; const char *sess; sdp_bandwidth_t *sbw=NULL; sdp_attribute_t *attr; @@ -506,12 +490,7 @@ int sdp_to_media_description(sdp_message_t *msg, SalMediaDescription *desc){ stream->rtp_port=atoi(rtp_port); if (stream->rtp_port > 0) desc->n_active_streams++; - - // if the SDP contains a zrtp-hash, add it to the StreamDesc - zrtp_info = _sdp_message_get_a_zrtp_hash(msg, i); - if (zrtp_info != NULL) - strncpy(stream->zrtp_hello_hash, zrtp_info, sizeof(stream->zrtp_hello_hash)); - + stream->ptime=_sdp_message_get_a_ptime(msg,i); if (strcasecmp("audio", mtype) == 0){ stream->type=SalAudio; @@ -549,8 +528,7 @@ int sdp_to_media_description(sdp_message_t *msg, SalMediaDescription *desc){ for (j = 0; ((attr = sdp_message_attribute_get(msg, i, j)) != NULL); j++) { if ((keywordcmp("rtcp", attr->a_att_field) == 0) && (attr->a_att_value != NULL)) { char tmp[256]; - // added bounds check - int nb = sscanf(attr->a_att_value, "%d IN IP4 %256s", &stream->rtcp_port, tmp); + int nb = sscanf(attr->a_att_value, "%d IN IP4 %s", &stream->rtcp_port, tmp); if (nb == 1) { /* SDP rtcp attribute only contains the port */ } else if (nb == 2) { diff --git a/oRTP b/oRTP index c702c0ea0..dbb75fb00 160000 --- a/oRTP +++ b/oRTP @@ -1 +1 @@ -Subproject commit c702c0ea0e66bbe1f27c79690003d9748b01560f +Subproject commit dbb75fb00c65ce0102385f235c1da2873e9f6c2e From 26df3747465742eb797e809db8cc1f4138198654 Mon Sep 17 00:00:00 2001 From: Simon Morlat Date: Fri, 22 Mar 2013 22:54:27 +0100 Subject: [PATCH 3/6] update mediastreamer2 and oRTP for bugfix regarding adaptive rate control in audio only. The rate control algorithm had a bug preventing him to enhance the quality was the network returns fine, and even worse it was setting the worse quality for the rest of the call. --- mediastreamer2 | 2 +- oRTP | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/mediastreamer2 b/mediastreamer2 index dc277cd95..246292160 160000 --- a/mediastreamer2 +++ b/mediastreamer2 @@ -1 +1 @@ -Subproject commit dc277cd95ec334066948c91dd9bf024c1ff1d933 +Subproject commit 2462921605f587a51f82bd439b85fea5bd759b0b diff --git a/oRTP b/oRTP index dbb75fb00..31d242e8c 160000 --- a/oRTP +++ b/oRTP @@ -1 +1 @@ -Subproject commit dbb75fb00c65ce0102385f235c1da2873e9f6c2e +Subproject commit 31d242e8c544ed197f60630593515aef2fb580e9 From 6bfc2d674fa156c6822e540a21b7bb1307a39946 Mon Sep 17 00:00:00 2001 From: Sylvain Berfini Date: Mon, 25 Mar 2013 09:57:30 +0100 Subject: [PATCH 4/6] Updated factory to use new package for CpuUtils (org.linphone.mediastream) --- java/impl/org/linphone/core/LinphoneCoreFactoryImpl.java | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/java/impl/org/linphone/core/LinphoneCoreFactoryImpl.java b/java/impl/org/linphone/core/LinphoneCoreFactoryImpl.java index 7b21ecaae..0b799f33e 100644 --- a/java/impl/org/linphone/core/LinphoneCoreFactoryImpl.java +++ b/java/impl/org/linphone/core/LinphoneCoreFactoryImpl.java @@ -21,7 +21,7 @@ package org.linphone.core; import java.io.File; import java.io.IOException; -import org.linphone.CpuUtils; +import org.linphone.mediastream.CpuUtils; import org.linphone.mediastream.Version; import android.util.Log; From d9c2a41bd4199f0edc9451e5c3075d2fb55d1abf Mon Sep 17 00:00:00 2001 From: Simon Morlat Date: Mon, 25 Mar 2013 11:32:32 +0100 Subject: [PATCH 5/6] update ms2 --- mediastreamer2 | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/mediastreamer2 b/mediastreamer2 index 246292160..4b8d2b655 160000 --- a/mediastreamer2 +++ b/mediastreamer2 @@ -1 +1 @@ -Subproject commit 2462921605f587a51f82bd439b85fea5bd759b0b +Subproject commit 4b8d2b655acc8a329464e7806653dceb04ade445 From 5cff1fa5b119dc2bc6abe831ce584339f04b80e9 Mon Sep 17 00:00:00 2001 From: Jehan Monnier Date: Tue, 26 Mar 2013 09:13:46 +0100 Subject: [PATCH 6/6] fix compilation issue with upnp --- coreapi/upnp.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/coreapi/upnp.c b/coreapi/upnp.c index 2dfd7f39c..75d0ef9e2 100644 --- a/coreapi/upnp.c +++ b/coreapi/upnp.c @@ -338,7 +338,7 @@ UpnpContext* linphone_upnp_context_new(LinphoneCore *lc) { linphone_core_add_iterate_hook(lc, linphone_core_upnp_hook, lupnp); lupnp->upnp_igd_ctxt = NULL; - lupnp->upnp_igd_ctxt = upnp_igd_create(linphone_upnp_igd_callback, linphone_upnp_igd_print, lupnp); + lupnp->upnp_igd_ctxt = upnp_igd_create(linphone_upnp_igd_callback, linphone_upnp_igd_print, NULL, lupnp); if(lupnp->upnp_igd_ctxt == NULL) { lupnp->state = LinphoneUpnpStateKo; ms_error("Can't create uPnP IGD context");