[asterisk-scf-commits] asterisk-scf/integration/sip.git branch "jira-astscf-397-cryptokey-configuration" updated.

Commits to the Asterisk SCF project code repositories asterisk-scf-commits at lists.digium.com
Thu Jan 12 08:50:14 CST 2012


branch "jira-astscf-397-cryptokey-configuration" has been updated
       via  30cea6347a5ed50f2c37ac13733f919d026f8135 (commit)
      from  8783c0d5741bd41fd625939d3584058fb3aeb486 (commit)

Summary of changes:
 config/Sip.config         |   38 +++++++++
 config/SipConfigurator.py |  182 ++++++++++++++++++++++++++-------------------
 2 files changed, 144 insertions(+), 76 deletions(-)


- Log -----------------------------------------------------------------
commit 30cea6347a5ed50f2c37ac13733f919d026f8135
Author: Brent Eagles <beagles at digium.com>
Date:   Thu Jan 12 11:17:14 2012 -0330

    Since the python configuration parser uses dictionaries internally, simply
    repeating keys will not work so I took a different approach of allowing
    arbitrary suffixes to be appended to ciphersuite/cryptokey pairs. The
    values are matched on suffix value. The suffixes are
    optional. ciphersuite/cryptokey pairs are also only processed now if
    encryption is enabled. The processing of key info is actually tied to the
    processing of the enableencryption property, so it works out okay.

diff --git a/config/Sip.config b/config/Sip.config
index b14323a..067a65f 100644
--- a/config/Sip.config
+++ b/config/Sip.config
@@ -171,6 +171,44 @@ ids=bob-bar-office,bob-bar-cell
 # dtmfmethod=rfc4733
 
 #
+# Enable SRTP authentication support (default: false)
+#
+# enableauth=false
+
+#
+# Enable SRTP encryption (default: false). Cipher suites and keys
+# should be defined if this is enabled.
+#
+# enableencryption=false
+
+#
+# Configuration cipher suites and their keys. More than one may be
+# defined and they must be defined in pairs and they must have a
+# suffix that identifies the pair. If a cryptosuite does not require a
+# key, simply enter a blank cryptokey property. If only one pair is
+# defined, a suffix may be omitted. These values are only processed if
+# encryption is enabled.
+#
+# Note: valid values are largely dependent on how pjsip is configured.
+#
+# WARNING: If multiple pairs are provided and suffixes are not used
+# properly, configuration mismatches will occur.
+#
+# ciphersuite=[cipher suite name]
+# cryptokey=[key or blank]
+#
+# AND OR
+#
+# ciphersuite[a suffix]=[cipher suite name]
+# cryptokey[a suffix]=[key or blank]
+#
+# eg.
+#
+# ciphersuite_a128=Awesome Suite 128bit
+# cryptokey_a128=Wx0wWhxAtxAxCRxAPPYKxEY
+#
+
+#
 # Example of configuring a STUN server for NAT handling.
 #
 # [transport_stun]
diff --git a/config/SipConfigurator.py b/config/SipConfigurator.py
index f10bfa9..3aadf88 100755
--- a/config/SipConfigurator.py
+++ b/config/SipConfigurator.py
@@ -19,27 +19,27 @@
 # Sip configurator
 
 # Bring in the common configuration infrastructure
-import ConfigParser, Ice, Configurator, sys, os, traceback
+import ConfigParser, Ice, Configurator, sys, os, traceback, uuid
 
 # Load our component specific configuration definitions
-Ice.loadSlice("--underscore -I\"" + os.environ["ASTSCF_HOME"] + "\"" + " -I" + Ice.getSliceDir() + " --all ../slice/AsteriskSCF/Configuration/SipSessionManager/SipConfigurationIf.ice")
-import AsteriskSCF.Configuration.SipSessionManager.V1
+Ice.loadSlice("--underscore -I\"" + os.environ["ASTSCF_HOME"] + "\"" + " -I" + Ice.getSliceDir() + " --all ../slice/AsteriskSCF/Configuration/SIPSessionManager/SIPConfigurationIf.ice")
+import AsteriskSCF.Configuration.SIPSessionManager.V1
 
 
 # Add our own visitor implementations for the sections we support
-class SipSectionVisitors(Configurator.SectionVisitors):
+class SIPSectionVisitors(Configurator.SectionVisitors):
     def visit_general(self, config, section):
-        group = AsteriskSCF.Configuration.SipSessionManager.V1.SipGeneralGroup()
+        group = AsteriskSCF.Configuration.SIPSessionManager.V1.SIPGeneralGroup()
         group.configurationItems = { }
         self.groups.append(group)
 
     def visit_transport_udp(self, config, section):
-        group = AsteriskSCF.Configuration.SipSessionManager.V1.SipUDPTransportGroup()
+        group = AsteriskSCF.Configuration.SIPSessionManager.V1.SIPUDPTransportGroup()
         group.name = section
         group.configurationItems = { }
 
         mapper = Configurator.OptionMapper()
-        item = AsteriskSCF.Configuration.SipSessionManager.V1.SipHostItem()
+        item = AsteriskSCF.Configuration.SIPSessionManager.V1.SIPHostItem()
         mapper.map('host', item, 'host', 'address', config.get, None)
         mapper.map('port', item, 'port', 'address', config.getint, 5060)
         for option in config.options(section):
@@ -50,12 +50,12 @@ class SipSectionVisitors(Configurator.SectionVisitors):
         self.groups.append(group)
 
     def visit_transport_tcp(self, config, section):
-        group = AsteriskSCF.Configuration.SipSessionManager.V1.SipTCPTransportGroup()
+        group = AsteriskSCF.Configuration.SIPSessionManager.V1.SIPTCPTransportGroup()
         group.name = section
         group.configurationItems = { }
 
         mapper = Configurator.OptionMapper()
-        item = AsteriskSCF.Configuration.SipSessionManager.V1.SipHostItem()
+        item = AsteriskSCF.Configuration.SIPSessionManager.V1.SIPHostItem()
         mapper.map('host', item, 'host', 'address', config.get, None)
         mapper.map('port', item, 'port', 'address', config.getint, 5060)
         for option in config.options(section):
@@ -66,12 +66,12 @@ class SipSectionVisitors(Configurator.SectionVisitors):
         self.groups.append(group)
 
     def visit_transport_tls(self, config, section):
-        group = AsteriskSCF.Configuration.SipSessionManager.V1.SipTLSTransportGroup()
+        group = AsteriskSCF.Configuration.SIPSessionManager.V1.SIPTLSTransportGroup()
         group.name = section
         group.configurationItems = { }
 
         mapper = Configurator.OptionMapper()
-        item = AsteriskSCF.Configuration.SipSessionManager.V1.SipHostItem()
+        item = AsteriskSCF.Configuration.SIPSessionManager.V1.SIPHostItem()
         mapper.map('host', item, 'host', 'address', config.get, None)
         mapper.map('port', item, 'port', 'address', config.getint, 5060)
         for option in config.options(section):
@@ -82,16 +82,16 @@ class SipSectionVisitors(Configurator.SectionVisitors):
         self.groups.append(group)
 
     def visit_transport_stun(self, config, section):
-        group = AsteriskSCF.Configuration.SipSessionManager.V1.SipSTUNTransportGroup()
+        group = AsteriskSCF.Configuration.SIPSessionManager.V1.SIPSTUNTransportGroup()
         group.name = section
         group.configurationItems = {}
         mapper = Configurator.OptionMapper()
 
-        item = AsteriskSCF.Configuration.SipSessionManager.V1.SipSignalingSTUNHostItem()
+        item = AsteriskSCF.Configuration.SIPSessionManager.V1.SIPSignalingSTUNHostItem()
         mapper.map('stunhost', item, 'address', 'stunServer', config.get, None)
         mapper.map('stunport', item, 'port', 'stunServer', config.getint, 3478)
 
-        item = AsteriskSCF.Configuration.SipSessionManager.V1.SipHostItem()
+        item = AsteriskSCF.Configuration.SIPSessionManager.V1.SIPHostItem()
         mapper.map('baseaddress', item, 'host', 'baseAddress', config.get, None)
         mapper.map('baseport', item, 'port', 'baseAddress', config.getint, 4512)
 
@@ -114,23 +114,23 @@ class SipSectionVisitors(Configurator.SectionVisitors):
 
                 for contact in contacts:
                     uri, slash, expiration = contact.partition('/')
-                    info = AsteriskSCF.Configuration.SipSessionManager.V1.ContactInfo()
+                    info = AsteriskSCF.Configuration.SIPSessionManager.V1.ContactInfo()
                     info.contactURI = uri
                     info.expiration = int(expiration)
                     ret.append(info)
 
                 return ret
 
-        group = AsteriskSCF.Configuration.SipSessionManager.V1.SipRegistrationGroup()
+        group = AsteriskSCF.Configuration.SIPSessionManager.V1.SIPRegistrationGroup()
         group.name = section
         group.configurationItems = {}
 
         mapper = Configurator.OptionMapper()
 
-        item = AsteriskSCF.Configuration.SipSessionManager.V1.SipClientRegistrationItem()
+        item = AsteriskSCF.Configuration.SIPSessionManager.V1.SIPClientRegistrationItem()
 
         mapper.map('aor', item, 'aor', 'registration', config.get, None)
-        mapper.map('expiration', item, 'defaultExpiration', 'registration', config.getint, AsteriskSCF.Configuration.SipSessionManager.V1.DefaultRegistrationExpirationSeconds)
+        mapper.map('expiration', item, 'defaultExpiration', 'registration', config.getint, AsteriskSCF.Configuration.SIPSessionManager.V1.DefaultRegistrationExpirationSeconds)
         handler = RegistrationContactHandler(config)
         mapper.map('contacts', item, 'contacts', 'registration', handler.get, None)
 
@@ -142,13 +142,13 @@ class SipSectionVisitors(Configurator.SectionVisitors):
         self.groups.append(group)
 
     def visit_identity(self, config, section):
-        group = AsteriskSCF.Configuration.SipSessionManager.V1.IdentityGroup()
+        group = AsteriskSCF.Configuration.SIPSessionManager.V1.IdentityGroup()
         group.name = section
         group.configurationItems = { }
 
         mapper = Configurator.OptionMapper()
 
-        item =  AsteriskSCF.Configuration.SipSessionManager.V1.IdentityItem()
+        item =  AsteriskSCF.Configuration.SIPSessionManager.V1.IdentityItem()
 	#      map(option, object, item, item_name, method, default)
         mapper.map('name', item, 'name', 'id', config.get, None)
         mapper.map('number', item, 'number', 'id', config.get, None)
@@ -161,15 +161,15 @@ class SipSectionVisitors(Configurator.SectionVisitors):
         self.groups.append(group)
 
     def visit_endpoint(self, config, section):
-        group = AsteriskSCF.Configuration.SipSessionManager.V1.SipEndpointGroup()
+        group = AsteriskSCF.Configuration.SIPSessionManager.V1.SIPEndpointGroup()
         group.name = section
         group.configurationItems = { }
 
         mapper = Configurator.OptionMapper()
 
-        mapper.map('routing', AsteriskSCF.Configuration.SipSessionManager.V1.SipRoutingItem(), 'routingServiceName', 'routingService', config.get, None)
+        mapper.map('routing', AsteriskSCF.Configuration.SIPSessionManager.V1.SIPRoutingItem(), 'routingServiceName', 'routingService', config.get, None)
 
-        item = AsteriskSCF.Configuration.SipSessionManager.V1.IdentityItem()
+        item = AsteriskSCF.Configuration.SIPSessionManager.V1.IdentityItem()
         mapper.map('name', item, 'name', 'identity', config.get, None)
         mapper.map('number', item, 'number', 'identity', config.get, None)
 
@@ -178,29 +178,29 @@ class SipSectionVisitors(Configurator.SectionVisitors):
             ids = config.get(section, 'ids')
             idList = ids.split(',')
             for id in idList:
-                item = AsteriskSCF.Configuration.SipSessionManager.V1.IdentityGroupRef()
+                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()
+        item = AsteriskSCF.Configuration.SIPSessionManager.V1.SIPSourceTransportAddressItem()
         mapper.map('sourcehost', item, 'host', 'sourceaddress', config.get, None)
         mapper.map('sourceport', item, 'port', 'sourceaddress', config.getint, 5060)
 
-        item = AsteriskSCF.Configuration.SipSessionManager.V1.SipTargetDestinationAddressItem()
+        item = AsteriskSCF.Configuration.SIPSessionManager.V1.SIPTargetDestinationAddressItem()
         mapper.map('targethost', item, 'host', 'targetaddress', config.get, None)
         mapper.map('targetport', item, 'port', 'targetaddress', config.getint, 5060)
 
-        item = AsteriskSCF.Configuration.SipSessionManager.V1.SipSignalingNATItem()
+        item = AsteriskSCF.Configuration.SIPSessionManager.V1.SIPSignalingNATItem()
         mapper.map('enablestun', item, 'stun', 'enableSTUN', config.get, None)
 
-        item = AsteriskSCF.Configuration.SipSessionManager.V1.SipMediaNATItem()
+        item = AsteriskSCF.Configuration.SIPSessionManager.V1.SIPMediaNATItem()
         mapper.map('enablertpoverice', item, 'enableICE', 'enableRTPICE', config.get, None)
         mapper.map('enableturn', item, 'enableTURN', 'enableRTPICE', config.get, None)
 
-        item = AsteriskSCF.Configuration.SipSessionManager.V1.SRTPCryptoItem()
+        item = AsteriskSCF.Configuration.SIPSessionManager.V1.SRTPCryptoItem()
 
         #
         # Maps key/suite pairs to SRTPCryptoKey configuration
@@ -212,77 +212,107 @@ class SipSectionVisitors(Configurator.SectionVisitors):
         # makes a safe delimiter.
         #
         class CryptoKeyHandler:
-                def __init__(self, config, keyItemArray):
+                def __init__(self, config, item):
                     self.config = config
-                    self.keyArray = keyItemArray
-                    self.currentCryptoItem = AsteriskSCF.Configuration.SipSessionManager.V1.SRTPCryptoKey()
+                    self.cryptoItem = item
 
-                def getSuite(self, section, item):
+                def enableEncryption(self, section, item):
                     itemData = self.config.get(section, item)
-                    self.currentCryptoItem.suite = self.config.get(section, item)
-                    self.checkAndAppend()
+                    if not itemData or len(itemData) == 0 or itemData.lower() not in ["1", "true", "yes"]:
+                        self.cryptoItem.enableEncryption = False
+                        return
+
+                    #
+                    # Okay, so encryption is enabled. We scan the
+                    # items in the section looking for ciphersuite and
+                    # cryptokey pairs associated to each other with a
+                    # common suffix (suffix can be any string really).
+                    # If a suffix is not present, we provide a default
+                    # one based on UUID generation. There *is* a
+                    # potential for collision, but hey.
+                    #
+
+                    self.cryptoItem.enableEncryption = True
+                    
+                    cryptoKeyPairs = { }
 
-                def getKey(self, section, item):
-                    itemData = self.config.get(section, item)
-                    self.currentCryptoItem.cryptoKey = self.config.get(section, item)
-                    self.checkAndAppend()
-
-                def checkAndAppend(self):
-                    if len(self.currentCryptoItem.suite) > 0 and len(self.currentCryptoItem.cryptoKey) > 0:
-                        self.keyArray.append(self.currentCryptoItem)
-                        self.currentCryptoItem = AsteriskSCF.Configuration.SipSessionManager.V1.SRTPCryptoKey()
-                        
+                    defaultSuffix = str(uuid.uuid1())
                     
-        mapper.map('enableauth', item, 'enableAuthentication', 'srtpCryptoSettings', config.get, None)
-        mapper.map('enableencryption', item, 'enableEncryption', 'srtpCryptoSettings', config.get, None)
+                    #
+                    # Get the items for this section.
+                    #
+                    for key, value in self.config.items(section):
+                        if key.lower().startswith("ciphersuite"):
+                            suffix = key[len("ciphersuite"):len(key)]
+                            if len(suffix) == 0:
+                                suffix = defaultSuffix
+                            if suffix not in cryptoKeyPairs:
+                                cryptoKeyPairs[suffix] = [ value, "" ]
+                            else:
+                                cryptoKeyPairs[suffix][0] = value
+                        elif key.lower().startswith("cryptokey"):
+                            suffix = key[len("cryptokey"):len(key)]
+                            if len(suffix) == 0:
+                                suffix = defaultSuffix
+                            if suffix not in cryptoKeyPairs:
+                                cryptoKeyPairs[suffix] = [ "", value ]
+                            else:
+                                cryptoKeyPairs[suffix][1] = value
+
+                    for k in cryptoKeyPairs.values():
+                        cryptoKey = AsteriskSCF.Configuration.SIPSessionManager.V1.SRTPCryptoKey()
+                        cryptoKey.suite = k[0]
+                        cryptoKey.cryptoKey = k[1]
+                        self.cryptoItem.cryptoKeys.append(cryptoKey)
 
+                    
+        mapper.map('enableauth', item, 'enableAuthentication', 'srtpCryptoSettings', config.get, None)
         item.cryptoKeys = []
-        handler = CryptoKeyHandler(config, item.cryptoKeys)
-        mapper.map('ciphersuite', item, 'suite', 'srtpCryptoSettings', handler.getSuite, None)
-        mapper.map('cryptokey', item, 'cryptoKey', 'srtpCryptoSettings', handler.getKey, None)
+        handler = CryptoKeyHandler(config, item)
+        mapper.map('enableencryption', item, 'enableEncryption', 'srtpCryptoSettings', handler.enableEncryption, None)
 
         class AllowableCallDirectionTransformer():
             def __init__(self, config):
                 self.config = config
             def get(self, section, item):
                 if self.config.get(section, item) == 'inbound':
-                    return AsteriskSCF.Configuration.SipSessionManager.V1.SipAllowableCallDirection.Inbound
+                    return AsteriskSCF.Configuration.SIPSessionManager.V1.SIPAllowableCallDirection.Inbound
                 elif self.config.get(section, item) == 'outbound':
-                    return AsteriskSCF.Configuration.SipSessionManager.V1.SipAllowableCallDirection.Outbound
+                    return AsteriskSCF.Configuration.SIPSessionManager.V1.SIPAllowableCallDirection.Outbound
                 elif self.config.get(section, item) == 'both':
-                    return AsteriskSCF.Configuration.SipSessionManager.V1.SipAllowableCallDirection.Both
+                    return AsteriskSCF.Configuration.SIPSessionManager.V1.SIPAllowableCallDirection.Both
                 elif self.config.get(section, item) == 'none':
-                    return AsteriskSCF.Configuration.SipSessionManager.V1.SipAllowableCallDirection.Disabled
+                    return AsteriskSCF.Configuration.SIPSessionManager.V1.SIPAllowableCallDirection.Disabled
 
         transformer = AllowableCallDirectionTransformer(config)
 
-        mapper.map('direction', AsteriskSCF.Configuration.SipSessionManager.V1.SipAllowableCallDirectionItem(), 'callDirection', 'callDirection', transformer.get, None)
+        mapper.map('direction', AsteriskSCF.Configuration.SIPSessionManager.V1.SIPAllowableCallDirectionItem(), 'callDirection', 'callDirection', transformer.get, None)
 
-        mapper.map('securetransport', AsteriskSCF.Configuration.SipSessionManager.V1.SipEndpointTransportItem(), 'secureTransport', 'transport', transformer.get, None)
+        mapper.map('securetransport', AsteriskSCF.Configuration.SIPSessionManager.V1.SIPEndpointTransportItem(), 'secureTransport', 'transport', transformer.get, None)
 
-        item = AsteriskSCF.Configuration.SipSessionManager.V1.SipRTPMediaServiceItem()
+        item = AsteriskSCF.Configuration.SIPSessionManager.V1.SIPRTPMediaServiceItem()
         mapper.map('rtpoveripv6', item, 'requireIPv6', 'mediaservice', config.getboolean, None)
 
-        item = AsteriskSCF.Configuration.SipSessionManager.V1.DirectMediaItem()
+        item = AsteriskSCF.Configuration.SIPSessionManager.V1.DirectMediaItem()
         mapper.map('directmedia', item, 'enabled', 'directmedia', config.getboolean, None)
 
-        item = AsteriskSCF.Configuration.SipSessionManager.V1.SipUDPTLMediaServiceItem()
+        item = AsteriskSCF.Configuration.SIPSessionManager.V1.SIPUDPTLMediaServiceItem()
         mapper.map('udptloveripv6', item, 'requireIPv6', 'udptlmediaservice', config.getboolean, None)
         mapper.map('udptloverice', item, 'enableICE', 'udptlmediaservice', config.getboolean, None)
         mapper.map('udptlwithturn', item, 'enableTURN', 'udptlmediaservice', config.getboolean, None)
 
-        item = AsteriskSCF.Configuration.SipSessionManager.V1.SipCryptoCertificateItem()
+        item = AsteriskSCF.Configuration.SIPSessionManager.V1.SIPCryptoCertificateItem()
         mapper.map('certificateauthorityfile', item, 'certificateAuthority', 'cryptocert', config.get, None)
         mapper.map('certificatefile', item, 'certificate', 'cryptocert', config.get, None)
         mapper.map('privatekeyfile', item, 'privateKey', 'cryptocert', config.get, None)
         mapper.map('privatekeypassword', item, 'privateKeyPassword', 'cryptocert', config.get, None)
 
-        item = AsteriskSCF.Configuration.SipSessionManager.V1.SipCryptoRequirementsItem()
+        item = AsteriskSCF.Configuration.SIPSessionManager.V1.SIPCryptoRequirementsItem()
         mapper.map('requireverifiedserver', item, 'requireVerifiedServer', 'cryptorequirements', config.getboolean, None)
         mapper.map('requireverifiedclient', item, 'requireVerifiedClient', 'cryptorequirements', config.getboolean, None)
         mapper.map('requireclientcertificate', item, 'requireClientCertificate', 'cryptorequirements', config.getboolean, None)
 
-        item = AsteriskSCF.Configuration.SipSessionManager.V1.SipCryptoItem()
+        item = AsteriskSCF.Configuration.SIPSessionManager.V1.SIPCryptoItem()
         mapper.map('supportedciphers', item, 'supportedCiphers', 'crypto', config.get, None)
         mapper.map('tlsservername', item, 'serverName', 'crypto', config.get, None)
         mapper.map('tlstimeout', item, 'timeout', 'crypto', config.getint, None)
@@ -292,15 +322,15 @@ class SipSectionVisitors(Configurator.SectionVisitors):
                 self.config = config
             def get(self, section, item):
                 if self.config.get(section, item) == 'unspecified':
-                    return AsteriskSCF.Configuration.SipSessionManager.V1.TLSProtocolMethod.PROTOCOLMETHODUNSPECIFIED
+                    return AsteriskSCF.Configuration.SIPSessionManager.V1.TLSProtocolMethod.PROTOCOLMETHODUNSPECIFIED
                 elif self.config.get(section, item) == 'tlsv1':
-                    return AsteriskSCF.Configuration.SipSessionManager.V1.TLSProtocolMethod.PROTOCOLMETHODTLSV1
+                    return AsteriskSCF.Configuration.SIPSessionManager.V1.TLSProtocolMethod.PROTOCOLMETHODTLSV1
                 elif self.config.get(section, item) == 'sslv2':
-                    return AsteriskSCF.Configuration.SipSessionManager.V1.TLSProtocolMethod.PROTOCOLMETHODTSSLV2
+                    return AsteriskSCF.Configuration.SIPSessionManager.V1.TLSProtocolMethod.PROTOCOLMETHODTSSLV2
                 elif self.config.get(section, item) == 'sslv3':
-                    return AsteriskSCF.Configuration.SipSessionManager.V1.TLSProtocolMethod.PROTOCOLMETHODSSLV3
+                    return AsteriskSCF.Configuration.SIPSessionManager.V1.TLSProtocolMethod.PROTOCOLMETHODSSLV3
                 elif self.config.get(section, item) == 'sslv23':
-                    return AsteriskSCF.Configuration.SipSessionManager.V1.TLSProtocolMethod.PROTOCOLMETHODSSLV23
+                    return AsteriskSCF.Configuration.SIPSessionManager.V1.TLSProtocolMethod.PROTOCOLMETHODSSLV23
 
         transformer = TLSProtocolMethodTransformer(config)
         mapper.map('tlsprotocolmethod', item, 'protocolMethod', 'crypto', transformer.get, None)
@@ -310,15 +340,15 @@ class SipSectionVisitors(Configurator.SectionVisitors):
                 self.config = config
             def get(self, section, item):
                 if self.config.get(section, item) == 'info':
-                    return AsteriskSCF.Configuration.SipSessionManager.V1.SipDTMFOption.INFO
+                    return AsteriskSCF.Configuration.SIPSessionManager.V1.SIPDTMFOption.INFO
                 if self.config.get(section, item) == 'rfc4733' or self.config.get(section.item) == 'rfc2833':
-                    return AsteriskSCF.Configuration.SipSessionManager.V1.SipDTMFOption.RFC4733
+                    return AsteriskSCF.Configuration.SIPSessionManager.V1.SIPDTMFOption.RFC4733
                 if self.config.get(section, item) == 'inband':
-                    return AsteriskSCF.Configuration.SipSessionManager.V1.SipDTMFOption.Inband
+                    return AsteriskSCF.Configuration.SIPSessionManager.V1.SIPDTMFOption.Inband
 
-        item = AsteriskSCF.Configuration.SipSessionManager.V1.SipDTMFItem()
+        item = AsteriskSCF.Configuration.SIPSessionManager.V1.SIPDTMFItem()
         dtmfTransformer = DTMFMethodTransformer(config)
-        mapper.map('dtmfmethod', item, 'dtmf', 'dtmfmethod', dtmfTransformer.get, AsteriskSCF.Configuration.SipSessionManager.V1.SipDTMFOption.RFC4733)
+        mapper.map('dtmfmethod', item, 'dtmf', 'dtmfmethod', dtmfTransformer.get, AsteriskSCF.Configuration.SIPSessionManager.V1.SIPDTMFOption.RFC4733)
 
         for option in config.options(section):
             mapper.execute(group, section, option)
@@ -328,7 +358,7 @@ class SipSectionVisitors(Configurator.SectionVisitors):
             formats = config.get(section, 'formats')
             configuredFormats = formats.split(',')
             for format in configuredFormats:
-                item = AsteriskSCF.Configuration.SipSessionManager.V1.SipMediaFormatItem()
+                item = AsteriskSCF.Configuration.SIPSessionManager.V1.SIPMediaFormatItem()
 
                 front, found, rest = format.partition('/')
                 if found:
@@ -372,7 +402,7 @@ class SipSectionVisitors(Configurator.SectionVisitors):
             registrations = config.get(section, 'registrations')
             registrationList = registrations.split(',')
             for reg in registrationList:
-                item = AsteriskSCF.Configuration.SipSessionManager.V1.SipRegistrationGroupRef()
+                item = AsteriskSCF.Configuration.SIPSessionManager.V1.SIPRegistrationGroupRef()
                 item.registrationGroupName = reg
                 group.configurationItems[reg] = item
         except:
@@ -396,9 +426,9 @@ class SipSectionVisitors(Configurator.SectionVisitors):
 
 # In order to do service locator based lookup we need to pass in a params object
 serviceLocatorParams = AsteriskSCF.Core.Discovery.V1.ServiceLocatorParams()
-serviceLocatorParams.category = AsteriskSCF.Configuration.SipSessionManager.V1.ConfigurationDiscoveryCategory
+serviceLocatorParams.category = AsteriskSCF.Configuration.SIPSessionManager.V1.ConfigurationDiscoveryCategory
 serviceLocatorParams.service = 'default' 
 
 # Make a configurator application and let it run
-app = Configurator.ConfiguratorApp('Sip.config', SipSectionVisitors(), None, serviceLocatorParams)
+app = Configurator.ConfiguratorApp('Sip.config', SIPSectionVisitors(), None, serviceLocatorParams)
 sys.exit(app.main(sys.argv))

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


-- 
asterisk-scf/integration/sip.git



More information about the asterisk-scf-commits mailing list