diff --git a/coreapi/linphonecore.c b/coreapi/linphonecore.c index 35efadc56..2e5c78f36 100644 --- a/coreapi/linphonecore.c +++ b/coreapi/linphonecore.c @@ -2105,20 +2105,24 @@ static RtpProfile *make_profile(LinphoneCore *lc, const SalStreamDescription *de const MSList *elem; RtpProfile *prof=rtp_profile_new("Call profile"); bool_t first=TRUE; - if (desc->type==SalAudio){ - bw=get_min_bandwidth(lc->up_audio_bw,desc->bandwidth); - } - else bw=get_min_bandwidth(lc->up_video_bw,desc->bandwidth); + for(elem=desc->payloads;elem!=NULL;elem=elem->next){ PayloadType *pt=(PayloadType*)elem->data; + + if (first) { + if (desc->type==SalAudio){ + linphone_core_update_allocated_audio_bandwidth_in_call(lc,pt); + } + *used_pt=payload_type_get_number(pt); + first=FALSE; + } + if (desc->type==SalAudio){ + bw=get_min_bandwidth(lc->up_audio_bw,desc->bandwidth); + }else bw=get_min_bandwidth(lc->up_video_bw,desc->bandwidth); if (bw>0) pt->normal_bitrate=bw*1000; else if (desc->type==SalAudio){ pt->normal_bitrate=-1; } - if (first) { - *used_pt=payload_type_get_number(pt); - first=FALSE; - } if (desc->ptime>0){ char tmp[40]; snprintf(tmp,sizeof(tmp),"ptime=%i",desc->ptime); diff --git a/coreapi/sal_eXosip2_presence.c b/coreapi/sal_eXosip2_presence.c index 9e77a173a..9d5641024 100644 --- a/coreapi/sal_eXosip2_presence.c +++ b/coreapi/sal_eXosip2_presence.c @@ -127,8 +127,8 @@ int sal_unsubscribe(SalOp *op){ int sal_subscribe_accept(SalOp *op){ osip_message_t *msg; eXosip_lock(); - eXosip_insubscription_build_answer(op->tid,200,&msg); - eXosip_insubscription_send_answer(op->tid,200,msg); + eXosip_insubscription_build_answer(op->tid,202,&msg); + eXosip_insubscription_send_answer(op->tid,202,msg); eXosip_unlock(); return 0; } @@ -623,7 +623,14 @@ void sal_exosip_subscription_recv(Sal *sal, eXosip_event_t *ev){ ev->did=op->did; ev->nid=op->nid; sal_exosip_subscription_closed(sal,ev); - }else ms_warning("Probably a refresh subscribe"); + }else { + osip_message_t *msg=NULL; + ms_warning("Probably a refresh subscribe"); + eXosip_lock(); + eXosip_insubscription_build_answer(ev->tid,202,&msg); + eXosip_insubscription_send_answer(ev->tid,202,msg); + eXosip_unlock(); + } }else _sal_exosip_subscription_recv(sal,ev); } diff --git a/mediastreamer2 b/mediastreamer2 index 5bcbcae29..6d48f5ac0 160000 --- a/mediastreamer2 +++ b/mediastreamer2 @@ -1 +1 @@ -Subproject commit 5bcbcae29d9cf6d22b4f6880489eafa98e100008 +Subproject commit 6d48f5ac0b1e1df8f455c7b26824dae631663cc8