[asterisk-scf-commits] asterisk-scf/integration/sip.git branch "sessionparty2" updated.

Commits to the Asterisk SCF project code repositories asterisk-scf-commits at lists.digium.com
Thu Sep 8 17:05:57 CDT 2011


branch "sessionparty2" has been updated
       via  a54a85fa8d77beff70f42bed5ac0afd6007ec7d4 (commit)
      from  ddf5f2abe6409e35beac498f1825c73db3293bd6 (commit)

Summary of changes:
 config/SipConfigurator.py |   22 ++++++++++++----------
 1 files changed, 12 insertions(+), 10 deletions(-)


- Log -----------------------------------------------------------------
commit a54a85fa8d77beff70f42bed5ac0afd6007ec7d4
Author: Ken Hunt <ken.hunt at digium.com>
Date:   Thu Sep 8 17:05:40 2011 -0500

    - Imports ConfigParser so that the parser's exceptions are available.
    - Quote the ASTSCF_HOME env variable content so that spaces can be in path.
    - Try/except for the optional ids section of endpoint configuraiton.

diff --git a/config/SipConfigurator.py b/config/SipConfigurator.py
index 0cd2c4d..bd9a383 100755
--- a/config/SipConfigurator.py
+++ b/config/SipConfigurator.py
@@ -19,11 +19,10 @@
 # Sip configurator
 
 # Bring in the common configuration infrastructure
-import Ice, Configurator, sys, os, traceback
+import ConfigParser, Ice, Configurator, sys, os, traceback
 
 # Load our component specific configuration definitions
-Ice.loadSlice("--underscore -I" + os.environ["ASTSCF_HOME"] + " -I" + Ice.getSliceDir() + " --all ../slice/AsteriskSCF/Configuration/SipSessionManager/SipConfigurationIf.ice")
-
+Ice.loadSlice("--underscore -I\"" + os.environ["ASTSCF_HOME"] + "\" -I" + Ice.getSliceDir() + " --all ../sip/slice/AsteriskSCF/Configuration/SipSessionManager/SipConfigurationIf.ice")
 import AsteriskSCF.Configuration.SipSessionManager.V1
 
 
@@ -134,15 +133,18 @@ class SipSectionVisitors(Configurator.SectionVisitors):
 	item = AsteriskSCF.Configuration.SipSessionManager.V1.IdentityItem()
 	mapper.map('name', item, 'name', 'identity', config.get, None)
         mapper.map('number', item, 'number', 'identity', config.get, None)
-      
 
         # Alternate form of setting id is a list of references to IdentityGroup objects.
-        ids = config.get(section, 'ids')
-        idList = ids.split(',')
-        for id in idList:
-            item = AsteriskSCF.Configuration.SipSessionManager.V1.IdentityGroupRef()
-            item.identityGroupName = id
-            group.configurationItems[id] = item
+	try:
+            ids = config.get(section, 'ids')
+            idList = ids.split(',')
+            for id in idList:
+                item = AsteriskSCF.Configuration.SipSessionManager.V1.IdentityGroupRef()
+                item.identityGroupName = id
+                group.configurationItems[id] = item
+	except ConfigParser.NoOptionError:
+	    # It's legit to omit the ids option from this section.
+	    pass
 
         item = AsteriskSCF.Configuration.SipSessionManager.V1.SipSourceTransportAddressItem()
         mapper.map('sourcehost', item, 'host', 'sourceaddress', config.get, None)

-----------------------------------------------------------------------


-- 
asterisk-scf/integration/sip.git



More information about the asterisk-scf-commits mailing list