[asterisk-commits] pjsip/subscriptions/presence/dialog info xml: Update regex. (testsuite[master])
SVN commits to the Asterisk project
asterisk-commits at lists.digium.com
Tue Apr 12 13:28:08 CDT 2016
Anonymous Coward #1000019 has submitted this change and it was merged.
Change subject: pjsip/subscriptions/presence/dialog_info_xml: Update regex.
......................................................................
pjsip/subscriptions/presence/dialog_info_xml: Update regex.
A change to fix ASTERISK-24601 has added a direction attribute
to the dialog-info+xml content when an extension is ringing.
This change updates the regex to expect it to be present.
ASTERISK-24601
Change-Id: I033e4a562eb9c2d75e7233ca9381b47c3ab78725
---
A tests/channels/pjsip/subscriptions/presence/dialog_info_xml/sipp/subscribe-direction-recipient.xml
M tests/channels/pjsip/subscriptions/presence/dialog_info_xml/test-config.yaml
2 files changed, 153 insertions(+), 2 deletions(-)
Approvals:
Mark Michelson: Looks good to me, approved
Richard Mudgett: Looks good to me, but someone else must approve
Anonymous Coward #1000019: Verified
diff --git a/tests/channels/pjsip/subscriptions/presence/dialog_info_xml/sipp/subscribe-direction-recipient.xml b/tests/channels/pjsip/subscriptions/presence/dialog_info_xml/sipp/subscribe-direction-recipient.xml
new file mode 100644
index 0000000..ccb7597
--- /dev/null
+++ b/tests/channels/pjsip/subscriptions/presence/dialog_info_xml/sipp/subscribe-direction-recipient.xml
@@ -0,0 +1,137 @@
+<?xml version="1.0" encoding="ISO-8859-1" ?>
+<!DOCTYPE scenario SYSTEM "sipp.dtd">
+
+<scenario name="Subscribe">
+ <send retrans="500">
+ <![CDATA[
+ SUBSCRIBE sip:presence@[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=[pid]SIPpTag00[call_number]
+ To: <sip:presence@[remote_ip]:[remote_port]>
+ Call-ID: [call_id]
+ CSeq: 1 SUBSCRIBE
+ Contact: "alice" <sip:alice@[local_ip]:[local_port]>
+ Expires: 3600
+ Max-Forwards: 70
+ Event: dialog
+ Accept: application/dialog-info+xml
+ Content-Length: 0
+
+ ]]>
+ </send>
+
+ <recv response="200" rtd="true" />
+
+ <recv request="NOTIFY" crlf="true">
+ <action>
+ <ereg regexp="<dialog-info xmlns=\"urn:ietf:params:xml:ns:dialog-info\" version=\"0\" state=\"full\" entity=\"sip:presence at 127.0.0.1(:5060)?\">
+ <dialog id=\"presence\">
+ <state>terminated</state>
+ </dialog>
+</dialog-info>" check_it="true" search_in="body" assign_to="body1" />
+ </action>
+ </recv>
+
+ <Reference variables="body1" />
+
+ <send>
+ <![CDATA[
+
+ SIP/2.0 200 OK
+ [last_Via:]
+ [last_From:]
+ [last_To:]
+ [last_Call-ID:]
+ [last_CSeq:]
+ Contact: <sip:[local_ip]:[local_port];transport=[transport]>
+ Content-Length: 0
+
+ ]]>
+ </send>
+
+ <recv request="NOTIFY" crlf="true">
+ <action>
+ <ereg regexp="<dialog-info xmlns=\"urn:ietf:params:xml:ns:dialog-info\" version=\"1\" state=\"full\" entity=\"sip:presence at 127.0.0.1(:5060)?\">
+ <dialog id=\"presence\" direction=\"recipient\">
+ <state>early</state>
+ </dialog>
+</dialog-info>" check_it="true" search_in="body" assign_to="body2" />
+ </action>
+ </recv>
+
+ <Reference variables="body2" />
+
+ <send>
+ <![CDATA[
+
+ SIP/2.0 200 OK
+ [last_Via:]
+ [last_From:]
+ [last_To:]
+ [last_Call-ID:]
+ [last_CSeq:]
+ Contact: <sip:[local_ip]:[local_port];transport=[transport]>
+ Content-Length: 0
+
+ ]]>
+ </send>
+
+ <recv request="NOTIFY" crlf="true">
+ <action>
+ <ereg regexp="<dialog-info xmlns=\"urn:ietf:params:xml:ns:dialog-info\" version=\"2\" state=\"full\" entity=\"sip:presence at 127.0.0.1(:5060)?\">
+ <dialog id=\"presence\">
+ <state>confirmed</state>
+ </dialog>
+</dialog-info>" check_it="true" search_in="body" assign_to="body3" />
+ </action>
+ </recv>
+
+ <Reference variables="body3" />
+
+ <send>
+ <![CDATA[
+
+ SIP/2.0 200 OK
+ [last_Via:]
+ [last_From:]
+ [last_To:]
+ [last_Call-ID:]
+ [last_CSeq:]
+ Contact: <sip:[local_ip]:[local_port];transport=[transport]>
+ Content-Length: 0
+
+ ]]>
+ </send>
+
+ <recv request="NOTIFY" crlf="true">
+ <action>
+ <ereg regexp="<dialog-info xmlns=\"urn:ietf:params:xml:ns:dialog-info\" version=\"3\" state=\"full\" entity=\"sip:presence at 127.0.0.1(:5060)?\">
+ <dialog id=\"presence\">
+ <state>confirmed</state>
+ <local>
+ <target uri=\"sip:presence at 127.0.0.1(:5060)?\">
+ <param pname=\"\+sip.rendering\" pvalue=\"no\" />
+ </target>
+ </local>
+ </dialog>
+</dialog-info>" check_it="true" search_in="body" assign_to="body4" />
+ </action>
+ </recv>
+
+ <Reference variables="body4" />
+
+ <send>
+ <![CDATA[
+
+ SIP/2.0 200 OK
+ [last_Via:]
+ [last_From:]
+ [last_To:]
+ [last_Call-ID:]
+ [last_CSeq:]
+ Contact: <sip:[local_ip]:[local_port];transport=[transport]>
+ Content-Length: 0
+
+ ]]>
+ </send>
+</scenario>
diff --git a/tests/channels/pjsip/subscriptions/presence/dialog_info_xml/test-config.yaml b/tests/channels/pjsip/subscriptions/presence/dialog_info_xml/test-config.yaml
index 30c7627..3f6a922 100644
--- a/tests/channels/pjsip/subscriptions/presence/dialog_info_xml/test-config.yaml
+++ b/tests/channels/pjsip/subscriptions/presence/dialog_info_xml/test-config.yaml
@@ -21,8 +21,14 @@
test-modules:
add-test-to-search-path: 'True'
test-object:
- config-section: sipp-config
- typename: 'sipp.SIPpTestCase'
+ -
+ maxversion: '13.9.0'
+ config-section: sipp-config
+ typename: 'sipp.SIPpTestCase'
+ -
+ minversion: '13.9.0'
+ config-section: sipp-config-v13.9.0
+ typename: 'sipp.SIPpTestCase'
modules:
-
typename: 'dialog_info_xml.DialogInfoXML'
@@ -34,3 +40,11 @@
-
scenarios:
- { 'key-args': {'scenario': 'subscribe.xml', '-p': '5061'} }
+
+sipp-config-v13.9.0:
+ reactor-timeout: 30
+ fail-on-any: True
+ test-iterations:
+ -
+ scenarios:
+ - { 'key-args': {'scenario': 'subscribe-direction-recipient.xml', '-p': '5061'} }
--
To view, visit https://gerrit.asterisk.org/2578
To unsubscribe, visit https://gerrit.asterisk.org/settings
Gerrit-MessageType: merged
Gerrit-Change-Id: I033e4a562eb9c2d75e7233ca9381b47c3ab78725
Gerrit-PatchSet: 2
Gerrit-Project: testsuite
Gerrit-Branch: master
Gerrit-Owner: Joshua Colp <jcolp at digium.com>
Gerrit-Reviewer: Anonymous Coward #1000019
Gerrit-Reviewer: Mark Michelson <mmichelson at digium.com>
Gerrit-Reviewer: Richard Mudgett <rmudgett at digium.com>
More information about the asterisk-commits
mailing list