summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorHolger Hans Peter Freyther <holger@moiji-mobile.com>2017-03-10 16:05:17 +0100
committerHolger Freyther <holger@freyther.de>2017-03-23 09:01:45 +0000
commit417f2542163edfe8ac8729918e2452dc7787a3d7 (patch)
tree3f3b235f4fac0b0c328934eb47c5507cfcb4facc
parent9d796ff15690eb313ec6d2323902f9ea677f300e (diff)
mncc/sip: Attempt to parse the media from session in progress
Parse the media from session in progress and if present in alerting connect the call early. Sadly this sets RTP to the sendrecv mode even if we would like to keep it as recvonly. Change-Id: I98d173abc46c67b87666ed2f193a581d6e72344b Related: OS#1784
-rw-r--r--src/mncc.c11
-rw-r--r--src/sip.c10
2 files changed, 17 insertions, 4 deletions
diff --git a/src/mncc.c b/src/mncc.c
index 5e2a3a1..669a80c 100644
--- a/src/mncc.c
+++ b/src/mncc.c
@@ -1,5 +1,5 @@
/*
- * (C) 2016 by Holger Hans Peter Freyther
+ * (C) 2016-2017 by Holger Hans Peter Freyther
*
* All Rights Reserved
*
@@ -196,6 +196,7 @@ static void mncc_call_leg_ring(struct call_leg *_leg)
{
struct gsm_mncc out_mncc = { 0, };
struct mncc_call_leg *leg;
+ struct call_leg *other_leg;
OSMO_ASSERT(_leg->type == CALL_TYPE_MNCC);
leg = (struct mncc_call_leg *) _leg;
@@ -208,6 +209,14 @@ static void mncc_call_leg_ring(struct call_leg *_leg)
out_mncc.progress.descr = 8; /* In-band information or appropriate pattern now available */
mncc_write(leg->conn, &out_mncc, leg->callref);
+
+ /*
+ * If we have remote IP/port let's connect it already.
+ * FIXME: We would like to keep this as recvonly...
+ */
+ other_leg = call_leg_other(&leg->base);
+ if (other_leg && other_leg->port != 0 && other_leg->ip != 0)
+ send_rtp_connect(leg, other_leg);
}
static void mncc_call_leg_release(struct call_leg *_leg)
diff --git a/src/sip.c b/src/sip.c
index 0a642b7..4f3d034 100644
--- a/src/sip.c
+++ b/src/sip.c
@@ -1,5 +1,5 @@
/*
- * (C) 2016 by Holger Hans Peter Freyther
+ * (C) 2016-2017 by Holger Hans Peter Freyther
*
* All Rights Reserved
*
@@ -39,13 +39,17 @@ static void sip_ring_call(struct call_leg *_leg);
static void sip_connect_call(struct call_leg *_leg);
static void sip_dtmf_call(struct call_leg *_leg, int keypad);
-static void call_progress(struct sip_call_leg *leg, const sip_t *sip)
+static void call_progress(struct sip_call_leg *leg, const sip_t *sip, int status)
{
struct call_leg *other = call_leg_other(&leg->base);
if (!other)
return;
+ /* Extract SDP for session in progress with matching codec */
+ if (status == 183)
+ sdp_extract_sdp(leg, sip, false);
+
LOGP(DSIP, LOGL_NOTICE, "leg(%p) is now rining.\n", leg);
other->ring_call(other);
}
@@ -159,7 +163,7 @@ void nua_callback(nua_event_t event, int status, char const *phrase, nua_t *nua,
leg->state = SIP_CC_DLG_CNFD;
if (status == 180 || status == 183)
- call_progress(leg, sip);
+ call_progress(leg, sip, status);
else if (status == 200)
call_connect(leg, sip);
else if (status >= 300) {