[Asterisk-code-review] tests/pjsip/hold: Add test checking codec order upon hold/unhold (testsuite[master])
Friendly Automation
asteriskteam at digium.com
Wed Jan 5 12:38:48 CST 2022
Friendly Automation has submitted this change. ( https://gerrit.asterisk.org/c/testsuite/+/17732 )
Change subject: tests/pjsip/hold: Add test checking codec order upon hold/unhold
......................................................................
tests/pjsip/hold: Add test checking codec order upon hold/unhold
With the fix of ASTERISK-29320 the order of the codecs in the incoming
SDP is preserved. To check this a testcase is added, performing a
hold/unhold operation on an outgoing channel.
Change-Id: Id7249b174e5630b901d303a19cdd808651e455ea
---
M tests/channels/pjsip/hold/configs/ast1/pjsip.conf
M tests/channels/pjsip/hold/run-test
A tests/channels/pjsip/hold/sipp/phone_B_codec_order.xml
M tests/channels/pjsip/hold_inactive/test-config.yaml
4 files changed, 299 insertions(+), 1 deletion(-)
Approvals:
Joshua Colp: Looks good to me, but someone else must approve
George Joseph: Looks good to me, approved
Friendly Automation: Approved for Submit
diff --git a/tests/channels/pjsip/hold/configs/ast1/pjsip.conf b/tests/channels/pjsip/hold/configs/ast1/pjsip.conf
index 65519b0..62f2cae 100644
--- a/tests/channels/pjsip/hold/configs/ast1/pjsip.conf
+++ b/tests/channels/pjsip/hold/configs/ast1/pjsip.conf
@@ -24,5 +24,5 @@
aors=phone_B
context=default
disallow=all
-allow=ulaw
+allow=ulaw,alaw,gsm
direct_media=no
diff --git a/tests/channels/pjsip/hold/run-test b/tests/channels/pjsip/hold/run-test
index 9b32ffc..086ec53 100755
--- a/tests/channels/pjsip/hold/run-test
+++ b/tests/channels/pjsip/hold/run-test
@@ -45,6 +45,9 @@
'-inf': INJECT_FILE},
{'scenario': 'phone_A.xml',
'-i': '127.0.0.2', '-p': '5060',
+ '-inf': INJECT_FILE},
+ {'scenario': 'phone_A.xml',
+ '-i': '127.0.0.2', '-p': '5060',
'-inf': INJECT_FILE}]
self.sipp_scn_phone_b = [{'scenario': 'phone_B_media_restrict.xml',
'-i': '127.0.0.3', '-p': '5060',
@@ -63,6 +66,9 @@
'-inf': INJECT_FILE},
{'scenario': 'phone_B_IP_media_restrict.xml',
'-i': '127.0.0.3', '-p': '5060',
+ '-inf': INJECT_FILE},
+ {'scenario': 'phone_B_codec_order.xml',
+ '-i': '127.0.0.3', '-p': '5060',
'-inf': INJECT_FILE}]
self.reactor_timeout = 60
diff --git a/tests/channels/pjsip/hold/sipp/phone_B_codec_order.xml b/tests/channels/pjsip/hold/sipp/phone_B_codec_order.xml
new file mode 100644
index 0000000..eb55b58
--- /dev/null
+++ b/tests/channels/pjsip/hold/sipp/phone_B_codec_order.xml
@@ -0,0 +1,291 @@
+<?xml version="1.0" encoding="ISO-8859-1" ?>
+<!DOCTYPE scenario SYSTEM "sipp.dtd">
+
+<scenario name="Phone B Hold">
+ <Global variables="global_call_id"/>
+ <Global variables="prime_tag"/>
+
+ <recv request="INVITE" crlf="true">
+ <action>
+ <ereg regexp=".*"
+ header="Call-ID:"
+ search_in="hdr"
+ check_it="true"
+ assign_to="global_call_id"/>
+ <ereg regexp="tag=.*"
+ header="From:"
+ search_in="hdr"
+ check_it="true"
+ assign_to="prime_tag"/>
+ </action>
+ </recv>
+
+ <send>
+ <![CDATA[
+ SIP/2.0 100 Trying
+ [last_Via:]
+ [last_From:]
+ [last_To:];tag=[call_number]
+ [last_Call-ID:]
+ [last_CSeq:]
+ Contact: <sip:[field1]@[local_ip]:[local_port];transport=[transport]>
+ User-Agent: PolycomSoundPointIP-SPIP_430-UA/3.2.3.1734
+ Accept-Language: en
+ Content-Length: 0
+ ]]>
+ </send>
+
+ <send>
+ <![CDATA[
+ SIP/2.0 180 Ringing
+ [last_Via:]
+ [last_From:]
+ [last_To:];tag=[call_number]
+ [last_Call-ID:]
+ [last_CSeq:]
+ Contact: <sip:[field1]@[local_ip]:[local_port];transport=[transport]>
+ User-Agent: PolycomSoundPointIP-SPIP_430-UA/3.2.3.1734
+ Allow-Events: talk,hold,conference
+ Accept-Language: en
+ Content-Length: 0
+ ]]>
+ </send>
+
+ <pause milliseconds="200"/>
+
+ <send retrans="500">
+ <![CDATA[
+ SIP/2.0 200 OK
+ [last_Via:]
+ [last_From:]
+ [last_To:];tag=[call_number]
+ [last_Call-ID:]
+ [last_CSeq:]
+ Contact: <sip:[field1]@[local_ip]:[local_port];transport=[transport]>
+ Allow: INVITE, ACK, BYE, CANCEL, OPTIONS, INFO, MESSAGE, SUBSCRIBE, NOTIFY, PRACK, UPDATE, REFER
+ Supported: 100rel,replaces
+ User-Agent: PolycomSoundPointIP-SPIP_430-UA/3.2.3.1734
+ Accept-Language: en
+ Content-Type: application/sdp
+ Content-Length: [len]
+
+ v=0
+ o=- 1325003603 1325003604 IN IP4 [local_ip]
+ s=Polycom IP Phone
+ c=IN IP4 [local_ip]
+ t=0 0
+ a=sendrecv
+ m=audio 2226 RTP/AVP 8 3 101
+ a=sendrecv
+ a=rtpmap:8 PCMA/8000
+ a=rtpmap:3 GSM/8000
+ a=rtpmap:101 telephone-event/8000
+ ]]>
+ </send>
+
+ <!-- RECV ACK -->
+ <recv request="ACK"/>
+
+ <!-- Wait some period of time -->
+ <pause milliseconds="2000"/>
+
+ <!-- Modify RTP session to be send only -->
+ <send retrans="500">
+ <![CDATA[
+ INVITE sip:[field0]@[remote_ip]:[remote_port] SIP/2.0
+ Via: SIP/2.0/[transport] [local_ip]:[local_port];branch=[branch]
+ From: [field1] <sip:[field1]@[local_ip]:[local_port]>;tag=[call_number]
+ To: [field0] <sip:[field1]@[remote_ip]>;[$prime_tag]
+ CSeq: [cseq] INVITE
+ Call-ID: [$global_call_id]
+ Contact: <sip:[field1]@[local_ip]:[local_port]>
+ Allow: INVITE, ACK, BYE, CANCEL, OPTIONS, INFO, MESSAGE, SUBSCRIBE, NOTIFY, PRACK, UPDATE, REFER
+ User-Agent: PolycomSoundPointIP-SPIP_430-UA/3.2.3.1734
+ Accept-Language: en
+ Supported: 100rel,replaces
+ Allow-Events: talk,hold,conference
+ Max-Forwards: 70
+ Content-Type: application/sdp
+ Content-Length: [len]
+
+ v=0
+ o=- 1325003603 1325003604 IN IP4 [local_ip]
+ s=Polycom IP Phone
+ c=IN IP4 [local_ip]
+ t=0 0
+ a=sendonly
+ m=audio 2226 RTP/AVP 8 3 101
+ a=sendonly
+ a=rtpmap:8 PCMA/8000
+ a=rtpmap:3 GSM/8000
+ a=rtpmap:101 telephone-event/8000
+ ]]>
+ </send>
+
+ <recv response="100" optional="true" />
+
+ <!-- Check that a-law has been selected after the reinvite -->
+ <recv response="200" rtd="true">
+ <action>
+ <ereg regexp="m=audio [0-9]{1,5} RTP/AVP 8 .*"
+ search_in="body" check_it="true" assign_to="1"/>
+ <test assign_to="1" variable="1" compare="equal" value=""/>
+ </action>
+ </recv>
+
+ <pause milliseconds="200"/>
+
+ <send>
+ <![CDATA[
+ ACK sip:[field1]@[remote_ip]:[remote_port] SIP/2.0
+ Via: SIP/2.0/[transport] [local_ip]:[local_port];branch=[branch]
+ From: [field1] <sip:[field1]@[local_ip]>;tag=[call_number]
+ To: <sip:[field0]@[remote_ip];user=[field0]>[peer_tag_param]
+ CSeq: [cseq] ACK
+ Call-ID: [$global_call_id]
+ Contact: <sip:[field1]@[local_ip]:[local_port]>
+ Allow: INVITE, ACK, BYE, CANCEL, OPTIONS, INFO, MESSAGE, SUBSCRIBE, NOTIFY, PRACK, UPDATE, REFER
+ User-Agent: PolycomSoundPointIP-SPIP_430-UA/3.2.3.1734
+ Accept-Language: en
+ Max-Forwards: 70
+ Content-Length: 0
+ ]]>
+ </send>
+
+ <!-- Wait some period of time -->
+ <pause milliseconds="2000"/>
+
+ <!-- Modify RTP session to be send only -->
+ <send retrans="500">
+ <![CDATA[
+ UPDATE sip:[field0]@[remote_ip]:[remote_port] SIP/2.0
+ Via: SIP/2.0/[transport] [local_ip]:[local_port];branch=[branch]
+ From: [field1] <sip:[field1]@[local_ip]:[local_port]>;tag=[call_number]
+ To: [field0] <sip:[field1]@[remote_ip]>;[$prime_tag]
+ CSeq: [cseq] UPDATE
+ Call-ID: [$global_call_id]
+ Contact: <sip:[field1]@[local_ip]:[local_port]>
+ Allow: INVITE, ACK, BYE, CANCEL, OPTIONS, INFO, MESSAGE, SUBSCRIBE, NOTIFY, PRACK, UPDATE, REFER
+ User-Agent: PolycomSoundPointIP-SPIP_430-UA/3.2.3.1734
+ Accept-Language: en
+ Supported: 100rel,replaces
+ Allow-Events: talk,hold,conference
+ Max-Forwards: 70
+ Content-Type: application/sdp
+ Content-Length: [len]
+
+ v=0
+ o=- 1325003603 1325003604 IN IP4 [local_ip]
+ s=Polycom IP Phone
+ c=IN IP4 [local_ip]
+ t=0 0
+ a=sendonly
+ m=audio 2226 RTP/AVP 8 3 101
+ a=sendonly
+ a=rtpmap:8 PCMA/8000
+ a=rtpmap:3 GSM/8000
+ a=rtpmap:101 telephone-event/8000
+ ]]>
+ </send>
+
+ <recv response="100" optional="true" />
+
+ <!-- Check that a-law has been selected after the update -->
+ <recv response="200" rtd="true">
+ <action>
+ <ereg regexp="m=audio [0-9]{1,5} RTP/AVP 8 .*"
+ search_in="body" check_it="true" assign_to="1"/>
+ <test assign_to="1" variable="1" compare="equal" value=""/>
+ </action>
+ </recv>
+
+ <pause milliseconds="200"/>
+
+ <send>
+ <![CDATA[
+ ACK sip:[field1]@[remote_ip]:[remote_port] SIP/2.0
+ Via: SIP/2.0/[transport] [local_ip]:[local_port];branch=[branch]
+ From: [field1] <sip:[field1]@[local_ip]>;tag=[call_number]
+ To: <sip:[field0]@[remote_ip];user=[field0]>[peer_tag_param]
+ CSeq: [cseq] ACK
+ Call-ID: [$global_call_id]
+ Contact: <sip:[field1]@[local_ip]:[local_port]>
+ Allow: INVITE, ACK, BYE, CANCEL, OPTIONS, INFO, MESSAGE, SUBSCRIBE, NOTIFY, PRACK, UPDATE, REFER
+ User-Agent: PolycomSoundPointIP-SPIP_430-UA/3.2.3.1734
+ Accept-Language: en
+ Max-Forwards: 70
+ Content-Length: 0
+ ]]>
+ </send>
+
+ <!-- Wait some period of time, then send the un-hold as reinvite without SDP -->
+ <pause milliseconds="2000"/>
+
+ <send retrans="500">
+ <![CDATA[
+ INVITE sip:[field0]@[remote_ip]:[remote_port] SIP/2.0
+ Via: SIP/2.0/[transport] [local_ip]:[local_port];branch=[branch]
+ From: [field1] <sip:[field1]@[local_ip]:[local_port]>;tag=[call_number]
+ To: [field0] <sip:[field1]@[remote_ip]>;[$prime_tag]
+ CSeq: [cseq] INVITE
+ Call-ID: [$global_call_id]
+ Contact: <sip:[field1]@[local_ip]:[local_port]>
+ Allow: INVITE, ACK, BYE, CANCEL, OPTIONS, INFO, MESSAGE, SUBSCRIBE, NOTIFY, PRACK, UPDATE, REFER
+ User-Agent: PolycomSoundPointIP-SPIP_430-UA/3.2.3.1734
+ Accept-Language: en
+ Supported: 100rel,replaces
+ Allow-Events: talk,hold,conference
+ Max-Forwards: 70
+ Content-Length: 0
+ ]]>
+ </send>
+
+ <recv response="100" optional="true" />
+
+ <!-- Check that a-law has been selected after the reinvite -->
+ <recv response="200" rtd="true">
+ <action>
+ <ereg regexp="m=audio [0-9]{1,5} RTP/AVP 8 .*"
+ search_in="body" check_it="true" assign_to="1"/>
+ <test assign_to="1" variable="1" compare="equal" value=""/>
+ </action>
+ </recv>
+
+ <send>
+ <![CDATA[
+ ACK sip:[field1]@[remote_ip]:[remote_port] SIP/2.0
+ Via: SIP/2.0/[transport] [local_ip]:[local_port];branch=[branch]
+ From: [field1] <sip:[field1]@[local_ip]>;tag=[call_number]
+ To: <sip:[field0]@[remote_ip];user=[field0]>[peer_tag_param]
+ CSeq: [cseq] ACK
+ Call-ID: [$global_call_id]
+ Contact: <sip:[field1]@[local_ip]:[local_port]>
+ Allow: INVITE, ACK, BYE, CANCEL, OPTIONS, INFO, MESSAGE, SUBSCRIBE, NOTIFY, PRACK, UPDATE, REFER
+ User-Agent: PolycomSoundPointIP-SPIP_430-UA/3.2.3.1734
+ Accept-Language: en
+ Max-Forwards: 70
+ Content-Length: 0
+ ]]>
+ </send>
+
+ <!-- Wait some period of time -->
+ <pause milliseconds="2000"/>
+
+ <send>
+ <![CDATA[
+ BYE sip:[field1]@1[remote_ip]:[remote_port] SIP/2.0
+ Via: SIP/2.0/UDP [local_ip]:[local_port];branch=[branch]
+ From: [field1] <sip:[field1]@[local_ip]:[local_port]>;tag=[call_number]
+ To: [field0] <sip:[field1]@[remote_ip]>[peer_tag_param]
+ CSeq: [cseq] BYE
+ Call-ID: [$global_call_id]
+ Contact: <sip:[field1]@[local_ip]:[local_port]>
+ User-Agent: PolycomSoundPointIP-SPIP_430-UA/3.2.3.1734
+ Accept-Language: en
+ Max-Forwards: 70
+ Content-Length: 0
+ ]]>
+ </send>
+
+
+</scenario>
diff --git a/tests/channels/pjsip/hold_inactive/test-config.yaml b/tests/channels/pjsip/hold_inactive/test-config.yaml
index 5a7c18c..790aa8c 100644
--- a/tests/channels/pjsip/hold_inactive/test-config.yaml
+++ b/tests/channels/pjsip/hold_inactive/test-config.yaml
@@ -5,6 +5,7 @@
sending a re-INVITE with a modified SDP containing a restricted audio
direction with and without an IP address of 0.0.0.0. Restricted audio
direction is also tested for unholding by a re-INVITE without an SDP.
+ A scenario checks that the correct codec is selected after unholding.
properties:
--
To view, visit https://gerrit.asterisk.org/c/testsuite/+/17732
To unsubscribe, or for help writing mail filters, visit https://gerrit.asterisk.org/settings
Gerrit-Project: testsuite
Gerrit-Branch: master
Gerrit-Change-Id: Id7249b174e5630b901d303a19cdd808651e455ea
Gerrit-Change-Number: 17732
Gerrit-PatchSet: 2
Gerrit-Owner: Florentin Mayer <f.mayer at commend.com>
Gerrit-Reviewer: Friendly Automation
Gerrit-Reviewer: George Joseph <gjoseph at digium.com>
Gerrit-Reviewer: Joshua Colp <jcolp at sangoma.com>
Gerrit-MessageType: merged
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.digium.com/pipermail/asterisk-code-review/attachments/20220105/26cfb509/attachment-0001.html>
More information about the asterisk-code-review
mailing list