diff options
-rw-r--r-- | mgw/MGCP_Test.ttcn | 22 |
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", |