<p>Richard Mudgett has uploaded this change for <strong>review</strong>.</p><p><a href="https://gerrit.asterisk.org/7514">View Change</a></p><pre style="font-family: monospace,monospace; white-space: pre-wrap;">channels/pjsip/dialplan_functions/pjsip_channel2: Add request-uri/dnid test.<br><br>Test PJSIP channel for CALLERID(dnid) and CHANNEL(pjsip,request_uri)<br><br>ASTERISK-27478<br><br>Change-Id: Ic3b98ceb212f5310a616d6bf373eac32adb1a395<br>---<br>A tests/channels/pjsip/dialplan_functions/pjsip_channel2/configs/ast1/extensions.conf<br>A tests/channels/pjsip/dialplan_functions/pjsip_channel2/configs/ast1/pjsip.conf<br>A tests/channels/pjsip/dialplan_functions/pjsip_channel2/sipp/incoming.xml<br>A tests/channels/pjsip/dialplan_functions/pjsip_channel2/test-config.yaml<br>M tests/channels/pjsip/dialplan_functions/tests.yaml<br>5 files changed, 186 insertions(+), 6 deletions(-)<br><br></pre><pre style="font-family: monospace,monospace; white-space: pre-wrap;">git pull ssh://gerrit.asterisk.org:29418/testsuite refs/changes/14/7514/1</pre><pre style="font-family: monospace,monospace; white-space: pre-wrap;">diff --git a/tests/channels/pjsip/dialplan_functions/pjsip_channel2/configs/ast1/extensions.conf b/tests/channels/pjsip/dialplan_functions/pjsip_channel2/configs/ast1/extensions.conf<br>new file mode 100644<br>index 0000000..9a96461<br>--- /dev/null<br>+++ b/tests/channels/pjsip/dialplan_functions/pjsip_channel2/configs/ast1/extensions.conf<br>@@ -0,0 +1,28 @@<br>+[globals]<br>+ruri_user = 1234<br>+ruri_full = sip:${ruri_user}@127.0.0.1:5060\;transport=UDP\;lr<br>+<br>+[default]<br>+exten = _XXXX,1,NoOp()<br>+same = n,NoOp(EXTEN is "${EXTEN}")<br>+same = n,NoOp(CALLERID(dnid) is "${CALLERID(dnid)}")<br>+same = n,NoOp(CHANNEL(pjsip,request_uri) is "${CHANNEL(pjsip,request_uri)}")<br>+<br>+same = n,Answer()<br>+<br>+same = n(exten),NoOp()<br>+same = n,GotoIf($["${ruri_user}"="${EXTEN}"]?dnid)<br>+same = n,UserEvent(Failure,Result:EXTEN is "${EXTEN}" expected "${ruri_user}")<br>+<br>+same = n(dnid),NoOp()<br>+same = n,GotoIf($["${ruri_user}"="${CALLERID(dnid)}"]?ruri)<br>+same = n,UserEvent(Failure,Result:CALLERID(dnid) is "${CALLERID(dnid)}" expected "${ruri_user}")<br>+<br>+same = n(ruri),NoOp()<br>+same = n,GotoIf($["${ruri_full}"="${CHANNEL(pjsip,request_uri)}"]?done)<br>+same = n,UserEvent(Failure,Result:CHANNEL(pjsip,request_uri) is "${CHANNEL(pjsip,request_uri)}" expected "${ruri_full}")<br>+<br>+same = n(done),NoOp()<br>+same = n,UserEvent(Done)<br>+same = n,Hangup()<br>+<br>diff --git a/tests/channels/pjsip/dialplan_functions/pjsip_channel2/configs/ast1/pjsip.conf b/tests/channels/pjsip/dialplan_functions/pjsip_channel2/configs/ast1/pjsip.conf<br>new file mode 100644<br>index 0000000..30b28ed<br>--- /dev/null<br>+++ b/tests/channels/pjsip/dialplan_functions/pjsip_channel2/configs/ast1/pjsip.conf<br>@@ -0,0 +1,9 @@<br>+[transport-udp]<br>+type = transport<br>+protocol = udp<br>+bind = 0.0.0.0<br>+<br>+[alice]<br>+type = endpoint<br>+context = default<br>+allow = !all,ulaw<br>diff --git a/tests/channels/pjsip/dialplan_functions/pjsip_channel2/sipp/incoming.xml b/tests/channels/pjsip/dialplan_functions/pjsip_channel2/sipp/incoming.xml<br>new file mode 100644<br>index 0000000..671741f<br>--- /dev/null<br>+++ b/tests/channels/pjsip/dialplan_functions/pjsip_channel2/sipp/incoming.xml<br>@@ -0,0 +1,80 @@<br>+<?xml version="1.0" encoding="ISO-8859-1" ?><br>+<!DOCTYPE scenario SYSTEM "sipp.dtd"><br>+<br>+<scenario name="INVITE with different Request-URI and To URI's"><br>+   <send retrans="500"><br>+         <![CDATA[<br>+                 INVITE sip:1234@[remote_ip]:[remote_port];transport=[transport];lr SIP/2.0<br>+                   Via: SIP/2.0/[transport] [local_ip]:[local_port];branch=[branch]<br>+                     From: [service] <sip:[service]@[local_ip]:[local_port]>;tag=[call_number]<br>+                      To: test <sip:4321@[remote_ip]:[remote_port]><br>+                  Call-ID: [call_id]<br>+                   CSeq: 1 INVITE<br>+                       Contact: <sip:[service]@[local_ip]:[local_port];transport=[transport]><br>+                 Max-Forwards: 70<br>+                     Subject: Test<br>+                        User-Agent: Test<br>+                     Content-Type: application/sdp<br>+                        Content-Length: [len]<br>+<br>+                     v=0<br>+                  o=phoneA 53655765 2353687637 IN IP[local_ip_type] [local_ip]<br>+                 s=-<br>+                  c=IN IP[media_ip_type] [media_ip]<br>+                    t=0 0<br>+                        m=audio 6000 RTP/AVP 0<br>+                       a=rtpmap:0 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="183" optional="true"><br>+      </recv><br>+<br>+     <recv response="200" rtd="true"><br>+   </recv><br>+<br>+     <send><br>+         <![CDATA[<br>+                 ACK sip:1234@[remote_ip]:[remote_port];transport=[transport];lr SIP/2.0<br>+                      Via: SIP/2.0/[transport] [local_ip]:[local_port];branch=[branch]<br>+                     From: [service] <sip:[service]@[local_ip]:[local_port]>;tag=[call_number]<br>+                      To: test <sip:4321@[remote_ip]:[remote_port]>[peer_tag_param]<br>+                  Call-ID: [call_id]<br>+                   CSeq: 1 ACK<br>+                  Contact: <sip:[service]@[local_ip]:[local_port];transport=[transport]><br>+                 Max-Forwards: 70<br>+                     Subject: Test<br>+                        Content-Length: 0<br>+            ]]><br>+       </send><br>+<br>+     <recv request="BYE"><br>+ </recv><br>+<br>+     <send><br>+         <![CDATA[<br>+                 SIP/2.0 200 OK<br>+                       [last_Via:]<br>+                  [last_From:]<br>+                 [last_To:]<br>+                   [last_Call-ID:]<br>+                      [last_CSeq:]<br>+                 Contact: <sip:[service]@[local_ip]:[local_port];transport=[transport]><br>+                 Content-Length: 0<br>+            ]]><br>+       </send><br>+<br>+     <!-- definition of the response time repartition table (unit is ms)   --><br>+      <ResponseTimeRepartition value="10, 20, 30, 40, 50, 100, 150, 200"/><br>+<br>+      <!-- definition of the call length repartition table (unit is ms)     --><br>+      <CallLengthRepartition value="10, 50, 100, 500, 1000, 5000, 10000"/><br>+<br>+</scenario><br>+<br>diff --git a/tests/channels/pjsip/dialplan_functions/pjsip_channel2/test-config.yaml b/tests/channels/pjsip/dialplan_functions/pjsip_channel2/test-config.yaml<br>new file mode 100644<br>index 0000000..bc1a537<br>--- /dev/null<br>+++ b/tests/channels/pjsip/dialplan_functions/pjsip_channel2/test-config.yaml<br>@@ -0,0 +1,62 @@<br>+testinfo:<br>+    summary:    'Test PJSIP channel for CALLERID(dnid) and CHANNEL(pjsip,request_uri)'<br>+    description: |<br>+        'Run a SIPp scenario that places a call from endpoint alice to check<br>+        that the CALLERID(dnid) and CHANNEL(pjsip,request_uri) are set to<br>+        expected values.'<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: 'ami.AMIEventModule'<br>+<br>+test-object-config:<br>+    test-iterations:<br>+        -<br>+            scenarios:<br>+                - { 'key-args': {'scenario': 'incoming.xml', '-i': '127.0.0.1', '-p': '5061', '-s': 'alice'} }<br>+<br>+ami-config:<br>+    -<br>+        type: 'headermatch'<br>+        id: '0'<br>+        conditions:<br>+            match:<br>+                Event: 'Newchannel'<br>+                Channel: 'PJSIP/alice-.*'<br>+        count: '1'<br>+    -<br>+        type: 'headermatch'<br>+        id: '0'<br>+        conditions:<br>+            match:<br>+                Event: 'UserEvent'<br>+                Channel: 'PJSIP/alice-.*'<br>+                UserEvent: 'Failure'<br>+        count: '0'<br>+    -<br>+        type: 'headermatch'<br>+        id: '0'<br>+        conditions:<br>+            match:<br>+                Event: 'UserEvent'<br>+                Channel: 'PJSIP/alice-.*'<br>+                UserEvent: 'Done'<br>+        count: '1'<br>+<br>+properties:<br>+    minversion: ['13.19.0', '15.2.0']<br>+    dependencies:<br>+        - sipp :<br>+            version : 'v3.0'<br>+        - asterisk : 'app_dial'<br>+        - asterisk : 'app_userevent'<br>+        - asterisk : 'func_callerid'<br>+        - asterisk : 'func_channel'<br>+        - asterisk : 'res_pjsip'<br>+    tags:<br>+        - pjsip<br>diff --git a/tests/channels/pjsip/dialplan_functions/tests.yaml b/tests/channels/pjsip/dialplan_functions/tests.yaml<br>index f653aa8..a2e26a0 100644<br>--- a/tests/channels/pjsip/dialplan_functions/tests.yaml<br>+++ b/tests/channels/pjsip/dialplan_functions/tests.yaml<br>@@ -1,10 +1,11 @@<br> # Enter tests here in the order they should be considered for execution:<br> tests:<br>-    - test: 'pjsip_channel'<br>-    - test: 'pjsip_endpoint'<br>-    - test: 'pjsip_aor'<br>-    - test: 'pjsip_contact'<br>-    - test: 'pjsip_session_refresh'<br>     - test: 'chan_is_avail'<br>-    - test: 'pjsip_header'<br>+    - test: 'pjsip_aor'<br>+    - test: 'pjsip_channel'<br>+    - test: 'pjsip_channel2'<br>+    - test: 'pjsip_contact'<br>     - test: 'pjsip_dtmfmode'<br>+    - test: 'pjsip_endpoint'<br>+    - test: 'pjsip_header'<br>+    - test: 'pjsip_session_refresh'<br></pre><p>To view, visit <a href="https://gerrit.asterisk.org/7514">change 7514</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/7514"/><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: newchange </div>
<div style="display:none"> Gerrit-Change-Id: Ic3b98ceb212f5310a616d6bf373eac32adb1a395 </div>
<div style="display:none"> Gerrit-Change-Number: 7514 </div>
<div style="display:none"> Gerrit-PatchSet: 1 </div>
<div style="display:none"> Gerrit-Owner: Richard Mudgett <rmudgett@digium.com> </div>