[svn-commits] jrose: testsuite/asterisk/trunk r3650 - in /asterisk/trunk/tests/fax: ./ voxf...

SVN commits to the Digium repositories svn-commits at lists.digium.com
Thu Feb 28 12:08:55 CST 2013


Author: jrose
Date: Thu Feb 28 12:08:51 2013
New Revision: 3650

URL: http://svnview.digium.com/svn/testsuite?view=rev&rev=3650
Log:
testuite/fax: A basic T38 test with res_fax and spandsp

This is a test written by Nitesh Bansal and made runnable within the
testsuite by myself which tests some basic fax functionality over T38.
A fax is sent from one Asterisk instance to another with faxsend and
faxreceive applications.

(closes issue ASTERISK-20919)
Reported by: Nitesh Bansal
Patches:
	run-test uploaded by Nitesh Bansal (license 6418) with modifications

Added:
    asterisk/trunk/tests/fax/voxfax_g711/
    asterisk/trunk/tests/fax/voxfax_g711/configs/
    asterisk/trunk/tests/fax/voxfax_g711/configs/ast1/
    asterisk/trunk/tests/fax/voxfax_g711/configs/ast1/extensions.conf   (with props)
    asterisk/trunk/tests/fax/voxfax_g711/configs/ast1/sip.conf   (with props)
    asterisk/trunk/tests/fax/voxfax_g711/configs/ast2/
    asterisk/trunk/tests/fax/voxfax_g711/configs/ast2/extensions.conf   (with props)
    asterisk/trunk/tests/fax/voxfax_g711/configs/ast2/sip.conf   (with props)
    asterisk/trunk/tests/fax/voxfax_g711/run-test   (with props)
    asterisk/trunk/tests/fax/voxfax_g711/send.tiff   (with props)
    asterisk/trunk/tests/fax/voxfax_g711/test-config.yaml   (with props)
Modified:
    asterisk/trunk/tests/fax/tests.yaml

Modified: asterisk/trunk/tests/fax/tests.yaml
URL: http://svnview.digium.com/svn/testsuite/asterisk/trunk/tests/fax/tests.yaml?view=diff&rev=3650&r1=3649&r2=3650
==============================================================================
--- asterisk/trunk/tests/fax/tests.yaml (original)
+++ asterisk/trunk/tests/fax/tests.yaml Thu Feb 28 12:08:51 2013
@@ -15,3 +15,4 @@
     - test: 'gateway_timeout3'
     - test: 'gateway_timeout4'
     - test: 'gateway_timeout5'
+    - test: 'voxfax_g711'

Added: asterisk/trunk/tests/fax/voxfax_g711/configs/ast1/extensions.conf
URL: http://svnview.digium.com/svn/testsuite/asterisk/trunk/tests/fax/voxfax_g711/configs/ast1/extensions.conf?view=auto&rev=3650
==============================================================================
--- asterisk/trunk/tests/fax/voxfax_g711/configs/ast1/extensions.conf (added)
+++ asterisk/trunk/tests/fax/voxfax_g711/configs/ast1/extensions.conf Thu Feb 28 12:08:51 2013
@@ -1,0 +1,2 @@
+[default]
+exten => 1234,1,ReceiveFAX(${ASTDATADIR}/receive.tiff)

Propchange: asterisk/trunk/tests/fax/voxfax_g711/configs/ast1/extensions.conf
------------------------------------------------------------------------------
    svn:eol-style = native

Propchange: asterisk/trunk/tests/fax/voxfax_g711/configs/ast1/extensions.conf
------------------------------------------------------------------------------
    svn:keywords = "Author Date Id Rev URL"

Propchange: asterisk/trunk/tests/fax/voxfax_g711/configs/ast1/extensions.conf
------------------------------------------------------------------------------
    svn:mime-type = text/plain

Added: asterisk/trunk/tests/fax/voxfax_g711/configs/ast1/sip.conf
URL: http://svnview.digium.com/svn/testsuite/asterisk/trunk/tests/fax/voxfax_g711/configs/ast1/sip.conf?view=auto&rev=3650
==============================================================================
--- asterisk/trunk/tests/fax/voxfax_g711/configs/ast1/sip.conf (added)
+++ asterisk/trunk/tests/fax/voxfax_g711/configs/ast1/sip.conf Thu Feb 28 12:08:51 2013
@@ -1,0 +1,15 @@
+[general]
+bindaddr = 127.0.0.1
+sipdebug=yes
+context = default
+
+[ast2-g711]
+type = peer
+context = default
+host = 127.0.0.2
+t38pt_udptl = yes
+disallow = all
+allow = ulaw
+qualify = no
+insecure = invite
+

Propchange: asterisk/trunk/tests/fax/voxfax_g711/configs/ast1/sip.conf
------------------------------------------------------------------------------
    svn:eol-style = native

Propchange: asterisk/trunk/tests/fax/voxfax_g711/configs/ast1/sip.conf
------------------------------------------------------------------------------
    svn:keywords = "Author Date Id Rev URL"

Propchange: asterisk/trunk/tests/fax/voxfax_g711/configs/ast1/sip.conf
------------------------------------------------------------------------------
    svn:mime-type = text/plain

Added: asterisk/trunk/tests/fax/voxfax_g711/configs/ast2/extensions.conf
URL: http://svnview.digium.com/svn/testsuite/asterisk/trunk/tests/fax/voxfax_g711/configs/ast2/extensions.conf?view=auto&rev=3650
==============================================================================
--- asterisk/trunk/tests/fax/voxfax_g711/configs/ast2/extensions.conf (added)
+++ asterisk/trunk/tests/fax/voxfax_g711/configs/ast2/extensions.conf Thu Feb 28 12:08:51 2013
@@ -1,0 +1,8 @@
+[default]
+[sendfax]
+exten => 1234,1,NoOp
+exten => 1234,n,SendFAX(${ASTDATADIR}/send.tiff,d)
+exten => h,1,NoOp
+exten => h,1,Wait(5)
+exten => h,n,UserEvent(FaxFinished,status: ${FAXOPT(status)},statusstr: ${FAXOPT(statusstr)},error: ${FAXOPT(error)})
+

Propchange: asterisk/trunk/tests/fax/voxfax_g711/configs/ast2/extensions.conf
------------------------------------------------------------------------------
    svn:eol-style = native

Propchange: asterisk/trunk/tests/fax/voxfax_g711/configs/ast2/extensions.conf
------------------------------------------------------------------------------
    svn:keywords = "Author Date Id Rev URL"

Propchange: asterisk/trunk/tests/fax/voxfax_g711/configs/ast2/extensions.conf
------------------------------------------------------------------------------
    svn:mime-type = text/plain

Added: asterisk/trunk/tests/fax/voxfax_g711/configs/ast2/sip.conf
URL: http://svnview.digium.com/svn/testsuite/asterisk/trunk/tests/fax/voxfax_g711/configs/ast2/sip.conf?view=auto&rev=3650
==============================================================================
--- asterisk/trunk/tests/fax/voxfax_g711/configs/ast2/sip.conf (added)
+++ asterisk/trunk/tests/fax/voxfax_g711/configs/ast2/sip.conf Thu Feb 28 12:08:51 2013
@@ -1,0 +1,17 @@
+[general]
+bindaddr = 127.0.0.2
+sipdebug=yes
+rtpkeepalive = 1
+t38pt_udptl = yes
+
+[ast1-g711]
+type = peer
+context=sendfax
+host = 127.0.0.1
+port = 5060
+t38pt_udptl = yes
+disallow = all
+allow = ulaw
+qualify = no
+insecure = invite
+

Propchange: asterisk/trunk/tests/fax/voxfax_g711/configs/ast2/sip.conf
------------------------------------------------------------------------------
    svn:eol-style = native

Propchange: asterisk/trunk/tests/fax/voxfax_g711/configs/ast2/sip.conf
------------------------------------------------------------------------------
    svn:keywords = "Author Date Id Rev URL"

Propchange: asterisk/trunk/tests/fax/voxfax_g711/configs/ast2/sip.conf
------------------------------------------------------------------------------
    svn:mime-type = text/plain

Added: asterisk/trunk/tests/fax/voxfax_g711/run-test
URL: http://svnview.digium.com/svn/testsuite/asterisk/trunk/tests/fax/voxfax_g711/run-test?view=auto&rev=3650
==============================================================================
--- asterisk/trunk/tests/fax/voxfax_g711/run-test (added)
+++ asterisk/trunk/tests/fax/voxfax_g711/run-test Thu Feb 28 12:08:51 2013
@@ -1,0 +1,79 @@
+#!/usr/bin/env python
+# vim: sw=3 et:
+'''
+Copyright (C) 2013, Digium, Inc.
+
+Nitesh Bansal
+Matthew Nicholson <mnicholson at digium.com>
+Jonathan Rose <jrose at digium.com>
+
+This program is free software, distributed under the terms of
+the GNU General Public License Version 2.
+'''
+
+import sys
+import logging
+import re
+import os
+import shutil
+
+from twisted.internet import reactor
+sys.path.append("lib/python")
+from asterisk.TestCase import TestCase
+
+logger = logging.getLogger(__name__)
+
+class VoxFaxG711(TestCase):
+
+    def __init__(self):
+        TestCase.__init__(self)
+        self.reactor_timeout = 180
+        self.calling_asterisk = None
+        self.receiving_asterisk = None
+        self.create_asterisk(2)
+
+        # copy the tiff file we are going to send to a good known location
+        shutil.copy("%s/send.tiff" % (os.path.dirname(os.path.realpath(__file__)),), "%s%s" % (self.ast[1].base, self.ast[1].directories['astdatadir']))
+
+    def ami_connect(self, ami):
+        if ami.id == 0:
+            logger.info("Asterisk 1 fully started")
+            self.receiving_asterisk = ami
+
+        if ami.id == 1:
+            logger.info("Asterisk 2 fully started")
+            self.calling_asterisk = ami
+
+        if (self.calling_asterisk is not None and self.receiving_asterisk is not None):
+            #Both the asterisk have booted, setup the call
+            self.calling_asterisk.registerEvent('UserEvent', self.fax_result)
+            df = self.calling_asterisk.originate(channel = "sip/ast1-g711/1234", context = "sendfax", exten = "1234", priority = "1")
+
+    def fax_result(self, ami, event):
+        if event['userevent'] != 'FaxFinished':
+            return
+
+        logger.info("Status Received %s" % event['status'])
+        logger.info("Status String Received %s" % event['statusstr'])
+        logger.info("Error String Received %s" % event['error'])
+
+        if event['statusstr'] == "OK":
+            self.passed = 1
+
+        self.stop_reactor()
+
+    def run(self):
+        TestCase.run(self)
+        self.create_ami_factory(2)
+
+def main():
+    test = VoxFaxG711()
+    reactor.run()
+    if not test.passed:
+       return 1
+
+    return 0
+
+if __name__ == "__main__":
+    sys.exit(main() or 0)
+

Propchange: asterisk/trunk/tests/fax/voxfax_g711/run-test
------------------------------------------------------------------------------
    svn:eol-style = native

Propchange: asterisk/trunk/tests/fax/voxfax_g711/run-test
------------------------------------------------------------------------------
    svn:executable = *

Propchange: asterisk/trunk/tests/fax/voxfax_g711/run-test
------------------------------------------------------------------------------
    svn:keywords = Author Date Id Revision

Propchange: asterisk/trunk/tests/fax/voxfax_g711/run-test
------------------------------------------------------------------------------
    svn:mime-type = text/plain

Added: asterisk/trunk/tests/fax/voxfax_g711/send.tiff
URL: http://svnview.digium.com/svn/testsuite/asterisk/trunk/tests/fax/voxfax_g711/send.tiff?view=auto&rev=3650
==============================================================================
Binary file - no diff available.

Propchange: asterisk/trunk/tests/fax/voxfax_g711/send.tiff
------------------------------------------------------------------------------
    svn:mime-type = image/tiff

Added: asterisk/trunk/tests/fax/voxfax_g711/test-config.yaml
URL: http://svnview.digium.com/svn/testsuite/asterisk/trunk/tests/fax/voxfax_g711/test-config.yaml?view=auto&rev=3650
==============================================================================
--- asterisk/trunk/tests/fax/voxfax_g711/test-config.yaml (added)
+++ asterisk/trunk/tests/fax/voxfax_g711/test-config.yaml Thu Feb 28 12:08:51 2013
@@ -1,0 +1,14 @@
+testinfo:
+    summary:     'Test hangup handler subroutines (endbeforehexten=no)'
+    description: |
+        'When a call is terminated, the user has the option of running an h exten
+        and/or hangup handler dialplan subroutines.  This test verifies that the
+        expected dialplan hangup locations are executed.
+        Tests run with endbeforehexten=no'
+
+properties:
+    minversion: '11.0.0'
+    dependencies:
+        - asterisk: 'app_dial'
+    tags:
+        - hangup

Propchange: asterisk/trunk/tests/fax/voxfax_g711/test-config.yaml
------------------------------------------------------------------------------
    svn:eol-style = native

Propchange: asterisk/trunk/tests/fax/voxfax_g711/test-config.yaml
------------------------------------------------------------------------------
    svn:keywords = "Author Date Id Rev URL"

Propchange: asterisk/trunk/tests/fax/voxfax_g711/test-config.yaml
------------------------------------------------------------------------------
    svn:mime-type = text/plain




More information about the svn-commits mailing list