[asterisk-commits] mmichelson: branch mmichelson/v6tests r528 - in /asterisk/team/mmichelson/v6t...
SVN commits to the Asterisk project
asterisk-commits at lists.digium.com
Wed Jul 21 13:11:56 CDT 2010
Author: mmichelson
Date: Wed Jul 21 13:11:52 2010
New Revision: 528
URL: http://svnview.digium.com/svn/testsuite?view=rev&rev=528
Log:
Adding IPv4 T.38 FAX test.
One thing that's currently missing from the test-config.yaml
is dependency checking for FAX. Test passes in 1.6.2, trunk,
and my udptl-v6 branch.
Added:
asterisk/team/mmichelson/v6tests/tests/udptl/
asterisk/team/mmichelson/v6tests/tests/udptl/1page.tif (with props)
asterisk/team/mmichelson/v6tests/tests/udptl/configs1/
asterisk/team/mmichelson/v6tests/tests/udptl/configs1/logger.conf (with props)
asterisk/team/mmichelson/v6tests/tests/udptl/configs1/manager.conf (with props)
asterisk/team/mmichelson/v6tests/tests/udptl/configs1/sip.conf (with props)
asterisk/team/mmichelson/v6tests/tests/udptl/configs2/
asterisk/team/mmichelson/v6tests/tests/udptl/configs2/extensions.conf (with props)
asterisk/team/mmichelson/v6tests/tests/udptl/configs2/logger.conf (with props)
asterisk/team/mmichelson/v6tests/tests/udptl/configs2/manager.conf (with props)
asterisk/team/mmichelson/v6tests/tests/udptl/configs2/sip.conf (with props)
asterisk/team/mmichelson/v6tests/tests/udptl/run-test (with props)
asterisk/team/mmichelson/v6tests/tests/udptl/test-config.yaml (with props)
Added: asterisk/team/mmichelson/v6tests/tests/udptl/1page.tif
URL: http://svnview.digium.com/svn/testsuite/asterisk/team/mmichelson/v6tests/tests/udptl/1page.tif?view=auto&rev=528
==============================================================================
Binary file - no diff available.
Propchange: asterisk/team/mmichelson/v6tests/tests/udptl/1page.tif
------------------------------------------------------------------------------
svn:keywords = Author Date Id Revision
Propchange: asterisk/team/mmichelson/v6tests/tests/udptl/1page.tif
------------------------------------------------------------------------------
svn:mime-type = application/octet-stream
Added: asterisk/team/mmichelson/v6tests/tests/udptl/configs1/logger.conf
URL: http://svnview.digium.com/svn/testsuite/asterisk/team/mmichelson/v6tests/tests/udptl/configs1/logger.conf?view=auto&rev=528
==============================================================================
--- asterisk/team/mmichelson/v6tests/tests/udptl/configs1/logger.conf (added)
+++ asterisk/team/mmichelson/v6tests/tests/udptl/configs1/logger.conf Wed Jul 21 13:11:52 2010
@@ -1,0 +1,82 @@
+;
+; Logging Configuration
+;
+; In this file, you configure logging to files or to
+; the syslog system.
+;
+; "logger reload" at the CLI will reload configuration
+; of the logging system.
+
+[general]
+; Customize the display of debug message time stamps
+; this example is the ISO 8601 date format (yyyy-mm-dd HH:MM:SS)
+; see strftime(3) Linux manual for format specifiers. Note that
+; there is a millisecond parameter which may also be used in
+; this field. Use %1q for tenths, %2q for hundredths, etc.
+;
+;dateformat=%F %T
+;
+; This appends the hostname to the name of the log files.
+;appendhostname = yes
+;
+; This determines whether or not we log queue events to a file
+; (defaults to yes).
+;queue_log = no
+;
+; Set the queue_log filename
+; (defaults to queue_log)
+;queue_log_name = queue_log
+;
+; Rename the logfiles using a timestamp instead of a
+; sequence number when "logger rotate" is executed
+; (defaults to no).
+;rotatetimestamp = yes
+;
+; This determines whether or not we log generic events to a file
+; (defaults to yes).
+;event_log = no
+;
+;
+; For each file, specify what to log.
+;
+; For console logging, you set options at start of
+; Asterisk with -v for verbose and -d for debug
+; See 'asterisk -h' for more information.
+;
+; Directory for log files is configures in asterisk.conf
+; option astlogdir
+;
+[logfiles]
+;
+; Format is "filename" and then "levels" of debugging to be included:
+; debug
+; notice
+; warning
+; error
+; verbose
+; dtmf
+;
+; Special filename "console" represents the system console
+;
+; We highly recommend that you DO NOT turn on debug mode if you are simply
+; running a production system. Debug mode turns on a LOT of extra messages,
+; most of which you are unlikely to understand without an understanding of
+; the underlying code. Do NOT report debug messages as code issues, unless
+; you have a specific issue that you are attempting to debug. They are
+; messages for just that -- debugging -- and do not rise to the level of
+; something that merit your attention as an Asterisk administrator. Debug
+; messages are also very verbose and can and do fill up logfiles quickly;
+; this is another reason not to have debug mode on a production system unless
+; you are in the process of debugging a specific issue.
+;
+;debug => debug
+;console => notice,warning,error
+console => notice,warning,error,debug
+;console => notice, warning,debug
+messages => notice,warning,error,debug,verbose,fax
+;full => notice,warning,error,debug,verbose
+
+;syslog keyword : This special keyword logs to syslog facility
+;
+;syslog.local0 => notice,warning,error
+;
Propchange: asterisk/team/mmichelson/v6tests/tests/udptl/configs1/logger.conf
------------------------------------------------------------------------------
svn:eol-style = native
Propchange: asterisk/team/mmichelson/v6tests/tests/udptl/configs1/logger.conf
------------------------------------------------------------------------------
svn:keywords = Author Date Id Revision
Propchange: asterisk/team/mmichelson/v6tests/tests/udptl/configs1/logger.conf
------------------------------------------------------------------------------
svn:mime-type = text/plain
Added: asterisk/team/mmichelson/v6tests/tests/udptl/configs1/manager.conf
URL: http://svnview.digium.com/svn/testsuite/asterisk/team/mmichelson/v6tests/tests/udptl/configs1/manager.conf?view=auto&rev=528
==============================================================================
--- asterisk/team/mmichelson/v6tests/tests/udptl/configs1/manager.conf (added)
+++ asterisk/team/mmichelson/v6tests/tests/udptl/configs1/manager.conf Wed Jul 21 13:11:52 2010
@@ -1,0 +1,9 @@
+[general]
+enabled = yes
+port = 5038
+bindaddr = 127.0.0.1
+
+[user]
+secret = mysecret
+read = system,call,log,verbose,agent,user,config,dtmf,reporting,cdr,dialplan
+write = system,call,agent,user,config,command,reporting,originate
Propchange: asterisk/team/mmichelson/v6tests/tests/udptl/configs1/manager.conf
------------------------------------------------------------------------------
svn:eol-style = native
Propchange: asterisk/team/mmichelson/v6tests/tests/udptl/configs1/manager.conf
------------------------------------------------------------------------------
svn:keywords = Author Date Id Revision
Propchange: asterisk/team/mmichelson/v6tests/tests/udptl/configs1/manager.conf
------------------------------------------------------------------------------
svn:mime-type = text/plain
Added: asterisk/team/mmichelson/v6tests/tests/udptl/configs1/sip.conf
URL: http://svnview.digium.com/svn/testsuite/asterisk/team/mmichelson/v6tests/tests/udptl/configs1/sip.conf?view=auto&rev=528
==============================================================================
--- asterisk/team/mmichelson/v6tests/tests/udptl/configs1/sip.conf (added)
+++ asterisk/team/mmichelson/v6tests/tests/udptl/configs1/sip.conf Wed Jul 21 13:11:52 2010
@@ -1,0 +1,11 @@
+[general]
+bindaddr = 0.0.0.0:5060
+t38pt_udptl = yes
+sipdebug = yes
+
+[receiver]
+type = friend
+host = 127.0.0.1
+port = 5061
+insecure = invite
+context = facks
Propchange: asterisk/team/mmichelson/v6tests/tests/udptl/configs1/sip.conf
------------------------------------------------------------------------------
svn:eol-style = native
Propchange: asterisk/team/mmichelson/v6tests/tests/udptl/configs1/sip.conf
------------------------------------------------------------------------------
svn:keywords = Author Date Id Revision
Propchange: asterisk/team/mmichelson/v6tests/tests/udptl/configs1/sip.conf
------------------------------------------------------------------------------
svn:mime-type = text/plain
Added: asterisk/team/mmichelson/v6tests/tests/udptl/configs2/extensions.conf
URL: http://svnview.digium.com/svn/testsuite/asterisk/team/mmichelson/v6tests/tests/udptl/configs2/extensions.conf?view=auto&rev=528
==============================================================================
--- asterisk/team/mmichelson/v6tests/tests/udptl/configs2/extensions.conf (added)
+++ asterisk/team/mmichelson/v6tests/tests/udptl/configs2/extensions.conf Wed Jul 21 13:11:52 2010
@@ -1,0 +1,4 @@
+[facks]
+exten => 666,1,ReceiveFax(recv.tiff)
+
+exten => h,1,UserEvent(recvstatus, status: ${FAXOPT(status)})
Propchange: asterisk/team/mmichelson/v6tests/tests/udptl/configs2/extensions.conf
------------------------------------------------------------------------------
svn:eol-style = native
Propchange: asterisk/team/mmichelson/v6tests/tests/udptl/configs2/extensions.conf
------------------------------------------------------------------------------
svn:keywords = Author Date Id Revision
Propchange: asterisk/team/mmichelson/v6tests/tests/udptl/configs2/extensions.conf
------------------------------------------------------------------------------
svn:mime-type = text/plain
Added: asterisk/team/mmichelson/v6tests/tests/udptl/configs2/logger.conf
URL: http://svnview.digium.com/svn/testsuite/asterisk/team/mmichelson/v6tests/tests/udptl/configs2/logger.conf?view=auto&rev=528
==============================================================================
--- asterisk/team/mmichelson/v6tests/tests/udptl/configs2/logger.conf (added)
+++ asterisk/team/mmichelson/v6tests/tests/udptl/configs2/logger.conf Wed Jul 21 13:11:52 2010
@@ -1,0 +1,82 @@
+;
+; Logging Configuration
+;
+; In this file, you configure logging to files or to
+; the syslog system.
+;
+; "logger reload" at the CLI will reload configuration
+; of the logging system.
+
+[general]
+; Customize the display of debug message time stamps
+; this example is the ISO 8601 date format (yyyy-mm-dd HH:MM:SS)
+; see strftime(3) Linux manual for format specifiers. Note that
+; there is a millisecond parameter which may also be used in
+; this field. Use %1q for tenths, %2q for hundredths, etc.
+;
+;dateformat=%F %T
+;
+; This appends the hostname to the name of the log files.
+;appendhostname = yes
+;
+; This determines whether or not we log queue events to a file
+; (defaults to yes).
+;queue_log = no
+;
+; Set the queue_log filename
+; (defaults to queue_log)
+;queue_log_name = queue_log
+;
+; Rename the logfiles using a timestamp instead of a
+; sequence number when "logger rotate" is executed
+; (defaults to no).
+;rotatetimestamp = yes
+;
+; This determines whether or not we log generic events to a file
+; (defaults to yes).
+;event_log = no
+;
+;
+; For each file, specify what to log.
+;
+; For console logging, you set options at start of
+; Asterisk with -v for verbose and -d for debug
+; See 'asterisk -h' for more information.
+;
+; Directory for log files is configures in asterisk.conf
+; option astlogdir
+;
+[logfiles]
+;
+; Format is "filename" and then "levels" of debugging to be included:
+; debug
+; notice
+; warning
+; error
+; verbose
+; dtmf
+;
+; Special filename "console" represents the system console
+;
+; We highly recommend that you DO NOT turn on debug mode if you are simply
+; running a production system. Debug mode turns on a LOT of extra messages,
+; most of which you are unlikely to understand without an understanding of
+; the underlying code. Do NOT report debug messages as code issues, unless
+; you have a specific issue that you are attempting to debug. They are
+; messages for just that -- debugging -- and do not rise to the level of
+; something that merit your attention as an Asterisk administrator. Debug
+; messages are also very verbose and can and do fill up logfiles quickly;
+; this is another reason not to have debug mode on a production system unless
+; you are in the process of debugging a specific issue.
+;
+;debug => debug
+;console => notice,warning,error
+console => notice,warning,error,debug
+;console => notice, warning,debug
+messages => notice,warning,error,debug,verbose,fax
+;full => notice,warning,error,debug,verbose
+
+;syslog keyword : This special keyword logs to syslog facility
+;
+;syslog.local0 => notice,warning,error
+;
Propchange: asterisk/team/mmichelson/v6tests/tests/udptl/configs2/logger.conf
------------------------------------------------------------------------------
svn:eol-style = native
Propchange: asterisk/team/mmichelson/v6tests/tests/udptl/configs2/logger.conf
------------------------------------------------------------------------------
svn:keywords = Author Date Id Revision
Propchange: asterisk/team/mmichelson/v6tests/tests/udptl/configs2/logger.conf
------------------------------------------------------------------------------
svn:mime-type = text/plain
Added: asterisk/team/mmichelson/v6tests/tests/udptl/configs2/manager.conf
URL: http://svnview.digium.com/svn/testsuite/asterisk/team/mmichelson/v6tests/tests/udptl/configs2/manager.conf?view=auto&rev=528
==============================================================================
--- asterisk/team/mmichelson/v6tests/tests/udptl/configs2/manager.conf (added)
+++ asterisk/team/mmichelson/v6tests/tests/udptl/configs2/manager.conf Wed Jul 21 13:11:52 2010
@@ -1,0 +1,9 @@
+[general]
+enabled = yes
+port = 5039
+bindaddr = 127.0.0.1
+
+[user]
+secret = mysecret
+read = system,call,log,verbose,agent,user,config,dtmf,reporting,cdr,dialplan
+write = system,call,agent,user,config,command,reporting,originate
Propchange: asterisk/team/mmichelson/v6tests/tests/udptl/configs2/manager.conf
------------------------------------------------------------------------------
svn:eol-style = native
Propchange: asterisk/team/mmichelson/v6tests/tests/udptl/configs2/manager.conf
------------------------------------------------------------------------------
svn:keywords = Author Date Id Revision
Propchange: asterisk/team/mmichelson/v6tests/tests/udptl/configs2/manager.conf
------------------------------------------------------------------------------
svn:mime-type = text/plain
Added: asterisk/team/mmichelson/v6tests/tests/udptl/configs2/sip.conf
URL: http://svnview.digium.com/svn/testsuite/asterisk/team/mmichelson/v6tests/tests/udptl/configs2/sip.conf?view=auto&rev=528
==============================================================================
--- asterisk/team/mmichelson/v6tests/tests/udptl/configs2/sip.conf (added)
+++ asterisk/team/mmichelson/v6tests/tests/udptl/configs2/sip.conf Wed Jul 21 13:11:52 2010
@@ -1,0 +1,11 @@
+[general]
+bindaddr = 0.0.0.0:5061
+t38pt_udptl = yes
+sipdebug = yes
+
+[sender]
+type = friend
+host = 127.0.0.1
+port = 5060
+insecure = invite
+context = facks
Propchange: asterisk/team/mmichelson/v6tests/tests/udptl/configs2/sip.conf
------------------------------------------------------------------------------
svn:eol-style = native
Propchange: asterisk/team/mmichelson/v6tests/tests/udptl/configs2/sip.conf
------------------------------------------------------------------------------
svn:keywords = Author Date Id Revision
Propchange: asterisk/team/mmichelson/v6tests/tests/udptl/configs2/sip.conf
------------------------------------------------------------------------------
svn:mime-type = text/plain
Added: asterisk/team/mmichelson/v6tests/tests/udptl/run-test
URL: http://svnview.digium.com/svn/testsuite/asterisk/team/mmichelson/v6tests/tests/udptl/run-test?view=auto&rev=528
==============================================================================
--- asterisk/team/mmichelson/v6tests/tests/udptl/run-test (added)
+++ asterisk/team/mmichelson/v6tests/tests/udptl/run-test Wed Jul 21 13:11:52 2010
@@ -1,0 +1,125 @@
+#!/usr/bin/env python
+'''
+Copyright (C) 2010, Digium, Inc.
+Mark Michelson <mmichelson 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 signal
+import subprocess
+from optparse import OptionParser
+from twisted.application import service, internet
+from twisted.internet import reactor, defer
+from starpy import manager
+
+sys.path.append("lib/python")
+from asterisk.asterisk import Asterisk
+from asterisk.version import AsteriskVersion
+
+class UdptlTest:
+ def __init__(self, argv):
+ self.last_step = ""
+ self.passed = False
+
+ parser = OptionParser()
+ parser.add_option("-v", "--version", dest="ast_version",
+ help="Asterisk version string")
+ (options, args) = parser.parse_args(argv)
+ self.ast_version = AsteriskVersion(options.ast_version)
+
+ reactor.callWhenRunning(self.run)
+
+ print self.ast_version
+ self.asterisk1 = Asterisk(base="/tmp/asterisk-testsuite/udptl")
+ self.asterisk1.install_config("tests/udptl/configs1/sip.conf")
+ self.asterisk1.install_config("tests/udptl/configs1/manager.conf")
+ self.asterisk1.install_config("tests/udptl/configs1/logger.conf")
+ self.asterisk2 = Asterisk(base="/tmp/asterisk-testsuite/udptl")
+ self.asterisk2.install_config("tests/udptl/configs2/sip.conf")
+ self.asterisk2.install_config("tests/udptl/configs2/manager.conf")
+ self.asterisk2.install_config("tests/udptl/configs2/extensions.conf")
+ self.asterisk2.install_config("tests/udptl/configs2/logger.conf")
+
+ def startAsterisk(self):
+ self.logLastStep("Starting Asterisk")
+ self.asterisk1.start()
+ self.asterisk1.cli_exec("fax set debug on")
+ self.asterisk2.start()
+ self.asterisk2.cli_exec("fax set debug on")
+
+ def amiOnConnect1(self, ami):
+ self.logLastStep("Connected to AMI 1")
+ self.ami1 = ami
+ self.ami1.originate("SIP/666 at receiver", None, None, None, None, None, None, "SendFax", "tests/udptl/1page.tif")
+
+ def checkRecvFaxResult(self, ami, event):
+ self.logLastStep("Checking Userevent")
+ if event.get("userevent").lower() != "recvstatus":
+ return
+
+ #Replace this with other stuff once I know what to expect
+ status = event.get("status")
+ print ("Status of FAX is %s" % (status))
+ if status == "SUCCESS":
+ self.passed = True
+ else:
+ self.passed = False
+
+ if self.shutdowncall.active():
+ self.shutdowncall.reset(1)
+
+ def amiOnConnect2(self, ami):
+ self.logLastStep("Connected to AMI 2")
+ self.ami2 = ami
+ self.ami2.registerEvent("UserEvent", self.checkRecvFaxResult)
+
+ def amiLoginError(self, ami):
+ self.logLastStep("AMI login failed")
+ reactor.callLater(1, self.shutDown)
+
+ def amiLogin(self):
+ self.logLastStep("Logging in to the AMI")
+ self.ami_factory1 = manager.AMIFactory("user", "mysecret")
+ self.ami_factory2 = manager.AMIFactory("user", "mysecret")
+ self.ami_factory1.login('127.0.0.1', 5038).addCallbacks(self.amiOnConnect1, self.amiLoginError)
+ self.ami_factory2.login('127.0.0.1', 5039).addCallbacks(self.amiOnConnect2, self.amiLoginError)
+
+ def logLastStep(self, step):
+ print step
+ self.lastStep = step
+
+ def shutDown(self):
+ self.asterisk1.stop()
+ self.asterisk2.stop()
+
+ if self.passed == True:
+ print "UDPTL test passed!"
+ else:
+ print "UDPTL test failed!"
+
+ if reactor.running:
+ print "Stopping reactor"
+ reactor.stop()
+
+ def run(self):
+ self.startAsterisk()
+ self.amiLogin()
+ self.shutdowncall = reactor.callLater(90, self.shutDown)
+
+
+def main(argv=None):
+ if argv is None:
+ argv = sys.argv
+
+ # Run UDPTL test
+ udptl_test = UdptlTest(argv)
+ reactor.run()
+ if udptl_test.passed != True:
+ return 1
+ return 0
+
+if __name__ == "__main__":
+ sys.exit(main() or 0)
Propchange: asterisk/team/mmichelson/v6tests/tests/udptl/run-test
------------------------------------------------------------------------------
svn:eol-style = native
Propchange: asterisk/team/mmichelson/v6tests/tests/udptl/run-test
------------------------------------------------------------------------------
svn:executable = *
Propchange: asterisk/team/mmichelson/v6tests/tests/udptl/run-test
------------------------------------------------------------------------------
svn:keywords = Author Date Id Revision
Propchange: asterisk/team/mmichelson/v6tests/tests/udptl/run-test
------------------------------------------------------------------------------
svn:mime-type = text/plain
Added: asterisk/team/mmichelson/v6tests/tests/udptl/test-config.yaml
URL: http://svnview.digium.com/svn/testsuite/asterisk/team/mmichelson/v6tests/tests/udptl/test-config.yaml?view=auto&rev=528
==============================================================================
--- asterisk/team/mmichelson/v6tests/tests/udptl/test-config.yaml (added)
+++ asterisk/team/mmichelson/v6tests/tests/udptl/test-config.yaml Wed Jul 21 13:11:52 2010
@@ -1,0 +1,10 @@
+testinfo:
+ summary: 'Test T.38 FAX transmission over SIP'
+ description: |
+ 'One Asterisk instance sends a FAX to another Asterisk instance'
+
+properties:
+ minversion: '1.6.2'
+ dependencies:
+ - python : 'twisted'
+ - python : 'starpy'
Propchange: asterisk/team/mmichelson/v6tests/tests/udptl/test-config.yaml
------------------------------------------------------------------------------
svn:eol-style = native
Propchange: asterisk/team/mmichelson/v6tests/tests/udptl/test-config.yaml
------------------------------------------------------------------------------
svn:keywords = Author Date Id Revision
Propchange: asterisk/team/mmichelson/v6tests/tests/udptl/test-config.yaml
------------------------------------------------------------------------------
svn:mime-type = text/plain
More information about the asterisk-commits
mailing list