]> sjero.net Git - linphone/commitdiff
fix bug in sdp offeranswer and malformed SDP.
authorSimon Morlat <simon.morlat@linphone.org>
Wed, 3 Mar 2010 10:38:13 +0000 (11:38 +0100)
committerSimon Morlat <simon.morlat@linphone.org>
Wed, 3 Mar 2010 10:38:13 +0000 (11:38 +0100)
coreapi/linphonecore.c
coreapi/offeranswer.c
coreapi/sal_eXosip2.c
coreapi/sal_eXosip2_sdp.c
mediastreamer2
oRTP

index 268e8f40f20f7854c33e99970bc7cace6469ea6a..58dde3adc0367b9ecbcc30d01cfe74e72ff308a5 100644 (file)
@@ -719,9 +719,9 @@ static int codec_compare(const PayloadType *a, const PayloadType *b){
        int ra,rb;
        ra=find_codec_rank(a->mime_type);
        rb=find_codec_rank(b->mime_type);
-       if (ra==rb) return 0;
        if (ra>rb) return 1;
        if (ra<rb) return -1;
+       return 0;
 }
 
 static MSList *add_missing_codecs(SalStreamType mtype, MSList *l){
@@ -954,7 +954,7 @@ static void linphone_core_init (LinphoneCore * lc, const LinphoneCoreVTable *vta
        linphone_core_assign_payload_type(&payload_type_speex_nb,110,"vbr=on");
        linphone_core_assign_payload_type(&payload_type_speex_wb,111,"vbr=on");
        linphone_core_assign_payload_type(&payload_type_speex_uwb,112,"vbr=on");
-       linphone_core_assign_payload_type(&payload_type_telephone_event,101,NULL);
+       linphone_core_assign_payload_type(&payload_type_telephone_event,101,"0-11");
        linphone_core_assign_payload_type(&payload_type_ilbc,113,"mode=30");
 
 #ifdef ENABLE_NONSTANDARD_GSM
index f4b914381e2ccd337e9708f1ba87bd0aa08a7c3e..2abf7174dfc03c95152fbd6eea4128d3f3897a45 100644 (file)
@@ -83,13 +83,13 @@ static void initiate_outgoing(const SalStreamDescription *local_offer,
                                        SalStreamDescription *result){
        if (remote_answer->port!=0)
                result->payloads=match_payloads(local_offer->payloads,remote_answer->payloads);
+       result->proto=local_offer->proto;
+       result->type=local_offer->type;
        if (result->payloads && !only_telephone_event(result->payloads)){
                strcpy(result->addr,remote_answer->addr);
                result->port=remote_answer->port;
                result->bandwidth=remote_answer->bandwidth;
                result->ptime=remote_answer->ptime;
-               result->proto=local_offer->proto;
-               result->type=local_offer->type;
        }else{
                result->port=0;
        }
@@ -100,13 +100,13 @@ static void initiate_incoming(const SalStreamDescription *local_cap,
                                        const SalStreamDescription *remote_offer,
                                        SalStreamDescription *result){
        result->payloads=match_payloads(local_cap->payloads,remote_offer->payloads);
+       result->proto=local_cap->proto;
+       result->type=local_cap->type;
        if (result->payloads && !only_telephone_event(result->payloads)){
                strcpy(result->addr,local_cap->addr);
                result->port=local_cap->port;
                result->bandwidth=local_cap->bandwidth;
-               result->ptime=local_cap->ptime;
-               result->proto=local_cap->proto;
-               result->type=local_cap->type;
+               result->ptime=local_cap->ptime;         
        }else{
                result->port=0;
        }
@@ -157,6 +157,7 @@ int offer_answer_initiate_incoming(const SalMediaDescription *local_capabilities
                }
     }
        result->nstreams=j;
+       strcpy(result->username, local_capabilities->username);
        strcpy(result->addr,local_capabilities->addr);
        return 0;
 }
index d3a6d224b683dd48aa2f45c49445ac6d87bcce3f..c4f00dac696fb51289829a05a3ac47c97bec6d8e 100644 (file)
@@ -373,7 +373,10 @@ int sal_call_accept(SalOp * h){
                if (h->supports_session_timers) osip_message_set_supported(msg, "timer");
        }
 
-       if (contact) osip_message_set_contact(msg,contact);
+       if (contact) {
+               osip_list_special_free(&msg->contacts,(void (*)(void*))osip_contact_free);
+               osip_message_set_contact(msg,contact);
+       }
        
        if (h->base.local_media){
                /*this is the case where we received an invite without SDP*/
@@ -536,6 +539,10 @@ static void handle_reinvite(Sal *sal,  eXosip_event_t *ev){
        if (op->base.root->session_expires!=0){
                if (op->supports_session_timers) osip_message_set_supported(msg, "timer");
        }
+       if (op->base.contact){
+               osip_list_special_free(&msg->contacts,(void (*)(void*))osip_contact_free);
+               osip_message_set_contact(msg,op->base.contact);
+       }
        if (sdp){
                op->sdp_offering=FALSE;
                op->base.remote_media=sal_media_description_new();
@@ -644,7 +651,6 @@ static void call_terminated(Sal *sal, eXosip_event_t *ev){
 
 static void call_released(Sal *sal, eXosip_event_t *ev){
        SalOp *op;
-       char *from;
        op=(SalOp*)ev->external_reference;
        if (op==NULL){
                return;
index 3dfde45d3a4f1a149868ed40ae893cf042eaf352..c1a1761cc414b24ff6da258d03d5529e75cd3e0a 100644 (file)
@@ -134,7 +134,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->type==PAYLOAD_AUDIO_CONTINUOUS || pt->type==PAYLOAD_AUDIO_PACKETIZED)
+       if (pt->channels>0)
                snprintf (attr,sizeof(attr),"%i %s/%i/%i", payload_type_get_number(pt), 
                        pt->mime_type, pt->clock_rate,pt->channels);
        else
index ae7dfdcaea6d5fe6d4f44a6247b4ca506799e379..2e18cdfe53230763907f3f9b55adeb4c16d396a7 160000 (submodule)
@@ -1 +1 @@
-Subproject commit ae7dfdcaea6d5fe6d4f44a6247b4ca506799e379
+Subproject commit 2e18cdfe53230763907f3f9b55adeb4c16d396a7
diff --git a/oRTP b/oRTP
index 36773054c1e9a47029432a2e8540161dad426293..0424a6538e1741e064c8d8573efee365b25593f1 160000 (submodule)
--- a/oRTP
+++ b/oRTP
@@ -1 +1 @@
-Subproject commit 36773054c1e9a47029432a2e8540161dad426293
+Subproject commit 0424a6538e1741e064c8d8573efee365b25593f1