<p>Jenkins2 <strong>merged</strong> this change.</p><p><a href="https://gerrit.asterisk.org/7705">View Change</a></p><div style="white-space:pre-wrap">Approvals:
Kevin Harwell: Looks good to me, but someone else must approve
Corey Farrell: Looks good to me, but someone else must approve
Joshua Colp: Looks good to me, approved
Jenkins2: Approved for Submit
</div><pre style="font-family: monospace,monospace; white-space: pre-wrap;">channels/SIP/ami/sip_notify/call_id: 3PCC patch for AMI "SIPnotify".<br><br>This test is somewhat complicated than other tests in AMI;<br>because the value of "Call-ID" is needed to send "SIPnotify" AMI action.<br><br>ASTERISK-27461<br><br>Change-Id: Idccbf32ed6670a5205ee99bd7413c7fe0804efb1<br>---<br>A tests/channels/SIP/ami/sip_notify/call_id/configs/ast1/extensions.conf<br>A tests/channels/SIP/ami/sip_notify/call_id/configs/ast1/sip.conf<br>A tests/channels/SIP/ami/sip_notify/call_id/sipp/callee.xml<br>A tests/channels/SIP/ami/sip_notify/call_id/sipp/caller.xml<br>A tests/channels/SIP/ami/sip_notify/call_id/test-config.yaml<br>M tests/channels/SIP/ami/sip_notify/tests.yaml<br>6 files changed, 248 insertions(+), 0 deletions(-)<br><br></pre><pre style="font-family: monospace,monospace; white-space: pre-wrap;">diff --git a/tests/channels/SIP/ami/sip_notify/call_id/configs/ast1/extensions.conf b/tests/channels/SIP/ami/sip_notify/call_id/configs/ast1/extensions.conf<br>new file mode 100644<br>index 0000000..106b4ff<br>--- /dev/null<br>+++ b/tests/channels/SIP/ami/sip_notify/call_id/configs/ast1/extensions.conf<br>@@ -0,0 +1,3 @@<br>+[default]<br>+exten => callee,1,Dial(SIP/callee)<br>+<br>diff --git a/tests/channels/SIP/ami/sip_notify/call_id/configs/ast1/sip.conf b/tests/channels/SIP/ami/sip_notify/call_id/configs/ast1/sip.conf<br>new file mode 100644<br>index 0000000..d782b39<br>--- /dev/null<br>+++ b/tests/channels/SIP/ami/sip_notify/call_id/configs/ast1/sip.conf<br>@@ -0,0 +1,21 @@<br>+[general]<br>+udpbindaddr=0.0.0.0:5060<br>+<br>+[caller]<br>+type=friend<br>+host=127.0.0.1<br>+port=5062<br>+directmedia=no<br>+disallow=all<br>+allow=ulaw<br>+context=default<br>+<br>+[callee]<br>+type=friend<br>+host=127.0.0.1<br>+port=5063<br>+directmedia=no<br>+disallow=all<br>+allow=ulaw<br>+context=default<br>+<br>diff --git a/tests/channels/SIP/ami/sip_notify/call_id/sipp/callee.xml b/tests/channels/SIP/ami/sip_notify/call_id/sipp/callee.xml<br>new file mode 100644<br>index 0000000..4e61799<br>--- /dev/null<br>+++ b/tests/channels/SIP/ami/sip_notify/call_id/sipp/callee.xml<br>@@ -0,0 +1,103 @@<br>+<?xml version="1.0" encoding="ISO-8859-1" ?><br>+<!DOCTYPE scenario SYSTEM "sipp.dtd"><br>+<br>+<scenario name="Notify Request with Call-ID"><br>+<br>+ <recv request="INVITE"><br>+ <action><br>+ <ereg regexp=": .*"<br>+ search_in="hdr"<br>+ header="Call-ID"<br>+ check_it="true"<br>+ assign_to="1"/><br>+ <ereg regexp=": .*"<br>+ search_in="hdr"<br>+ header="CSeq"<br>+ check_it="true"<br>+ assign_to="2"/><br>+ <log message="Received INVITE with Call-ID [$1] and CSeq [$2]." /><br>+ </action><br>+ </recv><br>+<br>+ <send><br>+ <![CDATA[<br>+<br>+ SIP/2.0 180 Ringing<br>+ [last_Via:]<br>+ [last_From:]<br>+ [last_To:];tag=[pid]SIPpTag[call_number]<br>+ Call-ID: [call_id]<br>+ [last_CSeq:]<br>+ Contact: <sip:user1@[local_ip]:[local_port];transport=[transport]><br>+ Content-Length: 0<br>+ ]]><br>+ </send><br>+<br>+ <recv request="NOTIFY"><br>+ <action><br>+ <ereg regexp=": .*$"<br>+ search_in="hdr"<br>+ header="Call-ID"<br>+ check_it="true"<br>+ assign_to="3"/><br>+ <log message="Received NOTIFY with Call-ID [$3]." /><br>+ </action><br>+ </recv><br>+<br>+ <send><br>+ <![CDATA[<br>+<br>+ SIP/2.0 200 OK<br>+ [last_Via:]<br>+ [last_From:]<br>+ [last_To:];tag=[pid]SIPpTag[call_number]<br>+ Call-ID: [call_id]<br>+ [last_CSeq:]<br>+ Contact: <sip:user1@[local_ip]:[local_port];transport=[transport]><br>+ Content-Length: 0<br>+ ]]><br>+ </send><br>+<br>+ <send><br>+ <![CDATA[<br>+<br>+ SIP/2.0 200 OK<br>+ [last_Via:]<br>+ [last_From:]<br>+ [last_To:];tag=[pid]SIPpTag[call_number]<br>+ Call-ID: [call_id]<br>+ CSeq[$2]<br>+ Contact: <sip:user1@[local_ip]:[local_port];transport=[transport]><br>+ Content-Type: application/sdp<br>+ Content-Length: [len]<br>+<br>+ v=0<br>+ o=user2 53655765 2353687637 IN IP[local_ip_type] [local_ip]<br>+ s=-<br>+ c=IN IP[local_ip_type] [local_ip]<br>+ t=0 0<br>+ m=audio 9000 RTP/AVP 8<br>+ a=rtpmap:8 PCMU/8000<br>+ ]]><br>+ </send><br>+<br>+ <recv request="ACK"><br>+ </recv><br>+<br>+ <recv request="BYE"><br>+ </recv><br>+<br>+ <send><br>+ <![CDATA[<br>+<br>+ SIP/2.0 200 OK<br>+ [last_Via:]<br>+ [last_From:]<br>+ [last_To:];tag=[pid]SIPpTag[call_number]<br>+ Call-ID: [call_id]<br>+ [last_CSeq:]<br>+ Contact: <sip:user1@[local_ip]:[local_port];transport=[transport]><br>+ Content-Length: 0<br>+ ]]><br>+ </send><br>+</scenario><br>diff --git a/tests/channels/SIP/ami/sip_notify/call_id/sipp/caller.xml b/tests/channels/SIP/ami/sip_notify/call_id/sipp/caller.xml<br>new file mode 100644<br>index 0000000..1ffa500<br>--- /dev/null<br>+++ b/tests/channels/SIP/ami/sip_notify/call_id/sipp/caller.xml<br>@@ -0,0 +1,72 @@<br>+<?xml version="1.0" encoding="ISO-8859-1" ?><br>+<!DOCTYPE scenario SYSTEM "sipp.dtd"><br>+<br>+<scenario name="Notify Request with Call-ID"><br>+<br>+ <send retrans="500"><br>+ <![CDATA[<br>+ INVITE sip:callee@voxbone.com SIP/2.0<br>+ Via: SIP/2.0/[transport] [local_ip]:[local_port];branch=[branch]<br>+ From: caller <sip:caller@voxbone.com>;tag=[call_number]<br>+ To: callee <sip:callee@voxbone.com:[remote_port]><br>+ Call-ID: [call_id]<br>+ CSeq: 1 INVITE<br>+ Contact: sip:sipp@[local_ip]:[local_port]<br>+ Content-Type: application/sdp<br>+ Content-Length: [len]<br>+<br>+ v=0<br>+ o=user1 53655765 2353687637 IN IP[local_ip_type] [local_ip]<br>+ s=-<br>+ c=IN IP[local_ip_type] [local_ip]<br>+ t=0 0<br>+ m=audio 9000 RTP/AVP 8<br>+ a=rtpmap:8 PCMU/8000<br>+ ]]><br>+ </send><br>+<br>+ <recv response="100" optional="true"><br>+ </recv><br>+<br>+ <recv response="180" optional="true"><br>+ </recv><br>+<br>+ <recv response="200"><br>+ <action><br>+ <ereg regexp=";tag=.*"<br>+ search_in="hdr"<br>+ header="To:"<br>+ check_it="true"<br>+ assign_to="1"/><br>+ </action><br>+ </recv><br>+<br>+ <send><br>+ <![CDATA[<br>+ ACK sip:callee@voxbone.com SIP/2.0<br>+ Via: SIP/2.0/[transport] [local_ip]:[local_port];branch=[branch]<br>+ From: caller <sip:caller@voxbone.com>;tag=[call_number]<br>+ To: callee <sip:callee@voxbone.com:[remote_port]>[$1]<br>+ Call-ID: [call_id]<br>+ CSeq: 2 ACK<br>+ Contact: sip:sipp@[local_ip]:[local_port]<br>+ Content-Length: 0<br>+ ]]><br>+ </send><br>+<br>+ <send><br>+ <![CDATA[<br>+ BYE sip:callee@voxbone.com SIP/2.0<br>+ Via: SIP/2.0/[transport] [local_ip]:[local_port];branch=[branch]<br>+ From: caller <sip:caller@voxbone.com>;tag=[call_number]<br>+ To: callee <sip:callee@voxbone.com:[remote_port]>[$1]<br>+ Call-ID: [call_id]<br>+ CSeq: 3 BYE<br>+ Contact: sip:sipp@[local_ip]:[local_port]<br>+ Content-Length: 0<br>+ ]]><br>+ </send><br>+<br>+ <recv response="487"> <!-- no RTP --><br>+ </recv><br>+</scenario><br>diff --git a/tests/channels/SIP/ami/sip_notify/call_id/test-config.yaml b/tests/channels/SIP/ami/sip_notify/call_id/test-config.yaml<br>new file mode 100644<br>index 0000000..4ed7627<br>--- /dev/null<br>+++ b/tests/channels/SIP/ami/sip_notify/call_id/test-config.yaml<br>@@ -0,0 +1,48 @@<br>+info:<br>+ summary: 'Test SIPNotify AMI Action for Call-ID'<br>+ description: |<br>+ This Tests the AMI Action SIPNotify in order to make sure<br>+ that Call-ID header can be specified.<br>+<br>+test-modules:<br>+ test-object:<br>+ config-section: test-object-config<br>+ typename: sipp.SIPpTestCase<br>+ modules:<br>+ -<br>+ config-section: ami-config<br>+ typename: 'pluggable_modules.EventActionModule'<br>+<br>+test-object-config:<br>+ fail-on-any: True<br>+ test-iterations:<br>+ -<br>+ scenarios:<br>+ - { 'key-args': { 'scenario': 'caller.xml', '-i': '127.0.0.1', '-p': '5062', '-trace_msg': '-pause_msg_ign' } }<br>+ - { 'key-args': { 'scenario': 'callee.xml', '-i': '127.0.0.1', '-p': '5063', '-trace_msg': '-pause_msg_ign' } }<br>+<br>+ami-config:<br>+ -<br>+ ami-events:<br>+ type: 'headermatch'<br>+ conditions:<br>+ match:<br>+ Event: 'VarSet'<br>+ Channel: 'SIP/callee-.*'<br>+ Variable: 'SIPCALLID'<br>+ ami-actions:<br>+ action:<br>+ Action: 'SIPnotify'<br>+ Channel: '{channel}'<br>+ Variable: 'Event=talk'<br>+ Call-ID: '{value}'<br>+<br>+properties:<br>+ minversion: [ '13.20.0', '15.3.0' ]<br>+ dependencies:<br>+ - sipp :<br>+ version : 'v3.0'<br>+ - asterisk : 'chan_sip'<br>+ tags:<br>+ - SIP<br>+<br>diff --git a/tests/channels/SIP/ami/sip_notify/tests.yaml b/tests/channels/SIP/ami/sip_notify/tests.yaml<br>index b1a3008..750f6d6 100644<br>--- a/tests/channels/SIP/ami/sip_notify/tests.yaml<br>+++ b/tests/channels/SIP/ami/sip_notify/tests.yaml<br>@@ -2,3 +2,4 @@<br> tests:<br> - test: 'custom_headers'<br> - test: 'content'<br>+ - test: 'call_id'<br></pre><p>To view, visit <a href="https://gerrit.asterisk.org/7705">change 7705</a>. To unsubscribe, 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/7705"/><meta itemprop="name" content="View Change"/></div></div>
<div style="display:none"> Gerrit-Project: testsuite </div>
<div style="display:none"> Gerrit-Branch: master </div>
<div style="display:none"> Gerrit-MessageType: merged </div>
<div style="display:none"> Gerrit-Change-Id: Idccbf32ed6670a5205ee99bd7413c7fe0804efb1 </div>
<div style="display:none"> Gerrit-Change-Number: 7705 </div>
<div style="display:none"> Gerrit-PatchSet: 7 </div>
<div style="display:none"> Gerrit-Owner: Yasuhiko Kamata <yasuhiko.kamata@nxtg.co.jp> </div>
<div style="display:none"> Gerrit-Reviewer: Corey Farrell <git@cfware.com> </div>
<div style="display:none"> Gerrit-Reviewer: Jenkins2 </div>
<div style="display:none"> Gerrit-Reviewer: Joshua Colp <jcolp@digium.com> </div>
<div style="display:none"> Gerrit-Reviewer: Kevin Harwell <kharwell@digium.com> </div>
<div style="display:none"> Gerrit-Reviewer: Richard Mudgett <rmudgett@digium.com> </div>
<div style="display:none"> Gerrit-Reviewer: Yasuhiko Kamata <yasuhiko.kamata@nxtg.co.jp> </div>