<p>Friendly Automation <strong>submitted</strong> this change.</p><p><a href="https://gerrit.asterisk.org/c/testsuite/+/14955">View Change</a></p><div style="white-space:pre-wrap">Approvals:
George Joseph: Looks good to me, approved
Friendly Automation: Approved for Submit
</div><pre style="font-family: monospace,monospace; white-space: pre-wrap;">testsuite: add validations for 181 and History-Info conversions<br><br>ASTERISK-29027 #close<br><br>Change-Id: I287c78b38f48817ea4547e3ab0370d26d2abf2e3<br>---<br>M tests/channels/pjsip/diversion/diversion_basic/sipp/user1.xml<br>M tests/channels/pjsip/diversion/diversion_caller_id/sipp/user1.xml<br>M tests/channels/pjsip/diversion/diversion_response/sipp/user1.xml<br>A tests/channels/pjsip/diversion/diversion_response_181/configs/ast1/extensions.conf<br>A tests/channels/pjsip/diversion/diversion_response_181/configs/ast1/pjsip.conf<br>A tests/channels/pjsip/diversion/diversion_response_181/sipp/user1.xml<br>A tests/channels/pjsip/diversion/diversion_response_181/sipp/user2.xml<br>A tests/channels/pjsip/diversion/diversion_response_181/test-config.yaml<br>A tests/channels/pjsip/diversion/history_info_request/configs/ast1/extensions.conf<br>A tests/channels/pjsip/diversion/history_info_request/configs/ast1/pjsip.conf<br>A tests/channels/pjsip/diversion/history_info_request/sipp/user1.xml<br>A tests/channels/pjsip/diversion/history_info_request/sipp/user2.xml<br>A tests/channels/pjsip/diversion/history_info_request/test-config.yaml<br>A tests/channels/pjsip/diversion/history_info_response_181/configs/ast1/extensions.conf<br>A tests/channels/pjsip/diversion/history_info_response_181/configs/ast1/pjsip.conf<br>A tests/channels/pjsip/diversion/history_info_response_181/sipp/user1.xml<br>A tests/channels/pjsip/diversion/history_info_response_181/sipp/user2.xml<br>A tests/channels/pjsip/diversion/history_info_response_181/test-config.yaml<br>A tests/channels/pjsip/diversion/no_diversion_response_181/configs/ast1/extensions.conf<br>A tests/channels/pjsip/diversion/no_diversion_response_181/configs/ast1/pjsip.conf<br>A tests/channels/pjsip/diversion/no_diversion_response_181/sipp/user1.xml<br>A tests/channels/pjsip/diversion/no_diversion_response_181/sipp/user2.xml<br>A tests/channels/pjsip/diversion/no_diversion_response_181/test-config.yaml<br>M tests/channels/pjsip/diversion/tests.yaml<br>A tests/channels/pjsip/history_info/diversion_request/configs/ast1/extensions.conf<br>A tests/channels/pjsip/history_info/diversion_request/configs/ast1/pjsip.conf<br>A tests/channels/pjsip/history_info/diversion_request/sipp/user1.xml<br>A tests/channels/pjsip/history_info/diversion_request/sipp/user2.xml<br>A tests/channels/pjsip/history_info/diversion_request/test-config.yaml<br>A tests/channels/pjsip/history_info/diversion_response_181/configs/ast1/extensions.conf<br>A tests/channels/pjsip/history_info/diversion_response_181/configs/ast1/pjsip.conf<br>A tests/channels/pjsip/history_info/diversion_response_181/sipp/user1.xml<br>A tests/channels/pjsip/history_info/diversion_response_181/sipp/user2.xml<br>A tests/channels/pjsip/history_info/diversion_response_181/test-config.yaml<br>A tests/channels/pjsip/history_info/history_info_request/configs/ast1/extensions.conf<br>A tests/channels/pjsip/history_info/history_info_request/configs/ast1/pjsip.conf<br>A tests/channels/pjsip/history_info/history_info_request/sipp/user1.xml<br>A tests/channels/pjsip/history_info/history_info_request/sipp/user2.xml<br>A tests/channels/pjsip/history_info/history_info_request/test-config.yaml<br>A tests/channels/pjsip/history_info/history_info_response_181/configs/ast1/extensions.conf<br>A tests/channels/pjsip/history_info/history_info_response_181/configs/ast1/pjsip.conf<br>A tests/channels/pjsip/history_info/history_info_response_181/sipp/user1.xml<br>A tests/channels/pjsip/history_info/history_info_response_181/sipp/user2.xml<br>A tests/channels/pjsip/history_info/history_info_response_181/test-config.yaml<br>A tests/channels/pjsip/history_info/no_diversion_response_181/configs/ast1/extensions.conf<br>A tests/channels/pjsip/history_info/no_diversion_response_181/configs/ast1/pjsip.conf<br>A tests/channels/pjsip/history_info/no_diversion_response_181/sipp/user1.xml<br>A tests/channels/pjsip/history_info/no_diversion_response_181/sipp/user2.xml<br>A tests/channels/pjsip/history_info/no_diversion_response_181/test-config.yaml<br>A tests/channels/pjsip/history_info/tests.yaml<br>M tests/channels/pjsip/tests.yaml<br>51 files changed, 1,843 insertions(+), 3 deletions(-)<br><br></pre><pre style="font-family: monospace,monospace; white-space: pre-wrap;"><span>diff --git a/tests/channels/pjsip/diversion/diversion_basic/sipp/user1.xml b/tests/channels/pjsip/diversion/diversion_basic/sipp/user1.xml</span><br><span>index a7c8dda..c21d27a 100644</span><br><span>--- a/tests/channels/pjsip/diversion/diversion_basic/sipp/user1.xml</span><br><span>+++ b/tests/channels/pjsip/diversion/diversion_basic/sipp/user1.xml</span><br><span>@@ -29,7 +29,7 @@</span><br><span> </span><br><span> <recv response="100" optional="true" /></span><br><span> </span><br><span style="color: hsl(0, 100%, 40%);">- <recv response="181" optional="true" /></span><br><span style="color: hsl(120, 100%, 40%);">+ <recv response="181" /></span><br><span> </span><br><span> <recv response="180" optional="true" /></span><br><span> </span><br><span>diff --git a/tests/channels/pjsip/diversion/diversion_caller_id/sipp/user1.xml b/tests/channels/pjsip/diversion/diversion_caller_id/sipp/user1.xml</span><br><span>index cae005c..0151a16 100644</span><br><span>--- a/tests/channels/pjsip/diversion/diversion_caller_id/sipp/user1.xml</span><br><span>+++ b/tests/channels/pjsip/diversion/diversion_caller_id/sipp/user1.xml</span><br><span>@@ -29,7 +29,13 @@</span><br><span> </span><br><span> <recv response="100" optional="true" /></span><br><span> </span><br><span style="color: hsl(0, 100%, 40%);">- <recv response="181" optional="true" /></span><br><span style="color: hsl(120, 100%, 40%);">+ <recv response="181"></span><br><span style="color: hsl(120, 100%, 40%);">+ <action></span><br><span style="color: hsl(120, 100%, 40%);">+ <!-- Check that the Diversion header is present and contains the correct caller id. --></span><br><span style="color: hsl(120, 100%, 40%);">+ <ereg regexp=".*sip:user3.*" search_in="hdr" header="Diversion:" check_it="true" assign_to="1" /></span><br><span style="color: hsl(120, 100%, 40%);">+ <log message="Received INVITE with Diversion header: [$1]." /></span><br><span style="color: hsl(120, 100%, 40%);">+ </action></span><br><span style="color: hsl(120, 100%, 40%);">+ </recv></span><br><span> </span><br><span> <recv response="180" optional="true" /></span><br><span> </span><br><span>diff --git a/tests/channels/pjsip/diversion/diversion_response/sipp/user1.xml b/tests/channels/pjsip/diversion/diversion_response/sipp/user1.xml</span><br><span>index cae005c..40d868f 100644</span><br><span>--- a/tests/channels/pjsip/diversion/diversion_response/sipp/user1.xml</span><br><span>+++ b/tests/channels/pjsip/diversion/diversion_response/sipp/user1.xml</span><br><span>@@ -29,7 +29,7 @@</span><br><span> </span><br><span> <recv response="100" optional="true" /></span><br><span> </span><br><span style="color: hsl(0, 100%, 40%);">- <recv response="181" optional="true" /></span><br><span style="color: hsl(120, 100%, 40%);">+ <recv response="181" /></span><br><span> </span><br><span> <recv response="180" optional="true" /></span><br><span> </span><br><span>diff --git a/tests/channels/pjsip/diversion/diversion_response_181/configs/ast1/extensions.conf b/tests/channels/pjsip/diversion/diversion_response_181/configs/ast1/extensions.conf</span><br><span>new file mode 100644</span><br><span>index 0000000..4719251</span><br><span>--- /dev/null</span><br><span>+++ b/tests/channels/pjsip/diversion/diversion_response_181/configs/ast1/extensions.conf</span><br><span>@@ -0,0 +1,7 @@</span><br><span style="color: hsl(120, 100%, 40%);">+[general]</span><br><span style="color: hsl(120, 100%, 40%);">+</span><br><span style="color: hsl(120, 100%, 40%);">+[default]</span><br><span style="color: hsl(120, 100%, 40%);">+</span><br><span style="color: hsl(120, 100%, 40%);">+exten => user1,1,Dial(PJSIP/user1)</span><br><span style="color: hsl(120, 100%, 40%);">+exten => user2,1,Dial(PJSIP/user2)</span><br><span style="color: hsl(120, 100%, 40%);">+exten => user3,1,Dial(PJSIP/user3)</span><br><span>diff --git a/tests/channels/pjsip/diversion/diversion_response_181/configs/ast1/pjsip.conf b/tests/channels/pjsip/diversion/diversion_response_181/configs/ast1/pjsip.conf</span><br><span>new file mode 100644</span><br><span>index 0000000..dcd83e2</span><br><span>--- /dev/null</span><br><span>+++ b/tests/channels/pjsip/diversion/diversion_response_181/configs/ast1/pjsip.conf</span><br><span>@@ -0,0 +1,33 @@</span><br><span style="color: hsl(120, 100%, 40%);">+[system]</span><br><span style="color: hsl(120, 100%, 40%);">+type=system</span><br><span style="color: hsl(120, 100%, 40%);">+timer_t1=100</span><br><span style="color: hsl(120, 100%, 40%);">+timer_b=6400</span><br><span style="color: hsl(120, 100%, 40%);">+</span><br><span style="color: hsl(120, 100%, 40%);">+[local]</span><br><span style="color: hsl(120, 100%, 40%);">+type=transport</span><br><span style="color: hsl(120, 100%, 40%);">+protocol=udp</span><br><span style="color: hsl(120, 100%, 40%);">+bind=0.0.0.0</span><br><span style="color: hsl(120, 100%, 40%);">+</span><br><span style="color: hsl(120, 100%, 40%);">+[user1-aors]</span><br><span style="color: hsl(120, 100%, 40%);">+type=aor</span><br><span style="color: hsl(120, 100%, 40%);">+contact=sip:user1@127.0.0.1:5061</span><br><span style="color: hsl(120, 100%, 40%);">+</span><br><span style="color: hsl(120, 100%, 40%);">+[user1]</span><br><span style="color: hsl(120, 100%, 40%);">+type=endpoint</span><br><span style="color: hsl(120, 100%, 40%);">+context=default</span><br><span style="color: hsl(120, 100%, 40%);">+aors=user1-aors</span><br><span style="color: hsl(120, 100%, 40%);">+direct_media=no</span><br><span style="color: hsl(120, 100%, 40%);">+disallow=all</span><br><span style="color: hsl(120, 100%, 40%);">+allow=ulaw</span><br><span style="color: hsl(120, 100%, 40%);">+</span><br><span style="color: hsl(120, 100%, 40%);">+[user2-aors]</span><br><span style="color: hsl(120, 100%, 40%);">+type=aor</span><br><span style="color: hsl(120, 100%, 40%);">+contact=sip:user2@127.0.0.1:5062</span><br><span style="color: hsl(120, 100%, 40%);">+</span><br><span style="color: hsl(120, 100%, 40%);">+[user2]</span><br><span style="color: hsl(120, 100%, 40%);">+type=endpoint</span><br><span style="color: hsl(120, 100%, 40%);">+context=default</span><br><span style="color: hsl(120, 100%, 40%);">+aors=user2-aors</span><br><span style="color: hsl(120, 100%, 40%);">+direct_media=no</span><br><span style="color: hsl(120, 100%, 40%);">+disallow=all</span><br><span style="color: hsl(120, 100%, 40%);">+allow=ulaw</span><br><span>diff --git a/tests/channels/pjsip/diversion/diversion_response_181/sipp/user1.xml b/tests/channels/pjsip/diversion/diversion_response_181/sipp/user1.xml</span><br><span>new file mode 100644</span><br><span>index 0000000..9b9a696</span><br><span>--- /dev/null</span><br><span>+++ b/tests/channels/pjsip/diversion/diversion_response_181/sipp/user1.xml</span><br><span>@@ -0,0 +1,74 @@</span><br><span style="color: hsl(120, 100%, 40%);">+<?xml version="1.0" encoding="ISO-8859-1" ?></span><br><span style="color: hsl(120, 100%, 40%);">+</span><br><span style="color: hsl(120, 100%, 40%);">+<scenario name="send an invite to user2"></span><br><span style="color: hsl(120, 100%, 40%);">+ <send retrans="500"></span><br><span style="color: hsl(120, 100%, 40%);">+ <![CDATA[</span><br><span style="color: hsl(120, 100%, 40%);">+ INVITE sip:user2@[remote_ip]:[remote_port] SIP/2.0</span><br><span style="color: hsl(120, 100%, 40%);">+ Via: SIP/2.0/[transport] [local_ip]:[local_port];branch=[branch]</span><br><span style="color: hsl(120, 100%, 40%);">+ From: user1 <sip:user1@[local_ip]:[local_port]>;tag=[call_number]</span><br><span style="color: hsl(120, 100%, 40%);">+ To: user2 <sip:user2@[remote_ip]:[remote_port]></span><br><span style="color: hsl(120, 100%, 40%);">+ Call-ID: [call_id]</span><br><span style="color: hsl(120, 100%, 40%);">+ CSeq: [cseq] INVITE</span><br><span style="color: hsl(120, 100%, 40%);">+ Contact: sip:user1@[local_ip]:[local_port]</span><br><span style="color: hsl(120, 100%, 40%);">+ Max-Forwards: 70</span><br><span style="color: hsl(120, 100%, 40%);">+ Content-Type: application/sdp</span><br><span style="color: hsl(120, 100%, 40%);">+ Content-Length: [len]</span><br><span style="color: hsl(120, 100%, 40%);">+</span><br><span style="color: hsl(120, 100%, 40%);">+ v=0</span><br><span style="color: hsl(120, 100%, 40%);">+ o=- 1324901698 1324901698 IN IP[local_ip_type] [local_ip]</span><br><span style="color: hsl(120, 100%, 40%);">+ s=-</span><br><span style="color: hsl(120, 100%, 40%);">+ c=IN IP[media_ip_type] [media_ip]</span><br><span style="color: hsl(120, 100%, 40%);">+ t=0 0</span><br><span style="color: hsl(120, 100%, 40%);">+ m=audio [media_port] RTP/AVP 0 101</span><br><span style="color: hsl(120, 100%, 40%);">+ a=sendrecv</span><br><span style="color: hsl(120, 100%, 40%);">+ a=rtpmap:0 PCMU/8000</span><br><span style="color: hsl(120, 100%, 40%);">+ a=rtpmap:101 telephone-event/8000</span><br><span style="color: hsl(120, 100%, 40%);">+</span><br><span style="color: hsl(120, 100%, 40%);">+ ]]></span><br><span style="color: hsl(120, 100%, 40%);">+ </send></span><br><span style="color: hsl(120, 100%, 40%);">+</span><br><span style="color: hsl(120, 100%, 40%);">+ <recv response="100" optional="true" /></span><br><span style="color: hsl(120, 100%, 40%);">+</span><br><span style="color: hsl(120, 100%, 40%);">+ <recv response="181"></span><br><span style="color: hsl(120, 100%, 40%);">+ <action></span><br><span style="color: hsl(120, 100%, 40%);">+ <!-- Check that the Diversion header is present and contains the correct name. --></span><br><span style="color: hsl(120, 100%, 40%);">+ <ereg regexp="amenhotep" search_in="hdr" header="Diversion:" check_it="true" assign_to="1" /></span><br><span style="color: hsl(120, 100%, 40%);">+ <log message="Received 181 with Diversion header: [$1]." /></span><br><span style="color: hsl(120, 100%, 40%);">+ </action></span><br><span style="color: hsl(120, 100%, 40%);">+ </recv></span><br><span style="color: hsl(120, 100%, 40%);">+</span><br><span style="color: hsl(120, 100%, 40%);">+ <recv response="180" optional="true" /></span><br><span style="color: hsl(120, 100%, 40%);">+</span><br><span style="color: hsl(120, 100%, 40%);">+ <recv response="183" optional="true" /></span><br><span style="color: hsl(120, 100%, 40%);">+</span><br><span style="color: hsl(120, 100%, 40%);">+ <recv response="200" /></span><br><span style="color: hsl(120, 100%, 40%);">+</span><br><span style="color: hsl(120, 100%, 40%);">+ <send></span><br><span style="color: hsl(120, 100%, 40%);">+ <![CDATA[</span><br><span style="color: hsl(120, 100%, 40%);">+ ACK sip:user3@[remote_ip]:[remote_port] SIP/2.0</span><br><span style="color: hsl(120, 100%, 40%);">+ Via: SIP/2.0/[transport] [local_ip]:[local_port];branch=[branch]</span><br><span style="color: hsl(120, 100%, 40%);">+ From: <sip:user1@[local_ip]>;tag=[call_number]</span><br><span style="color: hsl(120, 100%, 40%);">+ To: <sip:user3@[remote_ip]:[remote_port]>[peer_tag_param]</span><br><span style="color: hsl(120, 100%, 40%);">+ CSeq: [cseq] ACK</span><br><span style="color: hsl(120, 100%, 40%);">+ Call-ID: [call_id]</span><br><span style="color: hsl(120, 100%, 40%);">+ Max-Forwards: 70</span><br><span style="color: hsl(120, 100%, 40%);">+ Content-Length: 0</span><br><span style="color: hsl(120, 100%, 40%);">+</span><br><span style="color: hsl(120, 100%, 40%);">+ ]]></span><br><span style="color: hsl(120, 100%, 40%);">+ </send></span><br><span style="color: hsl(120, 100%, 40%);">+</span><br><span style="color: hsl(120, 100%, 40%);">+ <send retrans="500"></span><br><span style="color: hsl(120, 100%, 40%);">+ <![CDATA[</span><br><span style="color: hsl(120, 100%, 40%);">+ BYE sip:user3@[remote_ip]:[remote_port] SIP/2.0</span><br><span style="color: hsl(120, 100%, 40%);">+ Via: SIP/2.0/[transport] [local_ip]:[local_port];branch=[branch]</span><br><span style="color: hsl(120, 100%, 40%);">+ From: <sip:user1@[local_ip]>;tag=[call_number]</span><br><span style="color: hsl(120, 100%, 40%);">+ To: <sip:user3@[remote_ip]:[remote_port]>[peer_tag_param]</span><br><span style="color: hsl(120, 100%, 40%);">+ CSeq: [cseq] BYE</span><br><span style="color: hsl(120, 100%, 40%);">+ Call-ID: [call_id]</span><br><span style="color: hsl(120, 100%, 40%);">+ Max-Forwards: 70</span><br><span style="color: hsl(120, 100%, 40%);">+ Content-Length: 0</span><br><span style="color: hsl(120, 100%, 40%);">+ ]]></span><br><span style="color: hsl(120, 100%, 40%);">+ </send></span><br><span style="color: hsl(120, 100%, 40%);">+</span><br><span style="color: hsl(120, 100%, 40%);">+ <recv response="200" crlf="true" /></span><br><span style="color: hsl(120, 100%, 40%);">+</scenario></span><br><span>diff --git a/tests/channels/pjsip/diversion/diversion_response_181/sipp/user2.xml b/tests/channels/pjsip/diversion/diversion_response_181/sipp/user2.xml</span><br><span>new file mode 100644</span><br><span>index 0000000..39fa4cc</span><br><span>--- /dev/null</span><br><span>+++ b/tests/channels/pjsip/diversion/diversion_response_181/sipp/user2.xml</span><br><span>@@ -0,0 +1,45 @@</span><br><span style="color: hsl(120, 100%, 40%);">+<?xml version="1.0" encoding="ISO-8859-1" ?></span><br><span style="color: hsl(120, 100%, 40%);">+</span><br><span style="color: hsl(120, 100%, 40%);">+<scenario name="send forwarding response back with diversion header"></span><br><span style="color: hsl(120, 100%, 40%);">+ <recv request="INVITE" crlf="true" /></span><br><span style="color: hsl(120, 100%, 40%);">+</span><br><span style="color: hsl(120, 100%, 40%);">+ <send></span><br><span style="color: hsl(120, 100%, 40%);">+ <![CDATA[</span><br><span style="color: hsl(120, 100%, 40%);">+ SIP/2.0 181 Redirected</span><br><span style="color: hsl(120, 100%, 40%);">+ [last_Via:]</span><br><span style="color: hsl(120, 100%, 40%);">+ [last_From:]</span><br><span style="color: hsl(120, 100%, 40%);">+ [last_To:];tag=[call_number]</span><br><span style="color: hsl(120, 100%, 40%);">+ [last_Call-ID:]</span><br><span style="color: hsl(120, 100%, 40%);">+ [last_CSeq:]</span><br><span style="color: hsl(120, 100%, 40%);">+ Contact: <sip:user3@[local_ip]></span><br><span style="color: hsl(120, 100%, 40%);">+ Diversion: <sip:amenhotep@127.0.0.1>;reason=unconditional</span><br><span style="color: hsl(120, 100%, 40%);">+ Content-Length: 0</span><br><span style="color: hsl(120, 100%, 40%);">+ ]]></span><br><span style="color: hsl(120, 100%, 40%);">+ </send></span><br><span style="color: hsl(120, 100%, 40%);">+ <send retrans="500"></span><br><span style="color: hsl(120, 100%, 40%);">+ <![CDATA[</span><br><span style="color: hsl(120, 100%, 40%);">+ SIP/2.0 200 OK</span><br><span style="color: hsl(120, 100%, 40%);">+ [last_Via:]</span><br><span style="color: hsl(120, 100%, 40%);">+ [last_From:]</span><br><span style="color: hsl(120, 100%, 40%);">+ [last_To:];tag=[call_number]</span><br><span style="color: hsl(120, 100%, 40%);">+ [last_Call-ID:]</span><br><span style="color: hsl(120, 100%, 40%);">+ [last_CSeq:]</span><br><span style="color: hsl(120, 100%, 40%);">+ Contact: <sip:user2@[local_ip]:[local_port];transport=[transport]></span><br><span style="color: hsl(120, 100%, 40%);">+ Content-Type: application/sdp</span><br><span style="color: hsl(120, 100%, 40%);">+ Content-Length: [len]</span><br><span style="color: hsl(120, 100%, 40%);">+</span><br><span style="color: hsl(120, 100%, 40%);">+ v=0</span><br><span style="color: hsl(120, 100%, 40%);">+ o=- 1324901698 1324901698 IN IP[local_ip_type] [local_ip]</span><br><span style="color: hsl(120, 100%, 40%);">+ s=-</span><br><span style="color: hsl(120, 100%, 40%);">+ c=IN IP[media_ip_type] [media_ip]</span><br><span style="color: hsl(120, 100%, 40%);">+ t=0 0</span><br><span style="color: hsl(120, 100%, 40%);">+ m=audio [media_port] RTP/AVP 0 101</span><br><span style="color: hsl(120, 100%, 40%);">+ a=sendrecv</span><br><span style="color: hsl(120, 100%, 40%);">+ a=rtpmap:0 PCMU/8000</span><br><span style="color: hsl(120, 100%, 40%);">+ a=rtpmap:101 telephone-event/8000</span><br><span style="color: hsl(120, 100%, 40%);">+</span><br><span style="color: hsl(120, 100%, 40%);">+ ]]></span><br><span style="color: hsl(120, 100%, 40%);">+ </send></span><br><span style="color: hsl(120, 100%, 40%);">+</span><br><span style="color: hsl(120, 100%, 40%);">+ <recv request="ACK"/></span><br><span style="color: hsl(120, 100%, 40%);">+</scenario></span><br><span>diff --git a/tests/channels/pjsip/diversion/diversion_response_181/test-config.yaml b/tests/channels/pjsip/diversion/diversion_response_181/test-config.yaml</span><br><span>new file mode 100644</span><br><span>index 0000000..269f087</span><br><span>--- /dev/null</span><br><span>+++ b/tests/channels/pjsip/diversion/diversion_response_181/test-config.yaml</span><br><span>@@ -0,0 +1,29 @@</span><br><span style="color: hsl(120, 100%, 40%);">+testinfo:</span><br><span style="color: hsl(120, 100%, 40%);">+ summary: 'Test to make sure a 181 response containing a diversion header gets</span><br><span style="color: hsl(120, 100%, 40%);">+ propagated correctly.'</span><br><span style="color: hsl(120, 100%, 40%);">+</span><br><span style="color: hsl(120, 100%, 40%);">+ description: |</span><br><span style="color: hsl(120, 100%, 40%);">+ 'user1 calls user2 which sends a 181 to indicate redirection.</span><br><span style="color: hsl(120, 100%, 40%);">+ Verify the 181 response coming from user2 contains a diversion header.'</span><br><span style="color: hsl(120, 100%, 40%);">+</span><br><span style="color: hsl(120, 100%, 40%);">+properties:</span><br><span style="color: hsl(120, 100%, 40%);">+ dependencies:</span><br><span style="color: hsl(120, 100%, 40%);">+ - app : 'sipp'</span><br><span style="color: hsl(120, 100%, 40%);">+ - asterisk : 'app_dial'</span><br><span style="color: hsl(120, 100%, 40%);">+ - asterisk : 'res_pjsip'</span><br><span style="color: hsl(120, 100%, 40%);">+ - asterisk : 'res_pjsip_diversion'</span><br><span style="color: hsl(120, 100%, 40%);">+ tags:</span><br><span style="color: hsl(120, 100%, 40%);">+ - pjsip</span><br><span style="color: hsl(120, 100%, 40%);">+</span><br><span style="color: hsl(120, 100%, 40%);">+test-modules:</span><br><span style="color: hsl(120, 100%, 40%);">+ test-object:</span><br><span style="color: hsl(120, 100%, 40%);">+ config-section: test-object-config</span><br><span style="color: hsl(120, 100%, 40%);">+ typename: 'sipp.SIPpTestCase'</span><br><span style="color: hsl(120, 100%, 40%);">+</span><br><span style="color: hsl(120, 100%, 40%);">+test-object-config:</span><br><span style="color: hsl(120, 100%, 40%);">+ memcheck-delay-stop: 7</span><br><span style="color: hsl(120, 100%, 40%);">+ test-iterations:</span><br><span style="color: hsl(120, 100%, 40%);">+ -</span><br><span style="color: hsl(120, 100%, 40%);">+ scenarios:</span><br><span style="color: hsl(120, 100%, 40%);">+ - { 'key-args': { 'scenario':'user2.xml', '-p':'5062' } }</span><br><span style="color: hsl(120, 100%, 40%);">+ - { 'key-args': { 'scenario':'user1.xml', '-p':'5061' } }</span><br><span>diff --git a/tests/channels/pjsip/diversion/history_info_request/configs/ast1/extensions.conf b/tests/channels/pjsip/diversion/history_info_request/configs/ast1/extensions.conf</span><br><span>new file mode 100644</span><br><span>index 0000000..4719251</span><br><span>--- /dev/null</span><br><span>+++ b/tests/channels/pjsip/diversion/history_info_request/configs/ast1/extensions.conf</span><br><span>@@ -0,0 +1,7 @@</span><br><span style="color: hsl(120, 100%, 40%);">+[general]</span><br><span style="color: hsl(120, 100%, 40%);">+</span><br><span style="color: hsl(120, 100%, 40%);">+[default]</span><br><span style="color: hsl(120, 100%, 40%);">+</span><br><span style="color: hsl(120, 100%, 40%);">+exten => user1,1,Dial(PJSIP/user1)</span><br><span style="color: hsl(120, 100%, 40%);">+exten => user2,1,Dial(PJSIP/user2)</span><br><span style="color: hsl(120, 100%, 40%);">+exten => user3,1,Dial(PJSIP/user3)</span><br><span>diff --git a/tests/channels/pjsip/diversion/history_info_request/configs/ast1/pjsip.conf b/tests/channels/pjsip/diversion/history_info_request/configs/ast1/pjsip.conf</span><br><span>new file mode 100644</span><br><span>index 0000000..0291c85</span><br><span>--- /dev/null</span><br><span>+++ b/tests/channels/pjsip/diversion/history_info_request/configs/ast1/pjsip.conf</span><br><span>@@ -0,0 +1,45 @@</span><br><span style="color: hsl(120, 100%, 40%);">+[system]</span><br><span style="color: hsl(120, 100%, 40%);">+type=system</span><br><span style="color: hsl(120, 100%, 40%);">+timer_t1=100</span><br><span style="color: hsl(120, 100%, 40%);">+timer_b=6400</span><br><span style="color: hsl(120, 100%, 40%);">+</span><br><span style="color: hsl(120, 100%, 40%);">+[local]</span><br><span style="color: hsl(120, 100%, 40%);">+type=transport</span><br><span style="color: hsl(120, 100%, 40%);">+protocol=udp</span><br><span style="color: hsl(120, 100%, 40%);">+bind=0.0.0.0</span><br><span style="color: hsl(120, 100%, 40%);">+</span><br><span style="color: hsl(120, 100%, 40%);">+[user1-aors]</span><br><span style="color: hsl(120, 100%, 40%);">+type=aor</span><br><span style="color: hsl(120, 100%, 40%);">+contact=sip:user1@127.0.0.1:5061</span><br><span style="color: hsl(120, 100%, 40%);">+</span><br><span style="color: hsl(120, 100%, 40%);">+[user1]</span><br><span style="color: hsl(120, 100%, 40%);">+type=endpoint</span><br><span style="color: hsl(120, 100%, 40%);">+context=default</span><br><span style="color: hsl(120, 100%, 40%);">+aors=user1-aors</span><br><span style="color: hsl(120, 100%, 40%);">+direct_media=no</span><br><span style="color: hsl(120, 100%, 40%);">+disallow=all</span><br><span style="color: hsl(120, 100%, 40%);">+allow=ulaw</span><br><span style="color: hsl(120, 100%, 40%);">+</span><br><span style="color: hsl(120, 100%, 40%);">+[user2-aors]</span><br><span style="color: hsl(120, 100%, 40%);">+type=aor</span><br><span style="color: hsl(120, 100%, 40%);">+contact=sip:user2@127.0.0.1:5062</span><br><span style="color: hsl(120, 100%, 40%);">+</span><br><span style="color: hsl(120, 100%, 40%);">+[user2]</span><br><span style="color: hsl(120, 100%, 40%);">+type=endpoint</span><br><span style="color: hsl(120, 100%, 40%);">+context=default</span><br><span style="color: hsl(120, 100%, 40%);">+aors=user2-aors</span><br><span style="color: hsl(120, 100%, 40%);">+direct_media=no</span><br><span style="color: hsl(120, 100%, 40%);">+disallow=all</span><br><span style="color: hsl(120, 100%, 40%);">+allow=ulaw</span><br><span style="color: hsl(120, 100%, 40%);">+</span><br><span style="color: hsl(120, 100%, 40%);">+[user3-aors]</span><br><span style="color: hsl(120, 100%, 40%);">+type=aor</span><br><span style="color: hsl(120, 100%, 40%);">+contact=sip:user3@127.0.0.1:5063</span><br><span style="color: hsl(120, 100%, 40%);">+</span><br><span style="color: hsl(120, 100%, 40%);">+[user3]</span><br><span style="color: hsl(120, 100%, 40%);">+type=endpoint</span><br><span style="color: hsl(120, 100%, 40%);">+context=default</span><br><span style="color: hsl(120, 100%, 40%);">+aors=user3-aors</span><br><span style="color: hsl(120, 100%, 40%);">+direct_media=no</span><br><span style="color: hsl(120, 100%, 40%);">+disallow=all</span><br><span style="color: hsl(120, 100%, 40%);">+allow=ulaw</span><br><span>diff --git a/tests/channels/pjsip/diversion/history_info_request/sipp/user1.xml b/tests/channels/pjsip/diversion/history_info_request/sipp/user1.xml</span><br><span>new file mode 100644</span><br><span>index 0000000..c38a4c3</span><br><span>--- /dev/null</span><br><span>+++ b/tests/channels/pjsip/diversion/history_info_request/sipp/user1.xml</span><br><span>@@ -0,0 +1,70 @@</span><br><span style="color: hsl(120, 100%, 40%);">+<?xml version="1.0" encoding="ISO-8859-1" ?></span><br><span style="color: hsl(120, 100%, 40%);">+</span><br><span style="color: hsl(120, 100%, 40%);">+<scenario name="send an invite to user2"></span><br><span style="color: hsl(120, 100%, 40%);">+ <send retrans="500"></span><br><span style="color: hsl(120, 100%, 40%);">+ <![CDATA[</span><br><span style="color: hsl(120, 100%, 40%);">+ INVITE sip:user2@[remote_ip]:[remote_port] SIP/2.0</span><br><span style="color: hsl(120, 100%, 40%);">+ Via: SIP/2.0/[transport] [local_ip]:[local_port];branch=[branch]</span><br><span style="color: hsl(120, 100%, 40%);">+ From: user1 <sip:user1@[local_ip]:[local_port]>;tag=[call_number]</span><br><span style="color: hsl(120, 100%, 40%);">+ To: user2 <sip:amenhotep@[remote_ip]:[remote_port]></span><br><span style="color: hsl(120, 100%, 40%);">+ Call-ID: [call_id]</span><br><span style="color: hsl(120, 100%, 40%);">+ CSeq: [cseq] INVITE</span><br><span style="color: hsl(120, 100%, 40%);">+ Contact: sip:user1@[local_ip]:[local_port]</span><br><span style="color: hsl(120, 100%, 40%);">+ Max-Forwards: 70</span><br><span style="color: hsl(120, 100%, 40%);">+ History-Info: <sip:amenhotep@127.0.0.1>;index=1</span><br><span style="color: hsl(120, 100%, 40%);">+ History-Info: <sip:user2@127.0.0.1;cause=302>;index=1.1</span><br><span style="color: hsl(120, 100%, 40%);">+ Content-Type: application/sdp</span><br><span style="color: hsl(120, 100%, 40%);">+ Content-Length: [len]</span><br><span style="color: hsl(120, 100%, 40%);">+</span><br><span style="color: hsl(120, 100%, 40%);">+ v=0</span><br><span style="color: hsl(120, 100%, 40%);">+ o=- 1324901698 1324901698 IN IP[local_ip_type] [local_ip]</span><br><span style="color: hsl(120, 100%, 40%);">+ s=-</span><br><span style="color: hsl(120, 100%, 40%);">+ c=IN IP[media_ip_type] [media_ip]</span><br><span style="color: hsl(120, 100%, 40%);">+ t=0 0</span><br><span style="color: hsl(120, 100%, 40%);">+ m=audio [media_port] RTP/AVP 0 101</span><br><span style="color: hsl(120, 100%, 40%);">+ a=sendrecv</span><br><span style="color: hsl(120, 100%, 40%);">+ a=rtpmap:0 PCMU/8000</span><br><span style="color: hsl(120, 100%, 40%);">+ a=rtpmap:101 telephone-event/8000</span><br><span style="color: hsl(120, 100%, 40%);">+</span><br><span style="color: hsl(120, 100%, 40%);">+ ]]></span><br><span style="color: hsl(120, 100%, 40%);">+ </send></span><br><span style="color: hsl(120, 100%, 40%);">+</span><br><span style="color: hsl(120, 100%, 40%);">+ <recv response="100" optional="true" /></span><br><span style="color: hsl(120, 100%, 40%);">+</span><br><span style="color: hsl(120, 100%, 40%);">+ <recv response="181" optional="true" /></span><br><span style="color: hsl(120, 100%, 40%);">+</span><br><span style="color: hsl(120, 100%, 40%);">+ <recv response="180" optional="true" /></span><br><span style="color: hsl(120, 100%, 40%);">+</span><br><span style="color: hsl(120, 100%, 40%);">+ <recv response="183" optional="true" /></span><br><span style="color: hsl(120, 100%, 40%);">+</span><br><span style="color: hsl(120, 100%, 40%);">+ <recv response="200" /></span><br><span style="color: hsl(120, 100%, 40%);">+</span><br><span style="color: hsl(120, 100%, 40%);">+ <send></span><br><span style="color: hsl(120, 100%, 40%);">+ <![CDATA[</span><br><span style="color: hsl(120, 100%, 40%);">+ ACK sip:user2@[remote_ip]:[remote_port] SIP/2.0</span><br><span style="color: hsl(120, 100%, 40%);">+ Via: SIP/2.0/[transport] [local_ip]:[local_port];branch=[branch]</span><br><span style="color: hsl(120, 100%, 40%);">+ From: <sip:user1@[local_ip]>;tag=[call_number]</span><br><span style="color: hsl(120, 100%, 40%);">+ To: <sip:user2@[remote_ip]:[remote_port]>[peer_tag_param]</span><br><span style="color: hsl(120, 100%, 40%);">+ CSeq: [cseq] ACK</span><br><span style="color: hsl(120, 100%, 40%);">+ Call-ID: [call_id]</span><br><span style="color: hsl(120, 100%, 40%);">+ Max-Forwards: 70</span><br><span style="color: hsl(120, 100%, 40%);">+ Content-Length: 0</span><br><span style="color: hsl(120, 100%, 40%);">+</span><br><span style="color: hsl(120, 100%, 40%);">+ ]]></span><br><span style="color: hsl(120, 100%, 40%);">+ </send></span><br><span style="color: hsl(120, 100%, 40%);">+</span><br><span style="color: hsl(120, 100%, 40%);">+ <send retrans="500"></span><br><span style="color: hsl(120, 100%, 40%);">+ <![CDATA[</span><br><span style="color: hsl(120, 100%, 40%);">+ BYE sip:user2@[remote_ip]:[remote_port] SIP/2.0</span><br><span style="color: hsl(120, 100%, 40%);">+ Via: SIP/2.0/[transport] [local_ip]:[local_port];branch=[branch]</span><br><span style="color: hsl(120, 100%, 40%);">+ From: <sip:user1@[local_ip]>;tag=[call_number]</span><br><span style="color: hsl(120, 100%, 40%);">+ To: <sip:user2@[remote_ip]:[remote_port]>[peer_tag_param]</span><br><span style="color: hsl(120, 100%, 40%);">+ CSeq: [cseq] BYE</span><br><span style="color: hsl(120, 100%, 40%);">+ Call-ID: [call_id]</span><br><span style="color: hsl(120, 100%, 40%);">+ Max-Forwards: 70</span><br><span style="color: hsl(120, 100%, 40%);">+ Content-Length: 0</span><br><span style="color: hsl(120, 100%, 40%);">+ ]]></span><br><span style="color: hsl(120, 100%, 40%);">+ </send></span><br><span style="color: hsl(120, 100%, 40%);">+</span><br><span style="color: hsl(120, 100%, 40%);">+ <recv response="200" crlf="true" /></span><br><span style="color: hsl(120, 100%, 40%);">+</scenario></span><br><span>diff --git a/tests/channels/pjsip/diversion/history_info_request/sipp/user2.xml b/tests/channels/pjsip/diversion/history_info_request/sipp/user2.xml</span><br><span>new file mode 100644</span><br><span>index 0000000..f3f1549</span><br><span>--- /dev/null</span><br><span>+++ b/tests/channels/pjsip/diversion/history_info_request/sipp/user2.xml</span><br><span>@@ -0,0 +1,80 @@</span><br><span style="color: hsl(120, 100%, 40%);">+<?xml version="1.0" encoding="ISO-8859-1" ?></span><br><span style="color: hsl(120, 100%, 40%);">+</span><br><span style="color: hsl(120, 100%, 40%);">+<scenario name="receives invite with diversion info"></span><br><span style="color: hsl(120, 100%, 40%);">+ <recv request="INVITE" crlf="true"></span><br><span style="color: hsl(120, 100%, 40%);">+ <action></span><br><span style="color: hsl(120, 100%, 40%);">+ <!-- Check that the Diversion header is present and contains the correct name. --></span><br><span style="color: hsl(120, 100%, 40%);">+ <ereg regexp="amenhotep" search_in="hdr" header="Diversion:" check_it="true" assign_to="1" /></span><br><span style="color: hsl(120, 100%, 40%);">+ <log message="Received INVITE with Diversion header: [$1]." /></span><br><span style="color: hsl(120, 100%, 40%);">+ </action></span><br><span style="color: hsl(120, 100%, 40%);">+ </recv></span><br><span style="color: hsl(120, 100%, 40%);">+</span><br><span style="color: hsl(120, 100%, 40%);">+ <send></span><br><span style="color: hsl(120, 100%, 40%);">+ <![CDATA[</span><br><span style="color: hsl(120, 100%, 40%);">+ SIP/2.0 100 Trying</span><br><span style="color: hsl(120, 100%, 40%);">+ [last_Via:]</span><br><span style="color: hsl(120, 100%, 40%);">+ [last_From:]</span><br><span style="color: hsl(120, 100%, 40%);">+ [last_To:];tag=[call_number]</span><br><span style="color: hsl(120, 100%, 40%);">+ [last_Call-ID:]</span><br><span style="color: hsl(120, 100%, 40%);">+ [last_CSeq:]</span><br><span style="color: hsl(120, 100%, 40%);">+ Contact: <sip:user2@[local_ip]:[local_port];transport=[transport]></span><br><span style="color: hsl(120, 100%, 40%);">+ Content-Length: 0</span><br><span style="color: hsl(120, 100%, 40%);">+ ]]></span><br><span style="color: hsl(120, 100%, 40%);">+ </send></span><br><span style="color: hsl(120, 100%, 40%);">+</span><br><span style="color: hsl(120, 100%, 40%);">+ <send></span><br><span style="color: hsl(120, 100%, 40%);">+ <![CDATA[</span><br><span style="color: hsl(120, 100%, 40%);">+ SIP/2.0 180 Ringing</span><br><span style="color: hsl(120, 100%, 40%);">+ [last_Via:]</span><br><span style="color: hsl(120, 100%, 40%);">+ [last_From:]</span><br><span style="color: hsl(120, 100%, 40%);">+ [last_To:];tag=[call_number]</span><br><span style="color: hsl(120, 100%, 40%);">+ [last_Call-ID:]</span><br><span style="color: hsl(120, 100%, 40%);">+ [last_CSeq:]</span><br><span style="color: hsl(120, 100%, 40%);">+ Contact: <sip:user2@[local_ip]:[local_port];transport=[transport]></span><br><span style="color: hsl(120, 100%, 40%);">+ Content-Length: 0</span><br><span style="color: hsl(120, 100%, 40%);">+ ]]></span><br><span style="color: hsl(120, 100%, 40%);">+ </send></span><br><span style="color: hsl(120, 100%, 40%);">+</span><br><span style="color: hsl(120, 100%, 40%);">+ <send retrans="500"></span><br><span style="color: hsl(120, 100%, 40%);">+ <![CDATA[</span><br><span style="color: hsl(120, 100%, 40%);">+ SIP/2.0 200 OK</span><br><span style="color: hsl(120, 100%, 40%);">+ [last_Via:]</span><br><span style="color: hsl(120, 100%, 40%);">+ [last_From:]</span><br><span style="color: hsl(120, 100%, 40%);">+ [last_To:];tag=[call_number]</span><br><span style="color: hsl(120, 100%, 40%);">+ [last_Call-ID:]</span><br><span style="color: hsl(120, 100%, 40%);">+ [last_CSeq:]</span><br><span style="color: hsl(120, 100%, 40%);">+ Contact: <sip:user2@[local_ip]:[local_port];transport=[transport]></span><br><span style="color: hsl(120, 100%, 40%);">+ Content-Type: application/sdp</span><br><span style="color: hsl(120, 100%, 40%);">+ Content-Length: [len]</span><br><span style="color: hsl(120, 100%, 40%);">+</span><br><span style="color: hsl(120, 100%, 40%);">+ v=0</span><br><span style="color: hsl(120, 100%, 40%);">+ o=- 1324901698 1324901698 IN IP[local_ip_type] [local_ip]</span><br><span style="color: hsl(120, 100%, 40%);">+ s=-</span><br><span style="color: hsl(120, 100%, 40%);">+ c=IN IP[media_ip_type] [media_ip]</span><br><span style="color: hsl(120, 100%, 40%);">+ t=0 0</span><br><span style="color: hsl(120, 100%, 40%);">+ m=audio [media_port] RTP/AVP 0 101</span><br><span style="color: hsl(120, 100%, 40%);">+ a=sendrecv</span><br><span style="color: hsl(120, 100%, 40%);">+ a=rtpmap:0 PCMU/8000</span><br><span style="color: hsl(120, 100%, 40%);">+ a=rtpmap:101 telephone-event/8000</span><br><span style="color: hsl(120, 100%, 40%);">+</span><br><span style="color: hsl(120, 100%, 40%);">+ ]]></span><br><span style="color: hsl(120, 100%, 40%);">+ </send></span><br><span style="color: hsl(120, 100%, 40%);">+</span><br><span style="color: hsl(120, 100%, 40%);">+ <recv request="ACK"/></span><br><span style="color: hsl(120, 100%, 40%);">+</span><br><span style="color: hsl(120, 100%, 40%);">+ <recv request="BYE" crlf="true" /></span><br><span style="color: hsl(120, 100%, 40%);">+</span><br><span style="color: hsl(120, 100%, 40%);">+ <send retrans="500"></span><br><span style="color: hsl(120, 100%, 40%);">+ <![CDATA[</span><br><span style="color: hsl(120, 100%, 40%);">+ SIP/2.0 200 OK</span><br><span style="color: hsl(120, 100%, 40%);">+ [last_Via:]</span><br><span style="color: hsl(120, 100%, 40%);">+ [last_From:]</span><br><span style="color: hsl(120, 100%, 40%);">+ [last_To:];tag=[call_number]</span><br><span style="color: hsl(120, 100%, 40%);">+ [last_Call-ID:]</span><br><span style="color: hsl(120, 100%, 40%);">+ [last_CSeq:]</span><br><span style="color: hsl(120, 100%, 40%);">+ Content-Type: application/sdp</span><br><span style="color: hsl(120, 100%, 40%);">+ Content-Length: 0</span><br><span style="color: hsl(120, 100%, 40%);">+</span><br><span style="color: hsl(120, 100%, 40%);">+ ]]></span><br><span style="color: hsl(120, 100%, 40%);">+ </send></span><br><span style="color: hsl(120, 100%, 40%);">+</scenario></span><br><span>diff --git a/tests/channels/pjsip/diversion/history_info_request/test-config.yaml b/tests/channels/pjsip/diversion/history_info_request/test-config.yaml</span><br><span>new file mode 100644</span><br><span>index 0000000..43b1a38</span><br><span>--- /dev/null</span><br><span>+++ b/tests/channels/pjsip/diversion/history_info_request/test-config.yaml</span><br><span>@@ -0,0 +1,27 @@</span><br><span style="color: hsl(120, 100%, 40%);">+testinfo:</span><br><span style="color: hsl(120, 100%, 40%);">+ summary: 'Test to make sure the history-info headers on an invite gets</span><br><span style="color: hsl(120, 100%, 40%);">+ propagated as diversion correctly.'</span><br><span style="color: hsl(120, 100%, 40%);">+ description: |</span><br><span style="color: hsl(120, 100%, 40%);">+ 'user1 calls user2 with an invite containing a diversion header.'</span><br><span style="color: hsl(120, 100%, 40%);">+</span><br><span style="color: hsl(120, 100%, 40%);">+properties:</span><br><span style="color: hsl(120, 100%, 40%);">+ dependencies:</span><br><span style="color: hsl(120, 100%, 40%);">+ - app : 'sipp'</span><br><span style="color: hsl(120, 100%, 40%);">+ - asterisk : 'app_dial'</span><br><span style="color: hsl(120, 100%, 40%);">+ - asterisk : 'res_pjsip'</span><br><span style="color: hsl(120, 100%, 40%);">+ - asterisk : 'res_pjsip_diversion'</span><br><span style="color: hsl(120, 100%, 40%);">+ tags:</span><br><span style="color: hsl(120, 100%, 40%);">+ - pjsip</span><br><span style="color: hsl(120, 100%, 40%);">+</span><br><span style="color: hsl(120, 100%, 40%);">+test-modules:</span><br><span style="color: hsl(120, 100%, 40%);">+ test-object:</span><br><span style="color: hsl(120, 100%, 40%);">+ config-section: test-object-config</span><br><span style="color: hsl(120, 100%, 40%);">+ typename: 'sipp.SIPpTestCase'</span><br><span style="color: hsl(120, 100%, 40%);">+</span><br><span style="color: hsl(120, 100%, 40%);">+test-object-config:</span><br><span style="color: hsl(120, 100%, 40%);">+ memcheck-delay-stop: 7</span><br><span style="color: hsl(120, 100%, 40%);">+ test-iterations:</span><br><span style="color: hsl(120, 100%, 40%);">+ -</span><br><span style="color: hsl(120, 100%, 40%);">+ scenarios:</span><br><span style="color: hsl(120, 100%, 40%);">+ - { 'key-args': { 'scenario':'user2.xml', '-p':'5062' } }</span><br><span style="color: hsl(120, 100%, 40%);">+ - { 'key-args': { 'scenario':'user1.xml', '-p':'5061' } }</span><br><span>diff --git a/tests/channels/pjsip/diversion/history_info_response_181/configs/ast1/extensions.conf b/tests/channels/pjsip/diversion/history_info_response_181/configs/ast1/extensions.conf</span><br><span>new file mode 100644</span><br><span>index 0000000..4719251</span><br><span>--- /dev/null</span><br><span>+++ b/tests/channels/pjsip/diversion/history_info_response_181/configs/ast1/extensions.conf</span><br><span>@@ -0,0 +1,7 @@</span><br><span style="color: hsl(120, 100%, 40%);">+[general]</span><br><span style="color: hsl(120, 100%, 40%);">+</span><br><span style="color: hsl(120, 100%, 40%);">+[default]</span><br><span style="color: hsl(120, 100%, 40%);">+</span><br><span style="color: hsl(120, 100%, 40%);">+exten => user1,1,Dial(PJSIP/user1)</span><br><span style="color: hsl(120, 100%, 40%);">+exten => user2,1,Dial(PJSIP/user2)</span><br><span style="color: hsl(120, 100%, 40%);">+exten => user3,1,Dial(PJSIP/user3)</span><br><span>diff --git a/tests/channels/pjsip/diversion/history_info_response_181/configs/ast1/pjsip.conf b/tests/channels/pjsip/diversion/history_info_response_181/configs/ast1/pjsip.conf</span><br><span>new file mode 100644</span><br><span>index 0000000..dcd83e2</span><br><span>--- /dev/null</span><br><span>+++ b/tests/channels/pjsip/diversion/history_info_response_181/configs/ast1/pjsip.conf</span><br><span>@@ -0,0 +1,33 @@</span><br><span style="color: hsl(120, 100%, 40%);">+[system]</span><br><span style="color: hsl(120, 100%, 40%);">+type=system</span><br><span style="color: hsl(120, 100%, 40%);">+timer_t1=100</span><br><span style="color: hsl(120, 100%, 40%);">+timer_b=6400</span><br><span style="color: hsl(120, 100%, 40%);">+</span><br><span style="color: hsl(120, 100%, 40%);">+[local]</span><br><span style="color: hsl(120, 100%, 40%);">+type=transport</span><br><span style="color: hsl(120, 100%, 40%);">+protocol=udp</span><br><span style="color: hsl(120, 100%, 40%);">+bind=0.0.0.0</span><br><span style="color: hsl(120, 100%, 40%);">+</span><br><span style="color: hsl(120, 100%, 40%);">+[user1-aors]</span><br><span style="color: hsl(120, 100%, 40%);">+type=aor</span><br><span style="color: hsl(120, 100%, 40%);">+contact=sip:user1@127.0.0.1:5061</span><br><span style="color: hsl(120, 100%, 40%);">+</span><br><span style="color: hsl(120, 100%, 40%);">+[user1]</span><br><span style="color: hsl(120, 100%, 40%);">+type=endpoint</span><br><span style="color: hsl(120, 100%, 40%);">+context=default</span><br><span style="color: hsl(120, 100%, 40%);">+aors=user1-aors</span><br><span style="color: hsl(120, 100%, 40%);">+direct_media=no</span><br><span style="color: hsl(120, 100%, 40%);">+disallow=all</span><br><span style="color: hsl(120, 100%, 40%);">+allow=ulaw</span><br><span style="color: hsl(120, 100%, 40%);">+</span><br><span style="color: hsl(120, 100%, 40%);">+[user2-aors]</span><br><span style="color: hsl(120, 100%, 40%);">+type=aor</span><br><span style="color: hsl(120, 100%, 40%);">+contact=sip:user2@127.0.0.1:5062</span><br><span style="color: hsl(120, 100%, 40%);">+</span><br><span style="color: hsl(120, 100%, 40%);">+[user2]</span><br><span style="color: hsl(120, 100%, 40%);">+type=endpoint</span><br><span style="color: hsl(120, 100%, 40%);">+context=default</span><br><span style="color: hsl(120, 100%, 40%);">+aors=user2-aors</span><br><span style="color: hsl(120, 100%, 40%);">+direct_media=no</span><br><span style="color: hsl(120, 100%, 40%);">+disallow=all</span><br><span style="color: hsl(120, 100%, 40%);">+allow=ulaw</span><br><span>diff --git a/tests/channels/pjsip/diversion/history_info_response_181/sipp/user1.xml b/tests/channels/pjsip/diversion/history_info_response_181/sipp/user1.xml</span><br><span>new file mode 100644</span><br><span>index 0000000..9b9a696</span><br><span>--- /dev/null</span><br><span>+++ b/tests/channels/pjsip/diversion/history_info_response_181/sipp/user1.xml</span><br><span>@@ -0,0 +1,74 @@</span><br><span style="color: hsl(120, 100%, 40%);">+<?xml version="1.0" encoding="ISO-8859-1" ?></span><br><span style="color: hsl(120, 100%, 40%);">+</span><br><span style="color: hsl(120, 100%, 40%);">+<scenario name="send an invite to user2"></span><br><span style="color: hsl(120, 100%, 40%);">+ <send retrans="500"></span><br><span style="color: hsl(120, 100%, 40%);">+ <![CDATA[</span><br><span style="color: hsl(120, 100%, 40%);">+ INVITE sip:user2@[remote_ip]:[remote_port] SIP/2.0</span><br><span style="color: hsl(120, 100%, 40%);">+ Via: SIP/2.0/[transport] [local_ip]:[local_port];branch=[branch]</span><br><span style="color: hsl(120, 100%, 40%);">+ From: user1 <sip:user1@[local_ip]:[local_port]>;tag=[call_number]</span><br><span style="color: hsl(120, 100%, 40%);">+ To: user2 <sip:user2@[remote_ip]:[remote_port]></span><br><span style="color: hsl(120, 100%, 40%);">+ Call-ID: [call_id]</span><br><span style="color: hsl(120, 100%, 40%);">+ CSeq: [cseq] INVITE</span><br><span style="color: hsl(120, 100%, 40%);">+ Contact: sip:user1@[local_ip]:[local_port]</span><br><span style="color: hsl(120, 100%, 40%);">+ Max-Forwards: 70</span><br><span style="color: hsl(120, 100%, 40%);">+ Content-Type: application/sdp</span><br><span style="color: hsl(120, 100%, 40%);">+ Content-Length: [len]</span><br><span style="color: hsl(120, 100%, 40%);">+</span><br><span style="color: hsl(120, 100%, 40%);">+ v=0</span><br><span style="color: hsl(120, 100%, 40%);">+ o=- 1324901698 1324901698 IN IP[local_ip_type] [local_ip]</span><br><span style="color: hsl(120, 100%, 40%);">+ s=-</span><br><span style="color: hsl(120, 100%, 40%);">+ c=IN IP[media_ip_type] [media_ip]</span><br><span style="color: hsl(120, 100%, 40%);">+ t=0 0</span><br><span style="color: hsl(120, 100%, 40%);">+ m=audio [media_port] RTP/AVP 0 101</span><br><span style="color: hsl(120, 100%, 40%);">+ a=sendrecv</span><br><span style="color: hsl(120, 100%, 40%);">+ a=rtpmap:0 PCMU/8000</span><br><span style="color: hsl(120, 100%, 40%);">+ a=rtpmap:101 telephone-event/8000</span><br><span style="color: hsl(120, 100%, 40%);">+</span><br><span style="color: hsl(120, 100%, 40%);">+ ]]></span><br><span style="color: hsl(120, 100%, 40%);">+ </send></span><br><span style="color: hsl(120, 100%, 40%);">+</span><br><span style="color: hsl(120, 100%, 40%);">+ <recv response="100" optional="true" /></span><br><span style="color: hsl(120, 100%, 40%);">+</span><br><span style="color: hsl(120, 100%, 40%);">+ <recv response="181"></span><br><span style="color: hsl(120, 100%, 40%);">+ <action></span><br><span style="color: hsl(120, 100%, 40%);">+ <!-- Check that the Diversion header is present and contains the correct name. --></span><br><span style="color: hsl(120, 100%, 40%);">+ <ereg regexp="amenhotep" search_in="hdr" header="Diversion:" check_it="true" assign_to="1" /></span><br><span style="color: hsl(120, 100%, 40%);">+ <log message="Received 181 with Diversion header: [$1]." /></span><br><span style="color: hsl(120, 100%, 40%);">+ </action></span><br><span style="color: hsl(120, 100%, 40%);">+ </recv></span><br><span style="color: hsl(120, 100%, 40%);">+</span><br><span style="color: hsl(120, 100%, 40%);">+ <recv response="180" optional="true" /></span><br><span style="color: hsl(120, 100%, 40%);">+</span><br><span style="color: hsl(120, 100%, 40%);">+ <recv response="183" optional="true" /></span><br><span style="color: hsl(120, 100%, 40%);">+</span><br><span style="color: hsl(120, 100%, 40%);">+ <recv response="200" /></span><br><span style="color: hsl(120, 100%, 40%);">+</span><br><span style="color: hsl(120, 100%, 40%);">+ <send></span><br><span style="color: hsl(120, 100%, 40%);">+ <![CDATA[</span><br><span style="color: hsl(120, 100%, 40%);">+ ACK sip:user3@[remote_ip]:[remote_port] SIP/2.0</span><br><span style="color: hsl(120, 100%, 40%);">+ Via: SIP/2.0/[transport] [local_ip]:[local_port];branch=[branch]</span><br><span style="color: hsl(120, 100%, 40%);">+ From: <sip:user1@[local_ip]>;tag=[call_number]</span><br><span style="color: hsl(120, 100%, 40%);">+ To: <sip:user3@[remote_ip]:[remote_port]>[peer_tag_param]</span><br><span style="color: hsl(120, 100%, 40%);">+ CSeq: [cseq] ACK</span><br><span style="color: hsl(120, 100%, 40%);">+ Call-ID: [call_id]</span><br><span style="color: hsl(120, 100%, 40%);">+ Max-Forwards: 70</span><br><span style="color: hsl(120, 100%, 40%);">+ Content-Length: 0</span><br><span style="color: hsl(120, 100%, 40%);">+</span><br><span style="color: hsl(120, 100%, 40%);">+ ]]></span><br><span style="color: hsl(120, 100%, 40%);">+ </send></span><br><span style="color: hsl(120, 100%, 40%);">+</span><br><span style="color: hsl(120, 100%, 40%);">+ <send retrans="500"></span><br><span style="color: hsl(120, 100%, 40%);">+ <![CDATA[</span><br><span style="color: hsl(120, 100%, 40%);">+ BYE sip:user3@[remote_ip]:[remote_port] SIP/2.0</span><br><span style="color: hsl(120, 100%, 40%);">+ Via: SIP/2.0/[transport] [local_ip]:[local_port];branch=[branch]</span><br><span style="color: hsl(120, 100%, 40%);">+ From: <sip:user1@[local_ip]>;tag=[call_number]</span><br><span style="color: hsl(120, 100%, 40%);">+ To: <sip:user3@[remote_ip]:[remote_port]>[peer_tag_param]</span><br><span style="color: hsl(120, 100%, 40%);">+ CSeq: [cseq] BYE</span><br><span style="color: hsl(120, 100%, 40%);">+ Call-ID: [call_id]</span><br><span style="color: hsl(120, 100%, 40%);">+ Max-Forwards: 70</span><br><span style="color: hsl(120, 100%, 40%);">+ Content-Length: 0</span><br><span style="color: hsl(120, 100%, 40%);">+ ]]></span><br><span style="color: hsl(120, 100%, 40%);">+ </send></span><br><span style="color: hsl(120, 100%, 40%);">+</span><br><span style="color: hsl(120, 100%, 40%);">+ <recv response="200" crlf="true" /></span><br><span style="color: hsl(120, 100%, 40%);">+</scenario></span><br><span>diff --git a/tests/channels/pjsip/diversion/history_info_response_181/sipp/user2.xml b/tests/channels/pjsip/diversion/history_info_response_181/sipp/user2.xml</span><br><span>new file mode 100644</span><br><span>index 0000000..ae98c35</span><br><span>--- /dev/null</span><br><span>+++ b/tests/channels/pjsip/diversion/history_info_response_181/sipp/user2.xml</span><br><span>@@ -0,0 +1,46 @@</span><br><span style="color: hsl(120, 100%, 40%);">+<?xml version="1.0" encoding="ISO-8859-1" ?></span><br><span style="color: hsl(120, 100%, 40%);">+</span><br><span style="color: hsl(120, 100%, 40%);">+<scenario name="send forwarding response back with History-Info headers"></span><br><span style="color: hsl(120, 100%, 40%);">+ <recv request="INVITE" crlf="true" /></span><br><span style="color: hsl(120, 100%, 40%);">+</span><br><span style="color: hsl(120, 100%, 40%);">+ <send></span><br><span style="color: hsl(120, 100%, 40%);">+ <![CDATA[</span><br><span style="color: hsl(120, 100%, 40%);">+ SIP/2.0 181 Redirected</span><br><span style="color: hsl(120, 100%, 40%);">+ [last_Via:]</span><br><span style="color: hsl(120, 100%, 40%);">+ [last_From:]</span><br><span style="color: hsl(120, 100%, 40%);">+ [last_To:];tag=[call_number]</span><br><span style="color: hsl(120, 100%, 40%);">+ [last_Call-ID:]</span><br><span style="color: hsl(120, 100%, 40%);">+ [last_CSeq:]</span><br><span style="color: hsl(120, 100%, 40%);">+ Contact: <sip:user3@[local_ip]></span><br><span style="color: hsl(120, 100%, 40%);">+ History-Info: <sip:user2@127.0.0.1>;index=1</span><br><span style="color: hsl(120, 100%, 40%);">+ History-Info: <sip:amenhotep@127.0.0.1;cause=302>;index=1.1</span><br><span style="color: hsl(120, 100%, 40%);">+ Content-Length: 0</span><br><span style="color: hsl(120, 100%, 40%);">+ ]]></span><br><span style="color: hsl(120, 100%, 40%);">+ </send></span><br><span style="color: hsl(120, 100%, 40%);">+ <send retrans="500"></span><br><span style="color: hsl(120, 100%, 40%);">+ <![CDATA[</span><br><span style="color: hsl(120, 100%, 40%);">+ SIP/2.0 200 OK</span><br><span style="color: hsl(120, 100%, 40%);">+ [last_Via:]</span><br><span style="color: hsl(120, 100%, 40%);">+ [last_From:]</span><br><span style="color: hsl(120, 100%, 40%);">+ [last_To:];tag=[call_number]</span><br><span style="color: hsl(120, 100%, 40%);">+ [last_Call-ID:]</span><br><span style="color: hsl(120, 100%, 40%);">+ [last_CSeq:]</span><br><span style="color: hsl(120, 100%, 40%);">+ Contact: <sip:user2@[local_ip]:[local_port];transport=[transport]></span><br><span style="color: hsl(120, 100%, 40%);">+ Content-Type: application/sdp</span><br><span style="color: hsl(120, 100%, 40%);">+ Content-Length: [len]</span><br><span style="color: hsl(120, 100%, 40%);">+</span><br><span style="color: hsl(120, 100%, 40%);">+ v=0</span><br><span style="color: hsl(120, 100%, 40%);">+ o=- 1324901698 1324901698 IN IP[local_ip_type] [local_ip]</span><br><span style="color: hsl(120, 100%, 40%);">+ s=-</span><br><span style="color: hsl(120, 100%, 40%);">+ c=IN IP[media_ip_type] [media_ip]</span><br><span style="color: hsl(120, 100%, 40%);">+ t=0 0</span><br><span style="color: hsl(120, 100%, 40%);">+ m=audio [media_port] RTP/AVP 0 101</span><br><span style="color: hsl(120, 100%, 40%);">+ a=sendrecv</span><br><span style="color: hsl(120, 100%, 40%);">+ a=rtpmap:0 PCMU/8000</span><br><span style="color: hsl(120, 100%, 40%);">+ a=rtpmap:101 telephone-event/8000</span><br><span style="color: hsl(120, 100%, 40%);">+</span><br><span style="color: hsl(120, 100%, 40%);">+ ]]></span><br><span style="color: hsl(120, 100%, 40%);">+ </send></span><br><span style="color: hsl(120, 100%, 40%);">+</span><br><span style="color: hsl(120, 100%, 40%);">+ <recv request="ACK"/></span><br><span style="color: hsl(120, 100%, 40%);">+</scenario></span><br><span>diff --git a/tests/channels/pjsip/diversion/history_info_response_181/test-config.yaml b/tests/channels/pjsip/diversion/history_info_response_181/test-config.yaml</span><br><span>new file mode 100644</span><br><span>index 0000000..b8a4153</span><br><span>--- /dev/null</span><br><span>+++ b/tests/channels/pjsip/diversion/history_info_response_181/test-config.yaml</span><br><span>@@ -0,0 +1,29 @@</span><br><span style="color: hsl(120, 100%, 40%);">+testinfo:</span><br><span style="color: hsl(120, 100%, 40%);">+ summary: 'Test to make sure a 181 response containing history-info headers gets</span><br><span style="color: hsl(120, 100%, 40%);">+ propagated as Diversion correctly.'</span><br><span style="color: hsl(120, 100%, 40%);">+</span><br><span style="color: hsl(120, 100%, 40%);">+ description: |</span><br><span style="color: hsl(120, 100%, 40%);">+ 'user1 calls user2 which sends a 181 to indicate redirection.</span><br><span style="color: hsl(120, 100%, 40%);">+ Verify the 181 response coming from user2 contains a diversion header.'</span><br><span style="color: hsl(120, 100%, 40%);">+</span><br><span style="color: hsl(120, 100%, 40%);">+properties:</span><br><span style="color: hsl(120, 100%, 40%);">+ dependencies:</span><br><span style="color: hsl(120, 100%, 40%);">+ - app : 'sipp'</span><br><span style="color: hsl(120, 100%, 40%);">+ - asterisk : 'app_dial'</span><br><span style="color: hsl(120, 100%, 40%);">+ - asterisk : 'res_pjsip'</span><br><span style="color: hsl(120, 100%, 40%);">+ - asterisk : 'res_pjsip_diversion'</span><br><span style="color: hsl(120, 100%, 40%);">+ tags:</span><br><span style="color: hsl(120, 100%, 40%);">+ - pjsip</span><br><span style="color: hsl(120, 100%, 40%);">+</span><br><span style="color: hsl(120, 100%, 40%);">+test-modules:</span><br><span style="color: hsl(120, 100%, 40%);">+ test-object:</span><br><span style="color: hsl(120, 100%, 40%);">+ config-section: test-object-config</span><br><span style="color: hsl(120, 100%, 40%);">+ typename: 'sipp.SIPpTestCase'</span><br><span style="color: hsl(120, 100%, 40%);">+</span><br><span style="color: hsl(120, 100%, 40%);">+test-object-config:</span><br><span style="color: hsl(120, 100%, 40%);">+ memcheck-delay-stop: 7</span><br><span style="color: hsl(120, 100%, 40%);">+ test-iterations:</span><br><span style="color: hsl(120, 100%, 40%);">+ -</span><br><span style="color: hsl(120, 100%, 40%);">+ scenarios:</span><br><span style="color: hsl(120, 100%, 40%);">+ - { 'key-args': { 'scenario':'user2.xml', '-p':'5062' } }</span><br><span style="color: hsl(120, 100%, 40%);">+ - { 'key-args': { 'scenario':'user1.xml', '-p':'5061' } }</span><br><span>diff --git a/tests/channels/pjsip/diversion/no_diversion_response_181/configs/ast1/extensions.conf b/tests/channels/pjsip/diversion/no_diversion_response_181/configs/ast1/extensions.conf</span><br><span>new file mode 100644</span><br><span>index 0000000..4719251</span><br><span>--- /dev/null</span><br><span>+++ b/tests/channels/pjsip/diversion/no_diversion_response_181/configs/ast1/extensions.conf</span><br><span>@@ -0,0 +1,7 @@</span><br><span style="color: hsl(120, 100%, 40%);">+[general]</span><br><span style="color: hsl(120, 100%, 40%);">+</span><br><span style="color: hsl(120, 100%, 40%);">+[default]</span><br><span style="color: hsl(120, 100%, 40%);">+</span><br><span style="color: hsl(120, 100%, 40%);">+exten => user1,1,Dial(PJSIP/user1)</span><br><span style="color: hsl(120, 100%, 40%);">+exten => user2,1,Dial(PJSIP/user2)</span><br><span style="color: hsl(120, 100%, 40%);">+exten => user3,1,Dial(PJSIP/user3)</span><br><span>diff --git a/tests/channels/pjsip/diversion/no_diversion_response_181/configs/ast1/pjsip.conf b/tests/channels/pjsip/diversion/no_diversion_response_181/configs/ast1/pjsip.conf</span><br><span>new file mode 100644</span><br><span>index 0000000..dcd83e2</span><br><span>--- /dev/null</span><br><span>+++ b/tests/channels/pjsip/diversion/no_diversion_response_181/configs/ast1/pjsip.conf</span><br><span>@@ -0,0 +1,33 @@</span><br><span style="color: hsl(120, 100%, 40%);">+[system]</span><br><span style="color: hsl(120, 100%, 40%);">+type=system</span><br><span style="color: hsl(120, 100%, 40%);">+timer_t1=100</span><br><span style="color: hsl(120, 100%, 40%);">+timer_b=6400</span><br><span style="color: hsl(120, 100%, 40%);">+</span><br><span style="color: hsl(120, 100%, 40%);">+[local]</span><br><span style="color: hsl(120, 100%, 40%);">+type=transport</span><br><span style="color: hsl(120, 100%, 40%);">+protocol=udp</span><br><span style="color: hsl(120, 100%, 40%);">+bind=0.0.0.0</span><br><span style="color: hsl(120, 100%, 40%);">+</span><br><span style="color: hsl(120, 100%, 40%);">+[user1-aors]</span><br><span style="color: hsl(120, 100%, 40%);">+type=aor</span><br><span style="color: hsl(120, 100%, 40%);">+contact=sip:user1@127.0.0.1:5061</span><br><span style="color: hsl(120, 100%, 40%);">+</span><br><span style="color: hsl(120, 100%, 40%);">+[user1]</span><br><span style="color: hsl(120, 100%, 40%);">+type=endpoint</span><br><span style="color: hsl(120, 100%, 40%);">+context=default</span><br><span style="color: hsl(120, 100%, 40%);">+aors=user1-aors</span><br><span style="color: hsl(120, 100%, 40%);">+direct_media=no</span><br><span style="color: hsl(120, 100%, 40%);">+disallow=all</span><br><span style="color: hsl(120, 100%, 40%);">+allow=ulaw</span><br><span style="color: hsl(120, 100%, 40%);">+</span><br><span style="color: hsl(120, 100%, 40%);">+[user2-aors]</span><br><span style="color: hsl(120, 100%, 40%);">+type=aor</span><br><span style="color: hsl(120, 100%, 40%);">+contact=sip:user2@127.0.0.1:5062</span><br><span style="color: hsl(120, 100%, 40%);">+</span><br><span style="color: hsl(120, 100%, 40%);">+[user2]</span><br><span style="color: hsl(120, 100%, 40%);">+type=endpoint</span><br><span style="color: hsl(120, 100%, 40%);">+context=default</span><br><span style="color: hsl(120, 100%, 40%);">+aors=user2-aors</span><br><span style="color: hsl(120, 100%, 40%);">+direct_media=no</span><br><span style="color: hsl(120, 100%, 40%);">+disallow=all</span><br><span style="color: hsl(120, 100%, 40%);">+allow=ulaw</span><br><span>diff --git a/tests/channels/pjsip/diversion/no_diversion_response_181/sipp/user1.xml b/tests/channels/pjsip/diversion/no_diversion_response_181/sipp/user1.xml</span><br><span>new file mode 100644</span><br><span>index 0000000..216f8af</span><br><span>--- /dev/null</span><br><span>+++ b/tests/channels/pjsip/diversion/no_diversion_response_181/sipp/user1.xml</span><br><span>@@ -0,0 +1,74 @@</span><br><span style="color: hsl(120, 100%, 40%);">+<?xml version="1.0" encoding="ISO-8859-1" ?></span><br><span style="color: hsl(120, 100%, 40%);">+</span><br><span style="color: hsl(120, 100%, 40%);">+<scenario name="send an invite to user2"></span><br><span style="color: hsl(120, 100%, 40%);">+ <send retrans="500"></span><br><span style="color: hsl(120, 100%, 40%);">+ <![CDATA[</span><br><span style="color: hsl(120, 100%, 40%);">+ INVITE sip:user2@[remote_ip]:[remote_port] SIP/2.0</span><br><span style="color: hsl(120, 100%, 40%);">+ Via: SIP/2.0/[transport] [local_ip]:[local_port];branch=[branch]</span><br><span style="color: hsl(120, 100%, 40%);">+ From: user1 <sip:user1@[local_ip]:[local_port]>;tag=[call_number]</span><br><span style="color: hsl(120, 100%, 40%);">+ To: user2 <sip:user2@[remote_ip]:[remote_port]></span><br><span style="color: hsl(120, 100%, 40%);">+ Call-ID: [call_id]</span><br><span style="color: hsl(120, 100%, 40%);">+ CSeq: [cseq] INVITE</span><br><span style="color: hsl(120, 100%, 40%);">+ Contact: sip:user1@[local_ip]:[local_port]</span><br><span style="color: hsl(120, 100%, 40%);">+ Max-Forwards: 70</span><br><span style="color: hsl(120, 100%, 40%);">+ Content-Type: application/sdp</span><br><span style="color: hsl(120, 100%, 40%);">+ Content-Length: [len]</span><br><span style="color: hsl(120, 100%, 40%);">+</span><br><span style="color: hsl(120, 100%, 40%);">+ v=0</span><br><span style="color: hsl(120, 100%, 40%);">+ o=- 1324901698 1324901698 IN IP[local_ip_type] [local_ip]</span><br><span style="color: hsl(120, 100%, 40%);">+ s=-</span><br><span style="color: hsl(120, 100%, 40%);">+ c=IN IP[media_ip_type] [media_ip]</span><br><span style="color: hsl(120, 100%, 40%);">+ t=0 0</span><br><span style="color: hsl(120, 100%, 40%);">+ m=audio [media_port] RTP/AVP 0 101</span><br><span style="color: hsl(120, 100%, 40%);">+ a=sendrecv</span><br><span style="color: hsl(120, 100%, 40%);">+ a=rtpmap:0 PCMU/8000</span><br><span style="color: hsl(120, 100%, 40%);">+ a=rtpmap:101 telephone-event/8000</span><br><span style="color: hsl(120, 100%, 40%);">+</span><br><span style="color: hsl(120, 100%, 40%);">+ ]]></span><br><span style="color: hsl(120, 100%, 40%);">+ </send></span><br><span style="color: hsl(120, 100%, 40%);">+</span><br><span style="color: hsl(120, 100%, 40%);">+ <recv response="100" optional="true" /></span><br><span style="color: hsl(120, 100%, 40%);">+</span><br><span style="color: hsl(120, 100%, 40%);">+ <recv response="181"></span><br><span style="color: hsl(120, 100%, 40%);">+ <action></span><br><span style="color: hsl(120, 100%, 40%);">+ <!-- Check that the Diversion header is present and contains the correct name. --></span><br><span style="color: hsl(120, 100%, 40%);">+ <ereg regexp=".+" search_in="hdr" header="Diversion:" check_it_inverse="true" assign_to="1" /></span><br><span style="color: hsl(120, 100%, 40%);">+ <log message="Received 181 with Diversion header: [$1]." /></span><br><span style="color: hsl(120, 100%, 40%);">+ </action></span><br><span style="color: hsl(120, 100%, 40%);">+ </recv></span><br><span style="color: hsl(120, 100%, 40%);">+</span><br><span style="color: hsl(120, 100%, 40%);">+ <recv response="180" optional="true" /></span><br><span style="color: hsl(120, 100%, 40%);">+</span><br><span style="color: hsl(120, 100%, 40%);">+ <recv response="183" optional="true" /></span><br><span style="color: hsl(120, 100%, 40%);">+</span><br><span style="color: hsl(120, 100%, 40%);">+ <recv response="200" /></span><br><span style="color: hsl(120, 100%, 40%);">+</span><br><span style="color: hsl(120, 100%, 40%);">+ <send></span><br><span style="color: hsl(120, 100%, 40%);">+ <![CDATA[</span><br><span style="color: hsl(120, 100%, 40%);">+ ACK sip:user3@[remote_ip]:[remote_port] SIP/2.0</span><br><span style="color: hsl(120, 100%, 40%);">+ Via: SIP/2.0/[transport] [local_ip]:[local_port];branch=[branch]</span><br><span style="color: hsl(120, 100%, 40%);">+ From: <sip:user1@[local_ip]>;tag=[call_number]</span><br><span style="color: hsl(120, 100%, 40%);">+ To: <sip:user3@[remote_ip]:[remote_port]>[peer_tag_param]</span><br><span style="color: hsl(120, 100%, 40%);">+ CSeq: [cseq] ACK</span><br><span style="color: hsl(120, 100%, 40%);">+ Call-ID: [call_id]</span><br><span style="color: hsl(120, 100%, 40%);">+ Max-Forwards: 70</span><br><span style="color: hsl(120, 100%, 40%);">+ Content-Length: 0</span><br><span style="color: hsl(120, 100%, 40%);">+</span><br><span style="color: hsl(120, 100%, 40%);">+ ]]></span><br><span style="color: hsl(120, 100%, 40%);">+ </send></span><br><span style="color: hsl(120, 100%, 40%);">+</span><br><span style="color: hsl(120, 100%, 40%);">+ <send retrans="500"></span><br><span style="color: hsl(120, 100%, 40%);">+ <![CDATA[</span><br><span style="color: hsl(120, 100%, 40%);">+ BYE sip:user3@[remote_ip]:[remote_port] SIP/2.0</span><br><span style="color: hsl(120, 100%, 40%);">+ Via: SIP/2.0/[transport] [local_ip]:[local_port];branch=[branch]</span><br><span style="color: hsl(120, 100%, 40%);">+ From: <sip:user1@[local_ip]>;tag=[call_number]</span><br><span style="color: hsl(120, 100%, 40%);">+ To: <sip:user3@[remote_ip]:[remote_port]>[peer_tag_param]</span><br><span style="color: hsl(120, 100%, 40%);">+ CSeq: [cseq] BYE</span><br><span style="color: hsl(120, 100%, 40%);">+ Call-ID: [call_id]</span><br><span style="color: hsl(120, 100%, 40%);">+ Max-Forwards: 70</span><br><span style="color: hsl(120, 100%, 40%);">+ Content-Length: 0</span><br><span style="color: hsl(120, 100%, 40%);">+ ]]></span><br><span style="color: hsl(120, 100%, 40%);">+ </send></span><br><span style="color: hsl(120, 100%, 40%);">+</span><br><span style="color: hsl(120, 100%, 40%);">+ <recv response="200" crlf="true" /></span><br><span style="color: hsl(120, 100%, 40%);">+</scenario></span><br><span>diff --git a/tests/channels/pjsip/diversion/no_diversion_response_181/sipp/user2.xml b/tests/channels/pjsip/diversion/no_diversion_response_181/sipp/user2.xml</span><br><span>new file mode 100644</span><br><span>index 0000000..dbc6508</span><br><span>--- /dev/null</span><br><span>+++ b/tests/channels/pjsip/diversion/no_diversion_response_181/sipp/user2.xml</span><br><span>@@ -0,0 +1,44 @@</span><br><span style="color: hsl(120, 100%, 40%);">+<?xml version="1.0" encoding="ISO-8859-1" ?></span><br><span style="color: hsl(120, 100%, 40%);">+</span><br><span style="color: hsl(120, 100%, 40%);">+<scenario name="send forwarding response back with diversion header"></span><br><span style="color: hsl(120, 100%, 40%);">+ <recv request="INVITE" crlf="true" /></span><br><span style="color: hsl(120, 100%, 40%);">+</span><br><span style="color: hsl(120, 100%, 40%);">+ <send></span><br><span style="color: hsl(120, 100%, 40%);">+ <![CDATA[</span><br><span style="color: hsl(120, 100%, 40%);">+ SIP/2.0 181 Redirected</span><br><span style="color: hsl(120, 100%, 40%);">+ [last_Via:]</span><br><span style="color: hsl(120, 100%, 40%);">+ [last_From:]</span><br><span style="color: hsl(120, 100%, 40%);">+ [last_To:];tag=[call_number]</span><br><span style="color: hsl(120, 100%, 40%);">+ [last_Call-ID:]</span><br><span style="color: hsl(120, 100%, 40%);">+ [last_CSeq:]</span><br><span style="color: hsl(120, 100%, 40%);">+ Contact: <sip:user3@[local_ip]></span><br><span style="color: hsl(120, 100%, 40%);">+ Content-Length: 0</span><br><span style="color: hsl(120, 100%, 40%);">+ ]]></span><br><span style="color: hsl(120, 100%, 40%);">+ </send></span><br><span style="color: hsl(120, 100%, 40%);">+ <send retrans="500"></span><br><span style="color: hsl(120, 100%, 40%);">+ <![CDATA[</span><br><span style="color: hsl(120, 100%, 40%);">+ SIP/2.0 200 OK</span><br><span style="color: hsl(120, 100%, 40%);">+ [last_Via:]</span><br><span style="color: hsl(120, 100%, 40%);">+ [last_From:]</span><br><span style="color: hsl(120, 100%, 40%);">+ [last_To:];tag=[call_number]</span><br><span style="color: hsl(120, 100%, 40%);">+ [last_Call-ID:]</span><br><span style="color: hsl(120, 100%, 40%);">+ [last_CSeq:]</span><br><span style="color: hsl(120, 100%, 40%);">+ Contact: <sip:user2@[local_ip]:[local_port];transport=[transport]></span><br><span style="color: hsl(120, 100%, 40%);">+ Content-Type: application/sdp</span><br><span style="color: hsl(120, 100%, 40%);">+ Content-Length: [len]</span><br><span style="color: hsl(120, 100%, 40%);">+</span><br><span style="color: hsl(120, 100%, 40%);">+ v=0</span><br><span style="color: hsl(120, 100%, 40%);">+ o=- 1324901698 1324901698 IN IP[local_ip_type] [local_ip]</span><br><span style="color: hsl(120, 100%, 40%);">+ s=-</span><br><span style="color: hsl(120, 100%, 40%);">+ c=IN IP[media_ip_type] [media_ip]</span><br><span style="color: hsl(120, 100%, 40%);">+ t=0 0</span><br><span style="color: hsl(120, 100%, 40%);">+ m=audio [media_port] RTP/AVP 0 101</span><br><span style="color: hsl(120, 100%, 40%);">+ a=sendrecv</span><br><span style="color: hsl(120, 100%, 40%);">+ a=rtpmap:0 PCMU/8000</span><br><span style="color: hsl(120, 100%, 40%);">+ a=rtpmap:101 telephone-event/8000</span><br><span style="color: hsl(120, 100%, 40%);">+</span><br><span style="color: hsl(120, 100%, 40%);">+ ]]></span><br><span style="color: hsl(120, 100%, 40%);">+ </send></span><br><span style="color: hsl(120, 100%, 40%);">+</span><br><span style="color: hsl(120, 100%, 40%);">+ <recv request="ACK"/></span><br><span style="color: hsl(120, 100%, 40%);">+</scenario></span><br><span>diff --git a/tests/channels/pjsip/diversion/no_diversion_response_181/test-config.yaml b/tests/channels/pjsip/diversion/no_diversion_response_181/test-config.yaml</span><br><span>new file mode 100644</span><br><span>index 0000000..4882cff</span><br><span>--- /dev/null</span><br><span>+++ b/tests/channels/pjsip/diversion/no_diversion_response_181/test-config.yaml</span><br><span>@@ -0,0 +1,29 @@</span><br><span style="color: hsl(120, 100%, 40%);">+testinfo:</span><br><span style="color: hsl(120, 100%, 40%);">+ summary: 'Test to make sure a 181 response containing a no redirection info gets</span><br><span style="color: hsl(120, 100%, 40%);">+ propagated correctly.'</span><br><span style="color: hsl(120, 100%, 40%);">+</span><br><span style="color: hsl(120, 100%, 40%);">+ description: |</span><br><span style="color: hsl(120, 100%, 40%);">+ 'user1 calls user2 which sends a 181 to indicate redirection.</span><br><span style="color: hsl(120, 100%, 40%);">+ Verify the 181 response coming from user2 contains no header.'</span><br><span style="color: hsl(120, 100%, 40%);">+</span><br><span style="color: hsl(120, 100%, 40%);">+properties:</span><br><span style="color: hsl(120, 100%, 40%);">+ dependencies:</span><br><span style="color: hsl(120, 100%, 40%);">+ - app : 'sipp'</span><br><span style="color: hsl(120, 100%, 40%);">+ - asterisk : 'app_dial'</span><br><span style="color: hsl(120, 100%, 40%);">+ - asterisk : 'res_pjsip'</span><br><span style="color: hsl(120, 100%, 40%);">+ - asterisk : 'res_pjsip_diversion'</span><br><span style="color: hsl(120, 100%, 40%);">+ tags:</span><br><span style="color: hsl(120, 100%, 40%);">+ - pjsip</span><br><span style="color: hsl(120, 100%, 40%);">+</span><br><span style="color: hsl(120, 100%, 40%);">+test-modules:</span><br><span style="color: hsl(120, 100%, 40%);">+ test-object:</span><br><span style="color: hsl(120, 100%, 40%);">+ config-section: test-object-config</span><br><span style="color: hsl(120, 100%, 40%);">+ typename: 'sipp.SIPpTestCase'</span><br><span style="color: hsl(120, 100%, 40%);">+</span><br><span style="color: hsl(120, 100%, 40%);">+test-object-config:</span><br><span style="color: hsl(120, 100%, 40%);">+ memcheck-delay-stop: 7</span><br><span style="color: hsl(120, 100%, 40%);">+ test-iterations:</span><br><span style="color: hsl(120, 100%, 40%);">+ -</span><br><span style="color: hsl(120, 100%, 40%);">+ scenarios:</span><br><span style="color: hsl(120, 100%, 40%);">+ - { 'key-args': { 'scenario':'user2.xml', '-p':'5062' } }</span><br><span style="color: hsl(120, 100%, 40%);">+ - { 'key-args': { 'scenario':'user1.xml', '-p':'5061' } }</span><br><span>diff --git a/tests/channels/pjsip/diversion/tests.yaml b/tests/channels/pjsip/diversion/tests.yaml</span><br><span>index ea60a32..34f8add 100644</span><br><span>--- a/tests/channels/pjsip/diversion/tests.yaml</span><br><span>+++ b/tests/channels/pjsip/diversion/tests.yaml</span><br><span>@@ -4,6 +4,10 @@</span><br><span> - test: 'diversion_basic_drop_options'</span><br><span> - test: 'diversion_caller_id'</span><br><span> - test: 'diversion_request'</span><br><span style="color: hsl(120, 100%, 40%);">+ - test: 'history_info_request'</span><br><span> - test: 'diversion_request_drop_options'</span><br><span> - test: 'diversion_response'</span><br><span style="color: hsl(120, 100%, 40%);">+ - test: 'diversion_response_181'</span><br><span style="color: hsl(120, 100%, 40%);">+ - test: 'no_diversion_response_181'</span><br><span style="color: hsl(120, 100%, 40%);">+ - test: 'history_info_response_181'</span><br><span> - test: 'diversion_response_drop_options'</span><br><span>diff --git a/tests/channels/pjsip/history_info/diversion_request/configs/ast1/extensions.conf b/tests/channels/pjsip/history_info/diversion_request/configs/ast1/extensions.conf</span><br><span>new file mode 100644</span><br><span>index 0000000..4719251</span><br><span>--- /dev/null</span><br><span>+++ b/tests/channels/pjsip/history_info/diversion_request/configs/ast1/extensions.conf</span><br><span>@@ -0,0 +1,7 @@</span><br><span style="color: hsl(120, 100%, 40%);">+[general]</span><br><span style="color: hsl(120, 100%, 40%);">+</span><br><span style="color: hsl(120, 100%, 40%);">+[default]</span><br><span style="color: hsl(120, 100%, 40%);">+</span><br><span style="color: hsl(120, 100%, 40%);">+exten => user1,1,Dial(PJSIP/user1)</span><br><span style="color: hsl(120, 100%, 40%);">+exten => user2,1,Dial(PJSIP/user2)</span><br><span style="color: hsl(120, 100%, 40%);">+exten => user3,1,Dial(PJSIP/user3)</span><br><span>diff --git a/tests/channels/pjsip/history_info/diversion_request/configs/ast1/pjsip.conf b/tests/channels/pjsip/history_info/diversion_request/configs/ast1/pjsip.conf</span><br><span>new file mode 100644</span><br><span>index 0000000..e274b94</span><br><span>--- /dev/null</span><br><span>+++ b/tests/channels/pjsip/history_info/diversion_request/configs/ast1/pjsip.conf</span><br><span>@@ -0,0 +1,47 @@</span><br><span style="color: hsl(120, 100%, 40%);">+[system]</span><br><span style="color: hsl(120, 100%, 40%);">+type=system</span><br><span style="color: hsl(120, 100%, 40%);">+timer_t1=100</span><br><span style="color: hsl(120, 100%, 40%);">+timer_b=6400</span><br><span style="color: hsl(120, 100%, 40%);">+</span><br><span style="color: hsl(120, 100%, 40%);">+[local]</span><br><span style="color: hsl(120, 100%, 40%);">+type=transport</span><br><span style="color: hsl(120, 100%, 40%);">+protocol=udp</span><br><span style="color: hsl(120, 100%, 40%);">+bind=0.0.0.0</span><br><span style="color: hsl(120, 100%, 40%);">+</span><br><span style="color: hsl(120, 100%, 40%);">+[user1-aors]</span><br><span style="color: hsl(120, 100%, 40%);">+type=aor</span><br><span style="color: hsl(120, 100%, 40%);">+contact=sip:user1@127.0.0.1:5061</span><br><span style="color: hsl(120, 100%, 40%);">+</span><br><span style="color: hsl(120, 100%, 40%);">+[user1]</span><br><span style="color: hsl(120, 100%, 40%);">+type=endpoint</span><br><span style="color: hsl(120, 100%, 40%);">+context=default</span><br><span style="color: hsl(120, 100%, 40%);">+aors=user1-aors</span><br><span style="color: hsl(120, 100%, 40%);">+direct_media=no</span><br><span style="color: hsl(120, 100%, 40%);">+disallow=all</span><br><span style="color: hsl(120, 100%, 40%);">+allow=ulaw</span><br><span style="color: hsl(120, 100%, 40%);">+</span><br><span style="color: hsl(120, 100%, 40%);">+[user2-aors]</span><br><span style="color: hsl(120, 100%, 40%);">+type=aor</span><br><span style="color: hsl(120, 100%, 40%);">+contact=sip:user2@127.0.0.1:5062</span><br><span style="color: hsl(120, 100%, 40%);">+</span><br><span style="color: hsl(120, 100%, 40%);">+[user2]</span><br><span style="color: hsl(120, 100%, 40%);">+type=endpoint</span><br><span style="color: hsl(120, 100%, 40%);">+context=default</span><br><span style="color: hsl(120, 100%, 40%);">+aors=user2-aors</span><br><span style="color: hsl(120, 100%, 40%);">+direct_media=no</span><br><span style="color: hsl(120, 100%, 40%);">+disallow=all</span><br><span style="color: hsl(120, 100%, 40%);">+allow=ulaw</span><br><span style="color: hsl(120, 100%, 40%);">+send_diversion=no</span><br><span style="color: hsl(120, 100%, 40%);">+send_history_info=yes</span><br><span style="color: hsl(120, 100%, 40%);">+</span><br><span style="color: hsl(120, 100%, 40%);">+[user3-aors]</span><br><span style="color: hsl(120, 100%, 40%);">+type=aor</span><br><span style="color: hsl(120, 100%, 40%);">+contact=sip:user3@127.0.0.1:5063</span><br><span style="color: hsl(120, 100%, 40%);">+</span><br><span style="color: hsl(120, 100%, 40%);">+[user3]</span><br><span style="color: hsl(120, 100%, 40%);">+type=endpoint</span><br><span style="color: hsl(120, 100%, 40%);">+context=default</span><br><span style="color: hsl(120, 100%, 40%);">+aors=user3-aors</span><br><span style="color: hsl(120, 100%, 40%);">+direct_media=no</span><br><span style="color: hsl(120, 100%, 40%);">+disallow=all</span><br><span style="color: hsl(120, 100%, 40%);">+allow=ulaw</span><br><span>diff --git a/tests/channels/pjsip/history_info/diversion_request/sipp/user1.xml b/tests/channels/pjsip/history_info/diversion_request/sipp/user1.xml</span><br><span>new file mode 100644</span><br><span>index 0000000..df48d10</span><br><span>--- /dev/null</span><br><span>+++ b/tests/channels/pjsip/history_info/diversion_request/sipp/user1.xml</span><br><span>@@ -0,0 +1,69 @@</span><br><span style="color: hsl(120, 100%, 40%);">+<?xml version="1.0" encoding="ISO-8859-1" ?></span><br><span style="color: hsl(120, 100%, 40%);">+</span><br><span style="color: hsl(120, 100%, 40%);">+<scenario name="send an invite to user2"></span><br><span style="color: hsl(120, 100%, 40%);">+ <send retrans="500"></span><br><span style="color: hsl(120, 100%, 40%);">+ <![CDATA[</span><br><span style="color: hsl(120, 100%, 40%);">+ INVITE sip:user2@[remote_ip]:[remote_port] SIP/2.0</span><br><span style="color: hsl(120, 100%, 40%);">+ Via: SIP/2.0/[transport] [local_ip]:[local_port];branch=[branch]</span><br><span style="color: hsl(120, 100%, 40%);">+ From: user1 <sip:user1@[local_ip]:[local_port]>;tag=[call_number]</span><br><span style="color: hsl(120, 100%, 40%);">+ To: user2 <sip:user2@[remote_ip]:[remote_port]></span><br><span style="color: hsl(120, 100%, 40%);">+ Call-ID: [call_id]</span><br><span style="color: hsl(120, 100%, 40%);">+ CSeq: [cseq] INVITE</span><br><span style="color: hsl(120, 100%, 40%);">+ Contact: sip:user1@[local_ip]:[local_port]</span><br><span style="color: hsl(120, 100%, 40%);">+ Max-Forwards: 70</span><br><span style="color: hsl(120, 100%, 40%);">+ Diversion: <sip:amenhotep@127.0.0.1>;reason=unconditional</span><br><span style="color: hsl(120, 100%, 40%);">+ Content-Type: application/sdp</span><br><span style="color: hsl(120, 100%, 40%);">+ Content-Length: [len]</span><br><span style="color: hsl(120, 100%, 40%);">+</span><br><span style="color: hsl(120, 100%, 40%);">+ v=0</span><br><span style="color: hsl(120, 100%, 40%);">+ o=- 1324901698 1324901698 IN IP[local_ip_type] [local_ip]</span><br><span style="color: hsl(120, 100%, 40%);">+ s=-</span><br><span style="color: hsl(120, 100%, 40%);">+ c=IN IP[media_ip_type] [media_ip]</span><br><span style="color: hsl(120, 100%, 40%);">+ t=0 0</span><br><span style="color: hsl(120, 100%, 40%);">+ m=audio [media_port] RTP/AVP 0 101</span><br><span style="color: hsl(120, 100%, 40%);">+ a=sendrecv</span><br><span style="color: hsl(120, 100%, 40%);">+ a=rtpmap:0 PCMU/8000</span><br><span style="color: hsl(120, 100%, 40%);">+ a=rtpmap:101 telephone-event/8000</span><br><span style="color: hsl(120, 100%, 40%);">+</span><br><span style="color: hsl(120, 100%, 40%);">+ ]]></span><br><span style="color: hsl(120, 100%, 40%);">+ </send></span><br><span style="color: hsl(120, 100%, 40%);">+</span><br><span style="color: hsl(120, 100%, 40%);">+ <recv response="100" optional="true" /></span><br><span style="color: hsl(120, 100%, 40%);">+</span><br><span style="color: hsl(120, 100%, 40%);">+ <recv response="181" optional="true" /></span><br><span style="color: hsl(120, 100%, 40%);">+</span><br><span style="color: hsl(120, 100%, 40%);">+ <recv response="180" optional="true" /></span><br><span style="color: hsl(120, 100%, 40%);">+</span><br><span style="color: hsl(120, 100%, 40%);">+ <recv response="183" optional="true" /></span><br><span style="color: hsl(120, 100%, 40%);">+</span><br><span style="color: hsl(120, 100%, 40%);">+ <recv response="200" /></span><br><span style="color: hsl(120, 100%, 40%);">+</span><br><span style="color: hsl(120, 100%, 40%);">+ <send></span><br><span style="color: hsl(120, 100%, 40%);">+ <![CDATA[</span><br><span style="color: hsl(120, 100%, 40%);">+ ACK sip:user2@[remote_ip]:[remote_port] SIP/2.0</span><br><span style="color: hsl(120, 100%, 40%);">+ Via: SIP/2.0/[transport] [local_ip]:[local_port];branch=[branch]</span><br><span style="color: hsl(120, 100%, 40%);">+ From: <sip:user1@[local_ip]>;tag=[call_number]</span><br><span style="color: hsl(120, 100%, 40%);">+ To: <sip:user2@[remote_ip]:[remote_port]>[peer_tag_param]</span><br><span style="color: hsl(120, 100%, 40%);">+ CSeq: [cseq] ACK</span><br><span style="color: hsl(120, 100%, 40%);">+ Call-ID: [call_id]</span><br><span style="color: hsl(120, 100%, 40%);">+ Max-Forwards: 70</span><br><span style="color: hsl(120, 100%, 40%);">+ Content-Length: 0</span><br><span style="color: hsl(120, 100%, 40%);">+</span><br><span style="color: hsl(120, 100%, 40%);">+ ]]></span><br><span style="color: hsl(120, 100%, 40%);">+ </send></span><br><span style="color: hsl(120, 100%, 40%);">+</span><br><span style="color: hsl(120, 100%, 40%);">+ <send retrans="500"></span><br><span style="color: hsl(120, 100%, 40%);">+ <![CDATA[</span><br><span style="color: hsl(120, 100%, 40%);">+ BYE sip:user2@[remote_ip]:[remote_port] SIP/2.0</span><br><span style="color: hsl(120, 100%, 40%);">+ Via: SIP/2.0/[transport] [local_ip]:[local_port];branch=[branch]</span><br><span style="color: hsl(120, 100%, 40%);">+ From: <sip:user1@[local_ip]>;tag=[call_number]</span><br><span style="color: hsl(120, 100%, 40%);">+ To: <sip:user2@[remote_ip]:[remote_port]>[peer_tag_param]</span><br><span style="color: hsl(120, 100%, 40%);">+ CSeq: [cseq] BYE</span><br><span style="color: hsl(120, 100%, 40%);">+ Call-ID: [call_id]</span><br><span style="color: hsl(120, 100%, 40%);">+ Max-Forwards: 70</span><br><span style="color: hsl(120, 100%, 40%);">+ Content-Length: 0</span><br><span style="color: hsl(120, 100%, 40%);">+ ]]></span><br><span style="color: hsl(120, 100%, 40%);">+ </send></span><br><span style="color: hsl(120, 100%, 40%);">+</span><br><span style="color: hsl(120, 100%, 40%);">+ <recv response="200" crlf="true" /></span><br><span style="color: hsl(120, 100%, 40%);">+</scenario></span><br><span>diff --git a/tests/channels/pjsip/history_info/diversion_request/sipp/user2.xml b/tests/channels/pjsip/history_info/diversion_request/sipp/user2.xml</span><br><span>new file mode 100644</span><br><span>index 0000000..5d44b30</span><br><span>--- /dev/null</span><br><span>+++ b/tests/channels/pjsip/history_info/diversion_request/sipp/user2.xml</span><br><span>@@ -0,0 +1,82 @@</span><br><span style="color: hsl(120, 100%, 40%);">+<?xml version="1.0" encoding="ISO-8859-1" ?></span><br><span style="color: hsl(120, 100%, 40%);">+</span><br><span style="color: hsl(120, 100%, 40%);">+<scenario name="receives invite with diversion info"></span><br><span style="color: hsl(120, 100%, 40%);">+ <recv request="INVITE" crlf="true"></span><br><span style="color: hsl(120, 100%, 40%);">+ <action></span><br><span style="color: hsl(120, 100%, 40%);">+ <!-- Check that the Diversion header is present and contains the correct name. --></span><br><span style="color: hsl(120, 100%, 40%);">+ <ereg regexp="amenhotep" search_in="hdr" header="History-Info:" occurence="1" check_it="true" assign_to="1" /></span><br><span style="color: hsl(120, 100%, 40%);">+ <log message="Received INVITE with History-Info header: [$1]." /></span><br><span style="color: hsl(120, 100%, 40%);">+ <ereg regexp="user2" search_in="hdr" header="History-Info:" occurence="2" check_it="true" assign_to="2" /></span><br><span style="color: hsl(120, 100%, 40%);">+ <log message="Received INVITE with History-Info header: [$2]." /></span><br><span style="color: hsl(120, 100%, 40%);">+ </action></span><br><span style="color: hsl(120, 100%, 40%);">+ </recv></span><br><span style="color: hsl(120, 100%, 40%);">+</span><br><span style="color: hsl(120, 100%, 40%);">+ <send></span><br><span style="color: hsl(120, 100%, 40%);">+ <![CDATA[</span><br><span style="color: hsl(120, 100%, 40%);">+ SIP/2.0 100 Trying</span><br><span style="color: hsl(120, 100%, 40%);">+ [last_Via:]</span><br><span style="color: hsl(120, 100%, 40%);">+ [last_From:]</span><br><span style="color: hsl(120, 100%, 40%);">+ [last_To:];tag=[call_number]</span><br><span style="color: hsl(120, 100%, 40%);">+ [last_Call-ID:]</span><br><span style="color: hsl(120, 100%, 40%);">+ [last_CSeq:]</span><br><span style="color: hsl(120, 100%, 40%);">+ Contact: <sip:user2@[local_ip]:[local_port];transport=[transport]></span><br><span style="color: hsl(120, 100%, 40%);">+ Content-Length: 0</span><br><span style="color: hsl(120, 100%, 40%);">+ ]]></span><br><span style="color: hsl(120, 100%, 40%);">+ </send></span><br><span style="color: hsl(120, 100%, 40%);">+</span><br><span style="color: hsl(120, 100%, 40%);">+ <send></span><br><span style="color: hsl(120, 100%, 40%);">+ <![CDATA[</span><br><span style="color: hsl(120, 100%, 40%);">+ SIP/2.0 180 Ringing</span><br><span style="color: hsl(120, 100%, 40%);">+ [last_Via:]</span><br><span style="color: hsl(120, 100%, 40%);">+ [last_From:]</span><br><span style="color: hsl(120, 100%, 40%);">+ [last_To:];tag=[call_number]</span><br><span style="color: hsl(120, 100%, 40%);">+ [last_Call-ID:]</span><br><span style="color: hsl(120, 100%, 40%);">+ [last_CSeq:]</span><br><span style="color: hsl(120, 100%, 40%);">+ Contact: <sip:user2@[local_ip]:[local_port];transport=[transport]></span><br><span style="color: hsl(120, 100%, 40%);">+ Content-Length: 0</span><br><span style="color: hsl(120, 100%, 40%);">+ ]]></span><br><span style="color: hsl(120, 100%, 40%);">+ </send></span><br><span style="color: hsl(120, 100%, 40%);">+</span><br><span style="color: hsl(120, 100%, 40%);">+ <send retrans="500"></span><br><span style="color: hsl(120, 100%, 40%);">+ <![CDATA[</span><br><span style="color: hsl(120, 100%, 40%);">+ SIP/2.0 200 OK</span><br><span style="color: hsl(120, 100%, 40%);">+ [last_Via:]</span><br><span style="color: hsl(120, 100%, 40%);">+ [last_From:]</span><br><span style="color: hsl(120, 100%, 40%);">+ [last_To:];tag=[call_number]</span><br><span style="color: hsl(120, 100%, 40%);">+ [last_Call-ID:]</span><br><span style="color: hsl(120, 100%, 40%);">+ [last_CSeq:]</span><br><span style="color: hsl(120, 100%, 40%);">+ Contact: <sip:user2@[local_ip]:[local_port];transport=[transport]></span><br><span style="color: hsl(120, 100%, 40%);">+ Content-Type: application/sdp</span><br><span style="color: hsl(120, 100%, 40%);">+ Content-Length: [len]</span><br><span style="color: hsl(120, 100%, 40%);">+</span><br><span style="color: hsl(120, 100%, 40%);">+ v=0</span><br><span style="color: hsl(120, 100%, 40%);">+ o=- 1324901698 1324901698 IN IP[local_ip_type] [local_ip]</span><br><span style="color: hsl(120, 100%, 40%);">+ s=-</span><br><span style="color: hsl(120, 100%, 40%);">+ c=IN IP[media_ip_type] [media_ip]</span><br><span style="color: hsl(120, 100%, 40%);">+ t=0 0</span><br><span style="color: hsl(120, 100%, 40%);">+ m=audio [media_port] RTP/AVP 0 101</span><br><span style="color: hsl(120, 100%, 40%);">+ a=sendrecv</span><br><span style="color: hsl(120, 100%, 40%);">+ a=rtpmap:0 PCMU/8000</span><br><span style="color: hsl(120, 100%, 40%);">+ a=rtpmap:101 telephone-event/8000</span><br><span style="color: hsl(120, 100%, 40%);">+</span><br><span style="color: hsl(120, 100%, 40%);">+ ]]></span><br><span style="color: hsl(120, 100%, 40%);">+ </send></span><br><span style="color: hsl(120, 100%, 40%);">+</span><br><span style="color: hsl(120, 100%, 40%);">+ <recv request="ACK"/></span><br><span style="color: hsl(120, 100%, 40%);">+</span><br><span style="color: hsl(120, 100%, 40%);">+ <recv request="BYE" crlf="true" /></span><br><span style="color: hsl(120, 100%, 40%);">+</span><br><span style="color: hsl(120, 100%, 40%);">+ <send retrans="500"></span><br><span style="color: hsl(120, 100%, 40%);">+ <![CDATA[</span><br><span style="color: hsl(120, 100%, 40%);">+ SIP/2.0 200 OK</span><br><span style="color: hsl(120, 100%, 40%);">+ [last_Via:]</span><br><span style="color: hsl(120, 100%, 40%);">+ [last_From:]</span><br><span style="color: hsl(120, 100%, 40%);">+ [last_To:];tag=[call_number]</span><br><span style="color: hsl(120, 100%, 40%);">+ [last_Call-ID:]</span><br><span style="color: hsl(120, 100%, 40%);">+ [last_CSeq:]</span><br><span style="color: hsl(120, 100%, 40%);">+ Content-Type: application/sdp</span><br><span style="color: hsl(120, 100%, 40%);">+ Content-Length: 0</span><br><span style="color: hsl(120, 100%, 40%);">+</span><br><span style="color: hsl(120, 100%, 40%);">+ ]]></span><br><span style="color: hsl(120, 100%, 40%);">+ </send></span><br><span style="color: hsl(120, 100%, 40%);">+</scenario></span><br><span>diff --git a/tests/channels/pjsip/history_info/diversion_request/test-config.yaml b/tests/channels/pjsip/history_info/diversion_request/test-config.yaml</span><br><span>new file mode 100644</span><br><span>index 0000000..db7cd54</span><br><span>--- /dev/null</span><br><span>+++ b/tests/channels/pjsip/history_info/diversion_request/test-config.yaml</span><br><span>@@ -0,0 +1,27 @@</span><br><span style="color: hsl(120, 100%, 40%);">+testinfo:</span><br><span style="color: hsl(120, 100%, 40%);">+ summary: 'Test to make sure the diversion header on an invite gets</span><br><span style="color: hsl(120, 100%, 40%);">+ propagated correctly as a history info.'</span><br><span style="color: hsl(120, 100%, 40%);">+ description: |</span><br><span style="color: hsl(120, 100%, 40%);">+ 'user1 calls user2 with an invite containing a diversion header.'</span><br><span style="color: hsl(120, 100%, 40%);">+</span><br><span style="color: hsl(120, 100%, 40%);">+properties:</span><br><span style="color: hsl(120, 100%, 40%);">+ dependencies:</span><br><span style="color: hsl(120, 100%, 40%);">+ - app : 'sipp'</span><br><span style="color: hsl(120, 100%, 40%);">+ - asterisk : 'app_dial'</span><br><span style="color: hsl(120, 100%, 40%);">+ - asterisk : 'res_pjsip'</span><br><span style="color: hsl(120, 100%, 40%);">+ - asterisk : 'res_pjsip_diversion'</span><br><span style="color: hsl(120, 100%, 40%);">+ tags:</span><br><span style="color: hsl(120, 100%, 40%);">+ - pjsip</span><br><span style="color: hsl(120, 100%, 40%);">+</span><br><span style="color: hsl(120, 100%, 40%);">+test-modules:</span><br><span style="color: hsl(120, 100%, 40%);">+ test-object:</span><br><span style="color: hsl(120, 100%, 40%);">+ config-section: test-object-config</span><br><span style="color: hsl(120, 100%, 40%);">+ typename: 'sipp.SIPpTestCase'</span><br><span style="color: hsl(120, 100%, 40%);">+</span><br><span style="color: hsl(120, 100%, 40%);">+test-object-config:</span><br><span style="color: hsl(120, 100%, 40%);">+ memcheck-delay-stop: 7</span><br><span style="color: hsl(120, 100%, 40%);">+ test-iterations:</span><br><span style="color: hsl(120, 100%, 40%);">+ -</span><br><span style="color: hsl(120, 100%, 40%);">+ scenarios:</span><br><span style="color: hsl(120, 100%, 40%);">+ - { 'key-args': { 'scenario':'user2.xml', '-p':'5062' } }</span><br><span style="color: hsl(120, 100%, 40%);">+ - { 'key-args': { 'scenario':'user1.xml', '-p':'5061' } }</span><br><span>diff --git a/tests/channels/pjsip/history_info/diversion_response_181/configs/ast1/extensions.conf b/tests/channels/pjsip/history_info/diversion_response_181/configs/ast1/extensions.conf</span><br><span>new file mode 100644</span><br><span>index 0000000..4719251</span><br><span>--- /dev/null</span><br><span>+++ b/tests/channels/pjsip/history_info/diversion_response_181/configs/ast1/extensions.conf</span><br><span>@@ -0,0 +1,7 @@</span><br><span style="color: hsl(120, 100%, 40%);">+[general]</span><br><span style="color: hsl(120, 100%, 40%);">+</span><br><span style="color: hsl(120, 100%, 40%);">+[default]</span><br><span style="color: hsl(120, 100%, 40%);">+</span><br><span style="color: hsl(120, 100%, 40%);">+exten => user1,1,Dial(PJSIP/user1)</span><br><span style="color: hsl(120, 100%, 40%);">+exten => user2,1,Dial(PJSIP/user2)</span><br><span style="color: hsl(120, 100%, 40%);">+exten => user3,1,Dial(PJSIP/user3)</span><br><span>diff --git a/tests/channels/pjsip/history_info/diversion_response_181/configs/ast1/pjsip.conf b/tests/channels/pjsip/history_info/diversion_response_181/configs/ast1/pjsip.conf</span><br><span>new file mode 100644</span><br><span>index 0000000..4ab6741</span><br><span>--- /dev/null</span><br><span>+++ b/tests/channels/pjsip/history_info/diversion_response_181/configs/ast1/pjsip.conf</span><br><span>@@ -0,0 +1,35 @@</span><br><span style="color: hsl(120, 100%, 40%);">+[system]</span><br><span style="color: hsl(120, 100%, 40%);">+type=system</span><br><span style="color: hsl(120, 100%, 40%);">+timer_t1=100</span><br><span style="color: hsl(120, 100%, 40%);">+timer_b=6400</span><br><span style="color: hsl(120, 100%, 40%);">+</span><br><span style="color: hsl(120, 100%, 40%);">+[local]</span><br><span style="color: hsl(120, 100%, 40%);">+type=transport</span><br><span style="color: hsl(120, 100%, 40%);">+protocol=udp</span><br><span style="color: hsl(120, 100%, 40%);">+bind=0.0.0.0</span><br><span style="color: hsl(120, 100%, 40%);">+</span><br><span style="color: hsl(120, 100%, 40%);">+[user1-aors]</span><br><span style="color: hsl(120, 100%, 40%);">+type=aor</span><br><span style="color: hsl(120, 100%, 40%);">+contact=sip:user1@127.0.0.1:5061</span><br><span style="color: hsl(120, 100%, 40%);">+</span><br><span style="color: hsl(120, 100%, 40%);">+[user1]</span><br><span style="color: hsl(120, 100%, 40%);">+type=endpoint</span><br><span style="color: hsl(120, 100%, 40%);">+context=default</span><br><span style="color: hsl(120, 100%, 40%);">+aors=user1-aors</span><br><span style="color: hsl(120, 100%, 40%);">+direct_media=no</span><br><span style="color: hsl(120, 100%, 40%);">+disallow=all</span><br><span style="color: hsl(120, 100%, 40%);">+allow=ulaw</span><br><span style="color: hsl(120, 100%, 40%);">+send_diversion=no</span><br><span style="color: hsl(120, 100%, 40%);">+send_history_info=yes</span><br><span style="color: hsl(120, 100%, 40%);">+</span><br><span style="color: hsl(120, 100%, 40%);">+[user2-aors]</span><br><span style="color: hsl(120, 100%, 40%);">+type=aor</span><br><span style="color: hsl(120, 100%, 40%);">+contact=sip:user2@127.0.0.1:5062</span><br><span style="color: hsl(120, 100%, 40%);">+</span><br><span style="color: hsl(120, 100%, 40%);">+[user2]</span><br><span style="color: hsl(120, 100%, 40%);">+type=endpoint</span><br><span style="color: hsl(120, 100%, 40%);">+context=default</span><br><span style="color: hsl(120, 100%, 40%);">+aors=user2-aors</span><br><span style="color: hsl(120, 100%, 40%);">+direct_media=no</span><br><span style="color: hsl(120, 100%, 40%);">+disallow=all</span><br><span style="color: hsl(120, 100%, 40%);">+allow=ulaw</span><br><span>diff --git a/tests/channels/pjsip/history_info/diversion_response_181/sipp/user1.xml b/tests/channels/pjsip/history_info/diversion_response_181/sipp/user1.xml</span><br><span>new file mode 100644</span><br><span>index 0000000..129c5b9</span><br><span>--- /dev/null</span><br><span>+++ b/tests/channels/pjsip/history_info/diversion_response_181/sipp/user1.xml</span><br><span>@@ -0,0 +1,76 @@</span><br><span style="color: hsl(120, 100%, 40%);">+<?xml version="1.0" encoding="ISO-8859-1" ?></span><br><span style="color: hsl(120, 100%, 40%);">+</span><br><span style="color: hsl(120, 100%, 40%);">+<scenario name="send an invite to user2"></span><br><span style="color: hsl(120, 100%, 40%);">+ <send retrans="500"></span><br><span style="color: hsl(120, 100%, 40%);">+ <![CDATA[</span><br><span style="color: hsl(120, 100%, 40%);">+ INVITE sip:user2@[remote_ip]:[remote_port] SIP/2.0</span><br><span style="color: hsl(120, 100%, 40%);">+ Via: SIP/2.0/[transport] [local_ip]:[local_port];branch=[branch]</span><br><span style="color: hsl(120, 100%, 40%);">+ From: user1 <sip:user1@[local_ip]:[local_port]>;tag=[call_number]</span><br><span style="color: hsl(120, 100%, 40%);">+ To: user2 <sip:user2@[remote_ip]:[remote_port]></span><br><span style="color: hsl(120, 100%, 40%);">+ Call-ID: [call_id]</span><br><span style="color: hsl(120, 100%, 40%);">+ CSeq: [cseq] INVITE</span><br><span style="color: hsl(120, 100%, 40%);">+ Contact: sip:user1@[local_ip]:[local_port]</span><br><span style="color: hsl(120, 100%, 40%);">+ Max-Forwards: 70</span><br><span style="color: hsl(120, 100%, 40%);">+ Content-Type: application/sdp</span><br><span style="color: hsl(120, 100%, 40%);">+ Content-Length: [len]</span><br><span style="color: hsl(120, 100%, 40%);">+</span><br><span style="color: hsl(120, 100%, 40%);">+ v=0</span><br><span style="color: hsl(120, 100%, 40%);">+ o=- 1324901698 1324901698 IN IP[local_ip_type] [local_ip]</span><br><span style="color: hsl(120, 100%, 40%);">+ s=-</span><br><span style="color: hsl(120, 100%, 40%);">+ c=IN IP[media_ip_type] [media_ip]</span><br><span style="color: hsl(120, 100%, 40%);">+ t=0 0</span><br><span style="color: hsl(120, 100%, 40%);">+ m=audio [media_port] RTP/AVP 0 101</span><br><span style="color: hsl(120, 100%, 40%);">+ a=sendrecv</span><br><span style="color: hsl(120, 100%, 40%);">+ a=rtpmap:0 PCMU/8000</span><br><span style="color: hsl(120, 100%, 40%);">+ a=rtpmap:101 telephone-event/8000</span><br><span style="color: hsl(120, 100%, 40%);">+</span><br><span style="color: hsl(120, 100%, 40%);">+ ]]></span><br><span style="color: hsl(120, 100%, 40%);">+ </send></span><br><span style="color: hsl(120, 100%, 40%);">+</span><br><span style="color: hsl(120, 100%, 40%);">+ <recv response="100" optional="true" /></span><br><span style="color: hsl(120, 100%, 40%);">+</span><br><span style="color: hsl(120, 100%, 40%);">+ <recv response="181"></span><br><span style="color: hsl(120, 100%, 40%);">+ <action></span><br><span style="color: hsl(120, 100%, 40%);">+ <!-- Check that the Diversion header is present and contains the correct name. --></span><br><span style="color: hsl(120, 100%, 40%);">+ <ereg regexp="user2" search_in="hdr" header="History-Info:" occurence="1" check_it="true" assign_to="1" /></span><br><span style="color: hsl(120, 100%, 40%);">+ <log message="Received 181 with History-Info header: [$1]." /></span><br><span style="color: hsl(120, 100%, 40%);">+ <ereg regexp="amenhotep" search_in="hdr" header="History-Info:" occurence="2" check_it="true" assign_to="2" /></span><br><span style="color: hsl(120, 100%, 40%);">+ <log message="Received 181 with History-Info header: [$2]." /></span><br><span style="color: hsl(120, 100%, 40%);">+ </action></span><br><span style="color: hsl(120, 100%, 40%);">+ </recv></span><br><span style="color: hsl(120, 100%, 40%);">+</span><br><span style="color: hsl(120, 100%, 40%);">+ <recv response="180" optional="true" /></span><br><span style="color: hsl(120, 100%, 40%);">+</span><br><span style="color: hsl(120, 100%, 40%);">+ <recv response="183" optional="true" /></span><br><span style="color: hsl(120, 100%, 40%);">+</span><br><span style="color: hsl(120, 100%, 40%);">+ <recv response="200" /></span><br><span style="color: hsl(120, 100%, 40%);">+</span><br><span style="color: hsl(120, 100%, 40%);">+ <send></span><br><span style="color: hsl(120, 100%, 40%);">+ <![CDATA[</span><br><span style="color: hsl(120, 100%, 40%);">+ ACK sip:user3@[remote_ip]:[remote_port] SIP/2.0</span><br><span style="color: hsl(120, 100%, 40%);">+ Via: SIP/2.0/[transport] [local_ip]:[local_port];branch=[branch]</span><br><span style="color: hsl(120, 100%, 40%);">+ From: <sip:user1@[local_ip]>;tag=[call_number]</span><br><span style="color: hsl(120, 100%, 40%);">+ To: <sip:user3@[remote_ip]:[remote_port]>[peer_tag_param]</span><br><span style="color: hsl(120, 100%, 40%);">+ CSeq: [cseq] ACK</span><br><span style="color: hsl(120, 100%, 40%);">+ Call-ID: [call_id]</span><br><span style="color: hsl(120, 100%, 40%);">+ Max-Forwards: 70</span><br><span style="color: hsl(120, 100%, 40%);">+ Content-Length: 0</span><br><span style="color: hsl(120, 100%, 40%);">+</span><br><span style="color: hsl(120, 100%, 40%);">+ ]]></span><br><span style="color: hsl(120, 100%, 40%);">+ </send></span><br><span style="color: hsl(120, 100%, 40%);">+</span><br><span style="color: hsl(120, 100%, 40%);">+ <send retrans="500"></span><br><span style="color: hsl(120, 100%, 40%);">+ <![CDATA[</span><br><span style="color: hsl(120, 100%, 40%);">+ BYE sip:user3@[remote_ip]:[remote_port] SIP/2.0</span><br><span style="color: hsl(120, 100%, 40%);">+ Via: SIP/2.0/[transport] [local_ip]:[local_port];branch=[branch]</span><br><span style="color: hsl(120, 100%, 40%);">+ From: <sip:user1@[local_ip]>;tag=[call_number]</span><br><span style="color: hsl(120, 100%, 40%);">+ To: <sip:user3@[remote_ip]:[remote_port]>[peer_tag_param]</span><br><span style="color: hsl(120, 100%, 40%);">+ CSeq: [cseq] BYE</span><br><span style="color: hsl(120, 100%, 40%);">+ Call-ID: [call_id]</span><br><span style="color: hsl(120, 100%, 40%);">+ Max-Forwards: 70</span><br><span style="color: hsl(120, 100%, 40%);">+ Content-Length: 0</span><br><span style="color: hsl(120, 100%, 40%);">+ ]]></span><br><span style="color: hsl(120, 100%, 40%);">+ </send></span><br><span style="color: hsl(120, 100%, 40%);">+</span><br><span style="color: hsl(120, 100%, 40%);">+ <recv response="200" crlf="true" /></span><br><span style="color: hsl(120, 100%, 40%);">+</scenario></span><br><span>diff --git a/tests/channels/pjsip/history_info/diversion_response_181/sipp/user2.xml b/tests/channels/pjsip/history_info/diversion_response_181/sipp/user2.xml</span><br><span>new file mode 100644</span><br><span>index 0000000..5272697</span><br><span>--- /dev/null</span><br><span>+++ b/tests/channels/pjsip/history_info/diversion_response_181/sipp/user2.xml</span><br><span>@@ -0,0 +1,45 @@</span><br><span style="color: hsl(120, 100%, 40%);">+<?xml version="1.0" encoding="ISO-8859-1" ?></span><br><span style="color: hsl(120, 100%, 40%);">+</span><br><span style="color: hsl(120, 100%, 40%);">+<scenario name="send forwarding response back with history-info header"></span><br><span style="color: hsl(120, 100%, 40%);">+ <recv request="INVITE" crlf="true" /></span><br><span style="color: hsl(120, 100%, 40%);">+</span><br><span style="color: hsl(120, 100%, 40%);">+ <send></span><br><span style="color: hsl(120, 100%, 40%);">+ <![CDATA[</span><br><span style="color: hsl(120, 100%, 40%);">+ SIP/2.0 181 Redirected</span><br><span style="color: hsl(120, 100%, 40%);">+ [last_Via:]</span><br><span style="color: hsl(120, 100%, 40%);">+ [last_From:]</span><br><span style="color: hsl(120, 100%, 40%);">+ [last_To:];tag=[call_number]</span><br><span style="color: hsl(120, 100%, 40%);">+ [last_Call-ID:]</span><br><span style="color: hsl(120, 100%, 40%);">+ [last_CSeq:]</span><br><span style="color: hsl(120, 100%, 40%);">+ Contact: <sip:user3@[local_ip]></span><br><span style="color: hsl(120, 100%, 40%);">+ Diversion: <sip:amenhotep@127.0.0.1>;reason=unconditional</span><br><span style="color: hsl(120, 100%, 40%);">+ Content-Length: 0</span><br><span style="color: hsl(120, 100%, 40%);">+ ]]></span><br><span style="color: hsl(120, 100%, 40%);">+ </send></span><br><span style="color: hsl(120, 100%, 40%);">+ <send retrans="500"></span><br><span style="color: hsl(120, 100%, 40%);">+ <![CDATA[</span><br><span style="color: hsl(120, 100%, 40%);">+ SIP/2.0 200 OK</span><br><span style="color: hsl(120, 100%, 40%);">+ [last_Via:]</span><br><span style="color: hsl(120, 100%, 40%);">+ [last_From:]</span><br><span style="color: hsl(120, 100%, 40%);">+ [last_To:];tag=[call_number]</span><br><span style="color: hsl(120, 100%, 40%);">+ [last_Call-ID:]</span><br><span style="color: hsl(120, 100%, 40%);">+ [last_CSeq:]</span><br><span style="color: hsl(120, 100%, 40%);">+ Contact: <sip:user2@[local_ip]:[local_port];transport=[transport]></span><br><span style="color: hsl(120, 100%, 40%);">+ Content-Type: application/sdp</span><br><span style="color: hsl(120, 100%, 40%);">+ Content-Length: [len]</span><br><span style="color: hsl(120, 100%, 40%);">+</span><br><span style="color: hsl(120, 100%, 40%);">+ v=0</span><br><span style="color: hsl(120, 100%, 40%);">+ o=- 1324901698 1324901698 IN IP[local_ip_type] [local_ip]</span><br><span style="color: hsl(120, 100%, 40%);">+ s=-</span><br><span style="color: hsl(120, 100%, 40%);">+ c=IN IP[media_ip_type] [media_ip]</span><br><span style="color: hsl(120, 100%, 40%);">+ t=0 0</span><br><span style="color: hsl(120, 100%, 40%);">+ m=audio [media_port] RTP/AVP 0 101</span><br><span style="color: hsl(120, 100%, 40%);">+ a=sendrecv</span><br><span style="color: hsl(120, 100%, 40%);">+ a=rtpmap:0 PCMU/8000</span><br><span style="color: hsl(120, 100%, 40%);">+ a=rtpmap:101 telephone-event/8000</span><br><span style="color: hsl(120, 100%, 40%);">+</span><br><span style="color: hsl(120, 100%, 40%);">+ ]]></span><br><span style="color: hsl(120, 100%, 40%);">+ </send></span><br><span style="color: hsl(120, 100%, 40%);">+</span><br><span style="color: hsl(120, 100%, 40%);">+ <recv request="ACK"/></span><br><span style="color: hsl(120, 100%, 40%);">+</scenario></span><br><span>diff --git a/tests/channels/pjsip/history_info/diversion_response_181/test-config.yaml b/tests/channels/pjsip/history_info/diversion_response_181/test-config.yaml</span><br><span>new file mode 100644</span><br><span>index 0000000..9126551</span><br><span>--- /dev/null</span><br><span>+++ b/tests/channels/pjsip/history_info/diversion_response_181/test-config.yaml</span><br><span>@@ -0,0 +1,29 @@</span><br><span style="color: hsl(120, 100%, 40%);">+testinfo:</span><br><span style="color: hsl(120, 100%, 40%);">+ summary: 'Test to make sure a 181 response containing a Diversion header gets</span><br><span style="color: hsl(120, 100%, 40%);">+ propagated as History-Info correctly.'</span><br><span style="color: hsl(120, 100%, 40%);">+</span><br><span style="color: hsl(120, 100%, 40%);">+ description: |</span><br><span style="color: hsl(120, 100%, 40%);">+ 'user1 calls user2 which sends a 181 to indicate redirection.</span><br><span style="color: hsl(120, 100%, 40%);">+ Verify the 181 response coming from user2 contains a diversion header.'</span><br><span style="color: hsl(120, 100%, 40%);">+</span><br><span style="color: hsl(120, 100%, 40%);">+properties:</span><br><span style="color: hsl(120, 100%, 40%);">+ dependencies:</span><br><span style="color: hsl(120, 100%, 40%);">+ - app : 'sipp'</span><br><span style="color: hsl(120, 100%, 40%);">+ - asterisk : 'app_dial'</span><br><span style="color: hsl(120, 100%, 40%);">+ - asterisk : 'res_pjsip'</span><br><span style="color: hsl(120, 100%, 40%);">+ - asterisk : 'res_pjsip_diversion'</span><br><span style="color: hsl(120, 100%, 40%);">+ tags:</span><br><span style="color: hsl(120, 100%, 40%);">+ - pjsip</span><br><span style="color: hsl(120, 100%, 40%);">+</span><br><span style="color: hsl(120, 100%, 40%);">+test-modules:</span><br><span style="color: hsl(120, 100%, 40%);">+ test-object:</span><br><span style="color: hsl(120, 100%, 40%);">+ config-section: test-object-config</span><br><span style="color: hsl(120, 100%, 40%);">+ typename: 'sipp.SIPpTestCase'</span><br><span style="color: hsl(120, 100%, 40%);">+</span><br><span style="color: hsl(120, 100%, 40%);">+test-object-config:</span><br><span style="color: hsl(120, 100%, 40%);">+ memcheck-delay-stop: 7</span><br><span style="color: hsl(120, 100%, 40%);">+ test-iterations:</span><br><span style="color: hsl(120, 100%, 40%);">+ -</span><br><span style="color: hsl(120, 100%, 40%);">+ scenarios:</span><br><span style="color: hsl(120, 100%, 40%);">+ - { 'key-args': { 'scenario':'user2.xml', '-p':'5062' } }</span><br><span style="color: hsl(120, 100%, 40%);">+ - { 'key-args': { 'scenario':'user1.xml', '-p':'5061' } }</span><br><span>diff --git a/tests/channels/pjsip/history_info/history_info_request/configs/ast1/extensions.conf b/tests/channels/pjsip/history_info/history_info_request/configs/ast1/extensions.conf</span><br><span>new file mode 100644</span><br><span>index 0000000..4719251</span><br><span>--- /dev/null</span><br><span>+++ b/tests/channels/pjsip/history_info/history_info_request/configs/ast1/extensions.conf</span><br><span>@@ -0,0 +1,7 @@</span><br><span style="color: hsl(120, 100%, 40%);">+[general]</span><br><span style="color: hsl(120, 100%, 40%);">+</span><br><span style="color: hsl(120, 100%, 40%);">+[default]</span><br><span style="color: hsl(120, 100%, 40%);">+</span><br><span style="color: hsl(120, 100%, 40%);">+exten => user1,1,Dial(PJSIP/user1)</span><br><span style="color: hsl(120, 100%, 40%);">+exten => user2,1,Dial(PJSIP/user2)</span><br><span style="color: hsl(120, 100%, 40%);">+exten => user3,1,Dial(PJSIP/user3)</span><br><span>diff --git a/tests/channels/pjsip/history_info/history_info_request/configs/ast1/pjsip.conf b/tests/channels/pjsip/history_info/history_info_request/configs/ast1/pjsip.conf</span><br><span>new file mode 100644</span><br><span>index 0000000..425e05f</span><br><span>--- /dev/null</span><br><span>+++ b/tests/channels/pjsip/history_info/history_info_request/configs/ast1/pjsip.conf</span><br><span>@@ -0,0 +1,35 @@</span><br><span style="color: hsl(120, 100%, 40%);">+[system]</span><br><span style="color: hsl(120, 100%, 40%);">+type=system</span><br><span style="color: hsl(120, 100%, 40%);">+timer_t1=100</span><br><span style="color: hsl(120, 100%, 40%);">+timer_b=6400</span><br><span style="color: hsl(120, 100%, 40%);">+</span><br><span style="color: hsl(120, 100%, 40%);">+[local]</span><br><span style="color: hsl(120, 100%, 40%);">+type=transport</span><br><span style="color: hsl(120, 100%, 40%);">+protocol=udp</span><br><span style="color: hsl(120, 100%, 40%);">+bind=0.0.0.0</span><br><span style="color: hsl(120, 100%, 40%);">+</span><br><span style="color: hsl(120, 100%, 40%);">+[user1-aors]</span><br><span style="color: hsl(120, 100%, 40%);">+type=aor</span><br><span style="color: hsl(120, 100%, 40%);">+contact=sip:user1@127.0.0.1:5061</span><br><span style="color: hsl(120, 100%, 40%);">+</span><br><span style="color: hsl(120, 100%, 40%);">+[user1]</span><br><span style="color: hsl(120, 100%, 40%);">+type=endpoint</span><br><span style="color: hsl(120, 100%, 40%);">+context=default</span><br><span style="color: hsl(120, 100%, 40%);">+aors=user1-aors</span><br><span style="color: hsl(120, 100%, 40%);">+direct_media=no</span><br><span style="color: hsl(120, 100%, 40%);">+disallow=all</span><br><span style="color: hsl(120, 100%, 40%);">+allow=ulaw</span><br><span style="color: hsl(120, 100%, 40%);">+</span><br><span style="color: hsl(120, 100%, 40%);">+[user2-aors]</span><br><span style="color: hsl(120, 100%, 40%);">+type=aor</span><br><span style="color: hsl(120, 100%, 40%);">+contact=sip:user2@127.0.0.1:5062</span><br><span style="color: hsl(120, 100%, 40%);">+</span><br><span style="color: hsl(120, 100%, 40%);">+[user2]</span><br><span style="color: hsl(120, 100%, 40%);">+type=endpoint</span><br><span style="color: hsl(120, 100%, 40%);">+context=default</span><br><span style="color: hsl(120, 100%, 40%);">+aors=user2-aors</span><br><span style="color: hsl(120, 100%, 40%);">+direct_media=no</span><br><span style="color: hsl(120, 100%, 40%);">+disallow=all</span><br><span style="color: hsl(120, 100%, 40%);">+allow=ulaw</span><br><span style="color: hsl(120, 100%, 40%);">+send_diversion=no</span><br><span style="color: hsl(120, 100%, 40%);">+send_history_info=yes</span><br><span>diff --git a/tests/channels/pjsip/history_info/history_info_request/sipp/user1.xml b/tests/channels/pjsip/history_info/history_info_request/sipp/user1.xml</span><br><span>new file mode 100644</span><br><span>index 0000000..c38a4c3</span><br><span>--- /dev/null</span><br><span>+++ b/tests/channels/pjsip/history_info/history_info_request/sipp/user1.xml</span><br><span>@@ -0,0 +1,70 @@</span><br><span style="color: hsl(120, 100%, 40%);">+<?xml version="1.0" encoding="ISO-8859-1" ?></span><br><span style="color: hsl(120, 100%, 40%);">+</span><br><span style="color: hsl(120, 100%, 40%);">+<scenario name="send an invite to user2"></span><br><span style="color: hsl(120, 100%, 40%);">+ <send retrans="500"></span><br><span style="color: hsl(120, 100%, 40%);">+ <![CDATA[</span><br><span style="color: hsl(120, 100%, 40%);">+ INVITE sip:user2@[remote_ip]:[remote_port] SIP/2.0</span><br><span style="color: hsl(120, 100%, 40%);">+ Via: SIP/2.0/[transport] [local_ip]:[local_port];branch=[branch]</span><br><span style="color: hsl(120, 100%, 40%);">+ From: user1 <sip:user1@[local_ip]:[local_port]>;tag=[call_number]</span><br><span style="color: hsl(120, 100%, 40%);">+ To: user2 <sip:amenhotep@[remote_ip]:[remote_port]></span><br><span style="color: hsl(120, 100%, 40%);">+ Call-ID: [call_id]</span><br><span style="color: hsl(120, 100%, 40%);">+ CSeq: [cseq] INVITE</span><br><span style="color: hsl(120, 100%, 40%);">+ Contact: sip:user1@[local_ip]:[local_port]</span><br><span style="color: hsl(120, 100%, 40%);">+ Max-Forwards: 70</span><br><span style="color: hsl(120, 100%, 40%);">+ History-Info: <sip:amenhotep@127.0.0.1>;index=1</span><br><span style="color: hsl(120, 100%, 40%);">+ History-Info: <sip:user2@127.0.0.1;cause=302>;index=1.1</span><br><span style="color: hsl(120, 100%, 40%);">+ Content-Type: application/sdp</span><br><span style="color: hsl(120, 100%, 40%);">+ Content-Length: [len]</span><br><span style="color: hsl(120, 100%, 40%);">+</span><br><span style="color: hsl(120, 100%, 40%);">+ v=0</span><br><span style="color: hsl(120, 100%, 40%);">+ o=- 1324901698 1324901698 IN IP[local_ip_type] [local_ip]</span><br><span style="color: hsl(120, 100%, 40%);">+ s=-</span><br><span style="color: hsl(120, 100%, 40%);">+ c=IN IP[media_ip_type] [media_ip]</span><br><span style="color: hsl(120, 100%, 40%);">+ t=0 0</span><br><span style="color: hsl(120, 100%, 40%);">+ m=audio [media_port] RTP/AVP 0 101</span><br><span style="color: hsl(120, 100%, 40%);">+ a=sendrecv</span><br><span style="color: hsl(120, 100%, 40%);">+ a=rtpmap:0 PCMU/8000</span><br><span style="color: hsl(120, 100%, 40%);">+ a=rtpmap:101 telephone-event/8000</span><br><span style="color: hsl(120, 100%, 40%);">+</span><br><span style="color: hsl(120, 100%, 40%);">+ ]]></span><br><span style="color: hsl(120, 100%, 40%);">+ </send></span><br><span style="color: hsl(120, 100%, 40%);">+</span><br><span style="color: hsl(120, 100%, 40%);">+ <recv response="100" optional="true" /></span><br><span style="color: hsl(120, 100%, 40%);">+</span><br><span style="color: hsl(120, 100%, 40%);">+ <recv response="181" optional="true" /></span><br><span style="color: hsl(120, 100%, 40%);">+</span><br><span style="color: hsl(120, 100%, 40%);">+ <recv response="180" optional="true" /></span><br><span style="color: hsl(120, 100%, 40%);">+</span><br><span style="color: hsl(120, 100%, 40%);">+ <recv response="183" optional="true" /></span><br><span style="color: hsl(120, 100%, 40%);">+</span><br><span style="color: hsl(120, 100%, 40%);">+ <recv response="200" /></span><br><span style="color: hsl(120, 100%, 40%);">+</span><br><span style="color: hsl(120, 100%, 40%);">+ <send></span><br><span style="color: hsl(120, 100%, 40%);">+ <![CDATA[</span><br><span style="color: hsl(120, 100%, 40%);">+ ACK sip:user2@[remote_ip]:[remote_port] SIP/2.0</span><br><span style="color: hsl(120, 100%, 40%);">+ Via: SIP/2.0/[transport] [local_ip]:[local_port];branch=[branch]</span><br><span style="color: hsl(120, 100%, 40%);">+ From: <sip:user1@[local_ip]>;tag=[call_number]</span><br><span style="color: hsl(120, 100%, 40%);">+ To: <sip:user2@[remote_ip]:[remote_port]>[peer_tag_param]</span><br><span style="color: hsl(120, 100%, 40%);">+ CSeq: [cseq] ACK</span><br><span style="color: hsl(120, 100%, 40%);">+ Call-ID: [call_id]</span><br><span style="color: hsl(120, 100%, 40%);">+ Max-Forwards: 70</span><br><span style="color: hsl(120, 100%, 40%);">+ Content-Length: 0</span><br><span style="color: hsl(120, 100%, 40%);">+</span><br><span style="color: hsl(120, 100%, 40%);">+ ]]></span><br><span style="color: hsl(120, 100%, 40%);">+ </send></span><br><span style="color: hsl(120, 100%, 40%);">+</span><br><span style="color: hsl(120, 100%, 40%);">+ <send retrans="500"></span><br><span style="color: hsl(120, 100%, 40%);">+ <![CDATA[</span><br><span style="color: hsl(120, 100%, 40%);">+ BYE sip:user2@[remote_ip]:[remote_port] SIP/2.0</span><br><span style="color: hsl(120, 100%, 40%);">+ Via: SIP/2.0/[transport] [local_ip]:[local_port];branch=[branch]</span><br><span style="color: hsl(120, 100%, 40%);">+ From: <sip:user1@[local_ip]>;tag=[call_number]</span><br><span style="color: hsl(120, 100%, 40%);">+ To: <sip:user2@[remote_ip]:[remote_port]>[peer_tag_param]</span><br><span style="color: hsl(120, 100%, 40%);">+ CSeq: [cseq] BYE</span><br><span style="color: hsl(120, 100%, 40%);">+ Call-ID: [call_id]</span><br><span style="color: hsl(120, 100%, 40%);">+ Max-Forwards: 70</span><br><span style="color: hsl(120, 100%, 40%);">+ Content-Length: 0</span><br><span style="color: hsl(120, 100%, 40%);">+ ]]></span><br><span style="color: hsl(120, 100%, 40%);">+ </send></span><br><span style="color: hsl(120, 100%, 40%);">+</span><br><span style="color: hsl(120, 100%, 40%);">+ <recv response="200" crlf="true" /></span><br><span style="color: hsl(120, 100%, 40%);">+</scenario></span><br><span>diff --git a/tests/channels/pjsip/history_info/history_info_request/sipp/user2.xml b/tests/channels/pjsip/history_info/history_info_request/sipp/user2.xml</span><br><span>new file mode 100644</span><br><span>index 0000000..5d44b30</span><br><span>--- /dev/null</span><br><span>+++ b/tests/channels/pjsip/history_info/history_info_request/sipp/user2.xml</span><br><span>@@ -0,0 +1,82 @@</span><br><span style="color: hsl(120, 100%, 40%);">+<?xml version="1.0" encoding="ISO-8859-1" ?></span><br><span style="color: hsl(120, 100%, 40%);">+</span><br><span style="color: hsl(120, 100%, 40%);">+<scenario name="receives invite with diversion info"></span><br><span style="color: hsl(120, 100%, 40%);">+ <recv request="INVITE" crlf="true"></span><br><span style="color: hsl(120, 100%, 40%);">+ <action></span><br><span style="color: hsl(120, 100%, 40%);">+ <!-- Check that the Diversion header is present and contains the correct name. --></span><br><span style="color: hsl(120, 100%, 40%);">+ <ereg regexp="amenhotep" search_in="hdr" header="History-Info:" occurence="1" check_it="true" assign_to="1" /></span><br><span style="color: hsl(120, 100%, 40%);">+ <log message="Received INVITE with History-Info header: [$1]." /></span><br><span style="color: hsl(120, 100%, 40%);">+ <ereg regexp="user2" search_in="hdr" header="History-Info:" occurence="2" check_it="true" assign_to="2" /></span><br><span style="color: hsl(120, 100%, 40%);">+ <log message="Received INVITE with History-Info header: [$2]." /></span><br><span style="color: hsl(120, 100%, 40%);">+ </action></span><br><span style="color: hsl(120, 100%, 40%);">+ </recv></span><br><span style="color: hsl(120, 100%, 40%);">+</span><br><span style="color: hsl(120, 100%, 40%);">+ <send></span><br><span style="color: hsl(120, 100%, 40%);">+ <![CDATA[</span><br><span style="color: hsl(120, 100%, 40%);">+ SIP/2.0 100 Trying</span><br><span style="color: hsl(120, 100%, 40%);">+ [last_Via:]</span><br><span style="color: hsl(120, 100%, 40%);">+ [last_From:]</span><br><span style="color: hsl(120, 100%, 40%);">+ [last_To:];tag=[call_number]</span><br><span style="color: hsl(120, 100%, 40%);">+ [last_Call-ID:]</span><br><span style="color: hsl(120, 100%, 40%);">+ [last_CSeq:]</span><br><span style="color: hsl(120, 100%, 40%);">+ Contact: <sip:user2@[local_ip]:[local_port];transport=[transport]></span><br><span style="color: hsl(120, 100%, 40%);">+ Content-Length: 0</span><br><span style="color: hsl(120, 100%, 40%);">+ ]]></span><br><span style="color: hsl(120, 100%, 40%);">+ </send></span><br><span style="color: hsl(120, 100%, 40%);">+</span><br><span style="color: hsl(120, 100%, 40%);">+ <send></span><br><span style="color: hsl(120, 100%, 40%);">+ <![CDATA[</span><br><span style="color: hsl(120, 100%, 40%);">+ SIP/2.0 180 Ringing</span><br><span style="color: hsl(120, 100%, 40%);">+ [last_Via:]</span><br><span style="color: hsl(120, 100%, 40%);">+ [last_From:]</span><br><span style="color: hsl(120, 100%, 40%);">+ [last_To:];tag=[call_number]</span><br><span style="color: hsl(120, 100%, 40%);">+ [last_Call-ID:]</span><br><span style="color: hsl(120, 100%, 40%);">+ [last_CSeq:]</span><br><span style="color: hsl(120, 100%, 40%);">+ Contact: <sip:user2@[local_ip]:[local_port];transport=[transport]></span><br><span style="color: hsl(120, 100%, 40%);">+ Content-Length: 0</span><br><span style="color: hsl(120, 100%, 40%);">+ ]]></span><br><span style="color: hsl(120, 100%, 40%);">+ </send></span><br><span style="color: hsl(120, 100%, 40%);">+</span><br><span style="color: hsl(120, 100%, 40%);">+ <send retrans="500"></span><br><span style="color: hsl(120, 100%, 40%);">+ <![CDATA[</span><br><span style="color: hsl(120, 100%, 40%);">+ SIP/2.0 200 OK</span><br><span style="color: hsl(120, 100%, 40%);">+ [last_Via:]</span><br><span style="color: hsl(120, 100%, 40%);">+ [last_From:]</span><br><span style="color: hsl(120, 100%, 40%);">+ [last_To:];tag=[call_number]</span><br><span style="color: hsl(120, 100%, 40%);">+ [last_Call-ID:]</span><br><span style="color: hsl(120, 100%, 40%);">+ [last_CSeq:]</span><br><span style="color: hsl(120, 100%, 40%);">+ Contact: <sip:user2@[local_ip]:[local_port];transport=[transport]></span><br><span style="color: hsl(120, 100%, 40%);">+ Content-Type: application/sdp</span><br><span style="color: hsl(120, 100%, 40%);">+ Content-Length: [len]</span><br><span style="color: hsl(120, 100%, 40%);">+</span><br><span style="color: hsl(120, 100%, 40%);">+ v=0</span><br><span style="color: hsl(120, 100%, 40%);">+ o=- 1324901698 1324901698 IN IP[local_ip_type] [local_ip]</span><br><span style="color: hsl(120, 100%, 40%);">+ s=-</span><br><span style="color: hsl(120, 100%, 40%);">+ c=IN IP[media_ip_type] [media_ip]</span><br><span style="color: hsl(120, 100%, 40%);">+ t=0 0</span><br><span style="color: hsl(120, 100%, 40%);">+ m=audio [media_port] RTP/AVP 0 101</span><br><span style="color: hsl(120, 100%, 40%);">+ a=sendrecv</span><br><span style="color: hsl(120, 100%, 40%);">+ a=rtpmap:0 PCMU/8000</span><br><span style="color: hsl(120, 100%, 40%);">+ a=rtpmap:101 telephone-event/8000</span><br><span style="color: hsl(120, 100%, 40%);">+</span><br><span style="color: hsl(120, 100%, 40%);">+ ]]></span><br><span style="color: hsl(120, 100%, 40%);">+ </send></span><br><span style="color: hsl(120, 100%, 40%);">+</span><br><span style="color: hsl(120, 100%, 40%);">+ <recv request="ACK"/></span><br><span style="color: hsl(120, 100%, 40%);">+</span><br><span style="color: hsl(120, 100%, 40%);">+ <recv request="BYE" crlf="true" /></span><br><span style="color: hsl(120, 100%, 40%);">+</span><br><span style="color: hsl(120, 100%, 40%);">+ <send retrans="500"></span><br><span style="color: hsl(120, 100%, 40%);">+ <![CDATA[</span><br><span style="color: hsl(120, 100%, 40%);">+ SIP/2.0 200 OK</span><br><span style="color: hsl(120, 100%, 40%);">+ [last_Via:]</span><br><span style="color: hsl(120, 100%, 40%);">+ [last_From:]</span><br><span style="color: hsl(120, 100%, 40%);">+ [last_To:];tag=[call_number]</span><br><span style="color: hsl(120, 100%, 40%);">+ [last_Call-ID:]</span><br><span style="color: hsl(120, 100%, 40%);">+ [last_CSeq:]</span><br><span style="color: hsl(120, 100%, 40%);">+ Content-Type: application/sdp</span><br><span style="color: hsl(120, 100%, 40%);">+ Content-Length: 0</span><br><span style="color: hsl(120, 100%, 40%);">+</span><br><span style="color: hsl(120, 100%, 40%);">+ ]]></span><br><span style="color: hsl(120, 100%, 40%);">+ </send></span><br><span style="color: hsl(120, 100%, 40%);">+</scenario></span><br><span>diff --git a/tests/channels/pjsip/history_info/history_info_request/test-config.yaml b/tests/channels/pjsip/history_info/history_info_request/test-config.yaml</span><br><span>new file mode 100644</span><br><span>index 0000000..8fd4c76</span><br><span>--- /dev/null</span><br><span>+++ b/tests/channels/pjsip/history_info/history_info_request/test-config.yaml</span><br><span>@@ -0,0 +1,27 @@</span><br><span style="color: hsl(120, 100%, 40%);">+testinfo:</span><br><span style="color: hsl(120, 100%, 40%);">+ summary: 'Test to make sure the history-info headers on an invite gets</span><br><span style="color: hsl(120, 100%, 40%);">+ propagated as history-info correctly.'</span><br><span style="color: hsl(120, 100%, 40%);">+ description: |</span><br><span style="color: hsl(120, 100%, 40%);">+ 'user1 calls user2 with an invite containing a diversion header.'</span><br><span style="color: hsl(120, 100%, 40%);">+</span><br><span style="color: hsl(120, 100%, 40%);">+properties:</span><br><span style="color: hsl(120, 100%, 40%);">+ dependencies:</span><br><span style="color: hsl(120, 100%, 40%);">+ - app : 'sipp'</span><br><span style="color: hsl(120, 100%, 40%);">+ - asterisk : 'app_dial'</span><br><span style="color: hsl(120, 100%, 40%);">+ - asterisk : 'res_pjsip'</span><br><span style="color: hsl(120, 100%, 40%);">+ - asterisk : 'res_pjsip_diversion'</span><br><span style="color: hsl(120, 100%, 40%);">+ tags:</span><br><span style="color: hsl(120, 100%, 40%);">+ - pjsip</span><br><span style="color: hsl(120, 100%, 40%);">+</span><br><span style="color: hsl(120, 100%, 40%);">+test-modules:</span><br><span style="color: hsl(120, 100%, 40%);">+ test-object:</span><br><span style="color: hsl(120, 100%, 40%);">+ config-section: test-object-config</span><br><span style="color: hsl(120, 100%, 40%);">+ typename: 'sipp.SIPpTestCase'</span><br><span style="color: hsl(120, 100%, 40%);">+</span><br><span style="color: hsl(120, 100%, 40%);">+test-object-config:</span><br><span style="color: hsl(120, 100%, 40%);">+ memcheck-delay-stop: 7</span><br><span style="color: hsl(120, 100%, 40%);">+ test-iterations:</span><br><span style="color: hsl(120, 100%, 40%);">+ -</span><br><span style="color: hsl(120, 100%, 40%);">+ scenarios:</span><br><span style="color: hsl(120, 100%, 40%);">+ - { 'key-args': { 'scenario':'user2.xml', '-p':'5062' } }</span><br><span style="color: hsl(120, 100%, 40%);">+ - { 'key-args': { 'scenario':'user1.xml', '-p':'5061' } }</span><br><span>diff --git a/tests/channels/pjsip/history_info/history_info_response_181/configs/ast1/extensions.conf b/tests/channels/pjsip/history_info/history_info_response_181/configs/ast1/extensions.conf</span><br><span>new file mode 100644</span><br><span>index 0000000..4719251</span><br><span>--- /dev/null</span><br><span>+++ b/tests/channels/pjsip/history_info/history_info_response_181/configs/ast1/extensions.conf</span><br><span>@@ -0,0 +1,7 @@</span><br><span style="color: hsl(120, 100%, 40%);">+[general]</span><br><span style="color: hsl(120, 100%, 40%);">+</span><br><span style="color: hsl(120, 100%, 40%);">+[default]</span><br><span style="color: hsl(120, 100%, 40%);">+</span><br><span style="color: hsl(120, 100%, 40%);">+exten => user1,1,Dial(PJSIP/user1)</span><br><span style="color: hsl(120, 100%, 40%);">+exten => user2,1,Dial(PJSIP/user2)</span><br><span style="color: hsl(120, 100%, 40%);">+exten => user3,1,Dial(PJSIP/user3)</span><br><span>diff --git a/tests/channels/pjsip/history_info/history_info_response_181/configs/ast1/pjsip.conf b/tests/channels/pjsip/history_info/history_info_response_181/configs/ast1/pjsip.conf</span><br><span>new file mode 100644</span><br><span>index 0000000..4ab6741</span><br><span>--- /dev/null</span><br><span>+++ b/tests/channels/pjsip/history_info/history_info_response_181/configs/ast1/pjsip.conf</span><br><span>@@ -0,0 +1,35 @@</span><br><span style="color: hsl(120, 100%, 40%);">+[system]</span><br><span style="color: hsl(120, 100%, 40%);">+type=system</span><br><span style="color: hsl(120, 100%, 40%);">+timer_t1=100</span><br><span style="color: hsl(120, 100%, 40%);">+timer_b=6400</span><br><span style="color: hsl(120, 100%, 40%);">+</span><br><span style="color: hsl(120, 100%, 40%);">+[local]</span><br><span style="color: hsl(120, 100%, 40%);">+type=transport</span><br><span style="color: hsl(120, 100%, 40%);">+protocol=udp</span><br><span style="color: hsl(120, 100%, 40%);">+bind=0.0.0.0</span><br><span style="color: hsl(120, 100%, 40%);">+</span><br><span style="color: hsl(120, 100%, 40%);">+[user1-aors]</span><br><span style="color: hsl(120, 100%, 40%);">+type=aor</span><br><span style="color: hsl(120, 100%, 40%);">+contact=sip:user1@127.0.0.1:5061</span><br><span style="color: hsl(120, 100%, 40%);">+</span><br><span style="color: hsl(120, 100%, 40%);">+[user1]</span><br><span style="color: hsl(120, 100%, 40%);">+type=endpoint</span><br><span style="color: hsl(120, 100%, 40%);">+context=default</span><br><span style="color: hsl(120, 100%, 40%);">+aors=user1-aors</span><br><span style="color: hsl(120, 100%, 40%);">+direct_media=no</span><br><span style="color: hsl(120, 100%, 40%);">+disallow=all</span><br><span style="color: hsl(120, 100%, 40%);">+allow=ulaw</span><br><span style="color: hsl(120, 100%, 40%);">+send_diversion=no</span><br><span style="color: hsl(120, 100%, 40%);">+send_history_info=yes</span><br><span style="color: hsl(120, 100%, 40%);">+</span><br><span style="color: hsl(120, 100%, 40%);">+[user2-aors]</span><br><span style="color: hsl(120, 100%, 40%);">+type=aor</span><br><span style="color: hsl(120, 100%, 40%);">+contact=sip:user2@127.0.0.1:5062</span><br><span style="color: hsl(120, 100%, 40%);">+</span><br><span style="color: hsl(120, 100%, 40%);">+[user2]</span><br><span style="color: hsl(120, 100%, 40%);">+type=endpoint</span><br><span style="color: hsl(120, 100%, 40%);">+context=default</span><br><span style="color: hsl(120, 100%, 40%);">+aors=user2-aors</span><br><span style="color: hsl(120, 100%, 40%);">+direct_media=no</span><br><span style="color: hsl(120, 100%, 40%);">+disallow=all</span><br><span style="color: hsl(120, 100%, 40%);">+allow=ulaw</span><br><span>diff --git a/tests/channels/pjsip/history_info/history_info_response_181/sipp/user1.xml b/tests/channels/pjsip/history_info/history_info_response_181/sipp/user1.xml</span><br><span>new file mode 100644</span><br><span>index 0000000..7431e32</span><br><span>--- /dev/null</span><br><span>+++ b/tests/channels/pjsip/history_info/history_info_response_181/sipp/user1.xml</span><br><span>@@ -0,0 +1,76 @@</span><br><span style="color: hsl(120, 100%, 40%);">+<?xml version="1.0" encoding="ISO-8859-1" ?></span><br><span style="color: hsl(120, 100%, 40%);">+</span><br><span style="color: hsl(120, 100%, 40%);">+<scenario name="send an invite to user2"></span><br><span style="color: hsl(120, 100%, 40%);">+ <send retrans="500"></span><br><span style="color: hsl(120, 100%, 40%);">+ <![CDATA[</span><br><span style="color: hsl(120, 100%, 40%);">+ INVITE sip:user2@[remote_ip]:[remote_port] SIP/2.0</span><br><span style="color: hsl(120, 100%, 40%);">+ Via: SIP/2.0/[transport] [local_ip]:[local_port];branch=[branch]</span><br><span style="color: hsl(120, 100%, 40%);">+ From: user1 <sip:user1@[local_ip]:[local_port]>;tag=[call_number]</span><br><span style="color: hsl(120, 100%, 40%);">+ To: user2 <sip:user2@[remote_ip]:[remote_port]></span><br><span style="color: hsl(120, 100%, 40%);">+ Call-ID: [call_id]</span><br><span style="color: hsl(120, 100%, 40%);">+ CSeq: [cseq] INVITE</span><br><span style="color: hsl(120, 100%, 40%);">+ Contact: sip:user1@[local_ip]:[local_port]</span><br><span style="color: hsl(120, 100%, 40%);">+ Max-Forwards: 70</span><br><span style="color: hsl(120, 100%, 40%);">+ Content-Type: application/sdp</span><br><span style="color: hsl(120, 100%, 40%);">+ Content-Length: [len]</span><br><span style="color: hsl(120, 100%, 40%);">+</span><br><span style="color: hsl(120, 100%, 40%);">+ v=0</span><br><span style="color: hsl(120, 100%, 40%);">+ o=- 1324901698 1324901698 IN IP[local_ip_type] [local_ip]</span><br><span style="color: hsl(120, 100%, 40%);">+ s=-</span><br><span style="color: hsl(120, 100%, 40%);">+ c=IN IP[media_ip_type] [media_ip]</span><br><span style="color: hsl(120, 100%, 40%);">+ t=0 0</span><br><span style="color: hsl(120, 100%, 40%);">+ m=audio [media_port] RTP/AVP 0 101</span><br><span style="color: hsl(120, 100%, 40%);">+ a=sendrecv</span><br><span style="color: hsl(120, 100%, 40%);">+ a=rtpmap:0 PCMU/8000</span><br><span style="color: hsl(120, 100%, 40%);">+ a=rtpmap:101 telephone-event/8000</span><br><span style="color: hsl(120, 100%, 40%);">+</span><br><span style="color: hsl(120, 100%, 40%);">+ ]]></span><br><span style="color: hsl(120, 100%, 40%);">+ </send></span><br><span style="color: hsl(120, 100%, 40%);">+</span><br><span style="color: hsl(120, 100%, 40%);">+ <recv response="100" optional="true" /></span><br><span style="color: hsl(120, 100%, 40%);">+</span><br><span style="color: hsl(120, 100%, 40%);">+ <recv response="181"></span><br><span style="color: hsl(120, 100%, 40%);">+ <action></span><br><span style="color: hsl(120, 100%, 40%);">+ <!-- Check that the Diversion header is present and contains the correct name. --></span><br><span style="color: hsl(120, 100%, 40%);">+ <ereg regexp="user2" search_in="hdr" header="History-Info:" occurence="1" check_it="true" assign_to="1" /></span><br><span style="color: hsl(120, 100%, 40%);">+ <log message="Received 181 with History-Info header: [$1]." /></span><br><span style="color: hsl(120, 100%, 40%);">+ <ereg regexp="amenhotep" search_in="hdr" header="History-Info:" occurence="2" check_it="true" assign_to="2" /></span><br><span style="color: hsl(120, 100%, 40%);">+ <log message="Received 181 with History-Info header: [$2]." /></span><br><span style="color: hsl(120, 100%, 40%);">+ </action></span><br><span style="color: hsl(120, 100%, 40%);">+ </recv></span><br><span style="color: hsl(120, 100%, 40%);">+</span><br><span style="color: hsl(120, 100%, 40%);">+ <recv response="180" optional="true" /></span><br><span style="color: hsl(120, 100%, 40%);">+</span><br><span style="color: hsl(120, 100%, 40%);">+ <recv response="183" optional="true" /></span><br><span style="color: hsl(120, 100%, 40%);">+</span><br><span style="color: hsl(120, 100%, 40%);">+ <recv response="200" /></span><br><span style="color: hsl(120, 100%, 40%);">+</span><br><span style="color: hsl(120, 100%, 40%);">+ <send></span><br><span style="color: hsl(120, 100%, 40%);">+ <![CDATA[</span><br><span style="color: hsl(120, 100%, 40%);">+ ACK sip:user3@[remote_ip]:[remote_port] SIP/2.0</span><br><span style="color: hsl(120, 100%, 40%);">+ Via: SIP/2.0/[transport] [local_ip]:[local_port];branch=[branch]</span><br><span style="color: hsl(120, 100%, 40%);">+ From: <sip:user1@[local_ip]>;tag=[call_number]</span><br><span style="color: hsl(120, 100%, 40%);">+ To: <sip:user3@[remote_ip]:[remote_port]>[peer_tag_param]</span><br><span style="color: hsl(120, 100%, 40%);">+ CSeq: [cseq] ACK</span><br><span style="color: hsl(120, 100%, 40%);">+ Call-ID: [call_id]</span><br><span style="color: hsl(120, 100%, 40%);">+ Max-Forwards: 70</span><br><span style="color: hsl(120, 100%, 40%);">+ Content-Length: 0</span><br><span style="color: hsl(120, 100%, 40%);">+</span><br><span style="color: hsl(120, 100%, 40%);">+ ]]></span><br><span style="color: hsl(120, 100%, 40%);">+ </send></span><br><span style="color: hsl(120, 100%, 40%);">+</span><br><span style="color: hsl(120, 100%, 40%);">+ <send retrans="500"></span><br><span style="color: hsl(120, 100%, 40%);">+ <![CDATA[</span><br><span style="color: hsl(120, 100%, 40%);">+ BYE sip:user3@[remote_ip]:[remote_port] SIP/2.0</span><br><span style="color: hsl(120, 100%, 40%);">+ Via: SIP/2.0/[transport] [local_ip]:[local_port];branch=[branch]</span><br><span style="color: hsl(120, 100%, 40%);">+ From: <sip:user1@[local_ip]>;tag=[call_number]</span><br><span style="color: hsl(120, 100%, 40%);">+ To: <sip:user3@[remote_ip]:[remote_port]>[peer_tag_param]</span><br><span style="color: hsl(120, 100%, 40%);">+ CSeq: [cseq] BYE</span><br><span style="color: hsl(120, 100%, 40%);">+ Call-ID: [call_id]</span><br><span style="color: hsl(120, 100%, 40%);">+ Max-Forwards: 70</span><br><span style="color: hsl(120, 100%, 40%);">+ Content-Length: 0</span><br><span style="color: hsl(120, 100%, 40%);">+ ]]></span><br><span style="color: hsl(120, 100%, 40%);">+ </send></span><br><span style="color: hsl(120, 100%, 40%);">+</span><br><span style="color: hsl(120, 100%, 40%);">+ <recv response="200" crlf="true" /></span><br><span style="color: hsl(120, 100%, 40%);">+</scenario></span><br><span>diff --git a/tests/channels/pjsip/history_info/history_info_response_181/sipp/user2.xml b/tests/channels/pjsip/history_info/history_info_response_181/sipp/user2.xml</span><br><span>new file mode 100644</span><br><span>index 0000000..2c2d77a</span><br><span>--- /dev/null</span><br><span>+++ b/tests/channels/pjsip/history_info/history_info_response_181/sipp/user2.xml</span><br><span>@@ -0,0 +1,46 @@</span><br><span style="color: hsl(120, 100%, 40%);">+<?xml version="1.0" encoding="ISO-8859-1" ?></span><br><span style="color: hsl(120, 100%, 40%);">+</span><br><span style="color: hsl(120, 100%, 40%);">+<scenario name="send forwarding response back with diversion header"></span><br><span style="color: hsl(120, 100%, 40%);">+ <recv request="INVITE" crlf="true" /></span><br><span style="color: hsl(120, 100%, 40%);">+</span><br><span style="color: hsl(120, 100%, 40%);">+ <send></span><br><span style="color: hsl(120, 100%, 40%);">+ <![CDATA[</span><br><span style="color: hsl(120, 100%, 40%);">+ SIP/2.0 181 Redirected</span><br><span style="color: hsl(120, 100%, 40%);">+ [last_Via:]</span><br><span style="color: hsl(120, 100%, 40%);">+ [last_From:]</span><br><span style="color: hsl(120, 100%, 40%);">+ [last_To:];tag=[call_number]</span><br><span style="color: hsl(120, 100%, 40%);">+ [last_Call-ID:]</span><br><span style="color: hsl(120, 100%, 40%);">+ [last_CSeq:]</span><br><span style="color: hsl(120, 100%, 40%);">+ Contact: <sip:user3@[local_ip]></span><br><span style="color: hsl(120, 100%, 40%);">+ History-Info: <sip:user2@127.0.0.1>;index=1</span><br><span style="color: hsl(120, 100%, 40%);">+ History-Info: <sip:amenhotep@127.0.0.1;cause=302>;index=1.1</span><br><span style="color: hsl(120, 100%, 40%);">+ Content-Length: 0</span><br><span style="color: hsl(120, 100%, 40%);">+ ]]></span><br><span style="color: hsl(120, 100%, 40%);">+ </send></span><br><span style="color: hsl(120, 100%, 40%);">+ <send retrans="500"></span><br><span style="color: hsl(120, 100%, 40%);">+ <![CDATA[</span><br><span style="color: hsl(120, 100%, 40%);">+ SIP/2.0 200 OK</span><br><span style="color: hsl(120, 100%, 40%);">+ [last_Via:]</span><br><span style="color: hsl(120, 100%, 40%);">+ [last_From:]</span><br><span style="color: hsl(120, 100%, 40%);">+ [last_To:];tag=[call_number]</span><br><span style="color: hsl(120, 100%, 40%);">+ [last_Call-ID:]</span><br><span style="color: hsl(120, 100%, 40%);">+ [last_CSeq:]</span><br><span style="color: hsl(120, 100%, 40%);">+ Contact: <sip:user2@[local_ip]:[local_port];transport=[transport]></span><br><span style="color: hsl(120, 100%, 40%);">+ Content-Type: application/sdp</span><br><span style="color: hsl(120, 100%, 40%);">+ Content-Length: [len]</span><br><span style="color: hsl(120, 100%, 40%);">+</span><br><span style="color: hsl(120, 100%, 40%);">+ v=0</span><br><span style="color: hsl(120, 100%, 40%);">+ o=- 1324901698 1324901698 IN IP[local_ip_type] [local_ip]</span><br><span style="color: hsl(120, 100%, 40%);">+ s=-</span><br><span style="color: hsl(120, 100%, 40%);">+ c=IN IP[media_ip_type] [media_ip]</span><br><span style="color: hsl(120, 100%, 40%);">+ t=0 0</span><br><span style="color: hsl(120, 100%, 40%);">+ m=audio [media_port] RTP/AVP 0 101</span><br><span style="color: hsl(120, 100%, 40%);">+ a=sendrecv</span><br><span style="color: hsl(120, 100%, 40%);">+ a=rtpmap:0 PCMU/8000</span><br><span style="color: hsl(120, 100%, 40%);">+ a=rtpmap:101 telephone-event/8000</span><br><span style="color: hsl(120, 100%, 40%);">+</span><br><span style="color: hsl(120, 100%, 40%);">+ ]]></span><br><span style="color: hsl(120, 100%, 40%);">+ </send></span><br><span style="color: hsl(120, 100%, 40%);">+</span><br><span style="color: hsl(120, 100%, 40%);">+ <recv request="ACK"/></span><br><span style="color: hsl(120, 100%, 40%);">+</scenario></span><br><span>diff --git a/tests/channels/pjsip/history_info/history_info_response_181/test-config.yaml b/tests/channels/pjsip/history_info/history_info_response_181/test-config.yaml</span><br><span>new file mode 100644</span><br><span>index 0000000..e10e01f</span><br><span>--- /dev/null</span><br><span>+++ b/tests/channels/pjsip/history_info/history_info_response_181/test-config.yaml</span><br><span>@@ -0,0 +1,29 @@</span><br><span style="color: hsl(120, 100%, 40%);">+testinfo:</span><br><span style="color: hsl(120, 100%, 40%);">+ summary: 'Test to make sure a 181 response containing history-info headers gets</span><br><span style="color: hsl(120, 100%, 40%);">+ propagated as History-Info correctly.'</span><br><span style="color: hsl(120, 100%, 40%);">+</span><br><span style="color: hsl(120, 100%, 40%);">+ description: |</span><br><span style="color: hsl(120, 100%, 40%);">+ 'user1 calls user2 which sends a 181 to indicate redirection.</span><br><span style="color: hsl(120, 100%, 40%);">+ Verify the 181 response coming from user2 contains History-Info headers.'</span><br><span style="color: hsl(120, 100%, 40%);">+</span><br><span style="color: hsl(120, 100%, 40%);">+properties:</span><br><span style="color: hsl(120, 100%, 40%);">+ dependencies:</span><br><span style="color: hsl(120, 100%, 40%);">+ - app : 'sipp'</span><br><span style="color: hsl(120, 100%, 40%);">+ - asterisk : 'app_dial'</span><br><span style="color: hsl(120, 100%, 40%);">+ - asterisk : 'res_pjsip'</span><br><span style="color: hsl(120, 100%, 40%);">+ - asterisk : 'res_pjsip_diversion'</span><br><span style="color: hsl(120, 100%, 40%);">+ tags:</span><br><span style="color: hsl(120, 100%, 40%);">+ - pjsip</span><br><span style="color: hsl(120, 100%, 40%);">+</span><br><span style="color: hsl(120, 100%, 40%);">+test-modules:</span><br><span style="color: hsl(120, 100%, 40%);">+ test-object:</span><br><span style="color: hsl(120, 100%, 40%);">+ config-section: test-object-config</span><br><span style="color: hsl(120, 100%, 40%);">+ typename: 'sipp.SIPpTestCase'</span><br><span style="color: hsl(120, 100%, 40%);">+</span><br><span style="color: hsl(120, 100%, 40%);">+test-object-config:</span><br><span style="color: hsl(120, 100%, 40%);">+ memcheck-delay-stop: 7</span><br><span style="color: hsl(120, 100%, 40%);">+ test-iterations:</span><br><span style="color: hsl(120, 100%, 40%);">+ -</span><br><span style="color: hsl(120, 100%, 40%);">+ scenarios:</span><br><span style="color: hsl(120, 100%, 40%);">+ - { 'key-args': { 'scenario':'user2.xml', '-p':'5062' } }</span><br><span style="color: hsl(120, 100%, 40%);">+ - { 'key-args': { 'scenario':'user1.xml', '-p':'5061' } }</span><br><span>diff --git a/tests/channels/pjsip/history_info/no_diversion_response_181/configs/ast1/extensions.conf b/tests/channels/pjsip/history_info/no_diversion_response_181/configs/ast1/extensions.conf</span><br><span>new file mode 100644</span><br><span>index 0000000..4719251</span><br><span>--- /dev/null</span><br><span>+++ b/tests/channels/pjsip/history_info/no_diversion_response_181/configs/ast1/extensions.conf</span><br><span>@@ -0,0 +1,7 @@</span><br><span style="color: hsl(120, 100%, 40%);">+[general]</span><br><span style="color: hsl(120, 100%, 40%);">+</span><br><span style="color: hsl(120, 100%, 40%);">+[default]</span><br><span style="color: hsl(120, 100%, 40%);">+</span><br><span style="color: hsl(120, 100%, 40%);">+exten => user1,1,Dial(PJSIP/user1)</span><br><span style="color: hsl(120, 100%, 40%);">+exten => user2,1,Dial(PJSIP/user2)</span><br><span style="color: hsl(120, 100%, 40%);">+exten => user3,1,Dial(PJSIP/user3)</span><br><span>diff --git a/tests/channels/pjsip/history_info/no_diversion_response_181/configs/ast1/pjsip.conf b/tests/channels/pjsip/history_info/no_diversion_response_181/configs/ast1/pjsip.conf</span><br><span>new file mode 100644</span><br><span>index 0000000..4ab6741</span><br><span>--- /dev/null</span><br><span>+++ b/tests/channels/pjsip/history_info/no_diversion_response_181/configs/ast1/pjsip.conf</span><br><span>@@ -0,0 +1,35 @@</span><br><span style="color: hsl(120, 100%, 40%);">+[system]</span><br><span style="color: hsl(120, 100%, 40%);">+type=system</span><br><span style="color: hsl(120, 100%, 40%);">+timer_t1=100</span><br><span style="color: hsl(120, 100%, 40%);">+timer_b=6400</span><br><span style="color: hsl(120, 100%, 40%);">+</span><br><span style="color: hsl(120, 100%, 40%);">+[local]</span><br><span style="color: hsl(120, 100%, 40%);">+type=transport</span><br><span style="color: hsl(120, 100%, 40%);">+protocol=udp</span><br><span style="color: hsl(120, 100%, 40%);">+bind=0.0.0.0</span><br><span style="color: hsl(120, 100%, 40%);">+</span><br><span style="color: hsl(120, 100%, 40%);">+[user1-aors]</span><br><span style="color: hsl(120, 100%, 40%);">+type=aor</span><br><span style="color: hsl(120, 100%, 40%);">+contact=sip:user1@127.0.0.1:5061</span><br><span style="color: hsl(120, 100%, 40%);">+</span><br><span style="color: hsl(120, 100%, 40%);">+[user1]</span><br><span style="color: hsl(120, 100%, 40%);">+type=endpoint</span><br><span style="color: hsl(120, 100%, 40%);">+context=default</span><br><span style="color: hsl(120, 100%, 40%);">+aors=user1-aors</span><br><span style="color: hsl(120, 100%, 40%);">+direct_media=no</span><br><span style="color: hsl(120, 100%, 40%);">+disallow=all</span><br><span style="color: hsl(120, 100%, 40%);">+allow=ulaw</span><br><span style="color: hsl(120, 100%, 40%);">+send_diversion=no</span><br><span style="color: hsl(120, 100%, 40%);">+send_history_info=yes</span><br><span style="color: hsl(120, 100%, 40%);">+</span><br><span style="color: hsl(120, 100%, 40%);">+[user2-aors]</span><br><span style="color: hsl(120, 100%, 40%);">+type=aor</span><br><span style="color: hsl(120, 100%, 40%);">+contact=sip:user2@127.0.0.1:5062</span><br><span style="color: hsl(120, 100%, 40%);">+</span><br><span style="color: hsl(120, 100%, 40%);">+[user2]</span><br><span style="color: hsl(120, 100%, 40%);">+type=endpoint</span><br><span style="color: hsl(120, 100%, 40%);">+context=default</span><br><span style="color: hsl(120, 100%, 40%);">+aors=user2-aors</span><br><span style="color: hsl(120, 100%, 40%);">+direct_media=no</span><br><span style="color: hsl(120, 100%, 40%);">+disallow=all</span><br><span style="color: hsl(120, 100%, 40%);">+allow=ulaw</span><br><span>diff --git a/tests/channels/pjsip/history_info/no_diversion_response_181/sipp/user1.xml b/tests/channels/pjsip/history_info/no_diversion_response_181/sipp/user1.xml</span><br><span>new file mode 100644</span><br><span>index 0000000..55cb5e1</span><br><span>--- /dev/null</span><br><span>+++ b/tests/channels/pjsip/history_info/no_diversion_response_181/sipp/user1.xml</span><br><span>@@ -0,0 +1,76 @@</span><br><span style="color: hsl(120, 100%, 40%);">+<?xml version="1.0" encoding="ISO-8859-1" ?></span><br><span style="color: hsl(120, 100%, 40%);">+</span><br><span style="color: hsl(120, 100%, 40%);">+<scenario name="send an invite to user2"></span><br><span style="color: hsl(120, 100%, 40%);">+ <send retrans="500"></span><br><span style="color: hsl(120, 100%, 40%);">+ <![CDATA[</span><br><span style="color: hsl(120, 100%, 40%);">+ INVITE sip:user2@[remote_ip]:[remote_port] SIP/2.0</span><br><span style="color: hsl(120, 100%, 40%);">+ Via: SIP/2.0/[transport] [local_ip]:[local_port];branch=[branch]</span><br><span style="color: hsl(120, 100%, 40%);">+ From: user1 <sip:user1@[local_ip]:[local_port]>;tag=[call_number]</span><br><span style="color: hsl(120, 100%, 40%);">+ To: user2 <sip:user2@[remote_ip]:[remote_port]></span><br><span style="color: hsl(120, 100%, 40%);">+ Call-ID: [call_id]</span><br><span style="color: hsl(120, 100%, 40%);">+ CSeq: [cseq] INVITE</span><br><span style="color: hsl(120, 100%, 40%);">+ Contact: sip:user1@[local_ip]:[local_port]</span><br><span style="color: hsl(120, 100%, 40%);">+ Max-Forwards: 70</span><br><span style="color: hsl(120, 100%, 40%);">+ Content-Type: application/sdp</span><br><span style="color: hsl(120, 100%, 40%);">+ Content-Length: [len]</span><br><span style="color: hsl(120, 100%, 40%);">+</span><br><span style="color: hsl(120, 100%, 40%);">+ v=0</span><br><span style="color: hsl(120, 100%, 40%);">+ o=- 1324901698 1324901698 IN IP[local_ip_type] [local_ip]</span><br><span style="color: hsl(120, 100%, 40%);">+ s=-</span><br><span style="color: hsl(120, 100%, 40%);">+ c=IN IP[media_ip_type] [media_ip]</span><br><span style="color: hsl(120, 100%, 40%);">+ t=0 0</span><br><span style="color: hsl(120, 100%, 40%);">+ m=audio [media_port] RTP/AVP 0 101</span><br><span style="color: hsl(120, 100%, 40%);">+ a=sendrecv</span><br><span style="color: hsl(120, 100%, 40%);">+ a=rtpmap:0 PCMU/8000</span><br><span style="color: hsl(120, 100%, 40%);">+ a=rtpmap:101 telephone-event/8000</span><br><span style="color: hsl(120, 100%, 40%);">+</span><br><span style="color: hsl(120, 100%, 40%);">+ ]]></span><br><span style="color: hsl(120, 100%, 40%);">+ </send></span><br><span style="color: hsl(120, 100%, 40%);">+</span><br><span style="color: hsl(120, 100%, 40%);">+ <recv response="100" optional="true" /></span><br><span style="color: hsl(120, 100%, 40%);">+</span><br><span style="color: hsl(120, 100%, 40%);">+ <recv response="181"></span><br><span style="color: hsl(120, 100%, 40%);">+ <action></span><br><span style="color: hsl(120, 100%, 40%);">+ <!-- Check that the Diversion header is present and contains the correct name. --></span><br><span style="color: hsl(120, 100%, 40%);">+ <ereg regexp="user2" search_in="hdr" header="History-Info:" occurence="1" check_it="true" assign_to="1" /></span><br><span style="color: hsl(120, 100%, 40%);">+ <log message="Received 181 with History-Info header: [$1]." /></span><br><span style="color: hsl(120, 100%, 40%);">+ <ereg regexp=".+" search_in="hdr" header="History-Info:" occurence="2" check_it_inverse="true" assign_to="2" /></span><br><span style="color: hsl(120, 100%, 40%);">+ <log message="Received 181 with History-Info header: [$2]." /></span><br><span style="color: hsl(120, 100%, 40%);">+ </action></span><br><span style="color: hsl(120, 100%, 40%);">+ </recv></span><br><span style="color: hsl(120, 100%, 40%);">+</span><br><span style="color: hsl(120, 100%, 40%);">+ <recv response="180" optional="true" /></span><br><span style="color: hsl(120, 100%, 40%);">+</span><br><span style="color: hsl(120, 100%, 40%);">+ <recv response="183" optional="true" /></span><br><span style="color: hsl(120, 100%, 40%);">+</span><br><span style="color: hsl(120, 100%, 40%);">+ <recv response="200" /></span><br><span style="color: hsl(120, 100%, 40%);">+</span><br><span style="color: hsl(120, 100%, 40%);">+ <send></span><br><span style="color: hsl(120, 100%, 40%);">+ <![CDATA[</span><br><span style="color: hsl(120, 100%, 40%);">+ ACK sip:user3@[remote_ip]:[remote_port] SIP/2.0</span><br><span style="color: hsl(120, 100%, 40%);">+ Via: SIP/2.0/[transport] [local_ip]:[local_port];branch=[branch]</span><br><span style="color: hsl(120, 100%, 40%);">+ From: <sip:user1@[local_ip]>;tag=[call_number]</span><br><span style="color: hsl(120, 100%, 40%);">+ To: <sip:user3@[remote_ip]:[remote_port]>[peer_tag_param]</span><br><span style="color: hsl(120, 100%, 40%);">+ CSeq: [cseq] ACK</span><br><span style="color: hsl(120, 100%, 40%);">+ Call-ID: [call_id]</span><br><span style="color: hsl(120, 100%, 40%);">+ Max-Forwards: 70</span><br><span style="color: hsl(120, 100%, 40%);">+ Content-Length: 0</span><br><span style="color: hsl(120, 100%, 40%);">+</span><br><span style="color: hsl(120, 100%, 40%);">+ ]]></span><br><span style="color: hsl(120, 100%, 40%);">+ </send></span><br><span style="color: hsl(120, 100%, 40%);">+</span><br><span style="color: hsl(120, 100%, 40%);">+ <send retrans="500"></span><br><span style="color: hsl(120, 100%, 40%);">+ <![CDATA[</span><br><span style="color: hsl(120, 100%, 40%);">+ BYE sip:user3@[remote_ip]:[remote_port] SIP/2.0</span><br><span style="color: hsl(120, 100%, 40%);">+ Via: SIP/2.0/[transport] [local_ip]:[local_port];branch=[branch]</span><br><span style="color: hsl(120, 100%, 40%);">+ From: <sip:user1@[local_ip]>;tag=[call_number]</span><br><span style="color: hsl(120, 100%, 40%);">+ To: <sip:user3@[remote_ip]:[remote_port]>[peer_tag_param]</span><br><span style="color: hsl(120, 100%, 40%);">+ CSeq: [cseq] BYE</span><br><span style="color: hsl(120, 100%, 40%);">+ Call-ID: [call_id]</span><br><span style="color: hsl(120, 100%, 40%);">+ Max-Forwards: 70</span><br><span style="color: hsl(120, 100%, 40%);">+ Content-Length: 0</span><br><span style="color: hsl(120, 100%, 40%);">+ ]]></span><br><span style="color: hsl(120, 100%, 40%);">+ </send></span><br><span style="color: hsl(120, 100%, 40%);">+</span><br><span style="color: hsl(120, 100%, 40%);">+ <recv response="200" crlf="true" /></span><br><span style="color: hsl(120, 100%, 40%);">+</scenario></span><br><span>diff --git a/tests/channels/pjsip/history_info/no_diversion_response_181/sipp/user2.xml b/tests/channels/pjsip/history_info/no_diversion_response_181/sipp/user2.xml</span><br><span>new file mode 100644</span><br><span>index 0000000..64ac1e5</span><br><span>--- /dev/null</span><br><span>+++ b/tests/channels/pjsip/history_info/no_diversion_response_181/sipp/user2.xml</span><br><span>@@ -0,0 +1,44 @@</span><br><span style="color: hsl(120, 100%, 40%);">+<?xml version="1.0" encoding="ISO-8859-1" ?></span><br><span style="color: hsl(120, 100%, 40%);">+</span><br><span style="color: hsl(120, 100%, 40%);">+<scenario name="send forwarding response back with history-info header"></span><br><span style="color: hsl(120, 100%, 40%);">+ <recv request="INVITE" crlf="true" /></span><br><span style="color: hsl(120, 100%, 40%);">+</span><br><span style="color: hsl(120, 100%, 40%);">+ <send></span><br><span style="color: hsl(120, 100%, 40%);">+ <![CDATA[</span><br><span style="color: hsl(120, 100%, 40%);">+ SIP/2.0 181 Redirected</span><br><span style="color: hsl(120, 100%, 40%);">+ [last_Via:]</span><br><span style="color: hsl(120, 100%, 40%);">+ [last_From:]</span><br><span style="color: hsl(120, 100%, 40%);">+ [last_To:];tag=[call_number]</span><br><span style="color: hsl(120, 100%, 40%);">+ [last_Call-ID:]</span><br><span style="color: hsl(120, 100%, 40%);">+ [last_CSeq:]</span><br><span style="color: hsl(120, 100%, 40%);">+ Contact: <sip:user3@[local_ip]></span><br><span style="color: hsl(120, 100%, 40%);">+ Content-Length: 0</span><br><span style="color: hsl(120, 100%, 40%);">+ ]]></span><br><span style="color: hsl(120, 100%, 40%);">+ </send></span><br><span style="color: hsl(120, 100%, 40%);">+ <send retrans="500"></span><br><span style="color: hsl(120, 100%, 40%);">+ <![CDATA[</span><br><span style="color: hsl(120, 100%, 40%);">+ SIP/2.0 200 OK</span><br><span style="color: hsl(120, 100%, 40%);">+ [last_Via:]</span><br><span style="color: hsl(120, 100%, 40%);">+ [last_From:]</span><br><span style="color: hsl(120, 100%, 40%);">+ [last_To:];tag=[call_number]</span><br><span style="color: hsl(120, 100%, 40%);">+ [last_Call-ID:]</span><br><span style="color: hsl(120, 100%, 40%);">+ [last_CSeq:]</span><br><span style="color: hsl(120, 100%, 40%);">+ Contact: <sip:user2@[local_ip]:[local_port];transport=[transport]></span><br><span style="color: hsl(120, 100%, 40%);">+ Content-Type: application/sdp</span><br><span style="color: hsl(120, 100%, 40%);">+ Content-Length: [len]</span><br><span style="color: hsl(120, 100%, 40%);">+</span><br><span style="color: hsl(120, 100%, 40%);">+ v=0</span><br><span style="color: hsl(120, 100%, 40%);">+ o=- 1324901698 1324901698 IN IP[local_ip_type] [local_ip]</span><br><span style="color: hsl(120, 100%, 40%);">+ s=-</span><br><span style="color: hsl(120, 100%, 40%);">+ c=IN IP[media_ip_type] [media_ip]</span><br><span style="color: hsl(120, 100%, 40%);">+ t=0 0</span><br><span style="color: hsl(120, 100%, 40%);">+ m=audio [media_port] RTP/AVP 0 101</span><br><span style="color: hsl(120, 100%, 40%);">+ a=sendrecv</span><br><span style="color: hsl(120, 100%, 40%);">+ a=rtpmap:0 PCMU/8000</span><br><span style="color: hsl(120, 100%, 40%);">+ a=rtpmap:101 telephone-event/8000</span><br><span style="color: hsl(120, 100%, 40%);">+</span><br><span style="color: hsl(120, 100%, 40%);">+ ]]></span><br><span style="color: hsl(120, 100%, 40%);">+ </send></span><br><span style="color: hsl(120, 100%, 40%);">+</span><br><span style="color: hsl(120, 100%, 40%);">+ <recv request="ACK"/></span><br><span style="color: hsl(120, 100%, 40%);">+</scenario></span><br><span>diff --git a/tests/channels/pjsip/history_info/no_diversion_response_181/test-config.yaml b/tests/channels/pjsip/history_info/no_diversion_response_181/test-config.yaml</span><br><span>new file mode 100644</span><br><span>index 0000000..90b24e3</span><br><span>--- /dev/null</span><br><span>+++ b/tests/channels/pjsip/history_info/no_diversion_response_181/test-config.yaml</span><br><span>@@ -0,0 +1,29 @@</span><br><span style="color: hsl(120, 100%, 40%);">+testinfo:</span><br><span style="color: hsl(120, 100%, 40%);">+ summary: 'Test to make sure a 181 response containing no redirection gets</span><br><span style="color: hsl(120, 100%, 40%);">+ propagated as History-Info correctly.'</span><br><span style="color: hsl(120, 100%, 40%);">+</span><br><span style="color: hsl(120, 100%, 40%);">+ description: |</span><br><span style="color: hsl(120, 100%, 40%);">+ 'user1 calls user2 which sends a 181 to indicate redirection.</span><br><span style="color: hsl(120, 100%, 40%);">+ Verify the 181 response coming from user2 contains a history-info header.'</span><br><span style="color: hsl(120, 100%, 40%);">+</span><br><span style="color: hsl(120, 100%, 40%);">+properties:</span><br><span style="color: hsl(120, 100%, 40%);">+ dependencies:</span><br><span style="color: hsl(120, 100%, 40%);">+ - app : 'sipp'</span><br><span style="color: hsl(120, 100%, 40%);">+ - asterisk : 'app_dial'</span><br><span style="color: hsl(120, 100%, 40%);">+ - asterisk : 'res_pjsip'</span><br><span style="color: hsl(120, 100%, 40%);">+ - asterisk : 'res_pjsip_diversion'</span><br><span style="color: hsl(120, 100%, 40%);">+ tags:</span><br><span style="color: hsl(120, 100%, 40%);">+ - pjsip</span><br><span style="color: hsl(120, 100%, 40%);">+</span><br><span style="color: hsl(120, 100%, 40%);">+test-modules:</span><br><span style="color: hsl(120, 100%, 40%);">+ test-object:</span><br><span style="color: hsl(120, 100%, 40%);">+ config-section: test-object-config</span><br><span style="color: hsl(120, 100%, 40%);">+ typename: 'sipp.SIPpTestCase'</span><br><span style="color: hsl(120, 100%, 40%);">+</span><br><span style="color: hsl(120, 100%, 40%);">+test-object-config:</span><br><span style="color: hsl(120, 100%, 40%);">+ memcheck-delay-stop: 7</span><br><span style="color: hsl(120, 100%, 40%);">+ test-iterations:</span><br><span style="color: hsl(120, 100%, 40%);">+ -</span><br><span style="color: hsl(120, 100%, 40%);">+ scenarios:</span><br><span style="color: hsl(120, 100%, 40%);">+ - { 'key-args': { 'scenario':'user2.xml', '-p':'5062' } }</span><br><span style="color: hsl(120, 100%, 40%);">+ - { 'key-args': { 'scenario':'user1.xml', '-p':'5061' } }</span><br><span>diff --git a/tests/channels/pjsip/history_info/tests.yaml b/tests/channels/pjsip/history_info/tests.yaml</span><br><span>new file mode 100644</span><br><span>index 0000000..12cab26</span><br><span>--- /dev/null</span><br><span>+++ b/tests/channels/pjsip/history_info/tests.yaml</span><br><span>@@ -0,0 +1,7 @@</span><br><span style="color: hsl(120, 100%, 40%);">+# Enter tests here in the order they should be considered for execution:</span><br><span style="color: hsl(120, 100%, 40%);">+tests:</span><br><span style="color: hsl(120, 100%, 40%);">+ - test: 'diversion_request'</span><br><span style="color: hsl(120, 100%, 40%);">+ - test: 'history_info_request'</span><br><span style="color: hsl(120, 100%, 40%);">+ - test: 'history_info_response_181'</span><br><span style="color: hsl(120, 100%, 40%);">+ - test: 'diversion_response_181'</span><br><span style="color: hsl(120, 100%, 40%);">+ - test: 'no_diversion_response_181'</span><br><span>diff --git a/tests/channels/pjsip/tests.yaml b/tests/channels/pjsip/tests.yaml</span><br><span>index 057b8ae..919a0f9 100644</span><br><span>--- a/tests/channels/pjsip/tests.yaml</span><br><span>+++ b/tests/channels/pjsip/tests.yaml</span><br><span>@@ -6,6 +6,7 @@</span><br><span> - dir: 'configuration'</span><br><span> - dir: 'dialplan_functions'</span><br><span> - dir: 'diversion'</span><br><span style="color: hsl(120, 100%, 40%);">+ - dir: 'history_info'</span><br><span> - dir: 'headers'</span><br><span> - dir: 'identify'</span><br><span> - dir: 'message'</span><br><span></span><br></pre><p>To view, visit <a href="https://gerrit.asterisk.org/c/testsuite/+/14955">change 14955</a>. To unsubscribe, or for help writing mail filters, visit <a href="https://gerrit.asterisk.org/settings">settings</a>.</p><div itemscope itemtype="http://schema.org/EmailMessage"><div itemscope itemprop="action" itemtype="http://schema.org/ViewAction"><link itemprop="url" href="https://gerrit.asterisk.org/c/testsuite/+/14955"/><meta itemprop="name" content="View Change"/></div></div>
<div style="display:none"> Gerrit-Project: testsuite </div>
<div style="display:none"> Gerrit-Branch: 18 </div>
<div style="display:none"> Gerrit-Change-Id: I287c78b38f48817ea4547e3ab0370d26d2abf2e3 </div>
<div style="display:none"> Gerrit-Change-Number: 14955 </div>
<div style="display:none"> Gerrit-PatchSet: 1 </div>
<div style="display:none"> Gerrit-Owner: Torrey Searle <tsearle@gmail.com> </div>
<div style="display:none"> Gerrit-Reviewer: Friendly Automation </div>
<div style="display:none"> Gerrit-Reviewer: George Joseph <gjoseph@digium.com> </div>
<div style="display:none"> Gerrit-Reviewer: Joshua Colp <jcolp@sangoma.com> </div>
<div style="display:none"> Gerrit-MessageType: merged </div>