[asterisk-scf-commits] asterisk-scf/integration/testsuite.git branch "review" updated.

Commits to the Asterisk SCF project code repositories asterisk-scf-commits at lists.digium.com
Thu Jun 2 22:54:20 CDT 2011


branch "review" has been updated
       via  9cbe7bbbd1c72901b77df54fc693e05c8caefa00 (commit)
      from  452ae0ff2ea87a558fdc4632da2405c0863332db (commit)

Summary of changes:
 plugins/asteriskscf_configurator.py |   22 +++++++++++-----------
 1 files changed, 11 insertions(+), 11 deletions(-)


- Log -----------------------------------------------------------------
commit 9cbe7bbbd1c72901b77df54fc693e05c8caefa00
Author: Darren Sessions <dsessions at digium.com>
Date:   Thu Jun 2 22:54:17 2011 -0500

    fixed a modified transformer class in the configurator

diff --git a/plugins/asteriskscf_configurator.py b/plugins/asteriskscf_configurator.py
index 3d1e53b..3c4cb71 100644
--- a/plugins/asteriskscf_configurator.py
+++ b/plugins/asteriskscf_configurator.py
@@ -331,20 +331,20 @@ class SipSectionVisitors(SectionVisitors):
         mapper.map('targetport', item, 'port', 'targetaddress', remote['targetport'], 5060)
 
         class AllowableCallDirectionTransformer():
-            def get(self, config, option):
-                if self.chkOption(config, option) == 'inbound':
-                    direction = self.AsteriskSCF.SIP.V1.SipAllowableCallDirection.Inbound
-                elif self.chkOption(config, option) == 'outbound':
-                    direction = self.AsteriskSCF.SIP.V1.SipAllowableCallDirection.Outbound
-                elif self.chkOption(config, option) == 'both':
-                    direction = self.AsteriskSCF.SIP.V1.SipAllowableCallDirection.Both
-                else:
-                    direction = self.AsteriskSCF.SIP.V1.SipAllowableCallDirection.Both
+            def get(self, option):
+                if option:
+                    if option == 'inbound':
+                        return self.AsteriskSCF.SIP.V1.SipAllowableCallDirection.Inbound
+                    elif option == 'outbound':
+                        return self.AsteriskSCF.SIP.V1.SipAllowableCallDirection.Outbound
+                    elif option == 'both':
+                        return self.AsteriskSCF.SIP.V1.SipAllowableCallDirection.Both
+                return self.AsteriskSCF.SIP.V1.SipAllowableCallDirection.Both
 
         transformer = AllowableCallDirectionTransformer()
 
-        mapper.map('direction', self.AsteriskSCF.SIP.V1.SipAllowableCallDirectionItem(), 'callDirection', 'callDirection', transformer.get(config, 'direction'), None)
-        mapper.map('securetransport', AsteriskSCF.SIP.V1.SipEndpointTransportItem(), 'secureTransport', 'transport', transformer.get(config, 'securetransport'), None)
+        mapper.map('direction', self.AsteriskSCF.SIP.V1.SipAllowableCallDirectionItem(), 'callDirection', 'callDirection', transformer.get(self.chkOption(config, 'direction')), None)
+        mapper.map('securetransport', AsteriskSCF.SIP.V1.SipEndpointTransportItem(), 'secureTransport', 'transport', transformer.get(self.chkOption(config, 'securetransport')), None)
 
         item = AsteriskSCF.SIP.V1.SipRTPMediaServiceItem()
         mapper.map('rtpoveripv6', item, 'requireIPv6', 'mediaservice', self.chkOption(config, 'rtpoveripv6'), None)

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


-- 
asterisk-scf/integration/testsuite.git



More information about the asterisk-scf-commits mailing list