]> sjero.net Git - linphone/commitdiff
fix incoming re-INVITE without SDP.
authorSimon Morlat <simon.morlat@linphone.org>
Wed, 7 Mar 2012 15:42:54 +0000 (16:42 +0100)
committerSimon Morlat <simon.morlat@linphone.org>
Wed, 7 Mar 2012 15:42:54 +0000 (16:42 +0100)
coreapi/callbacks.c
coreapi/sal_eXosip2.c

index 085a77ebfd05b69146effc471449e75756da3ef0..f2917f876c8b5fecbba8402f56286d0b5311a882 100644 (file)
@@ -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)){
index 86c05c5e654d5c27d2974a8fe71d2432004a4623..451eb303142e577e8e7758930a2b7ceb21293913 100644 (file)
@@ -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){