linphone-developers
[Top][All Lists]
Advanced

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

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


From: Roy Huang
Subject: [Linphone-developers] No sound after OFF Hold (Resume)
Date: Thu, 16 Nov 2006 11:44:35 +0800

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.




reply via email to

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