[svn-commits] kharwell: testsuite/asterisk/trunk r6499 - in /asterisk/trunk/tests/channels/...

SVN commits to the Digium repositories svn-commits at lists.digium.com
Mon Mar 9 11:47:29 CDT 2015


Author: kharwell
Date: Mon Mar  9 11:47:26 2015
New Revision: 6499

URL: http://svnview.digium.com/svn/testsuite?view=rev&rev=6499
Log:
res_pjsip: Allow configuration of endpoint identifier query order

It is possible that two or more endpoint identifiers could match against an
incoming call. This test makes sure that no matter what order the endpoint
identifier modules were loaded priority is given based on the ones specified
in the global 'endpoint_identifier_order' option.

ASTERISK-24840
Reported by: Mark Michelson
Review: https://reviewboard.asterisk.org/r/4456/


Added:
    asterisk/trunk/tests/channels/pjsip/endpoint_identify/
    asterisk/trunk/tests/channels/pjsip/endpoint_identify/configs/
    asterisk/trunk/tests/channels/pjsip/endpoint_identify/configs/ast1/
    asterisk/trunk/tests/channels/pjsip/endpoint_identify/configs/ast1/extensions.conf   (with props)
    asterisk/trunk/tests/channels/pjsip/endpoint_identify/configs/ast1/pjsip.conf   (with props)
    asterisk/trunk/tests/channels/pjsip/endpoint_identify/configs/ast2/
    asterisk/trunk/tests/channels/pjsip/endpoint_identify/configs/ast2/extensions.conf   (with props)
    asterisk/trunk/tests/channels/pjsip/endpoint_identify/configs/ast2/pjsip.conf   (with props)
    asterisk/trunk/tests/channels/pjsip/endpoint_identify/test-config.yaml   (with props)
Modified:
    asterisk/trunk/tests/channels/pjsip/tests.yaml

Added: asterisk/trunk/tests/channels/pjsip/endpoint_identify/configs/ast1/extensions.conf
URL: http://svnview.digium.com/svn/testsuite/asterisk/trunk/tests/channels/pjsip/endpoint_identify/configs/ast1/extensions.conf?view=auto&rev=6499
==============================================================================
--- asterisk/trunk/tests/channels/pjsip/endpoint_identify/configs/ast1/extensions.conf (added)
+++ asterisk/trunk/tests/channels/pjsip/endpoint_identify/configs/ast1/extensions.conf Mon Mar  9 11:47:26 2015
@@ -1,0 +1,2 @@
+[default]
+

Propchange: asterisk/trunk/tests/channels/pjsip/endpoint_identify/configs/ast1/extensions.conf
------------------------------------------------------------------------------
    svn:eol-style = native

Propchange: asterisk/trunk/tests/channels/pjsip/endpoint_identify/configs/ast1/extensions.conf
------------------------------------------------------------------------------
    svn:keywords = Author Date Id Revision

Propchange: asterisk/trunk/tests/channels/pjsip/endpoint_identify/configs/ast1/extensions.conf
------------------------------------------------------------------------------
    svn:mime-type = text/plain

Added: asterisk/trunk/tests/channels/pjsip/endpoint_identify/configs/ast1/pjsip.conf
URL: http://svnview.digium.com/svn/testsuite/asterisk/trunk/tests/channels/pjsip/endpoint_identify/configs/ast1/pjsip.conf?view=auto&rev=6499
==============================================================================
--- asterisk/trunk/tests/channels/pjsip/endpoint_identify/configs/ast1/pjsip.conf (added)
+++ asterisk/trunk/tests/channels/pjsip/endpoint_identify/configs/ast1/pjsip.conf Mon Mar  9 11:47:26 2015
@@ -1,0 +1,33 @@
+[global]
+type=global
+debug=yes
+
+[udp]
+type=transport
+protocol=udp
+bind=127.0.0.1:5060
+
+;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
+
+[endpoint_t](!)
+type=endpoint
+context=default
+transport=udp
+direct_media=no
+disallow=all
+allow=ulaw
+
+[aor_t](!)
+type=aor
+
+;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
+;;; alice
+;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
+
+[alice](aor_t)
+max_contacts=1
+contact=sip:alice at 127.0.0.1:5061
+
+[alice](endpoint_t)
+aors=alice
+from_user=alice

Propchange: asterisk/trunk/tests/channels/pjsip/endpoint_identify/configs/ast1/pjsip.conf
------------------------------------------------------------------------------
    svn:eol-style = native

Propchange: asterisk/trunk/tests/channels/pjsip/endpoint_identify/configs/ast1/pjsip.conf
------------------------------------------------------------------------------
    svn:keywords = Author Date Id Revision

Propchange: asterisk/trunk/tests/channels/pjsip/endpoint_identify/configs/ast1/pjsip.conf
------------------------------------------------------------------------------
    svn:mime-type = text/plain

Added: asterisk/trunk/tests/channels/pjsip/endpoint_identify/configs/ast2/extensions.conf
URL: http://svnview.digium.com/svn/testsuite/asterisk/trunk/tests/channels/pjsip/endpoint_identify/configs/ast2/extensions.conf?view=auto&rev=6499
==============================================================================
--- asterisk/trunk/tests/channels/pjsip/endpoint_identify/configs/ast2/extensions.conf (added)
+++ asterisk/trunk/tests/channels/pjsip/endpoint_identify/configs/ast2/extensions.conf Mon Mar  9 11:47:26 2015
@@ -1,0 +1,9 @@
+[default]
+exten => alice,1,Answer()
+      same => n,UserEvent(Identify, result: fail)
+      same => n,Hangup()
+
+[ast1]
+exten => alice,1,Answer()
+      same => n,UserEvent(Identify, result: pass)
+      same => n,Hangup()

Propchange: asterisk/trunk/tests/channels/pjsip/endpoint_identify/configs/ast2/extensions.conf
------------------------------------------------------------------------------
    svn:eol-style = native

Propchange: asterisk/trunk/tests/channels/pjsip/endpoint_identify/configs/ast2/extensions.conf
------------------------------------------------------------------------------
    svn:keywords = Author Date Id Revision

Propchange: asterisk/trunk/tests/channels/pjsip/endpoint_identify/configs/ast2/extensions.conf
------------------------------------------------------------------------------
    svn:mime-type = text/plain

Added: asterisk/trunk/tests/channels/pjsip/endpoint_identify/configs/ast2/pjsip.conf
URL: http://svnview.digium.com/svn/testsuite/asterisk/trunk/tests/channels/pjsip/endpoint_identify/configs/ast2/pjsip.conf?view=auto&rev=6499
==============================================================================
--- asterisk/trunk/tests/channels/pjsip/endpoint_identify/configs/ast2/pjsip.conf (added)
+++ asterisk/trunk/tests/channels/pjsip/endpoint_identify/configs/ast2/pjsip.conf Mon Mar  9 11:47:26 2015
@@ -1,0 +1,37 @@
+[global]
+type=global
+debug=yes
+endpoint_identifier_order=ip,username
+
+[udp]
+type=transport
+protocol=udp
+bind=127.0.0.1:5061
+
+;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
+
+[endpoint_t](!)
+type=endpoint
+context=default
+transport=udp
+direct_media=no
+disallow=all
+allow=ulaw
+
+[aor]
+type=aor
+
+;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
+
+[ast1](endpoint_t)
+context=ast1
+aors=aor
+
+[ast1]
+type=identify
+endpoint=ast1
+match=127.0.0.1
+
+[alice](endpoint_t)
+aors=aor
+

Propchange: asterisk/trunk/tests/channels/pjsip/endpoint_identify/configs/ast2/pjsip.conf
------------------------------------------------------------------------------
    svn:eol-style = native

Propchange: asterisk/trunk/tests/channels/pjsip/endpoint_identify/configs/ast2/pjsip.conf
------------------------------------------------------------------------------
    svn:keywords = Author Date Id Revision

Propchange: asterisk/trunk/tests/channels/pjsip/endpoint_identify/configs/ast2/pjsip.conf
------------------------------------------------------------------------------
    svn:mime-type = text/plain

Added: asterisk/trunk/tests/channels/pjsip/endpoint_identify/test-config.yaml
URL: http://svnview.digium.com/svn/testsuite/asterisk/trunk/tests/channels/pjsip/endpoint_identify/test-config.yaml?view=auto&rev=6499
==============================================================================
--- asterisk/trunk/tests/channels/pjsip/endpoint_identify/test-config.yaml (added)
+++ asterisk/trunk/tests/channels/pjsip/endpoint_identify/test-config.yaml Mon Mar  9 11:47:26 2015
@@ -1,0 +1,63 @@
+testinfo:
+    summary: 'Test ordering of endpoint identifiers'
+    description: |
+        'It is possible that two or more endpoint identifiers could match
+         against an incoming call. This test makes sure that no matter what
+         order the endpoint identifier modules were loaded priority is given
+         based on the ones specified in the global endpoint_identifier_order
+         option.
+
+         It does this by starting two Asterisk instances. ast1 contains an
+         endpoint alice that calls ast2 that also has an endpoint alice
+         configured. ast2 also has configured an identify section that matches
+         on the localhost. This causes a conflict between the username and
+         ip endpoint identifiers. However, by specifying that the preferred
+         endpoint identifier order is ip,username it can be guaranteed to
+         identify the endpoint by ip and correctly choose the right endpoint.'
+
+test-modules:
+    test-object:
+        config-section: test-object-config
+        typename: 'test_case.TestCaseModule'
+    modules:
+        -
+            config-section: originator-config
+            typename: 'pluggable_modules.Originator'
+        -
+            config-section: hangup-config
+            typename: 'pluggable_modules.HangupMonitor'
+        -
+            config-section: ami-config
+            typename: 'ami.AMIEventModule'
+
+test-object-config:
+    asterisk-instances: 2
+    connect-ami: True
+
+originator-config:
+    trigger: 'ami_connect'
+    channel: 'PJSIP/alice'
+    async: 'True'
+
+hangup-config:
+    ids: '0'
+
+ami-config:
+    -
+        type: 'headermatch'
+        id: '1'
+        conditions:
+            match:
+                Event: 'UserEvent'
+                UserEvent: 'Identify'
+        requirements:
+            match:
+                result: 'pass'
+        count: '1'
+
+properties:
+    minversion: '13.0.0'
+    dependencies:
+        - asterisk : 'res_pjsip'
+    tags:
+        - pjsip

Propchange: asterisk/trunk/tests/channels/pjsip/endpoint_identify/test-config.yaml
------------------------------------------------------------------------------
    svn:eol-style = native

Propchange: asterisk/trunk/tests/channels/pjsip/endpoint_identify/test-config.yaml
------------------------------------------------------------------------------
    svn:keywords = Author Date Id Revision

Propchange: asterisk/trunk/tests/channels/pjsip/endpoint_identify/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=6499&r1=6498&r2=6499
==============================================================================
--- asterisk/trunk/tests/channels/pjsip/tests.yaml (original)
+++ asterisk/trunk/tests/channels/pjsip/tests.yaml Mon Mar  9 11:47:26 2015
@@ -33,3 +33,4 @@
     - test: 'dtmf_incompatible'
     - test: 'user_eq_phone'
     - test: 'keep_alive'
+    - test: 'endpoint_identify'




More information about the svn-commits mailing list