[Asterisk-code-review] message_destination_parsing: Add test for contact with user (testsuite[16])

Friendly Automation asteriskteam at digium.com
Wed Jun 16 22:20:27 CDT 2021


Friendly Automation has submitted this change. ( https://gerrit.asterisk.org/c/testsuite/+/16069 )

Change subject: message_destination_parsing: Add test for contact with user
......................................................................

message_destination_parsing: Add test for contact with user

Change-Id: I32f594407abc4c6a71cbae482328697d43f9ca28
---
M tests/channels/pjsip/message/message_destination_parsing/configs/ast1/pjsip.conf
M tests/channels/pjsip/message/message_destination_parsing/test-config.yaml
2 files changed, 15 insertions(+), 3 deletions(-)

Approvals:
  Joshua Colp: Looks good to me, but someone else must approve
  Kevin Harwell: Looks good to me, but someone else must approve
  George Joseph: Looks good to me, approved
  Friendly Automation: Approved for Submit



diff --git a/tests/channels/pjsip/message/message_destination_parsing/configs/ast1/pjsip.conf b/tests/channels/pjsip/message/message_destination_parsing/configs/ast1/pjsip.conf
index 619401c..b0aed0b 100644
--- a/tests/channels/pjsip/message/message_destination_parsing/configs/ast1/pjsip.conf
+++ b/tests/channels/pjsip/message/message_destination_parsing/configs/ast1/pjsip.conf
@@ -36,7 +36,7 @@
 
 [sipp_contact_user]
 type=aor
-contact=sip:someuser at 127.0.0.2:5062
+contact=sip:someuser at 127.0.0.2:5061
 max_contacts=1
 
 [sipp_contact_user]
diff --git a/tests/channels/pjsip/message/message_destination_parsing/test-config.yaml b/tests/channels/pjsip/message/message_destination_parsing/test-config.yaml
index adc4fbc..d36aac8 100644
--- a/tests/channels/pjsip/message/message_destination_parsing/test-config.yaml
+++ b/tests/channels/pjsip/message/message_destination_parsing/test-config.yaml
@@ -35,7 +35,7 @@
              # scenarios end.
                 - { 'key-args': { 'scenario':'message_recv.xml', '-i': '127.0.0.2', '-p':'5060', '-m':'6' },
                     'ordered-args': [ '-bind_local' ] }
-                - { 'key-args': { 'scenario':'message_recv.xml', '-i': '127.0.0.2', '-p':'5061', '-m':'4' },
+                - { 'key-args': { 'scenario':'message_recv.xml', '-i': '127.0.0.2', '-p':'5061', '-m':'5' },
                     'ordered-args': [ '-bind_local' ] }
                 - { 'key-args': { 'scenario':'message_recv.xml', '-i': '127.0.0.2', '-p':'5062', '-m':'5' },
                     'ordered-args': [ '-bind_local' ] }
@@ -235,8 +235,10 @@
             Event: 'TestEvent', State: 'MSG_FROMTO_URI' } }, count: 1 }
 
 
-        # The final test is for the dialstring format
+        # The final tests are for the dialstring format
 
+        # Simple <number>@<endpoint> where the endpoint's contact
+        # doesn't have a user in its URI.
         ami-actions: { action: { To: 'pjsip:PJSIP/8005551212 at sipp',
             Body: 'Test Message', Action: 'MessageSend', ActionID: '12361' } }
     -   ami-events: { conditions: { match: { Endpoint: 'sipp',
@@ -244,3 +246,13 @@
             MdataDestination: '^PJSIP/8005551212 at sipp$',
             Event: 'TestEvent', State: 'MSG_FROMTO_URI' } }, count: 1 }
 
+        # <number>@<endpoint> where the endpoint's contact
+        # has a user and port in its URI.  The existing user should be
+        # replaced by the number specified.
+        ami-actions: { action: { To: 'pjsip:PJSIP/8005551212 at sipp_contact_user',
+            Body: 'Test Message', Action: 'MessageSend', ActionID: '12362' } }
+    -   ami-events: { conditions: { match: { Endpoint: 'sipp_contact_user',
+            RequestURI: 'sip:8005551212 at 127.0.0.2:5061',
+            MdataDestination: '^PJSIP/8005551212 at sipp_contact_user$',
+            Event: 'TestEvent', State: 'MSG_FROMTO_URI' } }, count: 1 }
+

-- 
To view, visit https://gerrit.asterisk.org/c/testsuite/+/16069
To unsubscribe, or for help writing mail filters, visit https://gerrit.asterisk.org/settings

Gerrit-Project: testsuite
Gerrit-Branch: 16
Gerrit-Change-Id: I32f594407abc4c6a71cbae482328697d43f9ca28
Gerrit-Change-Number: 16069
Gerrit-PatchSet: 1
Gerrit-Owner: George Joseph <gjoseph at digium.com>
Gerrit-Reviewer: Friendly Automation
Gerrit-Reviewer: George Joseph <gjoseph at digium.com>
Gerrit-Reviewer: Joshua Colp <jcolp at sangoma.com>
Gerrit-Reviewer: Kevin Harwell <kharwell at digium.com>
Gerrit-MessageType: merged
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.digium.com/pipermail/asterisk-code-review/attachments/20210616/d5091671/attachment-0001.html>


More information about the asterisk-code-review mailing list