aboutsummaryrefslogtreecommitdiffstats
path: root/openbsc/include/openbsc
diff options
context:
space:
mode:
authorJacob Erlbeck <jerlbeck@sysmocom.de>2013-12-04 10:30:11 +0100
committerJacob Erlbeck <jerlbeck@sysmocom.de>2013-12-10 11:17:44 +0100
commitf6ec0e9fc4261d2173286e9b23fd19060040d1d1 (patch)
treef0dbbb3581da797161cbc4a713781333a15439e0 /openbsc/include/openbsc
parent58340e5b5bfa37b09a61d544904330c1932ccfec (diff)
mgcp/rtp: Refactored packet_duration computation
Since the packet duration is given in ms with the 'ptime' RTP media attribute and also with the 'p' MGCP local connection option, the computation is changed to use this value (if present). The computation assumes, that there are N complete frames in a packet and takes into account, that the ptime value possibly had been rounded towards the next ms value (which is never the case with a frame length of exact 20ms). Sponsored-by: On-Waves ehf
Diffstat (limited to 'openbsc/include/openbsc')
-rw-r--r--openbsc/include/openbsc/mgcp_internal.h3
1 files changed, 3 insertions, 0 deletions
diff --git a/openbsc/include/openbsc/mgcp_internal.h b/openbsc/include/openbsc/mgcp_internal.h
index b6f4a0df1..d59c5d7cb 100644
--- a/openbsc/include/openbsc/mgcp_internal.h
+++ b/openbsc/include/openbsc/mgcp_internal.h
@@ -82,6 +82,7 @@ struct mgcp_rtp_end {
uint32_t frame_duration_num;
uint32_t frame_duration_den;
int frames_per_packet;
+ uint32_t packet_duration_ms;
char *fmtp_extra;
/* RTP patching */
@@ -180,6 +181,8 @@ struct mgcp_trunk_config *mgcp_trunk_num(struct mgcp_config *cfg, int index);
void mgcp_rtp_end_config(struct mgcp_endpoint *endp, int expect_ssrc_change,
struct mgcp_rtp_end *rtp);
+uint32_t mgcp_rtp_packet_duration(struct mgcp_endpoint *endp,
+ struct mgcp_rtp_end *rtp);
void mgcp_state_calc_loss(struct mgcp_rtp_state *s, struct mgcp_rtp_end *,
uint32_t *expected, int *loss);