aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorPhilipp Maier <pmaier@sysmocom.de>2018-07-20 17:09:17 +0200
committerHarald Welte <laforge@gnumonks.org>2018-07-21 08:20:59 +0000
commit28bb82990cdba2bbc0e208cdf7e236fa412a84e1 (patch)
treeef0e07ec1f58b4461cb5da8faa16373fa1fae17e
parentc1e95c844c24c9b052af8a16bc1aa29509b2cefa (diff)
MGCP_Test: Make sure PT in RTP-Stream and MGCP match up
At the moment the RTP stream emulation is left in its default configuration, this means that the payload type that appears in the RTP stream is always 0. This may mismatch the payload type that is configured with MGCP. If nothing else is set, we should make sure that whan we create and modify flows, the RTP emulation is always reconfigured to use the payload-type that we set in the flow parameters. The other rtp-emulation parameters should be set to their defaults. - Make sure f_flow_modify and f_flow_create set the rtp flow parameters properly. Change-Id: Ie888424ac3e0bf0d960b6f071855b6dd43935a0e Related:OS#3384
-rw-r--r--mgw/MGCP_Test.ttcn22
1 files changed, 21 insertions, 1 deletions
diff --git a/mgw/MGCP_Test.ttcn b/mgw/MGCP_Test.ttcn
index d816a718..659d5f1c 100644
--- a/mgw/MGCP_Test.ttcn
+++ b/mgw/MGCP_Test.ttcn
@@ -58,6 +58,7 @@ module MGCP_Test {
private function f_init(template MgcpEndpoint ep := omit) runs on dummy_CT {
var Result res;
var uint32_t ssrc;
+
if (initialized == false) {
initialized := true;
@@ -243,7 +244,8 @@ module MGCP_Test {
HostPort mgw, /* mgw side */
uint7_t pt,
charstring codec,
- MgcpConnectionId mgcp_conn_id optional
+ MgcpConnectionId mgcp_conn_id optional,
+ RtpemConfig rtp_cfg optional
}
/* Create an RTP flow (bidirectional, or receive-only) */
@@ -256,6 +258,15 @@ module MGCP_Test {
/* bind local RTP emulation socket */
f_rtpem_bind(pt, flow.em.hostname, flow.em.portnr);
+ /* configure rtp-emulation */
+ if (ispresent(flow.rtp_cfg)) {
+ f_rtpem_configure(pt, flow.rtp_cfg);
+ } else {
+ var RtpemConfig rtp_cfg := c_RtpemDefaultCfg;
+ rtp_cfg.tx_payload_type := flow.pt
+ f_rtpem_configure(pt, rtp_cfg);
+ }
+
if (one_phase) {
/* Connect flow to MGW using a CRCX that also contains an SDP
* part that tells the MGW where we are listening for RTP streams
@@ -299,6 +310,15 @@ module MGCP_Test {
/* rebind local RTP emulation socket to the new address */
f_rtpem_bind(pt, flow.em.hostname, flow.em.portnr);
+ /* reconfigure rtp-emulation */
+ if (ispresent(flow.rtp_cfg)) {
+ f_rtpem_configure(pt, flow.rtp_cfg);
+ } else {
+ var RtpemConfig rtp_cfg := c_RtpemDefaultCfg;
+ rtp_cfg.tx_payload_type := flow.pt
+ f_rtpem_configure(pt, rtp_cfg);
+ }
+
/* connect MGW side RTP socket to the emulation-side RTP socket using SDP */
cmd := ts_MDCX(get_next_trans_id(), ep, mode, call_id, flow.mgcp_conn_id);
cmd.sdp := ts_SDP(flow.em.hostname, flow.em.hostname, "23", "42",