[asterisk-commits] kharwell: testsuite/asterisk/trunk r4766 - in /asterisk/trunk/tests/channels/...
SVN commits to the Asterisk project
asterisk-commits at lists.digium.com
Tue Mar 4 09:21:01 CST 2014
Author: kharwell
Date: Tue Mar 4 09:20:58 2014
New Revision: 4766
URL: http://svnview.digium.com/svn/testsuite?view=rev&rev=4766
Log:
res_pjsip_send_to_voicemail: transferring to voicemail for digium phones
Tests the send to voicemail feature module to make sure it appropriately parses
the relevant headers in a REFER and sets the correct channels variables.
Review: https://reviewboard.asterisk.org/r/3246/
Added:
asterisk/trunk/tests/channels/pjsip/refer_send_to_vm/
asterisk/trunk/tests/channels/pjsip/refer_send_to_vm/configs/
asterisk/trunk/tests/channels/pjsip/refer_send_to_vm/configs/ast1/
asterisk/trunk/tests/channels/pjsip/refer_send_to_vm/configs/ast1/extensions.conf (with props)
asterisk/trunk/tests/channels/pjsip/refer_send_to_vm/configs/ast1/pjsip.conf (with props)
asterisk/trunk/tests/channels/pjsip/refer_send_to_vm/sipp/
asterisk/trunk/tests/channels/pjsip/refer_send_to_vm/sipp/invite.xml (with props)
asterisk/trunk/tests/channels/pjsip/refer_send_to_vm/sipp/refer.xml (with props)
asterisk/trunk/tests/channels/pjsip/refer_send_to_vm/test-config.yaml (with props)
Modified:
asterisk/trunk/tests/channels/pjsip/tests.yaml
Added: asterisk/trunk/tests/channels/pjsip/refer_send_to_vm/configs/ast1/extensions.conf
URL: http://svnview.digium.com/svn/testsuite/asterisk/trunk/tests/channels/pjsip/refer_send_to_vm/configs/ast1/extensions.conf?view=auto&rev=4766
==============================================================================
--- asterisk/trunk/tests/channels/pjsip/refer_send_to_vm/configs/ast1/extensions.conf (added)
+++ asterisk/trunk/tests/channels/pjsip/refer_send_to_vm/configs/ast1/extensions.conf Tue Mar 4 09:20:58 2014
@@ -1,0 +1,13 @@
+[general]
+
+[default]
+
+exten => bob,1,Dial(PJSIP/${EXTEN})
+ same => n,Hangup()
+
+exten => carol,1,NoOp()
+ same => n,GotoIf($[${REDIRECTING(reason)} = "send_to_vm" | "${PJSIP_HEADER(read,X-Digium-Call-Feature)}" = "feature_send_to_vm"]?vm:notvm)
+ same => n(vm),UserEvent(Result, Status: passed)
+ same => n,Hangup()
+ same => n(notvm),UserEvent(Result, Status: failed)
+ same => n,Hangup()
Propchange: asterisk/trunk/tests/channels/pjsip/refer_send_to_vm/configs/ast1/extensions.conf
------------------------------------------------------------------------------
svn:eol-style = native
Propchange: asterisk/trunk/tests/channels/pjsip/refer_send_to_vm/configs/ast1/extensions.conf
------------------------------------------------------------------------------
svn:keywords = Author Date Id Rev URL
Propchange: asterisk/trunk/tests/channels/pjsip/refer_send_to_vm/configs/ast1/extensions.conf
------------------------------------------------------------------------------
svn:mime-type = text/plain
Added: asterisk/trunk/tests/channels/pjsip/refer_send_to_vm/configs/ast1/pjsip.conf
URL: http://svnview.digium.com/svn/testsuite/asterisk/trunk/tests/channels/pjsip/refer_send_to_vm/configs/ast1/pjsip.conf?view=auto&rev=4766
==============================================================================
--- asterisk/trunk/tests/channels/pjsip/refer_send_to_vm/configs/ast1/pjsip.conf (added)
+++ asterisk/trunk/tests/channels/pjsip/refer_send_to_vm/configs/ast1/pjsip.conf Tue Mar 4 09:20:58 2014
@@ -1,0 +1,48 @@
+[local]
+type=transport
+protocol=udp
+bind=0.0.0.0
+
+;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
+
+[endpoint_t](!)
+type=endpoint
+transport=local
+context=default
+direct_media=no
+disallow=all
+allow=ulaw
+
+[aor_t](!)
+type=aor
+max_contacts=1
+
+;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
+;;; alice
+;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
+
+[alice](aor_t)
+contact=sip:alice at 127.0.0.1:5061
+
+[alice](endpoint_t)
+aors=alice
+
+;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
+;;; bob
+;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
+
+[bob](aor_t)
+contact=sip:bob at 127.0.0.1:5062
+
+[bob](endpoint_t)
+aors=bob
+
+;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
+;;; carol
+;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
+
+[carol](aor_t)
+contact=sip:carol at 127.0.0.1:5063
+
+[carol](endpoint_t)
+aors=carol
Propchange: asterisk/trunk/tests/channels/pjsip/refer_send_to_vm/configs/ast1/pjsip.conf
------------------------------------------------------------------------------
svn:eol-style = native
Propchange: asterisk/trunk/tests/channels/pjsip/refer_send_to_vm/configs/ast1/pjsip.conf
------------------------------------------------------------------------------
svn:keywords = Author Date Id Rev URL
Propchange: asterisk/trunk/tests/channels/pjsip/refer_send_to_vm/configs/ast1/pjsip.conf
------------------------------------------------------------------------------
svn:mime-type = text/plain
Added: asterisk/trunk/tests/channels/pjsip/refer_send_to_vm/sipp/invite.xml
URL: http://svnview.digium.com/svn/testsuite/asterisk/trunk/tests/channels/pjsip/refer_send_to_vm/sipp/invite.xml?view=auto&rev=4766
==============================================================================
--- asterisk/trunk/tests/channels/pjsip/refer_send_to_vm/sipp/invite.xml (added)
+++ asterisk/trunk/tests/channels/pjsip/refer_send_to_vm/sipp/invite.xml Tue Mar 4 09:20:58 2014
@@ -1,0 +1,69 @@
+<?xml version="1.0" encoding="ISO-8859-1" ?>
+
+<scenario name="Refer with custom header">
+ <send retrans="500">
+ <![CDATA[
+ INVITE sip:bob@[remote_ip]:[remote_port] SIP/2.0
+ Via: SIP/2.0/[transport] [local_ip]:[local_port];branch=[branch]
+ From: alice <sip:alice@[local_ip]:[local_port]>;tag=[call_number]
+ To: bob <sip:bob@[remote_ip]:[remote_port]>
+ Call-ID: [call_id]
+ CSeq: [cseq] INVITE
+ Contact: sip:alice@[local_ip]:[local_port]
+ Max-Forwards: 70
+ Content-Type: application/sdp
+ Content-Length: [len]
+
+ v=0
+ o=- 1324901698 1324901698 IN IP4 [local_ip]
+ s=-
+ c=IN IP4 [local_ip]
+ t=0 0
+ m=audio 2226 RTP/AVP 0 101
+ a=sendrecv
+ a=rtpmap:0 PCMU/8000
+ a=rtpmap:101 telephone-event/8000
+
+ ]]>
+ </send>
+
+ <recv response="100" optional="true" />
+
+ <recv response="180" optional="true" />
+
+ <recv response="200" />
+
+ <send>
+ <![CDATA[
+ ACK sip:bob@[remote_ip]:[remote_port] SIP/2.0
+ Via: SIP/2.0/[transport] [local_ip]:[local_port];branch=[branch]
+ From: alice <sip:alice@[local_ip]>;tag=[call_number]
+ To: bob <sip:bob@[remote_ip]:[remote_port]>[peer_tag_param]
+ CSeq: [cseq] ACK
+ Call-ID: [call_id]
+ Contact: alice <sip:alice@[local_ip]:[local_port]>
+ Allow: INVITE, ACK, MESSAGE, BYE
+ Max-Forwards: 70
+ Content-Length: 0
+
+ ]]>
+ </send>
+
+ <recv request="BYE" crlf="true" />
+
+ <send>
+ <![CDATA[
+ SIP/2.0 200 OK
+ [last_Via:]
+ [last_From:]
+ [last_To:];tag=[call_number]
+ [last_Call-ID:]
+ [last_CSeq:]
+ Contact: <sip:alice@[local_ip]:[local_port];transport=[transport]>
+ Allow: INVITE, ACK, MESSAGE, BYE
+ Content-Type: application/sdp
+ Content-Length: 0
+
+ ]]>
+ </send>
+</scenario>
Propchange: asterisk/trunk/tests/channels/pjsip/refer_send_to_vm/sipp/invite.xml
------------------------------------------------------------------------------
svn:eol-style = native
Propchange: asterisk/trunk/tests/channels/pjsip/refer_send_to_vm/sipp/invite.xml
------------------------------------------------------------------------------
svn:keywords = Author Date Id Rev URL
Propchange: asterisk/trunk/tests/channels/pjsip/refer_send_to_vm/sipp/invite.xml
------------------------------------------------------------------------------
svn:mime-type = text/plain
Added: asterisk/trunk/tests/channels/pjsip/refer_send_to_vm/sipp/refer.xml
URL: http://svnview.digium.com/svn/testsuite/asterisk/trunk/tests/channels/pjsip/refer_send_to_vm/sipp/refer.xml?view=auto&rev=4766
==============================================================================
--- asterisk/trunk/tests/channels/pjsip/refer_send_to_vm/sipp/refer.xml (added)
+++ asterisk/trunk/tests/channels/pjsip/refer_send_to_vm/sipp/refer.xml Tue Mar 4 09:20:58 2014
@@ -1,0 +1,118 @@
+<?xml version="1.0" encoding="ISO-8859-1" ?>
+
+<scenario name="Refer with custom header">
+ <Global variables="remote_tag" />
+ <recv request="INVITE" crlf="true">
+ <!-- Save the from tag. We'll need it when we send our BYE -->
+ <action>
+ <ereg regexp=".*(;tag=.*)"
+ header="From:"
+ search_in="hdr"
+ check_it="true"
+ assign_to="to_hdr,remote_tag"/>
+ </action>
+ </recv>
+ <Reference variables="to_hdr" />
+
+ <send>
+ <![CDATA[
+
+ SIP/2.0 180 Ringing
+ [last_Via:]
+ [last_From:]
+ [last_To:];tag=[pid]SIPpTag01[call_number]
+ [last_Call-ID:]
+ [last_CSeq:]
+ Contact: <sip:[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]SIPpTag01[call_number]
+ [last_Call-ID:]
+ [last_CSeq:]
+ Contact: <sip:[local_ip]:[local_port];transport=[transport]>
+ Content-Type: application/sdp
+ Content-Length: [len]
+
+ v=0
+ o=- 1324901698 1324901698 IN IP4 [local_ip]
+ s=-
+ c=IN IP4 [local_ip]
+ t=0 0
+ m=audio 2226 RTP/AVP 0 101
+ a=sendrecv
+ a=rtpmap:0 PCMU/8000
+ a=rtpmap:101 telephone-event/8000
+ ]]>
+ </send>
+
+ <recv request="ACK" rtd="true" crlf="true" />
+
+ <pause milliseconds="1000"/>
+
+ <send retrans="500">
+ <![CDATA[
+ REFER sip:alice@[remote_ip]:[remote_port] SIP/2.0
+ Via: SIP/2.0/[transport] [local_ip]:[local_port];rport;branch=[branch]
+ From: <sip:bob@[local_ip]:[local_port]>;tag=[pid]SIPpTag01[call_number]
+ To: <sip:alice@[remote_ip]:[remote_port]>[$remote_tag]
+ Call-ID: [call_id]
+ CSeq: [cseq] REFER
+ Contact: <sip:bob@[local_ip]:[local_port]>
+ Max-Forwards: 70
+ Event: refer
+ Expires: 600
+ Supported: replaces, 100rel, timer, norefersub
+ Accept: message/sipfrag;version=2.0
+ Allow-Events: presence, message-summary, refer
+ Refer-To: <sip:carol@[remote_ip]:[remote_port]>
+ Referred-By: <sip:bob@[local_ip]:[local_port]>
+ User-Agent: Digium D40
+ X-Digium-Call-Feature: feature_send_to_vm
+ Diversion: <sip:carol@[local_ip]:[local_port]>;reason="send_to_vm"
+ Content-Length: [len]
+ ]]>
+ </send>
+
+ <recv response="202" />
+
+ <recv request="NOTIFY" crlf="true" />
+
+ <send>
+ <![CDATA[
+
+ SIP/2.0 200 OK
+ [last_Via:]
+ [last_From:]
+ [last_To:]
+ [last_Call-ID:]
+ [last_CSeq:]
+ Contact: <sip:bob@[local_ip]:[local_port];transport=[transport]>
+ Content-Length: 0
+ ]]>
+ </send>
+
+ <recv request="NOTIFY" crlf="true" />
+
+ <send>
+ <![CDATA[
+
+ SIP/2.0 200 OK
+ [last_Via:]
+ [last_From:]
+ [last_To:]
+ [last_Call-ID:]
+ [last_CSeq:]
+ Contact: <sip:bob@[local_ip]:[local_port];transport=[transport]>
+ Content-Length: 0
+ ]]>
+ </send>
+</scenario>
Propchange: asterisk/trunk/tests/channels/pjsip/refer_send_to_vm/sipp/refer.xml
------------------------------------------------------------------------------
svn:eol-style = native
Propchange: asterisk/trunk/tests/channels/pjsip/refer_send_to_vm/sipp/refer.xml
------------------------------------------------------------------------------
svn:keywords = Author Date Id Rev URL
Propchange: asterisk/trunk/tests/channels/pjsip/refer_send_to_vm/sipp/refer.xml
------------------------------------------------------------------------------
svn:mime-type = text/plain
Added: asterisk/trunk/tests/channels/pjsip/refer_send_to_vm/test-config.yaml
URL: http://svnview.digium.com/svn/testsuite/asterisk/trunk/tests/channels/pjsip/refer_send_to_vm/test-config.yaml?view=auto&rev=4766
==============================================================================
--- asterisk/trunk/tests/channels/pjsip/refer_send_to_vm/test-config.yaml (added)
+++ asterisk/trunk/tests/channels/pjsip/refer_send_to_vm/test-config.yaml Tue Mar 4 09:20:58 2014
@@ -1,0 +1,47 @@
+testinfo:
+ summary: 'Test the send to voicemail headers in a refer.'
+ description: |
+ 'When using a Digium phone depending on the configuration it is
+ possible for a REFER to contain a diversion and/or custom header.
+ This tests that the appropriate variables are set on the channel
+ before entering the dialplan when those headers are present in
+ a REFER.'
+
+properties:
+ minversion: '12.2.0'
+ dependencies:
+ - app : 'sipp'
+ - asterisk : 'res_pjsip'
+ - asterisk : 'res_pjsip_refer'
+ - asterisk : 'res_pjsip_send_to_voicemail'
+ tags:
+ - pjsip
+
+test-modules:
+ test-object:
+ config-section: test-object-config
+ typename: 'sipp.SIPpTestCase'
+ modules:
+ -
+ config-section: ami-config
+ typename: 'ami.AMIEventModule'
+
+test-object-config:
+ test-iterations:
+ -
+ scenarios:
+ - { 'key-args': { 'scenario':'refer.xml', '-p':'5062' } }
+ - { 'key-args': { 'scenario':'invite.xml', '-p':'5061' } }
+
+ami-config:
+ -
+ id: '0'
+ type: 'headermatch'
+ count: '1'
+ conditions:
+ match:
+ Event: 'UserEvent'
+ requirements:
+ match:
+ Status: 'passed'
+
Propchange: asterisk/trunk/tests/channels/pjsip/refer_send_to_vm/test-config.yaml
------------------------------------------------------------------------------
svn:eol-style = native
Propchange: asterisk/trunk/tests/channels/pjsip/refer_send_to_vm/test-config.yaml
------------------------------------------------------------------------------
svn:keywords = Author Date Id Rev URL
Propchange: asterisk/trunk/tests/channels/pjsip/refer_send_to_vm/test-config.yaml
------------------------------------------------------------------------------
svn:mime-type = text/plain
Modified: asterisk/trunk/tests/channels/pjsip/tests.yaml
URL: http://svnview.digium.com/svn/testsuite/asterisk/trunk/tests/channels/pjsip/tests.yaml?view=diff&rev=4766&r1=4765&r2=4766
==============================================================================
--- asterisk/trunk/tests/channels/pjsip/tests.yaml (original)
+++ asterisk/trunk/tests/channels/pjsip/tests.yaml Tue Mar 4 09:20:58 2014
@@ -17,3 +17,4 @@
- test: 'presence_pidf'
- test: 'presence_xpidf'
- test: 'mwi'
+ - test: 'refer_send_to_vm'
More information about the asterisk-commits
mailing list