mgcp_network: use mgcp_rtp_codec in downlink format callback
The callback function mgcp_get_format() is used to request the codec
parameters for a specific connection. This function returns the
parameters as idividual pointers. Since there is a struct that holds all
important codec information among the ones which are currently returned
by mgcp_get_format, lets just use this codec struct as single return
value.
Change-Id: I348f9141eb59ed1a986447b96ab4a24ddf326936
Related: OS#3807
diff --git a/src/libosmo-mgcp/mgcp_sdp.c b/src/libosmo-mgcp/mgcp_sdp.c
index 9252b98..3287cd1 100644
--- a/src/libosmo-mgcp/mgcp_sdp.c
+++ b/src/libosmo-mgcp/mgcp_sdp.c
@@ -344,6 +344,7 @@
const struct mgcp_conn_rtp *conn, struct msgb *sdp,
const char *addr)
{
+ const struct mgcp_rtp_codec *codec;
const char *fmtp_extra;
const char *audio_name;
int payload_type;
@@ -357,10 +358,12 @@
/* FIXME: constify endp and conn args in get_net_donwlink_format_cb() */
endp->cfg->get_net_downlink_format_cb((struct mgcp_endpoint *)endp,
- &payload_type, &audio_name,
- &fmtp_extra,
+ &codec, &fmtp_extra,
(struct mgcp_conn_rtp *)conn);
+ audio_name = codec->audio_name;
+ payload_type = codec->payload_type;
+
rc = msgb_printf(sdp,
"v=0\r\n"
"o=- %s 23 IN IP4 %s\r\n"