[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:22:31 CDT 2011


branch "review" has been updated
       via  178bdc78b87d81befb1eab2313b1a078b1e889d2 (commit)
      from  87f131ca8e237a89fdda3b85aea859ac3f1e8c2d (commit)

Summary of changes:
 plugins/asteriskscf_configurator.py                |   52 ++++++++++---------
 .../testcase.yaml                                  |   18 +++----
 2 files changed, 35 insertions(+), 35 deletions(-)


- Log -----------------------------------------------------------------
commit 178bdc78b87d81befb1eab2313b1a078b1e889d2
Author: Darren Sessions <dsessions at digium.com>
Date:   Thu Jun 2 22:22:28 2011 -0500

    some tweaks for ipv6

diff --git a/plugins/asteriskscf_configurator.py b/plugins/asteriskscf_configurator.py
index 78e6d54..e22bf71 100644
--- a/plugins/asteriskscf_configurator.py
+++ b/plugins/asteriskscf_configurator.py
@@ -240,23 +240,21 @@ class SipSectionVisitors(SectionVisitors):
         if remote['success'] == False:
             return remote
 
-        mapper = OptionMapper()
-
         group = self.AsteriskSCF.SIP.V1.SipUDPTransportGroup()
         group.name = section
         group.configurationItems = {}
 
+        mapper = OptionMapper()
         item = self.AsteriskSCF.SIP.V1.SipHostItem()
-
         mapper.map('host', item, 'host', 'address', remote['host'], None)
         mapper.map('port', item, 'port', 'address', remote['port'], 5060)
-
         for option in config:
             if option == 'ipv4oripv6':
                 pass
             mapper.execute(group, section, option)
 
         mapper.finish(group)
+
         self.groups.append(group)
 
         return {'success':True}
@@ -266,23 +264,21 @@ class SipSectionVisitors(SectionVisitors):
         if remote['success'] == False:
             return remote
 
-        mapper = OptionMapper()
-
         group = self.AsteriskSCF.SIP.V1.SipTCPTransportGroup()
         group.name = section
         group.configurationItems = {}
 
+        mapper = OptionMapper()
         item = self.AsteriskSCF.SIP.V1.SipHostItem()
-
         mapper.map('host', item, 'host', 'address', remote['host'], None)
         mapper.map('port', item, 'port', 'address', remote['port'], 5060)
-
         for option in config.options(section):
             if option == 'ipv4oripv6':
                 pass
             mapper.execute(group, section, option)
 
         mapper.finish(group)
+
         self.groups.append(group)
 
         return {'success':True}
@@ -292,34 +288,32 @@ class SipSectionVisitors(SectionVisitors):
         if remote['success'] == False:
             return remote
 
-        mapper = OptionMapper()
-
         group = self.AsteriskSCF.SIP.V1.SipTLSTransportGroup()
         group.name = section
         group.configurationItems = {}
 
+        mapper = OptionMapper()
         item = self.AsteriskSCF.SIP.V1.SipHostItem()
-
         mapper.map('host', item, 'host', 'address', remote['host'], None)
         mapper.map('port', item, 'port', 'address', remote['port'], 5060)
-
         for option in config.options(section):
             if option == 'ipv4oripv6':
                 pass
             mapper.execute(group, section, option)
 
         mapper.finish(group)
+
         self.groups.append(group)
 
         return {'success':True}
 
     def visit_endpoint(self, config, section):
-        mapper = OptionMapper()
-
         group = self.AsteriskSCF.SIP.V1.SipEndpointGroup()
         group.name = section
         group.configurationItems = {}
 
+        mapper = OptionMapper()
+
         mapper.map('routing', self.AsteriskSCF.SIP.V1.SipRoutingItem(), 'routingServiceName', 'routingService', config.get, None)
 
         remote = self.getRemoteHost(section, config, 'sourcehost', 'sourceport')
@@ -336,16 +330,24 @@ class SipSectionVisitors(SectionVisitors):
         mapper.map('targethost', item, 'host', 'targetaddress', remote['targethost'], None)
         mapper.map('targetport', item, 'port', 'targetaddress', remote['targetport'], 5060)
 
-        if self.chkOption(config, 'direction') == 'inbound':
-            direction = self.AsteriskSCF.SIP.V1.SipAllowableCallDirection.Inbound
-        elif self.chkOption(config, 'direction') == 'outbound':
-            direction = self.AsteriskSCF.SIP.V1.SipAllowableCallDirection.Outbound
-        elif self.chkOption(config, 'direction') == 'both':
-            direction = self.AsteriskSCF.SIP.V1.SipAllowableCallDirection.Both
-        else:
-            direction = self.AsteriskSCF.SIP.V1.SipAllowableCallDirection.Both
+        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
+
+        transformer = AllowableCallDirectionTransformer()
 
-        mapper.map('direction', self.AsteriskSCF.SIP.V1.SipAllowableCallDirectionItem(), 'callDirection', 'callDirection', direction, None)
+        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)
+
+        item = AsteriskSCF.SIP.V1.SipRTPMediaServiceItem()
+        mapper.map('rtpoveripv6', item, 'requireIPv6', 'mediaservice', self.chkOption(config, 'rtpoveripv6'), None)
 
         item = self.AsteriskSCF.SIP.V1.SipCryptoCertificateItem()
         mapper.map('certificateauthorityfile', item, 'certificateAuthority', 'cryptocert', self.chkOption(config, 'certificateauthorityfile'), None)
@@ -398,11 +400,11 @@ class SipSectionVisitors(SectionVisitors):
 
 class RtpSectionVisitors(SectionVisitors):
     def visit_general(self, config, section):
-        mapper = OptionMapper()
-
         group = self.AsteriskSCF.Media.RTP.V1.RtpGeneralGroup()
         group.configurationItems = {}
 
+        mapper = OptionMapper()
+
         portsItem = self.AsteriskSCF.Media.RTP.V1.PortRangesItem()
         mapper.map('startport', portsItem, 'startPort', self.AsteriskSCF.Media.RTP.V1.PortRangesItemName, self.chkOption(config, 'startport'), 10000)
         mapper.map('endport', portsItem, 'endPort', self.AsteriskSCF.Media.RTP.V1.PortRangesItemName, self.chkOption(config, 'endport'), 20000)
diff --git a/tests/sip/SysTest_Functional_Basic_CallSetup/testcase.yaml b/tests/sip/SysTest_Functional_Basic_CallSetup/testcase.yaml
index 1fca5b0..5d9f095 100644
--- a/tests/sip/SysTest_Functional_Basic_CallSetup/testcase.yaml
+++ b/tests/sip/SysTest_Functional_Basic_CallSetup/testcase.yaml
@@ -11,15 +11,10 @@ tests :
                 testsuite_remote_host : testsuite-remote-1.digium.internal
                 cmd :
                     start :
-                        #- service_locator_replicator
                         - service_locator
-                        #- bridge_state_replicator
                         - bridge
-                        #- routing_state_replicator
                         - routing
-                        #- sip_state_replicator
                         - sip_session_gateway
-                        #- rtp_state_replicator
                         - media_rtp_pjmedia
             - asteriskscf_configurator :
                 service_locator_host : testsuite-remote-1.digium.internal
@@ -39,6 +34,8 @@ tests :
                             sourceport : 5060
                             ipv4oripv6 : ipv4
                             direction : both
+                            securetransport : none
+                            rtpoveripv6 : no
                         - sipp :
                             type : endpoint
                             targethost : testsuite-remote-3.digium.internal
@@ -47,6 +44,8 @@ tests :
                             sourceport : 5060
                             ipv4oripv6 : ipv4
                             direction : both
+                            securetransport : none
+                            rtpoveripv6 : no
                     rtp :
                          - general :
                             startport : 10001
@@ -77,16 +76,11 @@ tests :
                 testsuite_remote_host : testsuite-remote-1.digium.internal
                 cmd :
                     start :
-                        - service_locator_replicator
                         - service_locator
                         - logger_server
-                        - bridge_state_replicator
                         - bridge
-                        - routing_state_replicator
                         - routing
-                        - sip_state_replicator
                         - sip_session_gateway
-                        - rtp_state_replicator
                         - media_rtp_pjmedia
             - asteriskscf_configurator :
                 service_locator_host : testsuite-remote-1.digium.internal
@@ -106,6 +100,8 @@ tests :
                             sourceport : 5060
                             ipv4oripv6 : ipv6
                             direction : both
+                            securetransport : none
+                            rtpoveripv6 : yes
                         - sipp :
                             type : endpoint
                             targethost : testsuite-remote-3.digium.internal
@@ -114,6 +110,8 @@ tests :
                             sourceport : 5060
                             ipv4oripv6 : ipv6
                             direction : both
+                            securetransport : none
+                            rtpoveripv6 : yes
                     rtp :
                          - general :
                             startport : 10001

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


-- 
asterisk-scf/integration/testsuite.git



More information about the asterisk-scf-commits mailing list