[Top][All Lists]

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: [Linphone-developers] sdp in re-invite rfc 3261 14.1. Current suppor

From: damico
Subject: Re: [Linphone-developers] sdp in re-invite rfc 3261 14.1. Current support/intentions?
Date: Mon, 20 Jul 2009 15:18:00 +0200
User-agent: Mozilla-Thunderbird (X11/20090706)

Simon Morlat ha scritto:
Hi Dave,

Thanks for the detailed analysis.
My apologize, indeed the INVITE without SDP is something supported but not the RE-INVITE without SDP.
This is a feature which is lacking in linphone.
As it is lacking to few people it has never been developped.
Would you be interested in sending a patch for this ?


Le vendredi 17 juillet 2009 17:38:25, Dave Harley a écrit :
Hi Simon,

I managed to get a test preformed using the latest version of Linphone
for windows (3.1.2).
Hopefully this is up to date enough.

1st test.
1) Linphone calls an analogue extension which is connected to a Mitel
2) Call is established.
3) Analogue extension tries to go on hold.
4) Analogue extension tries to retrieve call from hold.
5) Call is terminated ( actually not sure which end hangs up but its not

2nd test is the exact same with the exception that the call is made from
a xlite client.

Attached are wireshark pcap traces of the sip transfer for each test and
the debug trace produced by the Linphone client.

In the Linphone test the interesting bit is that Linphone issue's a 603
decline to the bodyless (re-)invite which is received after the dialog
has been established.
In the 2nd test the xlite response to the same packet  is 200 Ok with an
SDP body attached, which is acked with an SDP body ( including the hold
indication) by the Mitel.

The other interesting thing is that the Linphone test shows no
indication of a off hold event, which makes sense cause it never went on
hold in the first place I guess.
The xlite does see the off hold (re-)invite.  However in this case the
invite does have a body.  Screwy pabx!

>From my reading of 3216 sec 14.1 I would think that xlite is more

compliant, but I suppose I would say that. Certainly from an interop
point of view it would be nice if Linphone handled the interaction
I'm sure like all RFC's its open to interpretation and the xlite/Mitel
interpretation might not match your own views.

I'd be grateful if you could let me know your analysis.  If there is any
further testing I can do let me know and I'll do by best.

Best regards,

The results are as follows:

On Thu, 2009-07-16 at 17:25 +0200, Simon Morlat wrote:
Hi Dave,

Receiving of INVITEs and reINVITEs without SDP is implemented and it
should work. I think it has been implemented shortly after the email you
refer. Try lastest release (3.1.2). This feature is not tested very
often, just tell me if you find a bug.


Le jeudi 16 juillet 2009 16:17:32, Dave Harley a écrit :
Hi All,

There was a query about 2 years ago regarding receiving invites and
re-invites with no sdp offer when interoping with a mitel.  It
referenced 14.1 and 13.2.1 of RFC 3261.

I'm running an old release of linphone which was happily doing its job
up to now.  However recently it appears that I need to support the
above against both a Mitel and an Aastra A5000 iPBX.

At the time Simon pointed out he had no immediate intention of
implementing this (from the original thread: ).
Just wondering has this situation changed?  Is there any support in the
top of the tree for this aspect of the RFC?

I would test this myself before asking but getting access to the
environment where it exhibits is... problematic.

BTW I originally thought this was an osip issue and posted there. I was
wrong and was, very helpfully, pointed in the right direction. So
apologies if this mail seems familiar to any list members.

Best regards,
Dave Harley.Senior Systems Engineer

Email: address@hidden   Web:

Tel:     +353 21 4941607                        Fax:  +353 21 4800848

Integrated Point-Of-Care Entertainment & Information System

Unit 6 (Nualight Building), Cork Technology Park, Model Farm Road, Cork,

Dublin office : Digital Depot,Thomas Street, Dublin 8, Ireland

This email may contain information which is confidential and/or privileged.
The information is intended solely for the use of the individual or entity
named above. If you are not the intended recipient, be aware that any
disclosure, copying, distribution or use of the contents is prohibited. If
you have received this electronic transmission in error, please notify the
sender by telephone or return email and delete the material from your

Linphone-developers mailing list

Hi Simon and Dave,
I wrote a patch against linphone 2.1.1 to handle these cases one year ago. Unfortunately now I have no time to update it to newer linphone.

Maybe that patch can't be applied as is but I hope it can help you.


--- linphone_2.1.1/linphone2-1.1/coreapi/linphonecore.c 2008/06/11 10:05:56     
+++ linphone_2.1.1/linphone2-1.1/coreapi/linphonecore.c 2008/06/20 08:05:19     
@@ -1158,7 +1158,7 @@ const char * linphone_core_get_route(Lin
        return route;
-void linphone_set_sdp(osip_message_t *sip, const char *sdpmesg){
+void linphone_set_sdp(LinphoneCall *call, osip_message_t *sip, const char 
        int sdplen=strlen(sdpmesg);
        char clen[10];
@@ -1221,7 +1221,7 @@ int linphone_core_invite(LinphoneCore *l
-               linphone_set_sdp(invite,sdpmesg);
+               linphone_set_sdp(lc->call,invite,sdpmesg);
                if (lc->audio_control){
@@ -1511,14 +1511,14 @@ int linphone_core_accept_call(LinphoneCo
                        return -1;
                ms_message("sdp message generated 
-               linphone_set_sdp(msg,sdpmesg);
+               linphone_set_sdp(call,msg,sdpmesg);
                ms_message("sdp message attached to SIP answer");
                if (lc->audio_control){
                ms_message("init_media_streams done");
-               linphone_set_sdp(msg,sdpmesg);
+               linphone_set_sdp(call,msg,sdpmesg);
        ms_message("eXosip_lock() done");
--- linphone_2.1.1/linphone2-1.1/coreapi/exevents.c     2008/06/10 10:47:25     
+++ linphone_2.1.1/linphone2-1.1/coreapi/exevents.c     2008/06/20 07:59:56     
@@ -80,6 +80,7 @@ int linphone_call_accepted(LinphoneCore 
        if (!lc->sip_conf.sdp_200_ack){
+               call->audio_params.initialized = 0;
                /*we receive a 200OK with an sdp offer*/
@@ -92,7 +93,7 @@ int linphone_call_accepted(LinphoneCore 
        /*send the ack once streams are started*/
-       if (sdpanswer!=NULL) linphone_set_sdp(msg,sdpanswer);
+       if (sdpanswer!=NULL) linphone_set_sdp(call,msg,sdpanswer);
        if (err!=0){
                /*send a bye*/
@@ -358,6 +359,7 @@ int linphone_inc_new_call(LinphoneCore *
 void linphone_handle_ack(LinphoneCore *lc, eXosip_event_t *ev){
        sdp_message_t *sdp=eXosip_get_sdp_info(ev->ack);
        if (sdp){
+               lc->call->audio_params.initialized = 0;
@@ -367,35 +369,54 @@ void linphone_handle_reinvite(LinphoneCo
        sdp_message_t *sdp=eXosip_get_sdp_info(ev->request);
        sdp_context_t *ctx;
        LinphoneCall *call=lc->call;
+       bool_t just_handshake=TRUE;
        char *answer;
        int status;
-       if (sdp==NULL){
-               ms_warning("No sdp in reinvite !");
-               eXosip_lock();
-               eXosip_call_send_answer(ev->tid,603,NULL);
-               eXosip_unlock();
-               return;
-       }
-       /* get the result of the negociation */
-       linphone_call_init_media_params(call);
-       answer=sdp_context_get_answer(ctx,sdp);
-       status=sdp_context_get_status(ctx);
+       if (sdp){
+               /* get the result of the negociation */
+               just_handshake=FALSE;
+               linphone_call_init_media_params(call);
+               answer=sdp_context_get_answer(ctx,sdp);
+               status=sdp_context_get_status(ctx);
+       }else{
+               /**
+                * Nel caso non ci sia SDP nell'invite, come da RFC 
+                * bisogna generare una offert (pag. 86/87)
+                **/
+               call->profile=lc->local_profile;
+               ms_message("generating sdp offer (re-INVITE)");
+               answer=sdp_context_get_offer(call->sdpctx);
+               status=200;
+               if (answer){
+                       status=200;
+               }else{
+                       ms_error("fail to generate sdp offer !");
+                       status = 603;
+               }
+       }
        if (status==200){
                osip_message_t *msg=NULL;
-               linphone_core_stop_media_streams(lc);
-               linphone_core_init_media_streams(lc);
+               int err;
-               eXosip_call_build_answer(ev->tid,200,&msg);
-               answer=call->sdpctx->answerstr; /* takes the sdp already 
-               linphone_set_sdp(msg,answer);
-               eXosip_call_send_answer(ev->tid,200,msg);
+               err=eXosip_call_build_answer(ev->tid,200,&msg);
+               if (!err){
+                       linphone_set_sdp(call,msg,answer);
+                       eXosip_call_send_answer(ev->tid,200,msg);
+               }
-               linphone_call_set_state(lc->call,LCStateAccepted);
-               linphone_core_start_media_streams(lc,call);
+               if (err){
+                       ms_warning("I can not answer to reinvite (%s SDP)... 
Transaction does not exists?",((char *) sdp?"with":"without"));
+               }else if (!just_handshake){
+                       linphone_core_stop_media_streams(lc);
+                       linphone_core_init_media_streams(lc);
+                       linphone_call_set_state(lc->call,LCStateAccepted);
+                       linphone_core_start_media_streams(lc,call);
@@ -745,6 +766,7 @@ void linphone_call_ringing(LinphoneCore 
                        goto end;
+               audio_params->initialized = 0;
                lc->vtable.display_status(lc,_("Early media."));

reply via email to

[Prev in Thread] Current Thread [Next in Thread]