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