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
changes/30/2030/3
Holger Hans Peter Freyther 6 years ago committed by Holger Freyther
parent 9d796ff156
commit 417f254216
  1. 11
      src/mncc.c
  2. 10
      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
*
@ -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)

@ -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) {

Loading…
Cancel
Save