aboutsummaryrefslogtreecommitdiffstats
path: root/openbsc/src/libmgcp/mgcp_network.c
diff options
context:
space:
mode:
authorHolger Hans Peter Freyther <holger@moiji-mobile.com>2014-09-01 10:35:55 +0200
committerHolger Hans Peter Freyther <holger@moiji-mobile.com>2014-09-02 08:25:49 +0200
commitcac2438b0c33f54a6dcac55b55e8cfc33de197b2 (patch)
treebf8b01402f20bfb5d49a4cf6204197061dcb0924 /openbsc/src/libmgcp/mgcp_network.c
parent3713f78ac23ca815c361fe79378ff6d2e522ef6a (diff)
mgcp: Move the "codec" params to a struct
We might be offered multiple codecs by the remote and need to switch between them once we receive data. Do this by moving it to a struct so we can separate between proposed and current codec. In SDP we can have multiple codecs but a global ptime. The current code doesn't separate that clearly instead we write it to the main codec.
Diffstat (limited to 'openbsc/src/libmgcp/mgcp_network.c')
-rw-r--r--openbsc/src/libmgcp/mgcp_network.c12
1 files changed, 6 insertions, 6 deletions
diff --git a/openbsc/src/libmgcp/mgcp_network.c b/openbsc/src/libmgcp/mgcp_network.c
index 7dcf3f3..587d4e8 100644
--- a/openbsc/src/libmgcp/mgcp_network.c
+++ b/openbsc/src/libmgcp/mgcp_network.c
@@ -239,7 +239,7 @@ static int adjust_rtp_timestamp_offset(struct mgcp_endpoint *endp,
inet_ntoa(addr->sin_addr), ntohs(addr->sin_port),
endp->conn_mode);
} else {
- tsdelta = rtp_end->rate * 20 / 1000;
+ tsdelta = rtp_end->codec.rate * 20 / 1000;
LOGP(DMGCP, LOGL_NOTICE,
"Fixed packet duration and last timestamp delta "
"are not available on 0x%x, "
@@ -326,8 +326,8 @@ void mgcp_get_net_downlink_format_default(struct mgcp_endpoint *endp,
/* Use the BTS side parameters when passing the SDP data (for
* downlink) to the net peer.
*/
- *payload_type = endp->bts_end.payload_type;
- *audio_name = endp->bts_end.audio_name;
+ *payload_type = endp->bts_end.codec.payload_type;
+ *audio_name = endp->bts_end.codec.audio_name;
*fmtp_extra = endp->bts_end.fmtp_extra;
}
@@ -348,7 +348,7 @@ void mgcp_patch_and_count(struct mgcp_endpoint *endp, struct mgcp_rtp_state *sta
uint16_t seq, udelta;
uint32_t timestamp, ssrc;
struct rtp_hdr *rtp_hdr;
- int payload = rtp_end->payload_type;
+ int payload = rtp_end->codec.payload_type;
if (len < sizeof(*rtp_hdr))
return;
@@ -356,7 +356,7 @@ void mgcp_patch_and_count(struct mgcp_endpoint *endp, struct mgcp_rtp_state *sta
rtp_hdr = (struct rtp_hdr *) data;
seq = ntohs(rtp_hdr->sequence);
timestamp = ntohl(rtp_hdr->timestamp);
- arrival_time = get_current_ts(rtp_end->rate);
+ arrival_time = get_current_ts(rtp_end->codec.rate);
ssrc = ntohl(rtp_hdr->ssrc);
transit = arrival_time - timestamp;
@@ -380,7 +380,7 @@ void mgcp_patch_and_count(struct mgcp_endpoint *endp, struct mgcp_rtp_state *sta
inet_ntoa(addr->sin_addr), ntohs(addr->sin_port),
endp->conn_mode);
if (state->packet_duration == 0) {
- state->packet_duration = rtp_end->rate * 20 / 1000;
+ state->packet_duration = rtp_end->codec.rate * 20 / 1000;
LOGP(DMGCP, LOGL_NOTICE,
"Fixed packet duration is not available on 0x%x, "
"using fixed 20ms instead: %d from %s:%d in %d\n",