[asterisk-commits] mjordan: testsuite/asterisk/trunk r4988 - in /asterisk/trunk/tests/apps: ./ d...

SVN commits to the Asterisk project asterisk-commits at lists.digium.com
Fri Apr 25 12:34:32 CDT 2014


Author: mjordan
Date: Fri Apr 25 12:34:22 2014
New Revision: 4988

URL: http://svnview.digium.com/svn/testsuite?view=rev&rev=4988
Log:
tests/apps/directed_pickup: Add pickup test; restructure existing test

This patch does two things:
(1) It moves the existing directed_pickup test into a sub-directory,
    and makes the directed_pickup test a directory of tests
(2) It adds a test that covers the Pickup application. This test verifies
    three scenarios:
    1. A channel starts to dial an IAX peer. While ringing, another channel
       picks up the first.
    2. A channel starts to dial an IAX peer, and joins a pickup group. While
       ringing, another channel picks up the first from that pickup group.
    3. A channel sets PICKUPMARK equal to a value and starts to dial an IAX
       peer. While ringing, another channel picks up the first using the
       PICKUPMARK method of the Pickup application.

Review: https://reviewboard.asterisk.org/r/3403

ASTERISK-23520 #close
Reported by: Matt Jordan
patches:
  dp_diff uploaded by bford (License 6580)

Added:
    asterisk/trunk/tests/apps/directed_pickup/pickup/
    asterisk/trunk/tests/apps/directed_pickup/pickup/configs/
    asterisk/trunk/tests/apps/directed_pickup/pickup/configs/ast1/
    asterisk/trunk/tests/apps/directed_pickup/pickup/configs/ast1/extensions.conf   (with props)
    asterisk/trunk/tests/apps/directed_pickup/pickup/configs/ast1/iax.conf   (with props)
    asterisk/trunk/tests/apps/directed_pickup/pickup/test-config.yaml   (with props)
    asterisk/trunk/tests/apps/directed_pickup/pickup_chan/
    asterisk/trunk/tests/apps/directed_pickup/pickup_chan/configs/
    asterisk/trunk/tests/apps/directed_pickup/pickup_chan/configs/ast1/
    asterisk/trunk/tests/apps/directed_pickup/pickup_chan/configs/ast1/extensions.conf   (with props)
    asterisk/trunk/tests/apps/directed_pickup/pickup_chan/configs/ast1/iax.conf   (with props)
    asterisk/trunk/tests/apps/directed_pickup/pickup_chan/run-test   (with props)
    asterisk/trunk/tests/apps/directed_pickup/pickup_chan/test-config.yaml   (with props)
    asterisk/trunk/tests/apps/directed_pickup/tests.yaml   (with props)
Removed:
    asterisk/trunk/tests/apps/directed_pickup/run-test
    asterisk/trunk/tests/apps/directed_pickup/test-config.yaml
Modified:
    asterisk/trunk/tests/apps/directed_pickup/configs/ast1/extensions.conf
    asterisk/trunk/tests/apps/directed_pickup/configs/ast1/iax.conf
    asterisk/trunk/tests/apps/tests.yaml

Modified: asterisk/trunk/tests/apps/directed_pickup/configs/ast1/extensions.conf
URL: http://svnview.digium.com/svn/testsuite/asterisk/trunk/tests/apps/directed_pickup/configs/ast1/extensions.conf?view=diff&rev=4988&r1=4987&r2=4988
==============================================================================
--- asterisk/trunk/tests/apps/directed_pickup/configs/ast1/extensions.conf (original)
+++ asterisk/trunk/tests/apps/directed_pickup/configs/ast1/extensions.conf Fri Apr 25 12:34:22 2014
@@ -1,16 +1,0 @@
-[general]
-
-[globals]
-
-[pickuptest]
-exten => 1001,1,NoOp()
-    same => n,Answer()
-    same => n,Dial(IAX2/iax_pickup_b/ringing_exten)
-
-exten => ringing_exten,1,NoOp()
-    same => n,Ringing()
-    same => n,UserEvent(TestStatus,status:RINGING)
-    same => n,Background(tt-monkeys,noanswer)
-
-exten => 1002,1,NoOp()
-    same => n,PickupChan(IAX2/iax_pickup_b)

Modified: asterisk/trunk/tests/apps/directed_pickup/configs/ast1/iax.conf
URL: http://svnview.digium.com/svn/testsuite/asterisk/trunk/tests/apps/directed_pickup/configs/ast1/iax.conf?view=diff&rev=4988&r1=4987&r2=4988
==============================================================================
--- asterisk/trunk/tests/apps/directed_pickup/configs/ast1/iax.conf (original)
+++ asterisk/trunk/tests/apps/directed_pickup/configs/ast1/iax.conf Fri Apr 25 12:34:22 2014
@@ -1,9 +1,0 @@
-[general]
-bindaddr = 127.0.0.1
-disallow = all
-allow = ulaw
-
-[iax_pickup_b]
-type = friend
-host = 127.0.0.1
-context = pickuptest

Added: asterisk/trunk/tests/apps/directed_pickup/pickup/configs/ast1/extensions.conf
URL: http://svnview.digium.com/svn/testsuite/asterisk/trunk/tests/apps/directed_pickup/pickup/configs/ast1/extensions.conf?view=auto&rev=4988
==============================================================================
--- asterisk/trunk/tests/apps/directed_pickup/pickup/configs/ast1/extensions.conf (added)
+++ asterisk/trunk/tests/apps/directed_pickup/pickup/configs/ast1/extensions.conf Fri Apr 25 12:34:22 2014
@@ -1,0 +1,50 @@
+[default]
+
+; ----------------------------------------------------------------------
+; ***Required***
+; ----------------------------------------------------------------------
+
+exten => wait,1,NoOp()
+    same => n,Wait(10000)
+
+exten => hangup,1,NoOp()
+    same => n,Hangup()
+
+; ------------------------------------------------------------
+; Test extensions.
+; ------------------------------------------------------------
+
+exten => iax-one,1,NoOp()
+    same => n,Answer()
+    same => n,Dial(IAX2/iax_pickup/ringing_exten)
+
+exten => iax-two,1,NoOp()
+    same => n,Answer()
+    same => n,Dial(IAX2/iax_pickup/ringing_exten,,b(default^callgroup-handler^1))
+
+exten => iax-three,1,NoOp()
+    same => n,Answer()
+    same => n,Dial(IAX2/iax_pickup/ringing_exten,,b(default^pickupmark-handler^1))
+
+exten => ringing_exten,1,NoOp()
+    same => n,Ringing()
+    same => n,UserEvent(TestStatus,status:RINGING)
+    same => n,Echo()
+
+exten => callgroup-handler,1,NoOp()
+    same => n,Set(CHANNEL(namedcallgroup)=testing)
+    same => n,Return()
+
+exten => pickupmark-handler,1,NoOp()
+    same => n,Set(PICKUPMARK=10)
+    same => n,Return()
+
+exten => pickup-one,1,NoOp()
+    same => n,Pickup(iax-one at default)
+
+exten => pickup-two,1,NoOp()
+    same => n,Set(CHANNEL(namedpickupgroup)=testing)
+    same => n,Pickup()
+
+exten => pickup-three,1,NoOp()
+    same => n,Pickup(10 at PICKUPMARK)

Propchange: asterisk/trunk/tests/apps/directed_pickup/pickup/configs/ast1/extensions.conf
------------------------------------------------------------------------------
    svn:eol-style = native

Propchange: asterisk/trunk/tests/apps/directed_pickup/pickup/configs/ast1/extensions.conf
------------------------------------------------------------------------------
    svn:keywords = Author Date Id Revision

Propchange: asterisk/trunk/tests/apps/directed_pickup/pickup/configs/ast1/extensions.conf
------------------------------------------------------------------------------
    svn:mime-type = text/plain

Added: asterisk/trunk/tests/apps/directed_pickup/pickup/configs/ast1/iax.conf
URL: http://svnview.digium.com/svn/testsuite/asterisk/trunk/tests/apps/directed_pickup/pickup/configs/ast1/iax.conf?view=auto&rev=4988
==============================================================================
--- asterisk/trunk/tests/apps/directed_pickup/pickup/configs/ast1/iax.conf (added)
+++ asterisk/trunk/tests/apps/directed_pickup/pickup/configs/ast1/iax.conf Fri Apr 25 12:34:22 2014
@@ -1,0 +1,9 @@
+[general]
+bindaddr=127.0.0.1
+disallow=all
+allow=ulaw
+
+[iax_pickup]
+type=friend
+host=127.0.0.1
+context=default

Propchange: asterisk/trunk/tests/apps/directed_pickup/pickup/configs/ast1/iax.conf
------------------------------------------------------------------------------
    svn:eol-style = native

Propchange: asterisk/trunk/tests/apps/directed_pickup/pickup/configs/ast1/iax.conf
------------------------------------------------------------------------------
    svn:keywords = Author Date Id Revision

Propchange: asterisk/trunk/tests/apps/directed_pickup/pickup/configs/ast1/iax.conf
------------------------------------------------------------------------------
    svn:mime-type = text/plain

Added: asterisk/trunk/tests/apps/directed_pickup/pickup/test-config.yaml
URL: http://svnview.digium.com/svn/testsuite/asterisk/trunk/tests/apps/directed_pickup/pickup/test-config.yaml?view=auto&rev=4988
==============================================================================
--- asterisk/trunk/tests/apps/directed_pickup/pickup/test-config.yaml (added)
+++ asterisk/trunk/tests/apps/directed_pickup/pickup/test-config.yaml Fri Apr 25 12:34:22 2014
@@ -1,0 +1,250 @@
+testinfo:
+    summary: 'Test different scenarios of channel Pickup'
+    description:
+        This test verifies that the Pickup app works as intended by running through
+        the following scenarios.
+        Scenario one originates a local channel that dials an IAX phone. The call is then
+        picked up by another channel.
+        Scenario two originates a local channel belonging to a specific pickup group
+        and dials an IAX phone. The call is then picked up by another channel that is
+        in the same pickup group.
+        Scenario three originates a local channel with the PICKUPMARK channel variable
+        defined on the outgoing channel. The call is then picked up by another channel
+        that uses the PICKUPMARK to find the channel to pick up.
+
+test-modules:
+    test-object:
+        config-section: test-object-config
+        typename: 'apptest.AppTest'
+
+test-object-config:
+  app: 'Pickup'
+  scenarios:
+    -
+      # Scenario 1
+      # A channel dials an extension that rings constantly. Another channel will then
+      # pickup the specified extension at context.
+      channels:
+        -
+          channel-id: 'IAX-One'
+          channel-name: 'Local/iax-one at default'
+          context: 'default'
+          exten: 'wait'
+          start-on-create: 'True'
+          events:
+            -
+              type: 'headermatch'
+              conditions:
+                match:
+                  Event: 'UserEvent'
+                  UserEvent: 'TestStatus'
+                  Status: 'RINGING'
+              actions:
+                -
+                  action-type: 'set-expected-result'
+                  expected-result: 'IAX-One received UserEvent TestStatus'
+                -
+                  action-type: 'start-call'
+                  channel-id: 'Pickup-One'
+            -
+              type: 'headermatch'
+              conditions:
+                match:
+                  Event: 'BridgeEnter'
+                  BridgeType: 'basic'
+                  Channel: 'Local/iax-one at default-.*'
+              actions:
+                -
+                  action-type: 'set-expected-result'
+                  expected-result: 'IAX-One channel entered bridge'
+        -
+          channel-id: 'Pickup-One'
+          channel-name: 'Local/pickup-one at default'
+          context: 'default'
+          exten: 'wait'
+          events:
+            -
+              type: 'headermatch'
+              conditions:
+                match:
+                  Event: 'Pickup'
+                  Channel: 'Local/pickup-one at default-.*'
+                  TargetExten: 'iax-one'
+              actions:
+                -
+                  action-type: 'set-expected-result'
+                  expected-result: 'IAX-One channel picked up'
+            -
+              type: 'headermatch'
+              conditions:
+                match:
+                  Event: 'BridgeEnter'
+                  BridgeType: 'basic'
+                  Channel: 'Local/pickup-one at default-.*'
+              actions:
+                -
+                  action-type: 'set-expected-result'
+                  expected-result: 'Pickup-One channel entered bridge'
+                -
+                  action-type: 'hangup'
+                  delay: 1
+                -
+                  action-type: 'end-scenario'
+    -
+      # Scenario 2
+      # A channel is set to a namedpickupgroup and dials an extension that rings constantly.
+      # Another channel will then be placed in the same namedpickupgroup and pickup the
+      # ringing channel.
+      channels:
+        -
+          channel-id: 'IAX-Two'
+          channel-name: 'Local/iax-two at default'
+          context: 'default'
+          exten: 'wait'
+          start-on-create: 'True'
+          events:
+            -
+              type: 'headermatch'
+              conditions:
+                match:
+                  Event: 'UserEvent'
+                  UserEvent: 'TestStatus'
+                  Status: 'RINGING'
+              actions:
+                -
+                  action-type: 'set-expected-result'
+                  expected-result: 'IAX-Two received UserEvent TestStatus'
+                -
+                  action-type: 'start-call'
+                  channel-id: 'Pickup-Two'
+            -
+              type: 'headermatch'
+              conditions:
+                match:
+                  Event: 'BridgeEnter'
+                  BridgeType: 'basic'
+                  Channel: 'Local/iax-two at default-.*'
+              actions:
+                -
+                  action-type: 'set-expected-result'
+                  expected-result: 'IAX-Two channel entered bridge'
+        -
+          channel-id: 'Pickup-Two'
+          channel-name: 'Local/pickup-two at default'
+          context: 'default'
+          exten: 'wait'
+          events:
+            -
+              type: 'headermatch'
+              conditions:
+                match:
+                  Event: 'Pickup'
+                  Channel: 'Local/pickup-two at default-.*'
+                  TargetExten: 'iax-two'
+              actions:
+                -
+                  action-type: 'set-expected-result'
+                  expected-result: 'IAX-Two channel picked up'
+            -
+              type: 'headermatch'
+              conditions:
+                match:
+                  Event: 'BridgeEnter'
+                  BridgeType: 'basic'
+                  Channel: 'Local/pickup-two at default-.*'
+              actions:
+                -
+                  action-type: 'set-expected-result'
+                  expected-result: 'Pickup-Two channel entered bridge'
+                -
+                  action-type: 'hangup'
+                  delay: 1
+                -
+                  action-type: 'end-scenario'
+    -
+      # Scenario 3
+      # An outgoing channel sets the channel variable PICKUPMARK to a certain value before the
+      # call. Another channel will then pickup that call using the PICKUPMARK version of
+      # the Pickup application.
+      channels:
+        -
+          channel-id: 'IAX-Three'
+          channel-name: 'Local/iax-three at default'
+          context: 'default'
+          exten: 'wait'
+          start-on-create: 'True'
+          events:
+            -
+              type: 'headermatch'
+              conditions:
+                match:
+                  Event: 'UserEvent'
+                  UserEvent: 'TestStatus'
+                  Status: 'RINGING'
+              actions:
+                -
+                  action-type: 'set-expected-result'
+                  expected-result: 'IAX-Three received UserEvent TestStatus'
+                -
+                  action-type: 'start-call'
+                  channel-id: 'Pickup-Three'
+            -
+              type: 'headermatch'
+              conditions:
+                match:
+                  Event: 'BridgeEnter'
+                  BridgeType: 'basic'
+                  Channel: 'Local/iax-three at default-.*'
+              actions:
+                -
+                  action-type: 'set-expected-result'
+                  expected-result: 'IAX-Three channel entered bridge'
+        -
+          channel-id: 'Pickup-Three'
+          channel-name: 'Local/pickup-three at default'
+          context: 'default'
+          exten: 'wait'
+          events:
+            -
+              type: 'headermatch'
+              conditions:
+                match:
+                  Event: 'Pickup'
+                  Channel: 'Local/pickup-three at default-.*'
+                  TargetExten: 'iax-three'
+              actions:
+                -
+                  action-type: 'set-expected-result'
+                  expected-result: 'IAX-Three channel picked up'
+            -
+              type: 'headermatch'
+              conditions:
+                match:
+                  Event: 'BridgeEnter'
+                  BridgeType: 'basic'
+                  Channel: 'Local/pickup-three at default-.*'
+              actions:
+                -
+                  action-type: 'set-expected-result'
+                  expected-result: 'Pickup-Three channel entered bridge'
+                -
+                  action-type: 'hangup'
+                  delay: 1
+                -
+                  action-type: 'end-scenario'
+
+properties:
+    minversion: '11.0.0'
+    dependencies:
+        - python : 'twisted'
+        - python : 'starpy'
+        - asterisk : 'app_userevent'
+        - asterisk : 'chan_iax2'
+        - asterisk : 'app_directed_pickup'
+        - asterisk : 'app_dial'
+        - asterisk : 'app_echo'
+        - asterisk : 'app_stack'
+        - asterisk : 'func_channel'
+    tags:
+        - iax2
+        - pickup

Propchange: asterisk/trunk/tests/apps/directed_pickup/pickup/test-config.yaml
------------------------------------------------------------------------------
    svn:eol-style = native

Propchange: asterisk/trunk/tests/apps/directed_pickup/pickup/test-config.yaml
------------------------------------------------------------------------------
    svn:keywords = Author Date Id Revision

Propchange: asterisk/trunk/tests/apps/directed_pickup/pickup/test-config.yaml
------------------------------------------------------------------------------
    svn:mime-type = text/plain

Added: asterisk/trunk/tests/apps/directed_pickup/pickup_chan/configs/ast1/extensions.conf
URL: http://svnview.digium.com/svn/testsuite/asterisk/trunk/tests/apps/directed_pickup/pickup_chan/configs/ast1/extensions.conf?view=auto&rev=4988
==============================================================================
--- asterisk/trunk/tests/apps/directed_pickup/pickup_chan/configs/ast1/extensions.conf (added)
+++ asterisk/trunk/tests/apps/directed_pickup/pickup_chan/configs/ast1/extensions.conf Fri Apr 25 12:34:22 2014
@@ -1,0 +1,16 @@
+[general]
+
+[globals]
+
+[pickuptest]
+exten => 1001,1,NoOp()
+    same => n,Answer()
+    same => n,Dial(IAX2/iax_pickup_b/ringing_exten)
+
+exten => ringing_exten,1,NoOp()
+    same => n,Ringing()
+    same => n,UserEvent(TestStatus,status:RINGING)
+    same => n,Echo()
+
+exten => 1002,1,NoOp()
+    same => n,PickupChan(IAX2/iax_pickup_b)

Propchange: asterisk/trunk/tests/apps/directed_pickup/pickup_chan/configs/ast1/extensions.conf
------------------------------------------------------------------------------
    svn:eol-style = native

Propchange: asterisk/trunk/tests/apps/directed_pickup/pickup_chan/configs/ast1/extensions.conf
------------------------------------------------------------------------------
    svn:keywords = Author Date Id Revision

Propchange: asterisk/trunk/tests/apps/directed_pickup/pickup_chan/configs/ast1/extensions.conf
------------------------------------------------------------------------------
    svn:mime-type = text/plain

Added: asterisk/trunk/tests/apps/directed_pickup/pickup_chan/configs/ast1/iax.conf
URL: http://svnview.digium.com/svn/testsuite/asterisk/trunk/tests/apps/directed_pickup/pickup_chan/configs/ast1/iax.conf?view=auto&rev=4988
==============================================================================
--- asterisk/trunk/tests/apps/directed_pickup/pickup_chan/configs/ast1/iax.conf (added)
+++ asterisk/trunk/tests/apps/directed_pickup/pickup_chan/configs/ast1/iax.conf Fri Apr 25 12:34:22 2014
@@ -1,0 +1,9 @@
+[general]
+bindaddr = 127.0.0.1
+disallow = all
+allow = ulaw
+
+[iax_pickup_b]
+type = friend
+host = 127.0.0.1
+context = pickuptest

Propchange: asterisk/trunk/tests/apps/directed_pickup/pickup_chan/configs/ast1/iax.conf
------------------------------------------------------------------------------
    svn:eol-style = native

Propchange: asterisk/trunk/tests/apps/directed_pickup/pickup_chan/configs/ast1/iax.conf
------------------------------------------------------------------------------
    svn:keywords = Author Date Id Revision

Propchange: asterisk/trunk/tests/apps/directed_pickup/pickup_chan/configs/ast1/iax.conf
------------------------------------------------------------------------------
    svn:mime-type = text/plain

Added: asterisk/trunk/tests/apps/directed_pickup/pickup_chan/run-test
URL: http://svnview.digium.com/svn/testsuite/asterisk/trunk/tests/apps/directed_pickup/pickup_chan/run-test?view=auto&rev=4988
==============================================================================
--- asterisk/trunk/tests/apps/directed_pickup/pickup_chan/run-test (added)
+++ asterisk/trunk/tests/apps/directed_pickup/pickup_chan/run-test Fri Apr 25 12:34:22 2014
@@ -1,0 +1,158 @@
+#!/usr/bin/env python
+'''
+Copyright (C) 2010, Digium, Inc.
+David Vossel <dvossel at digium.com>
+
+This program is free software, distributed under the terms of
+the GNU General Public License Version 2.
+'''
+
+import sys
+import os
+import logging
+
+from twisted.internet import reactor
+
+sys.path.append("lib/python")
+from asterisk.asterisk import Asterisk
+from asterisk.version import AsteriskVersion
+from asterisk.test_case import TestCase
+
+LOGGER = logging.getLogger(__name__)
+
+class PickupTest(TestCase):
+
+    def __init__(self):
+        TestCase.__init__(self)
+        self.firstChannel = None
+        self.secondChannel = None
+        self.bridgeCount = 0
+        self.create_asterisk()
+
+        self.bridgingModel12 = False
+        self.bridge = None
+        self.firstChannelBridged = False
+        self.secondChannelBridged = False
+        self.picked_up = False
+
+    def hangup(self, ami):
+        self.stop_reactor()
+
+    def check_test_done(self):
+
+        if self.picked_up and (not self.bridgingModel12 or (self.firstChannelBridged and self.secondChannelBridged)):
+            self.set_passed(True)
+            self.ami[0].hangup(self.firstChannel).addCallback(self.hangup)
+            LOGGER.info("Both first and second channel detected; passing test")
+
+
+    def check_BridgeEnter(self, ami, event):
+        channel = event.get('channel')
+        bridge = event.get('bridgeuniqueid')
+        other_channel = None
+
+        if channel == self.firstChannel:
+            self.firstChannelBridged = True
+            if self.secondChannel:
+                other_channel = self.secondChannel
+        else:
+            if not self.secondChannel:
+                self.secondChannel = channel
+            self.secondChannelBridged = True
+            other_channel = self.firstChannel
+
+        if self.bridge is not None:
+            if bridge != self.bridge:
+                LOGGER.error("Channel: '%s' entered bridge '%s', but was expected to enter the '%s' bridge with '%s'" % (channel, bridge, other_channel, self.bridge))
+                self.set_passed(False)
+        else:
+            self.bridge = bridge
+
+        self.check_test_done()
+
+    def check_Bridge(self, ami, event):
+        if self.bridgeCount != 0:
+            return
+        self.bridgeCount += 1
+
+        channel1 = event.get('channel1')
+        channel2 = event.get('channel2')
+
+        self.check_test_done()
+
+    def check_Pickup(self, ami, event):
+        if not self.secondChannel:
+            self.secondChannel = event.get('channel')
+        elif self.secondChannel != event.get('channel'):
+            LOGGER.error("Channel %s is in Pickup event but is not second channel %s" % (
+                event.get('channel'), self.secondChannel))
+            self.set_passed(False)
+            return
+
+        LOGGER.info("Detected second channel in Pickup: %s" % self.secondChannel)
+        self.picked_up = True
+        if not self.bridgingModel12:
+            self.ami[0].registerEvent('Bridge', self.check_Bridge)
+        self.check_test_done()
+
+    def check_UserEvent(self, ami, event):
+        if event.get("userevent") != "TestStatus":
+            return
+
+        status = event.get('status')
+        if status != 'RINGING':
+            return
+
+        self.ami[0].registerEvent('Pickup', self.check_Pickup)
+
+        if self.bridgingModel12:
+            self.ami[0].registerEvent('BridgeEnter', self.check_BridgeEnter)
+
+        LOGGER.info("Originating Pickup attempt")
+        self.ami[0].originate(
+            channel = "Local/1002 at pickuptest",
+            application = "Echo",
+        ).addErrback(self.handle_originate_failure)
+
+    def check_Dial(self, ami, event):
+        dialstring = event.get('dialstring')
+        if dialstring != 'iax_pickup_b/ringing_exten':
+            return
+        self.firstChannel = event.get('channel')
+        LOGGER.info("Detected first channel %s" % self.firstChannel)
+
+    def ami_connect(self, ami):
+        running_version = AsteriskVersion()
+        post_version = AsteriskVersion("12.0.0")
+        if running_version < post_version:
+            # Pre-Asterisk 12
+            self.ami[0].registerEvent("Dial", self.check_Dial)
+        else:
+            # Asterisk 12+
+            self.bridgingModel12 = True
+            self.ami[0].registerEvent("DialBegin", self.check_Dial)
+        self.ami[0].registerEvent("UserEvent", self.check_UserEvent)
+        LOGGER.info("Originating channel to be picked up")
+        self.ami[0].originate(
+            channel = "IAX2/iax_pickup_b/1001",
+            application = "Echo",
+        ).addErrback(self.handle_originate_failure)
+
+    def run(self):
+        TestCase.run(self)
+        self.create_ami_factory()
+
+
+def main():
+    test = PickupTest()
+    test.start_asterisk()
+    reactor.run()
+    test.stop_asterisk()
+    if test.passed != True:
+        return 1
+    return 0
+
+if __name__ == "__main__":
+    sys.exit(main() or 0)
+
+# vim:sw=4:ts=4:expandtab:textwidth=79

Propchange: asterisk/trunk/tests/apps/directed_pickup/pickup_chan/run-test
------------------------------------------------------------------------------
    svn:eol-style = native

Propchange: asterisk/trunk/tests/apps/directed_pickup/pickup_chan/run-test
------------------------------------------------------------------------------
    svn:executable = *

Propchange: asterisk/trunk/tests/apps/directed_pickup/pickup_chan/run-test
------------------------------------------------------------------------------
    svn:keywords = Author Date Id Revision

Propchange: asterisk/trunk/tests/apps/directed_pickup/pickup_chan/run-test
------------------------------------------------------------------------------
    svn:mime-type = text/plain

Added: asterisk/trunk/tests/apps/directed_pickup/pickup_chan/test-config.yaml
URL: http://svnview.digium.com/svn/testsuite/asterisk/trunk/tests/apps/directed_pickup/pickup_chan/test-config.yaml?view=auto&rev=4988
==============================================================================
--- asterisk/trunk/tests/apps/directed_pickup/pickup_chan/test-config.yaml (added)
+++ asterisk/trunk/tests/apps/directed_pickup/pickup_chan/test-config.yaml Fri Apr 25 12:34:22 2014
@@ -1,0 +1,18 @@
+testinfo:
+    summary:     'Test PickupChan'
+    description: |
+        'This test verifies functionality of the PickupChan app and its options'
+
+properties:
+    minversion: '1.8.0.0'
+    dependencies:
+        - python : 'twisted'
+        - python : 'starpy'
+        - asterisk : 'app_userevent'
+        - asterisk : 'chan_iax2'
+        - asterisk : 'app_dial'
+        - asterisk : 'app_directed_pickup'
+        - asterisk : 'app_echo'
+    tags:
+        - iax2
+        - pickup

Propchange: asterisk/trunk/tests/apps/directed_pickup/pickup_chan/test-config.yaml
------------------------------------------------------------------------------
    svn:eol-style = native

Propchange: asterisk/trunk/tests/apps/directed_pickup/pickup_chan/test-config.yaml
------------------------------------------------------------------------------
    svn:keywords = Author Date Id Revision

Propchange: asterisk/trunk/tests/apps/directed_pickup/pickup_chan/test-config.yaml
------------------------------------------------------------------------------
    svn:mime-type = text/plain

Added: asterisk/trunk/tests/apps/directed_pickup/tests.yaml
URL: http://svnview.digium.com/svn/testsuite/asterisk/trunk/tests/apps/directed_pickup/tests.yaml?view=auto&rev=4988
==============================================================================
--- asterisk/trunk/tests/apps/directed_pickup/tests.yaml (added)
+++ asterisk/trunk/tests/apps/directed_pickup/tests.yaml Fri Apr 25 12:34:22 2014
@@ -1,0 +1,4 @@
+# Enter tests here in the order they should be considered for execution:
+tests:
+    - test: 'pickup_chan'
+    - test: 'pickup'

Propchange: asterisk/trunk/tests/apps/directed_pickup/tests.yaml
------------------------------------------------------------------------------
    svn:eol-style = native

Propchange: asterisk/trunk/tests/apps/directed_pickup/tests.yaml
------------------------------------------------------------------------------
    svn:keywords = Author Date Id Revision

Propchange: asterisk/trunk/tests/apps/directed_pickup/tests.yaml
------------------------------------------------------------------------------
    svn:mime-type = text/plain

Modified: asterisk/trunk/tests/apps/tests.yaml
URL: http://svnview.digium.com/svn/testsuite/asterisk/trunk/tests/apps/tests.yaml?view=diff&rev=4988&r1=4987&r2=4988
==============================================================================
--- asterisk/trunk/tests/apps/tests.yaml (original)
+++ asterisk/trunk/tests/apps/tests.yaml Fri Apr 25 12:34:22 2014
@@ -10,7 +10,7 @@
     - dir: 'page'
     - dir: 'chanspy'
     - dir: 'queues'
-    - test: 'directed_pickup'
+    - dir: 'directed_pickup'
     - test: 'mixmonitor'
     - test: 'mixmonitor_audiohook_inherit'
     - test: 'mixmonitor_func'




More information about the asterisk-commits mailing list