From 800c9a97b11d2a07b1e67ad5158e7a4c85001a7b Mon Sep 17 00:00:00 2001 From: Simon Morlat Date: Wed, 16 Mar 2011 17:37:30 +0100 Subject: [PATCH] reduce sdp size (exceeds ethernet mtu!) --- coreapi/linphonecall.c | 2 +- coreapi/linphonecore.c | 9 +++++++-- coreapi/sal_eXosip2_sdp.c | 4 ++-- 3 files changed, 10 insertions(+), 5 deletions(-) diff --git a/coreapi/linphonecall.c b/coreapi/linphonecall.c index 899cb66cb..9a21ca65b 100644 --- a/coreapi/linphonecall.c +++ b/coreapi/linphonecall.c @@ -110,7 +110,7 @@ void update_local_media_description(LinphoneCore *lc, LinphoneCall *call, SalMed } SalMediaDescription *create_local_media_description(LinphoneCore *lc, LinphoneCall *call){ - unsigned int id=rand(); + unsigned int id=rand() & 0xfff; return _create_local_media_description(lc,call,id,id); } diff --git a/coreapi/linphonecore.c b/coreapi/linphonecore.c index 062e345b0..36e42b1f2 100644 --- a/coreapi/linphonecore.c +++ b/coreapi/linphonecore.c @@ -658,6 +658,7 @@ static const char *codec_pref_order[]={ "theora", "H263-1998", "H263", + "x-snow", NULL, }; @@ -692,7 +693,10 @@ static MSList *add_missing_codecs(SalStreamType mtype, MSList *l){ } if (pt && ms_filter_codec_supported(pt->mime_type)){ if (ms_list_find(l,pt)==NULL){ - payload_type_set_flag(pt,PAYLOAD_TYPE_ENABLED); + /*do not enable old or experimental codecs by default*/ + if (strcasecmp(pt->mime_type,"H263")!=0 && strcasecmp(pt->mime_type,"x-snow")!=0){ + payload_type_set_flag(pt,PAYLOAD_TYPE_ENABLED); + } ms_message("Adding new codec %s/%i with fmtp %s", pt->mime_type,pt->clock_rate,pt->recv_fmtp ? pt->recv_fmtp : ""); l=ms_list_insert_sorted(l,pt,(int (*)(const void *, const void *))codec_compare); @@ -959,7 +963,8 @@ static void linphone_core_init (LinphoneCore * lc, const LinphoneCoreVTable *vta linphone_core_assign_payload_type(&payload_type_mp4v,99,"profile-level-id=3"); linphone_core_assign_payload_type(&payload_type_x_snow,100,NULL); linphone_core_assign_payload_type(&payload_type_h264,102,"profile-level-id=428014"); - linphone_core_assign_payload_type(&payload_type_h264,103,"packetization-mode=1;profile-level-id=428014"); + /* due to limited space in SDP, we have to disable this h264 line which is normally no more necessary */ + /* linphone_core_assign_payload_type(&payload_type_h264,103,"packetization-mode=1;profile-level-id=428014");*/ #endif ms_init(); diff --git a/coreapi/sal_eXosip2_sdp.c b/coreapi/sal_eXosip2_sdp.c index d6e671b86..fcf06f425 100644 --- a/coreapi/sal_eXosip2_sdp.c +++ b/coreapi/sal_eXosip2_sdp.c @@ -141,7 +141,7 @@ static sdp_message_t *create_generic_sdp(const SalMediaDescription *desc) osip_strdup (sessid), osip_strdup (sessver), osip_strdup ("IN"), inet6 ? osip_strdup("IP6") : osip_strdup ("IP4"), osip_strdup (desc->addr)); - sdp_message_s_name_set (local, osip_strdup ("A conversation")); + sdp_message_s_name_set (local, osip_strdup ("Talk")); if(!sal_media_description_has_dir (desc,SalStreamSendOnly)) { sdp_message_c_connection_add (local, -1, @@ -166,7 +166,7 @@ static void add_payload(sdp_message_t *msg, int line, const PayloadType *pt) { char attr[256]; sdp_message_m_payload_add (msg,line, int_2char (payload_type_get_number(pt))); - if (pt->channels>0) + if (pt->channels>1) snprintf (attr,sizeof(attr),"%i %s/%i/%i", payload_type_get_number(pt), pt->mime_type, pt->clock_rate,pt->channels); else