aboutsummaryrefslogtreecommitdiffstats
path: root/openbsc/src/libmgcp
diff options
context:
space:
mode:
authorJacob Erlbeck <jerlbeck@sysmocom.de>2013-11-29 13:43:49 +0100
committerHolger Hans Peter Freyther <holger@moiji-mobile.com>2013-12-05 10:28:51 +0100
commit78a9501cfda39c8413c6698a063a08405521160c (patch)
tree140833707d42ef24e95fd1b07785eb1b2baa2a6f /openbsc/src/libmgcp
parent3dff27d38ded0e902c93dbc025f5664c3ac1ccdf (diff)
mgcp: Handle SDP in CRCX received by the MGW
So far the SDP part of the CRCX message has been ignored by the MGW. This patch adds SDP parsing for this case, eventually updating the net end's payload type and connection parameters. Sponsored-by: On-Waves ehf
Diffstat (limited to 'openbsc/src/libmgcp')
-rw-r--r--openbsc/src/libmgcp/mgcp_protocol.c9
1 files changed, 9 insertions, 0 deletions
diff --git a/openbsc/src/libmgcp/mgcp_protocol.c b/openbsc/src/libmgcp/mgcp_protocol.c
index 645b8a75e..a0b905de0 100644
--- a/openbsc/src/libmgcp/mgcp_protocol.c
+++ b/openbsc/src/libmgcp/mgcp_protocol.c
@@ -624,6 +624,7 @@ static struct msgb *handle_create_con(struct mgcp_parse_data *p)
const char *callid = NULL;
const char *mode = NULL;
char *line;
+ int have_sdp = 0;
if (p->found != 0)
return create_err_response(NULL, 510, "CRCX", p->trans);
@@ -640,6 +641,9 @@ static struct msgb *handle_create_con(struct mgcp_parse_data *p)
case 'M':
mode = (const char *) line + 3;
break;
+ case '\0':
+ have_sdp = 1;
+ goto mgcp_header_done;
default:
LOGP(DMGCP, LOGL_NOTICE, "Unhandled option: '%c'/%d on 0x%x\n",
*line, *line, ENDPOINT_NUMBER(endp));
@@ -647,6 +651,7 @@ static struct msgb *handle_create_con(struct mgcp_parse_data *p)
}
}
+mgcp_header_done:
tcfg = p->endp->tcfg;
/* Check required data */
@@ -697,9 +702,13 @@ static struct msgb *handle_create_con(struct mgcp_parse_data *p)
goto error2;
endp->allocated = 1;
+
+ /* set up RTP media parameters */
endp->bts_end.payload_type = tcfg->audio_payload;
endp->bts_end.fmtp_extra = talloc_strdup(tcfg->endpoints,
tcfg->audio_fmtp_extra);
+ if (have_sdp)
+ parse_sdp_data(&endp->net_end, p);
/* policy CB */
if (p->cfg->policy_cb) {