linphone-developers
[Top][All Lists]
Advanced

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

Re: [Linphone-developers] No sound after OFF Hold (Resume)


From: Simon Morlat
Subject: Re: [Linphone-developers] No sound after OFF Hold (Resume)
Date: Fri, 17 Nov 2006 17:01:36 +0100
User-agent: KMail/1.9.5

Hi,

Actually the coreapi doesn't use the eXosip sdp negociation capability, it 
uses its own sdp generator (see sdphandler.c).
But unfortunately in case of re-INVITE, the sdphandler.c code is not invoked 
because of a hole in eXosip, and instead we fallback under the eXosip sdp 
support...
So your patch fixes one part of the problem by setting the correct audio port 
number, which seems to be enough for your test case.
However it does not fix the codec list, the video port, and video codec 
list... The good approach would be that eXosip re-invoke the sdphandler to 
get a new correct sdp answer. 
I know this is implemented in eXosip2: eXosip2 generates an event when 
receiving re-INVITE, then it can be handled by the application to restart a 
negociation and the mediastreams.
I plan since a long time to switch linphone to eXosip2 for that reason.
However this will not be a little task: there are a few api changes, and I've 
made changes to eXosip1 to fix IPv6 bugs; thoses changes will need to be 
applied to eXosip2.

So I don't want to merge your patch to the main branch, since it doesn't fix 
properly the root problem. I hope you'll understand that.
However I consider your patch can be useful to make linphone working in this 
case (use of mulaw/alaw, audio only), so I'll recommend your patch to people 
who are in your case, so it's good it is in the mailing list.

Thanks a lot for your work

Simon


Le jeudi 16 novembre 2006 04:44, Roy Huang a écrit :
> Hi Simon,
>
> I have a Polycom SIP phone, which has Hold function. During the talk,
> if I press the hold to mute for a while, then resume, but I cannot
> heard sound at the linphonec side any more.
>
> After study the log, I got the reason. During the establishment of
> dialog, linphonec tell IP phone, it will receive audio at 7078 port.
> If press Hold or Resume button on IP phone, there is a new INVITE
> request and OK response happened. In this OK response, 10500 port is
> described in SDP's media line. Then IP phone use this port to send
> audio stream. But linphonec still waiting for audio data on port 7078.
>
> The following patch seems fix this problem. -Roy
>
> diff -ur linphone-1.5.0-orig/coreapi/exevents.c
> linphone-1.5.0/coreapi/exevents.c
> --- linphone-1.5.0-orig/coreapi/exevents.c      2006-10-03
> 20:34:12.000000000 +0800
> +++ linphone-1.5.0/coreapi/exevents.c   2006-11-16 11:03:53.000000000 +0800
> @@ -274,6 +274,8 @@
>         status=sdp_context_get_status(ctx);
>
>  #endif
> +       eXosip_set_sdp_port(did, lc->rtp_conf.audio_rtp_port);
> +
>         switch(status)
>         {
>                 case 200:
> @@ -642,7 +644,7 @@
>         }
>         lc->call->cid=cid;
>         lc->call->did=did;
> -
> +       eXosip_set_sdp_port(did, lc->rtp_conf.audio_rtp_port);
>  }
>
>  void linphone_call_ringing(LinphoneCore *lc, eXosip_event_t *ev){
> diff -ur linphone-1.5.0-orig/exosip/eXosip.c linphone-1.5.0/exosip/eXosip.c
> --- linphone-1.5.0-orig/exosip/eXosip.c 2006-08-09 21:01:57.000000000 +0800
> +++ linphone-1.5.0/exosip/eXosip.c      2006-11-16 11:13:41.000000000 +0800
> @@ -927,6 +927,7 @@
>    jc->external_reference = reference;
>    ADD_ELEMENT(eXosip.j_calls, jc);
>
> +  osip_negotiation_ctx_set_mycontext(jc->c_ctx, jc);
>    eXosip_update(); /* fixed? */
>    __eXosip_wakeup();
>    return jc->c_id;
> @@ -1406,6 +1407,7 @@
>      }
>    else if (status>199 && status<300)
>      {
> +      osip_negotiation_ctx_set_mycontext(jc->c_ctx, jc);
>        i = eXosip_answer_invite_2xx_with_body(jc, jd,
> status,bodytype,body); }
>    else if (status>300 && status<699)
> @@ -1424,6 +1426,27 @@
>    return 0;
>  }
>
> +int eXosip_set_sdp_port(int jid, int sdp_port)
> +{
> +       eXosip_dialog_t *jd = NULL;
> +       eXosip_call_t *jc = NULL;
> +       if (jid>0) {
> +               eXosip_call_dialog_find(jid, &jc, &jd);
> +       }
> +       if (jd==NULL) {
> +               OSIP_TRACE (osip_trace
> +                               (__FILE__, __LINE__, OSIP_ERROR, NULL,
> +                       "eXosip: No call here?\n"));
> +               return -1;
> +       }
> +       if (sdp_port==NULL)
> +               memset(jc->c_sdp_port, '\0', 10);
> +       else
> +               snprintf(jc->c_sdp_port, 9, "%d", sdp_port);
> +
> +       return 0;
> +}
> +
>  int eXosip_set_redirection_address (int jid, char *contact)
>  {
>    eXosip_dialog_t *jd = NULL;
> diff -ur linphone-1.5.0-orig/exosip/eXosip.h linphone-1.5.0/exosip/eXosip.h
> --- linphone-1.5.0-orig/exosip/eXosip.h 2006-08-09 21:01:57.000000000 +0800
> +++ linphone-1.5.0/exosip/eXosip.h      2006-11-16 11:01:34.000000000 +0800
> @@ -327,6 +327,14 @@
>    int eXosip_transfer_call_out_of_dialog(char *refer_to, char *from,
> char *to, char *route);
>
>  /**
> + * Set s_sdp_port
> + *
> + * @param jid          dialog id of call.
> + * @param sdp_port     local audio receive port
> + */
> +  int eXosip_set_sdp_port (int jid, int sdp_port);
> +
> +/**
>   * Set redirection url before a call to eXosip_answer_call.
>   *
>   * @param jid          dialog id of call.
>
>
> _______________________________________________
> Linphone-developers mailing list
> address@hidden
> http://lists.nongnu.org/mailman/listinfo/linphone-developers




reply via email to

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