aboutsummaryrefslogtreecommitdiffstats
path: root/openbsc/src/libmgcp/mgcp_protocol.c
diff options
context:
space:
mode:
authorHolger Hans Peter Freyther <zecke@selfish.org>2012-09-03 00:07:39 +0200
committerHolger Hans Peter Freyther <zecke@selfish.org>2012-12-16 13:18:08 +0100
commit5ea1bc77a3947f541d576f95e7ecc7249fc65b9b (patch)
treeb8a507d08730963050c8af3a884dffdce04d97a8 /openbsc/src/libmgcp/mgcp_protocol.c
parent7e7ee5f8c6904a607e7505021c16de4c26dadbe0 (diff)
mgcp: Allow to freely control the a=fmtp line for experiments
In case of AMR one can specify the available codecs out-of-band. Allow to configure this line statically in the configuration file.
Diffstat (limited to 'openbsc/src/libmgcp/mgcp_protocol.c')
-rw-r--r--openbsc/src/libmgcp/mgcp_protocol.c11
1 files changed, 9 insertions, 2 deletions
diff --git a/openbsc/src/libmgcp/mgcp_protocol.c b/openbsc/src/libmgcp/mgcp_protocol.c
index 63fee5ff7..6919a591d 100644
--- a/openbsc/src/libmgcp/mgcp_protocol.c
+++ b/openbsc/src/libmgcp/mgcp_protocol.c
@@ -190,6 +190,7 @@ static struct msgb *create_response_with_sdp(struct mgcp_endpoint *endp,
const char *msg, const char *trans_id)
{
const char *addr = endp->cfg->local_ip;
+ const char *fmtp_extra = endp->bts_end.fmtp_extra;
char sdp_record[4096];
if (!addr)
@@ -202,10 +203,12 @@ static struct msgb *create_response_with_sdp(struct mgcp_endpoint *endp,
"c=IN IP4 %s\r\n"
"t=0 0\r\n"
"m=audio %d RTP/AVP %d\r\n"
- "a=rtpmap:%d %s\r\n",
+ "a=rtpmap:%d %s\r\n"
+ "%s%s",
endp->ci, endp->ci, addr, addr,
endp->net_end.local_port, endp->bts_end.payload_type,
- endp->bts_end.payload_type, endp->tcfg->audio_name);
+ endp->bts_end.payload_type, endp->tcfg->audio_name,
+ fmtp_extra ? fmtp_extra : "", fmtp_extra ? "\r\n" : "");
return create_resp(endp, 200, " OK", msg, trans_id, NULL, sdp_record);
}
@@ -587,6 +590,8 @@ static struct msgb *handle_create_con(struct mgcp_parse_data *p)
endp->allocated = 1;
endp->bts_end.payload_type = tcfg->audio_payload;
+ endp->bts_end.fmtp_extra = talloc_strdup(tcfg->endpoints,
+ tcfg->audio_fmtp_extra);
/* policy CB */
if (p->cfg->policy_cb) {
@@ -958,6 +963,8 @@ static void mgcp_rtp_end_reset(struct mgcp_rtp_end *end)
end->rtp_port = end->rtcp_port = 0;
end->payload_type = -1;
end->local_alloc = -1;
+ talloc_free(end->fmtp_extra);
+ end->fmtp_extra = NULL;
}
static void mgcp_rtp_end_init(struct mgcp_rtp_end *end)