MGCP_Test: Test non LCO crcx
When a CRCX without an LCO option (codec) is sent, then older versions of osmo-mgw will omit the port number in the SDP part of the response. Also no default codec is selected and reported back. This testcase pinpoints the problem. Change-Id: Ie16cdab936ce468fe378d4ec9e1c61f81c07fb4e Related: OS#2658
This commit is contained in:
parent
ac8fc7f859
commit
45635f4379
|
@ -80,6 +80,15 @@ module MGCP_Templates {
|
|||
sdp := sdp
|
||||
}
|
||||
|
||||
template MgcpCommand ts_CRCX_no_lco(MgcpTransId trans_id, charstring ep, MgcpConnectionMode mode, MgcpCallId call_id, template SDP_Message sdp := omit) := {
|
||||
line := t_MgcpCmdLine("CRCX", trans_id, ep),
|
||||
params := {
|
||||
t_MgcpParConnMode(mode),
|
||||
ts_MgcpParCallId(call_id)
|
||||
},
|
||||
sdp := sdp
|
||||
}
|
||||
|
||||
template MgcpCommand tr_CRCX(template MgcpEndpoint ep := ?) := {
|
||||
line := t_MgcpCmdLine("CRCX", ?, ep),
|
||||
params := *,
|
||||
|
|
|
@ -307,12 +307,48 @@ module MGCP_Test {
|
|||
f_dlcx_ok(ep, call_id);
|
||||
}
|
||||
|
||||
function f_crcx_no_lco(charstring ep_prefix) runs on dummy_CT {
|
||||
var MgcpEndpoint ep := ep_prefix & "2@" & c_mgw_domain;
|
||||
var template MgcpCommand cmd;
|
||||
var MgcpResponse resp;
|
||||
var MgcpCallId call_id := '1234'H;
|
||||
|
||||
f_init(ep);
|
||||
|
||||
/* create the connection on the MGW */
|
||||
cmd := ts_CRCX_no_lco(get_next_trans_id(), ep, "recvonly", call_id);
|
||||
resp := mgcp_transceive_mgw(cmd, tr_CRCX_ACK);
|
||||
extract_conn_id(resp);
|
||||
|
||||
/* clean-up */
|
||||
f_dlcx_ok(ep, call_id);
|
||||
|
||||
/* See also OS#2658: Even when we omit the LCO information, we
|
||||
expect the MGW to pick a sane payload type for us. This
|
||||
payload type should be visible in the SDP of the response. */
|
||||
if (resp.sdp.media_list[0].attributes[0].rtpmap.attr_value != "0 PCMU/8000/1") {
|
||||
setverdict(fail, "SDP contains unexpected codec");
|
||||
}
|
||||
|
||||
/* See also OS#2658: We also expect the MGW to assign a port
|
||||
number to us. */
|
||||
if (isbound(resp.sdp.media_list[0].media_field.ports.port_number) == false) {
|
||||
setverdict(fail, "SDP does not contain a port number");
|
||||
}
|
||||
}
|
||||
|
||||
/* test valid CRCX without SDP */
|
||||
testcase TC_crcx() runs on dummy_CT {
|
||||
f_crcx(c_mgw_ep_rtpbridge);
|
||||
setverdict(pass);
|
||||
}
|
||||
|
||||
/* test valid CRCX without SDP and LCO */
|
||||
testcase TC_crcx_no_lco() runs on dummy_CT {
|
||||
f_crcx_no_lco(c_mgw_ep_rtpbridge);
|
||||
setverdict(pass);
|
||||
}
|
||||
|
||||
/* test valid CRCX without SDP (older method without endpoint prefix) */
|
||||
testcase TC_crcx_noprefix() runs on dummy_CT {
|
||||
f_crcx("");
|
||||
|
@ -881,6 +917,7 @@ module MGCP_Test {
|
|||
control {
|
||||
execute(TC_selftest());
|
||||
execute(TC_crcx());
|
||||
execute(TC_crcx_no_lco());
|
||||
execute(TC_crcx_noprefix());
|
||||
execute(TC_crcx_unsupp_mode());
|
||||
execute(TC_crcx_early_bidir_mode());
|
||||
|
|
|
@ -4,6 +4,9 @@
|
|||
<skipped>no verdict</skipped>
|
||||
</testcase>
|
||||
<testcase classname='MGCP_Test' name='TC_crcx' time='MASKED'/>
|
||||
<testcase classname='MGCP_Test' name='TC_crcx_no_lco' time='MASKED'>
|
||||
<error type='DTE'>Dynamic test case error: Using the value of an optional field containing omit.</error>
|
||||
</testcase>
|
||||
<testcase classname='MGCP_Test' name='TC_crcx_noprefix' time='MASKED'/>
|
||||
<testcase classname='MGCP_Test' name='TC_crcx_unsupp_mode' time='MASKED'/>
|
||||
<testcase classname='MGCP_Test' name='TC_crcx_early_bidir_mode' time='MASKED'/>
|
||||
|
|
Loading…
Reference in New Issue