[asterisk-commits] pabelanger: branch pabelanger/non-root r673 - in /asterisk/team/pabelanger/no...

SVN commits to the Asterisk project asterisk-commits at lists.digium.com
Sat Jul 31 21:10:19 CDT 2010


Author: pabelanger
Date: Sat Jul 31 21:10:13 2010
New Revision: 673

URL: http://svnview.digium.com/svn/testsuite?view=rev&rev=673
Log:
New _gen_logger_conf function.
First step towards backwards compatible config files.


Added:
    asterisk/team/pabelanger/non-root/tests/rfc2833_dtmf_detect/configs/1.4/
    asterisk/team/pabelanger/non-root/tests/rfc2833_dtmf_detect/configs/1.4/sip.conf   (with props)
Modified:
    asterisk/team/pabelanger/non-root/lib/python/asterisk/asterisk.py
    asterisk/team/pabelanger/non-root/tests/rfc2833_dtmf_detect/configs/sip.conf

Modified: asterisk/team/pabelanger/non-root/lib/python/asterisk/asterisk.py
URL: http://svnview.digium.com/svn/testsuite/asterisk/team/pabelanger/non-root/lib/python/asterisk/asterisk.py?view=diff&rev=673&r1=672&r2=673
==============================================================================
--- asterisk/team/pabelanger/non-root/lib/python/asterisk/asterisk.py (original)
+++ asterisk/team/pabelanger/non-root/lib/python/asterisk/asterisk.py Sat Jul 31 21:10:13 2010
@@ -95,6 +95,7 @@
             print "Unable to discover dir layout from asterisk.conf"
             return
         self.__gen_ast_conf(ast_conf, dir_cat, ast_conf_options)
+        self.__gen_logger_conf()
         for (var, val) in dir_cat.options:
             self.__mirror_dir(var, val)
 
@@ -115,6 +116,8 @@
         # Be _really_ sure that Asterisk has started up before returning.
         time.sleep(5.0)
         self.cli_exec("core waitfullybooted")
+        self.cli_exec("core set verbose 15")
+        self.cli_exec("core set debug 15")
 
     def stop(self):
         """Stop this instance of Asterisk.
@@ -153,8 +156,10 @@
         asterisk.install_configs("tests/my-cool-test/configs")
         """
 	for dirname, dirnames, filenames in os.walk(cfg_path):
-	    if ".svn" in dirnames:
-		dirnames.remove(".svn")
+            blacklist = [ ".svn", "1.4", "1.6.2", "1.8" ]
+            for b in blacklist:
+                if b in dirnames:
+                    dirnames.remove(b)
             for filename in filenames:
                 target = "%s/%s" % (dirname, filename)
 		self.install_config(target)
@@ -176,6 +181,18 @@
         if not os.path.exists(cfg_path):
             print "Config file '%s' does not exist" % cfg_path
             return
+
+	v = "trunk"
+	if self.ast_version.branch == "branch-1.8":
+		v = "1.8"
+	elif self.ast_version.branch == "branch-1.6.2":
+		v = "1.6.2"
+	elif self.ast_version.branch == "branch-1.4":
+		v = "1.4"
+        
+	tmp = "%s/%s/%s" % (os.path.dirname(cfg_path), v, os.path.basename(cfg_path))
+	if os.path.exists(tmp):
+            cfg_path = tmp
         target_path = os.path.join(self.astetcdir, os.path.basename(cfg_path))
         if os.path.exists(target_path):
             os.remove(target_path)
@@ -261,6 +278,25 @@
             pass
         process.wait()
         return output
+
+    def __gen_logger_conf(self):
+        local_logger_conf = os.path.join(self.astetcdir, "logger.conf")
+
+        try:
+            f = open(local_logger_conf, "w")
+        except IOError:
+            print "Failed to open %s" % local_logger_conf
+            return
+        except:
+            print "Unexpected error: %s" % sys.exc_info()[0]
+            return
+
+        f.write("[general]\n\n") 
+        f.write("[logfiles]\n\n") 
+	f.write("console => notice,warning,error\n")
+	f.write("messages => notice,warning,error\n")
+	f.write("full => notice,warning,error,debug,verbose,dtmf,fax\n")
+	f.close()
 
     def __gen_ast_conf(self, ast_conf, dir_cat, ast_conf_options):
         for (var, val) in dir_cat.options:

Added: asterisk/team/pabelanger/non-root/tests/rfc2833_dtmf_detect/configs/1.4/sip.conf
URL: http://svnview.digium.com/svn/testsuite/asterisk/team/pabelanger/non-root/tests/rfc2833_dtmf_detect/configs/1.4/sip.conf?view=auto&rev=673
==============================================================================
--- asterisk/team/pabelanger/non-root/tests/rfc2833_dtmf_detect/configs/1.4/sip.conf (added)
+++ asterisk/team/pabelanger/non-root/tests/rfc2833_dtmf_detect/configs/1.4/sip.conf Sat Jul 31 21:10:13 2010
@@ -1,0 +1,9 @@
+[general]
+bindaddr=127.0.0.1:5060
+canreinvite=no
+
+[test1]
+type=friend
+host=dynamic
+dtmf=rfc2833
+context=dtmf_test

Propchange: asterisk/team/pabelanger/non-root/tests/rfc2833_dtmf_detect/configs/1.4/sip.conf
------------------------------------------------------------------------------
    svn:eol-style = native

Propchange: asterisk/team/pabelanger/non-root/tests/rfc2833_dtmf_detect/configs/1.4/sip.conf
------------------------------------------------------------------------------
    svn:keywords = Author Date Id Revision

Propchange: asterisk/team/pabelanger/non-root/tests/rfc2833_dtmf_detect/configs/1.4/sip.conf
------------------------------------------------------------------------------
    svn:mime-type = text/plain

Modified: asterisk/team/pabelanger/non-root/tests/rfc2833_dtmf_detect/configs/sip.conf
URL: http://svnview.digium.com/svn/testsuite/asterisk/team/pabelanger/non-root/tests/rfc2833_dtmf_detect/configs/sip.conf?view=diff&rev=673&r1=672&r2=673
==============================================================================
--- asterisk/team/pabelanger/non-root/tests/rfc2833_dtmf_detect/configs/sip.conf (original)
+++ asterisk/team/pabelanger/non-root/tests/rfc2833_dtmf_detect/configs/sip.conf Sat Jul 31 21:10:13 2010
@@ -1,6 +1,6 @@
 [general]
 udpbindaddr=127.0.0.1:5060
-canreinvite=no
+directmedia=no
 
 [test1]
 type=friend




More information about the asterisk-commits mailing list