From 42267c4ce2fc5f1392a1cea18c3afe41d3d6e534 Mon Sep 17 00:00:00 2001 From: Simon Morlat Date: Wed, 7 Mar 2012 16:42:54 +0100 Subject: [PATCH] fix incoming re-INVITE without SDP. --- coreapi/callbacks.c | 7 +++++++ coreapi/sal_eXosip2.c | 15 +++------------ 2 files changed, 10 insertions(+), 12 deletions(-) diff --git a/coreapi/callbacks.c b/coreapi/callbacks.c index 085a77ebf..f2917f876 100644 --- a/coreapi/callbacks.c +++ b/coreapi/callbacks.c @@ -443,6 +443,13 @@ static void call_updating(SalOp *op){ LinphoneCall *call=(LinphoneCall*)sal_op_get_user_pointer(op); SalMediaDescription *rmd=sal_call_get_remote_media_description(op); + if (rmd==NULL){ + /* case of a reINVITE without SDP */ + call_accept_update(lc,call); + call->media_pending=TRUE; + return; + } + switch(call->state){ case LinphoneCallPausedByRemote: if (sal_media_description_has_dir(rmd,SalStreamSendRecv) || sal_media_description_has_dir(rmd,SalStreamRecvOnly)){ diff --git a/coreapi/sal_eXosip2.c b/coreapi/sal_eXosip2.c index 86c05c5e6..451eb3031 100644 --- a/coreapi/sal_eXosip2.c +++ b/coreapi/sal_eXosip2.c @@ -1006,7 +1006,6 @@ static void inc_new_call(Sal *sal, eXosip_event_t *ev){ static void handle_reinvite(Sal *sal, eXosip_event_t *ev){ SalOp *op=find_op(sal,ev); sdp_message_t *sdp; - osip_message_t *msg=NULL; if (op==NULL) { ms_warning("Reinvite for non-existing operation !"); @@ -1028,18 +1027,11 @@ static void handle_reinvite(Sal *sal, eXosip_event_t *ev){ op->base.remote_media=sal_media_description_new(); sdp_to_media_description(sdp,op->base.remote_media); sdp_message_free(sdp); - sal->callbacks.call_updating(op); + }else { op->sdp_offering=TRUE; - eXosip_lock(); - eXosip_call_build_answer(ev->tid,200,&msg); - if (msg!=NULL){ - set_sdp_from_desc(msg,op->base.local_media); - eXosip_call_send_answer(ev->tid,200,msg); - } - eXosip_unlock(); } - + sal->callbacks.call_updating(op); } static void handle_ack(Sal *sal, eXosip_event_t *ev){ @@ -1064,9 +1056,8 @@ static void handle_ack(Sal *sal, eXosip_event_t *ev){ } if (op->reinvite){ op->reinvite=FALSE; - }else{ - sal->callbacks.call_ack(op); } + sal->callbacks.call_ack(op); } static void update_contact_from_response(SalOp *op, osip_message_t *response){