<p>Jenkins2 <strong>merged</strong> this change.</p><p><a href="https://gerrit.asterisk.org/8712">View Change</a></p><div style="white-space:pre-wrap">Approvals:
  Benjamin Keith Ford: Looks good to me, but someone else must approve
  George Joseph: Looks good to me, approved
  Jenkins2: Approved for Submit

</div><pre style="font-family: monospace,monospace; white-space: pre-wrap;">Remove checks for Asterisk version.<br><br>It is no longer needed to check for Asterisk version.  This removes all<br>version detection code and conditionals based on version.<br><br>This change results in some minor changes of behavior:<br>* Some places where output included "Asterisk <version>" now just says<br>  "Asterisk".<br>* The Asterisk version is no longer provided as a command-line argument<br>  when running individual tests.<br>* tests/http_server/servername no longer checks the specific version,<br>  only that unconfigured server name matches regular expression<br>  "^Asterisk/.".<br><br>Change-Id: I1ef916e1e52b9712b3c25bf63ee750b4b456f09e<br>---<br>M README.txt<br>M lib/python/asterisk/apptest.py<br>M lib/python/asterisk/asterisk.py<br>M lib/python/asterisk/test_case.py<br>M lib/python/asterisk/test_config.py<br>M lib/python/asterisk/test_runner.py<br>M lib/python/asterisk/thread_test_condition.py<br>D lib/python/asterisk/version.py<br>M runtests.py<br>M sample-yaml/test-config.yaml.sample<br>M test-config.yaml<br>M tests/apps/bridge/bridge_transfer_callee/run-test<br>M tests/apps/confbridge/confbridge_nominal/run-test<br>M tests/apps/directed_pickup/pickup_chan/run-test<br>M tests/apps/queues/queue_baseline/run-test<br>M tests/apps/queues/reason_pause_ami/run-test<br>M tests/apps/queues/set_penalty/run-test<br>M tests/bridge/atxfer_nominal/transfer.py<br>M tests/bridge/blonde_nominal/transfer.py<br>M tests/bridge/dial_LS_options/Tester.py<br>M tests/bridge/parkcall/Executioner.py<br>M tests/bridge/parkcall_blindxfer/Hangup.py<br>M tests/bridge/parkcall_bridgefeatures/Executioner.py<br>M tests/bridge/parkcall_timeout/comebacktoorigin_no/Executioner.py<br>M tests/bridge/parkcall_timeout/comebacktoorigin_yes/Executioner.py<br>M tests/callparking/run-test<br>M tests/callparking_retrieval/run-test<br>M tests/channels/SIP/SDP_attribute_passthrough/run-test<br>D tests/channels/SIP/SDP_attribute_passthrough/sipp/phone_A_h263.xml<br>D tests/channels/SIP/SDP_attribute_passthrough/sipp/phone_A_h264.xml<br>D tests/channels/SIP/SDP_attribute_passthrough/sipp/phone_B_h263.xml<br>D tests/channels/SIP/SDP_attribute_passthrough/sipp/phone_B_h264.xml<br>M tests/channels/SIP/SDP_offer_answer/run-test<br>D tests/channels/SIP/SDP_offer_answer/sipp/decline_unsupported_image_multi_1.8.xml<br>M tests/channels/SIP/info_dtmf/run-test<br>M tests/channels/SIP/nat_supertest/run-test<br>M tests/channels/SIP/sip_attended_transfer/attended_transfer.py<br>M tests/channels/SIP/sip_blind_transfer/callee_refer_only/run-test<br>M tests/channels/SIP/sip_blind_transfer/callee_with_reinvite/run-test<br>M tests/channels/SIP/sip_blind_transfer/caller_refer_only/run-test<br>M tests/channels/SIP/sip_blind_transfer/caller_with_reinvite/run-test<br>M tests/channels/SIP/sip_hold/run-test<br>M tests/channels/SIP/sip_hold_direct_media/run-test<br>M tests/channels/SIP/sip_hold_ice/run-test<br>M tests/channels/SIP/sip_one_legged_transfer/run-test<br>M tests/channels/SIP/sip_tls_call/run-test<br>M tests/channels/pjsip/sdp_offer_answer/attribute_passthrough/speex_h263_h264/run-test<br>M tests/fax/pjsip/t38_fast_reject/run-test<br>M tests/feature_call_pickup/run-test<br>M tests/http_server/servername/run-test<br>M tests/masquerade/run-test<br>M tests/rest_api/danger/safe/safe.py<br>M usage.py<br>53 files changed, 146 insertions(+), 2,363 deletions(-)<br><br></pre><pre style="font-family: monospace,monospace; white-space: pre-wrap;">diff --git a/README.txt b/README.txt<br>index 2135791..91bc21e 100644<br>--- a/README.txt<br>+++ b/README.txt<br>@@ -458,9 +458,7 @@<br> # The properties section contains information about requirements and<br> # dependencies for this test.<br> properties:<br>-    minversion : '1.8.0.0' # minimum Asterisk version compatible with this test<br>     buildoption : 'TEST_FRAMEWORK' # OPTIONAL - Asterisk compilation flag<br>-    maxversion : '10.5.1' # OPTIONAL<br>     features:<br>         # List features the Asterisk version under test must support for this test<br>         # to execute.  All features must be satisfied for the test to run.<br>diff --git a/lib/python/asterisk/apptest.py b/lib/python/asterisk/apptest.py<br>index 77d74e2..1fc8496 100644<br>--- a/lib/python/asterisk/apptest.py<br>+++ b/lib/python/asterisk/apptest.py<br>@@ -20,7 +20,6 @@<br> sys.path.append("lib/python")<br> from test_case import TestCase<br> from ami import AMIEventInstance<br>-from version import AsteriskVersion<br> <br> LOGGER = logging.getLogger(__name__)<br> <br>@@ -87,14 +86,6 @@<br> <br>     def _create_application_event_instances(self, channel_id, events):<br>         for event_config in events:<br>-            minversion = event_config.get('minversion')<br>-            maxversion = event_config.get('maxversion')<br>-            if (minversion is not None and<br>-                    AsteriskVersion() < AsteriskVersion(minversion)):<br>-                continue<br>-            if (maxversion is not None and<br>-                    AsteriskVersion() >= AsteriskVersion(maxversion)):<br>-                continue<br>             ae_instance = ApplicationEventInstance(channel_id,<br>                                                    event_config,<br>                                                    self)<br>diff --git a/lib/python/asterisk/asterisk.py b/lib/python/asterisk/asterisk.py<br>index 10ee683..985afea 100755<br>--- a/lib/python/asterisk/asterisk.py<br>+++ b/lib/python/asterisk/asterisk.py<br>@@ -21,7 +21,6 @@<br> import test_suite_utils<br> <br> from config import ConfigFile<br>-from version import AsteriskVersion<br> <br> from twisted.internet import reactor, protocol, defer, utils, error<br> from twisted.python.failure import Failure<br>@@ -369,15 +368,10 @@<br>         self.process = None<br>         self.astetcdir = ""<br>         self.original_astmoddir = ""<br>-        self.ast_version = None<br>         self.remote_config = remote_config<br>         self.memcheck_delay_stop = 0<br>         if test_config is not None and 'memcheck-delay-stop' in test_config:<br>             self.memcheck_delay_stop = test_config['memcheck-delay-stop'] or 0<br>-<br>-        # If the process is remote, don't bother<br>-        if not self.remote_config:<br>-            self.ast_version = AsteriskVersion()<br> <br>         valgrind_env = os.getenv("VALGRIND_ENABLE") or ""<br>         self.valgrind_enabled = True if "true" in valgrind_env else False<br>@@ -579,10 +573,7 @@<br>         def __send_stop_gracefully():<br>             """Send a core stop gracefully CLI command"""<br>             LOGGER.debug('sending stop gracefully')<br>-            if self.ast_version and self.ast_version < AsteriskVersion("1.6.0"):<br>-                cli_deferred = self.cli_exec("stop gracefully")<br>-            else:<br>-                cli_deferred = self.cli_exec("core stop gracefully")<br>+            cli_deferred = self.cli_exec("core stop gracefully")<br>             cli_deferred.addCallbacks(__stop_gracefully_callback, __stop_gracefully_error)<br> <br>         def __stop_gracefully_callback(cli_command):<br>@@ -771,8 +762,7 @@<br>             LOGGER.error("Config file '%s' does not exist" % cfg_path)<br>             return<br> <br>-        tmp = "%s/%s/%s" % (os.path.dirname(cfg_path),<br>-                            self.ast_version.branch if self.ast_version else '',<br>+        tmp = "%s/%s" % (os.path.dirname(cfg_path),<br>                             os.path.basename(cfg_path))<br>         if os.path.exists(tmp):<br>             cfg_path = tmp<br>@@ -860,10 +850,7 @@<br>                 "<tech/data> application <appname> appdata\n"<br>                 "<tech/data> extension <exten>@<context>")<br> <br>-        if self.ast_version and self.ast_version < AsteriskVersion("1.6.2"):<br>-            return self.cli_exec("originate %s" % argstr)<br>-        else:<br>-            return self.cli_exec("channel originate %s" % argstr)<br>+        return self.cli_exec("channel originate %s" % argstr)<br> <br>     def cli_exec(self, cli_cmd):<br>         """Execute a CLI command on this instance of Asterisk.<br>diff --git a/lib/python/asterisk/test_case.py b/lib/python/asterisk/test_case.py<br>index 1ef360e..80321f7 100644<br>--- a/lib/python/asterisk/test_case.py<br>+++ b/lib/python/asterisk/test_case.py<br>@@ -22,7 +22,6 @@<br> from asterisk import Asterisk<br> from test_config import TestConfig<br> from test_conditions import TestConditionController<br>-from version import AsteriskVersion<br> <br> <br> try:<br>@@ -135,7 +134,6 @@<br>         self.create_pcap = False<br>         self._stopping = False<br>         self.testlogdir = self._set_test_log_directory()<br>-        self.ast_version = AsteriskVersion()<br>         self._start_callbacks = []<br>         self._stop_callbacks = []<br>         self._ami_connect_callbacks = []<br>diff --git a/lib/python/asterisk/test_config.py b/lib/python/asterisk/test_config.py<br>index 260d292..8fdb884 100644<br>--- a/lib/python/asterisk/test_config.py<br>+++ b/lib/python/asterisk/test_config.py<br>@@ -20,7 +20,6 @@<br> <br> import test_suite_utils<br> <br>-from version import AsteriskVersion<br> from asterisk import Asterisk<br> from buildoptions import AsteriskBuildOptions<br> from sippversion import SIPpVersion<br>@@ -294,11 +293,6 @@<br>         self.config = None<br>         self.summary = None<br>         self.description = None<br>-        self.maxversion = []<br>-        self.maxversion_check = False<br>-        self.minversion = []<br>-        self.minversion_check = False<br>-        self.forced_version = None<br>         self.deps = []<br>         self.tags = []<br>         self.expect_pass = True<br>@@ -326,7 +320,6 @@<br>         if self.global_test_config is not None:<br>             settings = self.global_test_config<br>             self.condition_definitions = settings.condition_definitions<br>-            self.forced_version = settings.forced_version<br>             return<br> <br>         if "global-settings" in self.config:<br>@@ -369,16 +362,6 @@<br>         if "properties" not in self.config:<br>             return<br>         properties = self.config["properties"]<br>-        minversion = properties.get("minversion", ["1.4"])<br>-<br>-        if not isinstance(minversion, list):<br>-            minversion = [minversion]<br>-        self.minversion = [AsteriskVersion(ver) for ver in minversion]<br>-<br>-        maxversion = properties.get("maxversion", [])<br>-        if not isinstance(maxversion, list):<br>-            maxversion = [maxversion]<br>-        self.maxversion = [AsteriskVersion(ver) for ver in maxversion]<br> <br>         self.expect_pass = (properties.get("expectedResult", self.expect_pass) and<br>                             properties.get("expected-result", self.expect_pass))<br>@@ -386,15 +369,9 @@<br>             self.tags = properties["tags"]<br>         if "features" in properties:<br>             self.features = set(properties["features"])<br>-        if "forced-version" in properties:<br>-            self.forced_version = AsteriskVersion(properties["forced-version"])<br>-<br>-        for ver in self.minversion:<br>-            if ver.feature:<br>-                self.features.add(ver.feature)<br> <br>         for feature in self.features:<br>-            self.feature_check[feature] = False<br>+            self.feature_check[feature] = True<br> <br>     def _parse_config(self):<br>         """Parse the test-config YAML file."""<br>@@ -469,49 +446,15 @@<br>             ]<br>         return self.deps<br> <br>-    def check_deps(self, ast_version):<br>+    def check_deps(self):<br>         """Check whether or not a test should execute based on its dependencies<br> <br>-        Keyword arguments:<br>-        ast_version The AsteriskVersion object containing the version of<br>-                    Asterisk that will be executed<br>         Returns:<br>         can_run True if the test can execute, False otherwise<br>         """<br> <br>         if not self.config:<br>             return False<br>-<br>-        if self.forced_version is not None:<br>-            ast_version = self.forced_version<br>-<br>-        # If we have a minimum version for our branch; use that. Otherwise,<br>-        # compare against all listed minimum versions.<br>-        min_candidates = [ver for ver in self.minversion<br>-                          if ver.major == ast_version.major]<br>-        if not len(min_candidates):<br>-            min_candidates = self.minversion<br>-        self.minversion_check = all([ast_version >= ver<br>-                                     for ver in min_candidates])<br>-<br>-        # Max version is a bit different: generally, it is a hard cut-off<br>-        # (as what the test covers has been removed).  If we have a maximum<br>-        # version for our branch; use that.  Otherwise, compare against all<br>-        # listed maximum versions.<br>-        max_candidates = [ver for ver in self.maxversion<br>-                          if ver.major == ast_version.major]<br>-        if not len(max_candidates):<br>-            max_candidates = self.maxversion<br>-        self.maxversion_check = all([ast_version < ver<br>-                                     for ver in max_candidates])<br>-<br>-        if not self.minversion_check or not self.maxversion_check:<br>-            self.can_run = False<br>-<br>-        for feature in self.features:<br>-            self.feature_check[feature] = ast_version.has_feature(feature)<br>-            if not self.feature_check[feature]:<br>-                self.can_run = False<br> <br>         for dep in self.get_deps():<br>             if dep.met is False:<br>diff --git a/lib/python/asterisk/test_runner.py b/lib/python/asterisk/test_runner.py<br>index a31c8ca..644d117 100755<br>--- a/lib/python/asterisk/test_runner.py<br>+++ b/lib/python/asterisk/test_runner.py<br>@@ -25,8 +25,6 @@<br> <br> sys.path.append('lib/python')<br> <br>-from version import AsteriskVersion<br>-<br> <br> class TestModuleFinder(object):<br>     """Determines if a module is a test module that can be loaded"""<br>@@ -94,13 +92,12 @@<br> sys.path_hooks.append(TestModuleFinder)<br> <br> <br>-def load_test_modules(test_config, test_object, ast_version):<br>+def load_test_modules(test_config, test_object):<br>     """Load the pluggable modules for a test<br> <br>     Keyword Arguments:<br>     test_config The test configuration object<br>     test_object The test object that the modules will attach to<br>-    ast_version A string containing the Asterisk version<br>     """<br> <br>     if not test_object:<br>@@ -113,75 +110,18 @@<br>         return<br> <br>     for module_spec in test_config['test-modules']['modules']:<br>-        if check_module_version(module_spec, ast_version):<br>-            # If there's a specific portion of the config for this module,<br>-            # use it<br>-            if ('config-section' in module_spec<br>-                    and module_spec['config-section'] in test_config):<br>-                module_config = test_config[module_spec['config-section']]<br>-            else:<br>-                module_config = test_config<br>-<br>-            module_type = load_and_parse_module(module_spec['typename'])<br>-            # Modules take in two parameters: the module configuration object,<br>-            # and the test object that they attach to<br>-            module_type(module_config, test_object)<br>+        # If there's a specific portion of the config for this module,<br>+        # use it<br>+        if ('config-section' in module_spec<br>+                and module_spec['config-section'] in test_config):<br>+            module_config = test_config[module_spec['config-section']]<br>         else:<br>-            LOGGER.debug("Skipping the loading of test module %s due to it's "<br>-                         "minversion and/or maxversion not being met." %<br>-                         module_spec['typename'])<br>+            module_config = test_config<br> <br>-<br>-def check_module_version(module_spec, ast_version):<br>-    """Check the module configuration for minversion and maxversion and check<br>-    if the Asterisk version meets the version(s) if found<br>-<br>-    Keyword Arguments:<br>-    module_spec A dictionary of a pluggable module configuration<br>-    ast_version A string containing the Asterisk version<br>-<br>-    Returns:<br>-    False if minversion or maxversion are found and do not meet the Asterisk<br>-    version, True otherwise<br>-    """<br>-<br>-    running_version = AsteriskVersion(ast_version)<br>-<br>-    minversion = module_spec.get("minversion", [])<br>-    if not isinstance(minversion, list):<br>-        minversion = [minversion]<br>-    min_versions = [AsteriskVersion(ver) for ver in minversion]<br>-<br>-    # If we have a minimum version for our branch; use that.  Otherwise,<br>-    # compare against all listed minimum versions.<br>-    min_candidates = [ver for ver in min_versions<br>-                      if ver.major == running_version.major]<br>-    if not len(min_candidates):<br>-        min_candidates = min_versions<br>-    min_version_check = all([running_version >= ver for ver in min_candidates])<br>-<br>-    if not min_version_check:<br>-        return False<br>-<br>-    maxversion = module_spec.get("maxversion", [])<br>-    if not isinstance(maxversion, list):<br>-        maxversion = [maxversion]<br>-    max_versions = [AsteriskVersion(ver) for ver in maxversion]<br>-<br>-    # Max version is a bit different: generally, it is a hard cut-off<br>-    # (as what the test covers has been removed).  If we have a maximum<br>-    # version for our branch; use that.  Otherwise, compare against all<br>-    # listed maximum versions.<br>-    max_candidates = [ver for ver in max_versions<br>-                      if ver.major == running_version.major]<br>-    if not len(max_candidates):<br>-        max_candidates = max_versions<br>-    max_version_check = all([running_version < ver for ver in max_candidates])<br>-<br>-    if not max_version_check:<br>-        return False<br>-<br>-    return True<br>+        module_type = load_and_parse_module(module_spec['typename'])<br>+        # Modules take in two parameters: the module configuration object,<br>+        # and the test object that they attach to<br>+        module_type(module_config, test_object)<br> <br> <br> def load_and_parse_module(type_name):<br>@@ -213,7 +153,7 @@<br>     return module<br> <br> <br>-def create_test_object(test_path, test_config, ast_version):<br>+def create_test_object(test_path, test_config):<br>     """Create the specified test object from the test configuration<br> <br>     Parameters:<br>@@ -231,8 +171,7 @@<br>         objs = test_config['test-modules']['test-object']<br>         if not isinstance(objs, list):<br>             objs = [objs]<br>-        return next((obj for obj in objs if check_module_version(<br>-            obj, ast_version)), None)<br>+        return next((obj for obj in objs), None)<br> <br>     if not 'test-modules' in test_config:<br>         LOGGER.error("No test-modules block in configuration")<br>@@ -338,18 +277,6 @@<br>         return 1<br>     test_directory = args[1]<br> <br>-    if (len(args) < 3):<br>-        LOGGER.error("test_runner requires the Asterisk version to execute")<br>-        return 1<br>-    ast_version = args[2]<br>-<br>-    try:<br>-        AsteriskVersion()<br>-    except OSError:<br>-        # If there is no Asterisk version on the local system, then we need to<br>-        # set the version to the one that was passed into the application.<br>-        AsteriskVersion(default=ast_version)<br>-<br>     LOGGER.info("Starting test run for %s" % test_directory)<br>     test_config = load_test_config(test_directory)<br>     if test_config is None:<br>@@ -357,16 +284,16 @@<br> <br>     read_module_paths(test_config, test_directory)<br> <br>-    test_object = create_test_object(test_directory, test_config, ast_version)<br>+    test_object = create_test_object(test_directory, test_config)<br>     if test_object is None:<br>         return 1<br> <br>     # Load other modules that may be specified<br>-    load_test_modules(test_config, test_object, ast_version)<br>+    load_test_modules(test_config, test_object)<br> <br>     # Load global modules as well<br>     if test_object.global_config.config:<br>-        load_test_modules(test_object.global_config.config, test_object, ast_version)<br>+        load_test_modules(test_object.global_config.config, test_object)<br> <br>     # Kick off the twisted reactor<br>     reactor.run()<br>diff --git a/lib/python/asterisk/thread_test_condition.py b/lib/python/asterisk/thread_test_condition.py<br>index 0b622ea..595e3ce 100644<br>--- a/lib/python/asterisk/thread_test_condition.py<br>+++ b/lib/python/asterisk/thread_test_condition.py<br>@@ -10,7 +10,6 @@<br> <br> import logging<br> from test_conditions import TestCondition<br>-from version import AsteriskVersion<br> from twisted.internet import defer<br> <br> LOGGER = logging.getLogger(__name__)<br>@@ -23,9 +22,6 @@<br>     check thread usage in Asterisk.  It provides common functionality for<br>     parsing out the results of the 'core show threads' Asterisk command<br>     """<br>-<br>-    _ast_version = AsteriskVersion()<br>-    _ast_version_10 = AsteriskVersion("10")<br> <br>     def __init__(self, test_config):<br>         """Constructor<br>@@ -62,15 +58,9 @@<br>             if 'threads listed' in line or 'Asterisk ending' in line:<br>                 continue<br> <br>-            # get the name and thread ID - strip off the cli_exec / pthread ID<br>-            initial_partition = line.partition(' ')<br>-<br>-            #In v10 and greater, the result of core show threads introduces the<br>-            # Asterisk thread ID immediately after the pthread ID.  Use that if<br>-            # it's available.<br>-<br>-            if (ThreadTestCondition._ast_version >= ThreadTestCondition._ast_version_10):<br>-                initial_partition = initial_partition[2].partition(' ')<br>+            # The result of core show threads includes the Asterisk thread ID<br>+            # immediately after the pthread ID.<br>+            initial_partition = initial_partition[2].partition(' ')<br>             thread_id = initial_partition[0]<br>             thread_name = initial_partition[2].partition(' ')[0]<br>             if (thread_id != "" and thread_name != ""<br>diff --git a/lib/python/asterisk/version.py b/lib/python/asterisk/version.py<br>deleted file mode 100644<br>index 5c25032..0000000<br>--- a/lib/python/asterisk/version.py<br>+++ /dev/null<br>@@ -1,804 +0,0 @@<br>-#!/usr/bin/env python<br>-"""Asterisk Version String Handling<br>-<br>-This module implements an Asterisk version string parser.  It can also compare<br>-version strings to determine which version is considered newer.<br>-<br>-Copyright (C) 2012, Digium, Inc.<br>-Russell Bryant <russell@digium.com><br>-Matt Jordan <mjordan@digium.com><br>-<br>-This program is free software, distributed under the terms of<br>-the GNU General Public License Version 2.<br>-"""<br>-<br>-import re<br>-import unittest<br>-import logging<br>-import sys<br>-import subprocess<br>-<br>-import test_suite_utils<br>-<br>-LOGGER = logging.getLogger(__name__)<br>-<br>-<br>-def parse_svn_branch_name(branch_tokens):<br>-    """Parse an Asterisk SVN branch version"""<br>-    name = branch_tokens[0]<br>-    munched = 0<br>-    for i in range(1, len(branch_tokens)):<br>-        # Stop when we hit the revision<br>-        if branch_tokens[i][0] == 'r':<br>-            candidate = branch_tokens[i].replace('r', '')<br>-            candidate = candidate.replace('M', '').replace('m', '')<br>-            if candidate.isdigit():<br>-                break<br>-        name += '-' + branch_tokens[i]<br>-        munched += 1<br>-    return (name, munched)<br>-<br>-<br>-def parse_version(version_string):<br>-    """Parse a 'standard' Asterisk version"""<br>-    parsed_numbers = [0, 0, 0]<br>-    if '/' in version_string:<br>-        # Strip off any prefix<br>-        version_string = version_string[version_string.index('/') + 1:]<br>-    version_tokens = version_string.split('.')<br>-    count = 0<br>-    if not version_tokens[0].isdigit():<br>-        return (parsed_numbers, False)<br>-    for token in version_tokens:<br>-        if count == 0 and int(token) == 1:<br>-            # Skip '1' in '1.8' branches - it adds no value<br>-            continue<br>-        parsed_numbers[count] = int(token)<br>-        count += 1<br>-    return (parsed_numbers, True)<br>-<br>-<br>-def parse_revision(revision_string):<br>-    """Parse a modified version of Asterisk"""<br>-    candidate = revision_string.replace('M', '')<br>-    candidate = candidate.replace('r', '').replace('m', '')<br>-    if candidate.isdigit():<br>-        return (int(candidate), True)<br>-    return (0, False)<br>-<br>-<br>-def parse_feature(feature_string):<br>-    """Parse a feature from a version"""<br>-    for feature in AsteriskVersion.supported_features:<br>-        if feature in feature_string:<br>-            feature_string = feature_string.replace(feature, '')<br>-            iteration = -1<br>-            if (len(feature_string) > 0):<br>-                iteration = int(feature_string)<br>-            return (feature, iteration, True)<br>-    return ('', -1, False)<br>-<br>-<br>-def parse_version_modifier(version_modifier):<br>-    """Parse a version modifier"""<br>-    for modifier in AsteriskVersion.supported_modifiers:<br>-        if modifier in version_modifier:<br>-            version_modifier = version_modifier.replace(modifier, '')<br>-            iteration = -1<br>-            if (len(version_modifier) > 0):<br>-                iteration = int(version_modifier)<br>-            return (modifier, iteration, True)<br>-    return ('', -1, False)<br>-<br>-<br>-def parse_parent_branch(parent_branch):<br>-    """Parse a parent branch out of a version branch"""<br>-    # Parent branch can be just about anything, so just accept it.<br>-    # This should be the last thing called.<br>-    return (parent_branch, True)<br>-<br>-DEFAULT_VERSION = None<br>-<br>-class AsteriskVersion(object):<br>-    """An Asterisk Version.<br>-<br>-    This class handles Asterisk version strings.<br>-<br>-    Attributes:<br>-    raw_version - The pre-parsed version string<br>-    branch      - If true, this is a branch and not a tag. Note that<br>-                  if svn is True, then this implies that we think this<br>-                  must be 'trunk'. This is always True if git is True.<br>-    svn         - The Asterisk version is derived from Subversion<br>-    git         - The Asterisk version is derived from Git<br>-    major       - The major version number<br>-    minor       - The minor version number<br>-    patch       - The patch version number<br>-    feature     - Asterisk specific branch/tag features, e.g., 'cert'<br>-    modifier    - Asterisk tag release modifiers, e.g., 'rc'<br>-    iteration   - Iteration of the modifier, e.g., 1 for 'rc1'<br>-    parent      - If a parent SVN branch exists, what branch this was<br>-                  derived from<br>-    name        - The name of the team branch or 'trunk' for SVN, or<br>-                  'master' for Git. If None, then a major/minor/patch<br>-                  version should be available.<br>-    """<br>-<br>-    supported_features = ['cert', 'digiumphones', 'dfsg']<br>-<br>-    supported_modifiers = ['rc', 'beta']<br>-<br>-    def __init__(self, version=None, default=None):<br>-        """Construct an Asterisk Version parser.<br>-<br>-        Keyword Arguments:<br>-        version -- The Asterisk version string to parse.<br>-        default -- Set a default version value. Whenever the initializer is<br>-                   called without the version keyword argument, then this<br>-                   default version will get returned instead. This setting<br>-                   persists beyond the lifetime of this object.<br>-        """<br>-        global DEFAULT_VERSION<br>-<br>-        if default:<br>-            DEFAULT_VERSION = default<br>-<br>-        if not version:<br>-            if DEFAULT_VERSION:<br>-                version = DEFAULT_VERSION<br>-            else:<br>-                version = AsteriskVersion.get_version_from_binary()<br>-<br>-        self.raw_version = version<br>-        self.branch = False<br>-        self.svn = False<br>-        self.git = False<br>-        self.major = 0<br>-        self.minor = 0<br>-        self.patch = 0<br>-        self.iteration = 0<br>-        self.revision = None<br>-        self.feature = None<br>-        self.modifier = None<br>-        self.parent = None<br>-        self.name = None<br>-<br>-        self.parse_version_string(self.raw_version)<br>-<br>-    def parse_version_string(self, raw_version):<br>-        """Parse a raw version string into its parts"""<br>-        parsed_numbers = [0, 0, 0]<br>-        raw_version = raw_version.replace('Asterisk ', '')<br>-<br>-        tokens = re.split('[-~]', raw_version)<br>-        count = 0<br>-        while (count < len(tokens)):<br>-            token = tokens[count]<br>-            # Determine if we're a subversion branch<br>-            if 'SVN' == token:<br>-                self.svn = True<br>-            elif 'GIT' == token:<br>-                # All Git versions are branches<br>-                self.git = True<br>-                self.branch = True<br>-            elif 'branch' == token:<br>-                self.branch = True<br>-            else:<br>-                if self.svn and not self.branch and not self.name:<br>-                    # Team branch or trunk.  This will modify the current<br>-                    # position based on the number of tokens consumed<br>-                    (self.name,<br>-                     munched) = parse_svn_branch_name(tokens[count:])<br>-                    count += munched<br>-                elif self.git and token == 'master':<br>-                    # It's a Git branch! This should contain our upstream<br>-                    # major branch, so we only care if the current token<br>-                    # says this is master.<br>-                    self.name = token<br>-                else:<br>-                    handled = False<br>-                    if (len([num for num in parsed_numbers if num != 0]) == 0):<br>-                        (parsed_numbers, handled) = parse_version(token)<br>-                        self.major = parsed_numbers[0]<br>-                        self.minor = parsed_numbers[1]<br>-                        self.patch = parsed_numbers[2]<br>-                    if not handled and '/' in token and not self.feature and not self.revision:<br>-                        # Strip off any prefix and update the version numbers<br>-                        token = token[token.index('/') + 1:]<br>-                        ((self.major, self.minor, self.patch), handled) = parse_version(token)<br>-                    if not handled and not self.feature:<br>-                        # If a feature returns back a number, its actually the<br>-                        # 'patch' version number (e.g., 1.8.11-cert3)<br>-                        (self.feature, temp, handled) = parse_feature(token)<br>-                        if (temp > 0):<br>-                            self.patch = temp<br>-                    if not handled and not self.modifier:<br>-                        (self.modifier,<br>-                         self.iteration,<br>-                         handled) = parse_version_modifier(token)<br>-                    if not handled and not self.revision and not self.git:<br>-                        (self.revision, handled) = parse_revision(token)<br>-                    if not handled and not self.parent and not self.git:<br>-                        (self.parent, handled) = parse_parent_branch(token)<br>-                    if not handled and self.git:<br>-                        if self.revision:<br>-                            self.revision = '{0}-{1}'.format(self.revision, token)<br>-                        else:<br>-                            self.revision = token<br>-                        handled = True<br>-                    if not handled:<br>-                        LOGGER.error("Unable to parse token '%s' in version "<br>-                                     "string '%s'" % (token, raw_version))<br>-            count += 1<br>-<br>-    def __str__(self):<br>-        """Return the raw Asterisk version as a string"""<br>-        return self.raw_version<br>-<br>-    def __int__(self):<br>-        """Convert the Asterisk version to an integer for comparisons"""<br>-        if self.name:<br>-            return sys.maxint<br>-        elif (self.branch):<br>-            # Branches are a little odd. The more you specify, the less your<br>-            # calculated value is. This keeps the following relationships true:<br>-            # branch-1.8 > 1.8.12.0 > branch-1.8.11-cert<br>-            value = self.major * 100000000<br>-            if (self.minor == 0):<br>-                value += 9900000<br>-            else:<br>-                value += self.minor * 100000<br>-            if (self.patch == 0):<br>-                value += 99000<br>-            else:<br>-                value += self.patch * 1000<br>-            value += 999<br>-            return value<br>-        else:<br>-            return (self._modifier_weight() + self.patch * 1000 +<br>-                    self.minor * 100000 + self.major * 100000000)<br>-<br>-    def __lt__(self, other):<br>-        """Test if self < other """<br>-        if int(self) < int(other):<br>-            return True<br>-        elif self.svn and other.svn:<br>-            return self.revision < other.revision<br>-        else:<br>-            return False<br>-<br>-    def __le__(self, other):<br>-        """Test if self <= other"""<br>-        if int(self) <= int(other):<br>-            return True<br>-        elif self.svn and other.svn:<br>-            return self.revision <= other.revision<br>-        else:<br>-            return False<br>-<br>-    def __eq__(self, other):<br>-        """Test if self == other"""<br>-        if int(self) != int(other):<br>-            return False<br>-        if (self.svn and other.svn) or (self.git and other.git):<br>-            return self.revision == other.revision<br>-        return True<br>-<br>-    def __ne__(self, other):<br>-        """Test if self != other"""<br>-        if int(self) == int(other):<br>-            if (self.svn and other.svn) or (self.git and other.git):<br>-                return self.revision != other.revision<br>-            else:<br>-                return False<br>-        return True<br>-<br>-    def __gt__(self, other):<br>-        """Test if self > other"""<br>-        if int(self) > int(other):<br>-            return True<br>-        elif self.svn and other.svn:<br>-            return self.revision > other.revision<br>-        else:<br>-            return False<br>-<br>-    def __ge__(self, other):<br>-        """Test if self >= other"""<br>-        if int(self) >= int(other):<br>-            return True<br>-        elif self.svn and other.svn:<br>-            return self.revision >= other.revision<br>-        else:<br>-            return False<br>-<br>-    def _modifier_weight(self):<br>-        """Determine the relative weight due to a modifier"""<br>-        if self.modifier:<br>-            if self.modifier == 'rc':<br>-                return self.iteration * 10<br>-            else:<br>-                return self.iteration<br>-        return 100<br>-<br>-    def has_feature(self, feature):<br>-        """Returns:<br>-        True if this AsteriskVersion has a feature<br>-        False otherwise<br>-        """<br>-        if (self.name or self.major >= 11):<br>-            # Assume that 11 or trunk has all the features<br>-            return True<br>-        if feature == self.feature:<br>-            return True<br>-        else:<br>-            if feature == 'digiumphones' and self.feature == 'cert':<br>-                return True<br>-        return False<br>-<br>-    @classmethod<br>-    def get_version_from_binary(cls):<br>-        """Obtain the version from the installed instance of Asterisk<br>-<br>-        This method will invoke Asterisk, get the version, parse the<br>-        result, and cache it. Once cached, the cached version will<br>-        always be returned.<br>-<br>-        Returns: The installed Asterisk version<br>-        """<br>-        if not hasattr(cls, "_asterisk_version_from_binary"):<br>-            version = ""<br>-            ast_binary = (test_suite_utils.which("asterisk") or<br>-                          "/usr/sbin/asterisk")<br>-            cmd = [<br>-                ast_binary,<br>-                "-V",<br>-            ]<br>-<br>-            try:<br>-                process = subprocess.Popen(cmd, stdout=subprocess.PIPE,<br>-                                           stderr=None)<br>-                version = process.stdout.read()<br>-            except OSError as o_excep:<br>-                LOGGER.error("OSError [%d]: %s" % (o_excep.errno,<br>-                                                   o_excep.strerror))<br>-                raise<br>-            process.wait()<br>-            cls._asterisk_version_from_binary = version.replace(<br>-                "Asterisk ", "")<br>-        return cls._asterisk_version_from_binary<br>-<br>-<br>-class AsteriskVersionTests(unittest.TestCase):<br>-    """Unit tests for AsteriskVersion"""<br>-<br>-    def test_version_18_1(self):<br>-        """Test parsing 1.8 version string"""<br>-        version = AsteriskVersion("1.8.6.0")<br>-        self.assertFalse(version.svn)<br>-        self.assertFalse(version.branch)<br>-        self.assertEqual(str(version), "1.8.6.0")<br>-        self.assertEqual(version.major, 8)<br>-        self.assertEqual(version.minor, 6)<br>-        self.assertEqual(version.patch, 0)<br>-<br>-    def test_version_18_2(self):<br>-        """Test parsing another 1.8 version string"""<br>-        version = AsteriskVersion("Asterisk 1.8.13.1")<br>-        self.assertFalse(version.svn)<br>-        self.assertFalse(version.branch)<br>-        self.assertEqual(str(version), "Asterisk 1.8.13.1")<br>-        self.assertEqual(version.major, 8)<br>-        self.assertEqual(version.minor, 13)<br>-        self.assertEqual(version.patch, 1)<br>-<br>-    def test_version_10_1(self):<br>-        """Test parsing a 10 version string"""<br>-        version = AsteriskVersion("10.0")<br>-        self.assertFalse(version.svn)<br>-        self.assertFalse(version.branch)<br>-        self.assertEqual(str(version), "10.0")<br>-        self.assertEqual(version.major, 10)<br>-        self.assertEqual(version.minor, 0)<br>-        self.assertEqual(version.patch, 0)<br>-<br>-    def test_version_10_2(self):<br>-        """Test parsing another 10 version string"""<br>-        version = AsteriskVersion("Asterisk 10.5.1")<br>-        self.assertFalse(version.svn)<br>-        self.assertFalse(version.branch)<br>-        self.assertEqual(str(version), "Asterisk 10.5.1")<br>-        self.assertEqual(version.major, 10)<br>-        self.assertEqual(version.minor, 5)<br>-        self.assertEqual(version.patch, 1)<br>-<br>-    def test_version_11_1(self):<br>-        """Test parsing an 11 version string"""<br>-        version = AsteriskVersion("11")<br>-        self.assertFalse(version.svn)<br>-        self.assertFalse(version.branch)<br>-        self.assertEqual(str(version), "11")<br>-        self.assertEqual(version.major, 11)<br>-        self.assertEqual(version.minor, 0)<br>-        self.assertEqual(version.patch, 0)<br>-<br>-    def test_version_11_2(self):<br>-        """Test parsing another 11 version string"""<br>-        version = AsteriskVersion("11.1.9")<br>-        self.assertFalse(version.svn)<br>-        self.assertFalse(version.branch)<br>-        self.assertEqual(str(version), "11.1.9")<br>-        self.assertEqual(version.major, 11)<br>-        self.assertEqual(version.minor, 1)<br>-        self.assertEqual(version.patch, 9)<br>-<br>-    def test_version_11_3(self):<br>-        """Test parsing yet another 11 version string"""<br>-        version = AsteriskVersion("Asterisk 11.0")<br>-        self.assertFalse(version.svn)<br>-        self.assertFalse(version.branch)<br>-        self.assertEqual(str(version), "Asterisk 11.0")<br>-        self.assertEqual(version.major, 11)<br>-        self.assertEqual(version.minor, 0)<br>-        self.assertEqual(version.patch, 0)<br>-<br>-    def test_svn_version_trunk_1(self):<br>-        """Test parsing a trunk version with revision"""<br>-        version = AsteriskVersion("SVN-trunk-r252849")<br>-        self.assertTrue(version.svn)<br>-        self.assertFalse(version.branch)<br>-        self.assertEqual(str(version), "SVN-trunk-r252849")<br>-        self.assertEqual(version.name, "trunk")<br>-        self.assertEqual(version.revision, 252849)<br>-<br>-    def test_svn_version_trunk_2(self):<br>-        """Test parsing a modified trunk version with revision"""<br>-        version = AsteriskVersion("Asterisk SVN-trunk-r252849M")<br>-        self.assertTrue(version.svn)<br>-        self.assertFalse(version.branch)<br>-        self.assertEqual(str(version), "Asterisk SVN-trunk-r252849M")<br>-        self.assertEqual(version.name, "trunk")<br>-        self.assertEqual(version.revision, 252849)<br>-<br>-    def test_svn_version_teambranch_1(self):<br>-        """Test parsing a rather long team branch"""<br>-        version = AsteriskVersion("SVN-russell-cdr-q-r249059M-/trunk")<br>-        self.assertTrue(version.svn)<br>-        self.assertFalse(version.branch)<br>-        self.assertEqual(str(version), "SVN-russell-cdr-q-r249059M-/trunk")<br>-        self.assertEqual(version.name, "russell-cdr-q")<br>-        self.assertEqual(version.revision, 249059)<br>-        self.assertEqual(version.parent, "/trunk")<br>-<br>-    def test_svn_version_teambranch_2(self):<br>-        """Test parsing a slightly shorter team branch"""<br>-        version = AsteriskVersion("Asterisk SVN-russell-rest-r12345")<br>-        self.assertTrue(version.svn)<br>-        self.assertFalse(version.branch)<br>-        self.assertEqual(str(version), "Asterisk SVN-russell-rest-r12345")<br>-        self.assertEqual(version.name, "russell-rest")<br>-        self.assertEqual(version.revision, 12345)<br>-<br>-    def test_svn_branch_10_1(self):<br>-        """Test parsing an Asterisk 10 version branch"""<br>-        version = AsteriskVersion("SVN-branch-10-r11111")<br>-        self.assertTrue(version.svn)<br>-        self.assertTrue(version.branch)<br>-        self.assertEqual(str(version), "SVN-branch-10-r11111")<br>-        self.assertEqual(version.major, 10)<br>-        self.assertEqual(version.minor, 0)<br>-        self.assertEqual(version.patch, 0)<br>-        self.assertEqual(version.revision, 11111)<br>-<br>-    def test_svn_branch_18_features_1(self):<br>-        """Test parsing a 1.8 branch with features"""<br>-        ver = "SVN-branch-1.8-digiumphones-r357808-/branches/1.8"<br>-        version = AsteriskVersion(ver)<br>-        self.assertTrue(version.svn)<br>-        self.assertTrue(version.branch)<br>-        self.assertEqual(version.major, 8)<br>-        self.assertEqual(version.minor, 0)<br>-        self.assertEqual(version.patch, 0)<br>-        self.assertEqual(version.revision, 357808)<br>-        self.assertEqual(version.parent, '/branches/1.8')<br>-        self.assertTrue(version.feature, 'digiumphones')<br>-<br>-    def test_svn_branch_10_features_1(self):<br>-        """Test parsing a 10 branch with features"""<br>-        ver = "SVN-branch-10-digiumphones-r365402-/branches/10"<br>-        version = AsteriskVersion(ver)<br>-        self.assertTrue(version.svn)<br>-        self.assertTrue(version.branch)<br>-        self.assertEqual(version.major, 10)<br>-        self.assertEqual(version.minor, 0)<br>-        self.assertEqual(version.patch, 0)<br>-        self.assertEqual(version.revision, 365402)<br>-        self.assertEqual(version.parent, '/branches/10')<br>-        self.assertEqual(version.feature, 'digiumphones')<br>-<br>-    def test_svn_branch_10_features_2(self):<br>-        """Test parsing another 10 feature branch"""<br>-        ver = "Asterisk SVN-branch-10-digiumphones-r365402"<br>-        version = AsteriskVersion(ver)<br>-        self.assertTrue(version.svn)<br>-        self.assertTrue(version.branch)<br>-        self.assertEqual(version.major, 10)<br>-        self.assertEqual(version.minor, 0)<br>-        self.assertEqual(version.patch, 0)<br>-        self.assertEqual(version.revision, 365402)<br>-        self.assertEqual(version.feature, 'digiumphones')<br>-<br>-    def test_version_10_with_features_and_modifier(self):<br>-        """Test parsing a 10 feature branch with a modifier"""<br>-        version = AsteriskVersion("Asterisk 10.6.1-digiumphones-beta3")<br>-        self.assertFalse(version.svn)<br>-        self.assertFalse(version.branch)<br>-        self.assertEqual(version.major, 10)<br>-        self.assertEqual(version.minor, 6)<br>-        self.assertEqual(version.patch, 1)<br>-        self.assertEqual(version.feature, 'digiumphones')<br>-        self.assertEqual(version.modifier, 'beta')<br>-        self.assertEqual(version.iteration, 3)<br>-<br>-    def test_svn_1811_certified_1(self):<br>-        """Test a CA 1.8 version tag"""<br>-        version = AsteriskVersion("Asterisk 1.8.11-cert1")<br>-        self.assertFalse(version.svn)<br>-        self.assertFalse(version.branch)<br>-        self.assertEqual(version.major, 8)<br>-        self.assertEqual(version.minor, 11)<br>-        self.assertEqual(version.patch, 1)<br>-        self.assertEqual(version.feature, 'cert')<br>-<br>-    def test_svn_1811_certified_2(self):<br>-        """Test another CA 1.8 version tag"""<br>-        version = AsteriskVersion("1.8.11-cert2")<br>-        self.assertFalse(version.svn)<br>-        self.assertFalse(version.branch)<br>-        self.assertEqual(version.major, 8)<br>-        self.assertEqual(version.minor, 11)<br>-        self.assertEqual(version.patch, 2)<br>-        self.assertEqual(version.feature, 'cert')<br>-<br>-    def test_svn_1811_certified_3(self):<br>-        """Test a CA 1.8 version tag with modifier"""<br>-        version = AsteriskVersion("Asterisk 1.8.11-cert3-rc1")<br>-        self.assertFalse(version.svn)<br>-        self.assertFalse(version.branch)<br>-        self.assertEqual(version.major, 8)<br>-        self.assertEqual(version.minor, 11)<br>-        self.assertEqual(version.patch, 3)<br>-        self.assertEqual(version.feature, 'cert')<br>-        self.assertEqual(version.modifier, 'rc')<br>-        self.assertEqual(version.iteration, 1)<br>-<br>-    def test_svn_1811_certified_branch(self):<br>-        """Test a CA 1.8 version branch"""<br>-        version = AsteriskVersion("Asterisk SVN-branch-1.8.11-cert-r368608")<br>-        self.assertTrue(version.svn)<br>-        self.assertTrue(version.branch)<br>-        self.assertEqual(version.major, 8)<br>-        self.assertEqual(version.minor, 11)<br>-        self.assertEqual(version.patch, 0)<br>-        self.assertEqual(version.feature, 'cert')<br>-        self.assertEqual(version.revision, 368608)<br>-<br>-    def test_git_11_branch(self):<br>-        """Test a Git checkout from master"""<br>-        version = AsteriskVersion("Asterisk GIT-11-a987f3")<br>-        self.assertFalse(version.svn)<br>-        self.assertTrue(version.git)<br>-        self.assertTrue(version.branch)<br>-        self.assertEqual(version.major, 11)<br>-        self.assertEqual(version.minor, 0)<br>-        self.assertEqual(version.patch, 0)<br>-        self.assertEqual(version.revision, "a987f3")<br>-<br>-    def test_git_116_certified_branch(self):<br>-        """Test a Git checkout from master"""<br>-        version = AsteriskVersion("Asterisk GIT-11.6-cert-a987f3")<br>-        self.assertFalse(version.svn)<br>-        self.assertTrue(version.git)<br>-        self.assertTrue(version.branch)<br>-        self.assertTrue(version.branch)<br>-        self.assertEqual(version.major, 11)<br>-        self.assertEqual(version.minor, 6)<br>-        self.assertEqual(version.patch, 0)<br>-        self.assertEqual(version.feature, 'cert')<br>-        self.assertEqual(version.name, None)<br>-        self.assertEqual(version.revision, "a987f3")<br>-<br>-    def test_git_131_certified_branch(self):<br>-        """Test a Git checkout from certified/13.1 branch<br>-<br>-        Note that in this test, the last known tag is 13.1-cert3, but<br>-        modifications have been made since then on the branch<br>-        """<br>-        version = AsteriskVersion("Asterisk GIT-13-certified/13.1-cert3-1-hsd81h23")<br>-        self.assertFalse(version.svn)<br>-        self.assertTrue(version.git)<br>-        self.assertTrue(version.branch)<br>-        self.assertEqual(version.major, 13)<br>-        self.assertEqual(version.minor, 1)<br>-        self.assertEqual(version.patch, 3)<br>-        self.assertEqual(version.feature, 'cert')<br>-        self.assertEqual(version.name, None)<br>-        self.assertEqual(version.revision, '1-hsd81h23')<br>-<br>-    def test_git_131_certified_tag(self):<br>-        """Test a Git created tag from the certified/13.1 branch"""<br>-        version = AsteriskVersion("Asterisk certified/13.1-cert3-rc1")<br>-        self.assertFalse(version.svn)<br>-        # This is just a tag that happened to be made from git<br>-        self.assertFalse(version.git)<br>-        self.assertFalse(version.branch)<br>-        self.assertEqual(version.major, 13)<br>-        self.assertEqual(version.minor, 1)<br>-        self.assertEqual(version.patch, 3)<br>-        self.assertEqual(version.feature, 'cert')<br>-        self.assertEqual(version.name, None)<br>-        self.assertEqual(version.modifier, 'rc')<br>-        self.assertEqual(version.iteration, 1)<br>-<br>-    def test_git_master(self):<br>-        """Test a Git checkout from master"""<br>-        version = AsteriskVersion("Asterisk GIT-master-a987f3")<br>-        self.assertFalse(version.svn)<br>-        self.assertTrue(version.git)<br>-        self.assertTrue(version.branch)<br>-        self.assertEqual(version.name, "master")<br>-        self.assertEqual(version.revision, "a987f3")<br>-<br>-    def test_cmp1(self):<br>-        """Compare two trunk versions, an 11 tag, and a 1.8 branch"""<br>-        version1 = AsteriskVersion("SVN-trunk-r252849")<br>-        version2 = AsteriskVersion("SVN-branch-1.8-r245581M")<br>-        version3 = AsteriskVersion("Asterisk 11.0.1")<br>-        version4 = AsteriskVersion("SVN-trunk-r300000")<br>-        self.assertTrue(version1 > version2)<br>-        self.assertTrue(version1 > version3)<br>-        self.assertFalse(version1 > version4)<br>-<br>-    def test_cmp2(self):<br>-        """Compare trunk against a team branch"""<br>-        version1 = AsteriskVersion("SVN-trunk-r252849")<br>-        version2 = AsteriskVersion("SVN-russell-cdr-q-r249059M-/trunk")<br>-        self.assertTrue(version1 > version2)<br>-<br>-    def test_cmp3(self):<br>-        """Compare 10 branch against 1.8 branch"""<br>-        version1 = AsteriskVersion("SVN-branch-10-r245581M")<br>-        version2 = AsteriskVersion("SVN-branch-1.8-r245581M")<br>-        self.assertTrue(version1 > version2)<br>-<br>-    def test_cmp4(self):<br>-        """Compare two version tags"""<br>-        version1 = AsteriskVersion("10.0")<br>-        version2 = AsteriskVersion("1.8")<br>-        self.assertTrue(version1 > version2)<br>-<br>-    def test_cmp5(self):<br>-        """Compare the simplest version tags"""<br>-        version1 = AsteriskVersion("10")<br>-        version2 = AsteriskVersion("1.8")<br>-        self.assertTrue(version1 > version2)<br>-<br>-    def test_cmp6(self):<br>-        """Compare trunk against 10 branch"""<br>-        version1 = AsteriskVersion("SVN-trunk-r245581")<br>-        version2 = AsteriskVersion("SVN-branch-10-r251232")<br>-        self.assertTrue(version1 > version2)<br>-<br>-    def test_cmp16(self):<br>-        """Compare two versions, one with a modifier"""<br>-        version1 = AsteriskVersion("1.8.6.0-rc1")<br>-        version2 = AsteriskVersion("1.8.6.0")<br>-        self.assertTrue(version1 < version2)<br>-<br>-    def test_cmp17(self):<br>-        """Compare two modifiers"""<br>-        version1 = AsteriskVersion("1.8.8.0-beta1")<br>-        version2 = AsteriskVersion("1.8.8.0-rc1")<br>-        self.assertTrue(version1 < version2)<br>-<br>-    def test_cmp18(self):<br>-        """Compare two versions with the same modifier"""<br>-        version1 = AsteriskVersion("1.8.6.0-rc2")<br>-        version2 = AsteriskVersion("1.8.6.0-rc1")<br>-        self.assertTrue(version1 > version2)<br>-<br>-    def test_cmp19(self):<br>-        """Compare a high modifier against the next higher version"""<br>-        version1 = AsteriskVersion("1.8.6.1")<br>-        version2 = AsteriskVersion("1.8.6.0-rc11")<br>-        self.assertTrue(version1 > version2)<br>-<br>-    def test_cmp20(self):<br>-        """Compare two versions with a regression/security difference"""<br>-        version1 = AsteriskVersion("1.8.5.0")<br>-        version2 = AsteriskVersion("1.8.5.1")<br>-        self.assertTrue(version1 < version2)<br>-<br>-    def test_cmp21(self):<br>-        """Compare a tag against the same major version branch"""<br>-        version1 = AsteriskVersion("1.8.10")<br>-        version2 = AsteriskVersion("SVN-branch-1.8-r360138")<br>-        self.assertTrue(version1 < version2)<br>-<br>-    def test_cmp22(self):<br>-        """Compare a tag against a modified same major version branch"""<br>-        version1 = AsteriskVersion("1.8.10")<br>-        version2 = AsteriskVersion("SVN-branch-1.8-r360138M")<br>-        self.assertTrue(version1 < version2)<br>-<br>-    def test_cmp23(self):<br>-        """Compare the same CA version with a patch difference"""<br>-        version1 = AsteriskVersion("1.8.11-cert1")<br>-        version2 = AsteriskVersion("1.8.11-cert2")<br>-        self.assertTrue(version1 < version2)<br>-<br>-    def test_cmp24(self):<br>-        """Compare two CA versions"""<br>-        version1 = AsteriskVersion("1.8.11-cert1")<br>-        version2 = AsteriskVersion("1.8.15-cert1")<br>-        self.assertTrue(version1 < version2)<br>-<br>-    def test_cmp25(self):<br>-        """Compare a CA version against a standard release from the branch"""<br>-        version1 = AsteriskVersion("1.8.11-cert1")<br>-        version2 = AsteriskVersion("1.8.13.0")<br>-        self.assertTrue(version1 < version2)<br>-<br>-    def test_cmp26(self):<br>-        """Compare a CA branch against a tagged version"""<br>-        version1 = AsteriskVersion("SVN-branch-1.8.11-cert-r363674")<br>-        version2 = AsteriskVersion("1.8.12.0")<br>-        self.assertTrue(version1 < version2)<br>-<br>-    def test_cmp27(self):<br>-        """Compare two CA branches"""<br>-        version1 = AsteriskVersion("SVN-branch-1.8.11-r363674")<br>-        version2 = AsteriskVersion("SVN-branch-1.8.15-r363674")<br>-        self.assertTrue(version1 < version2)<br>-<br>-    def test_cmp28(self):<br>-        """Compare a CA branch against the standard branch"""<br>-        version1 = AsteriskVersion("SVN-branch-1.8.11-r363674")<br>-        version2 = AsteriskVersion("SVN-branch-1.8-r369138M")<br>-        self.assertTrue(version1 < version2)<br>-<br>-    def test_cmp29(self):<br>-        """Compare a CA version against a CA branch"""<br>-        version1 = AsteriskVersion("1.8.11-cert1")<br>-        version2 = AsteriskVersion("Asterisk SVN-branch-1.8.11-cert-r368608")<br>-        self.assertTrue(version1 < version2)<br>-<br>-    def test_cmp_git_18_11(self):<br>-        """Compare a Git 1.8 branch to an 11 branch"""<br>-        version1 = AsteriskVersion("Asterisk GIT-1.8-18has09")<br>-        version2 = AsteriskVersion("Asterisk GIT-11-81yhas90")<br>-        self.assertTrue(version1 < version2)<br>-<br>-    def test_cmp_git_11(self):<br>-        """Compare two Git 11 branch versions"""<br>-        version1 = AsteriskVersion("Asterisk GIT-11-a9suh193")<br>-        version2 = AsteriskVersion("Asterisk GIT-11-aj981bnd")<br>-        self.assertTrue(version1 != version2)<br>-        self.assertFalse(version1 < version2)<br>-        self.assertFalse(version1 > version2)<br>-        self.assertFalse(version1 == version2)<br>-<br>-    def test_cmp_git_1811_1811branch(self):<br>-        """Compare a CA version against a Git CA branch"""<br>-        version1 = AsteriskVersion("1.8.11-cert2")<br>-        version2 = AsteriskVersion("Asterisk GIT-1.8.11-cert-89haskljh")<br>-        self.assertTrue(version1 < version2)<br>-<br>-<br>-def main():<br>-    """Run the unit tests"""<br>-    logging.basicConfig()<br>-    unittest.main()<br>-<br>-<br>-if __name__ == "__main__":<br>-    main()<br>diff --git a/runtests.py b/runtests.py<br>index d684f86..8089387 100755<br>--- a/runtests.py<br>+++ b/runtests.py<br>@@ -53,7 +53,6 @@<br>     new_PYTHONPATH.append(os.getenv("PYTHONPATH"))<br> new_PYTHONPATH.append("lib/python")<br> <br>-from asterisk.version import AsteriskVersion<br> from asterisk.asterisk import Asterisk<br> from asterisk.test_config import TestConfig<br> from mailer import send_email<br>@@ -92,16 +91,15 @@<br> ref_debug_is_enabled = False<br> <br> class TestRun:<br>-    def __init__(self, test_name, ast_version, options, global_config=None, timeout=-1):<br>+    def __init__(self, test_name, options, global_config=None, timeout=-1):<br>         self.can_run = False<br>         self.did_run = False<br>         self.time = 0.0<br>         self.test_name = test_name<br>-        self.ast_version = ast_version<br>         self.options = options<br>         self.test_config = TestConfig(test_name, global_config)<br>         self.failure_message = ""<br>-        self.__check_can_run(ast_version)<br>+        self.__check_can_run()<br>         self.stdout = ""<br>         self.timeout = timeout<br>         self.cleanup = options.cleanup<br>@@ -133,7 +131,6 @@<br>                 os.environ['PCAP'] = "yes"<br> <br>             self.stdout_print("Running %s ..." % cmd)<br>-            cmd.append(str(self.ast_version).rstrip())<br>             p = subprocess.Popen(cmd, stdout=subprocess.PIPE,<br>                                  stderr=subprocess.STDOUT)<br>             self.pid = p.pid<br>@@ -445,9 +442,9 @@<br>         self._archive_files(run_dir, archive_dir, 'dumpfile.pcap')<br>         self._archive_files(run_dir, archive_dir, 'packet.pcap')<br> <br>-    def __check_can_run(self, ast_version):<br>+    def __check_can_run(self):<br>         """Check tags and dependencies in the test config."""<br>-        if self.test_config.check_deps(ast_version) and \<br>+        if self.test_config.check_deps() and \<br>                 self.test_config.check_tags(self.options.tags, self.options.skip_tags):<br>             self.can_run = True<br> <br>@@ -456,13 +453,13 @@<br> <br> <br> class TestSuite:<br>-    def __init__(self, ast_version, options):<br>+    def __init__(self, options):<br>         self.options = options<br> <br>         self.tests = []<br>         self.start_time = None<br>         self.global_config = self._parse_global_config()<br>-        self.tests = self._parse_test_yaml("tests", ast_version)<br>+        self.tests = self._parse_test_yaml("tests")<br>         if self.options.randomorder:<br>             random.shuffle(self.tests)<br>         else:<br>@@ -475,7 +472,7 @@<br>     def _parse_global_config(self):<br>         return TestConfig(os.getcwd())<br> <br>-    def _parse_test_yaml(self, test_dir, ast_version):<br>+    def _parse_test_yaml(self, test_dir):<br>         tests = []<br> <br>         config = load_yaml_config("%s/%s" % (test_dir, TESTS_CONFIG))<br>@@ -503,10 +500,10 @@<br>                                     for test in self.options.skip_tests_regex)):<br>                         continue<br> <br>-                    tests.append(TestRun(path, ast_version, self.options,<br>+                    tests.append(TestRun(path, self.options,<br>                                          self.global_config, self.options.timeout))<br>                 elif val == "dir":<br>-                    tests += self._parse_test_yaml(path, ast_version)<br>+                    tests += self._parse_test_yaml(path)<br> <br>         return tests<br> <br>@@ -538,13 +535,6 @@<br>             print "      --> Summary: %s" % t.test_config.summary<br>             if t.test_config.skip is not None:<br>                 print "      --> Skip: %s" % t.test_config.skip<br>-            print ("      --> Minimum Version: %s (%s)" %<br>-                   (", ".join([str(v) for v in t.test_config.minversion]),<br>-                    t.test_config.minversion_check))<br>-            if t.test_config.maxversion is not None:<br>-                print ("      --> Maximum Version: %s (%s)" %<br>-                       (", ".join([str(v) for v in t.test_config.maxversion]),<br>-                        t.test_config.maxversion_check))<br>             if t.test_config.features:<br>                 print "      --> Features:"<br>                 for feature_name in t.test_config.features:<br>@@ -611,16 +601,6 @@<br>                     self.total_skipped += 1<br>                     continue<br>                 print "--> Cannot run test '%s'" % t.test_name<br>-                if t.test_config.forced_version is not None:<br>-                    print "--- --> Forced Asterisk Version: %s" % \<br>-                        (str(t.test_config.forced_version))<br>-                print ("--- --> Minimum Version: %s (%s)" %<br>-                       (", ".join([str(v) for v in t.test_config.minversion]),<br>-                        t.test_config.minversion_check))<br>-                if t.test_config.maxversion is not None:<br>-                    print ("--- --> Maximum Version: %s (%s)" %<br>-                           (", ".join([str(v) for v in t.test_config.maxversion]),<br>-                            t.test_config.maxversion_check))<br>                 for f in t.test_config.features:<br>                     print "--- --> Version Feature: %s - %s" % (<br>                         f, str(t.test_config.feature_check[f]))<br>@@ -873,10 +853,8 @@<br>     signal.signal(signal.SIGUSR1, handle_usr1)<br>     signal.signal(signal.SIGTERM, handle_term)<br> <br>-    ast_version = AsteriskVersion(default=options.version)<br>-<br>     if options.list_tests or options.list_tags or options.list_terse :<br>-        test_suite = TestSuite(ast_version, options)<br>+        test_suite = TestSuite(options)<br> <br>         if options.list_tests:<br>             test_suite.list_tests()<br>@@ -912,10 +890,10 @@<br>         syslog.openlog('AsteriskTestsuite', syslog.LOG_PID)<br>     while ((iteration < options.number or continue_forever) and not abandon_test_suite):<br> <br>-        test_suite = TestSuite(ast_version, options)<br>+        test_suite = TestSuite(options)<br> <br>-        running_str = "Running tests for Asterisk {0} (run {1} of {2})...\n".format(<br>-            str(ast_version).strip('\n'), iteration + 1, options.number)<br>+        running_str = "Running tests for Asterisk (run {0} of {1})...\n".format(<br>+            iteration + 1, options.number)<br>         print running_str<br>         if options.syslog:<br>             syslog.syslog(running_str)<br>diff --git a/sample-yaml/test-config.yaml.sample b/sample-yaml/test-config.yaml.sample<br>index 8d78b80..773b98f 100644<br>--- a/sample-yaml/test-config.yaml.sample<br>+++ b/sample-yaml/test-config.yaml.sample<br>@@ -27,12 +27,6 @@<br> # dependencies for this test.<br> properties:<br> <br>-    # The minimum version of Asterisk necessary to run the test<br>-    minversion: '1.8.0.0'<br>-<br>-    # The maximum version of Asterisk that this test can exeucte under<br>-    maxversion: '10.5.1' # OPTIONAL<br>-<br>     # A sequence of feature specifies that the version of Asterisk under test must support.<br>     features: # OPTIONAL<br>         # List features the Asterisk version under test must support for this test<br>@@ -194,23 +188,12 @@<br>     modules: # OPTIONAL<br>         -<br>             # The keyword in the test-config.yaml file that provides the configuration for the module<br>-            config-section: 'ami-config-1.3'<br>+            config-section: 'ami-config'<br> <br>             # The fully qualified package.module.class to instantiate as the module.<br>             # A few that are available:<br>             # ami.AMIEventModule, cdr.CDRModule<br>             typename: 'ami.AMIEventModule'<br>-<br>-            # The minimum version of Asterisk necessary to load this module<br>-            minversion: '1.8.0.0' # OPTIONAL<br>-<br>-            # The maximum version of Asterisk that this module can load under<br>-            maxversion: '11.0.0' # OPTIONAL<br>-        -<br>-            # Similar to above but with different Asterisk version requirements<br>-            config-section: 'ami-config-1.4'<br>-            typename: 'ami.AMIEventModule'<br>-            minversion: '12.0.0'<br> <br> # The configuration for the test object. The configuration will differ depending<br> # on the test object used<br>@@ -241,23 +224,7 @@<br> <br> # The configuration for a pluggable module. See other *-config.yaml.sample files<br> # for more details.<br>-ami-config-1.3:<br>-    -<br>-        type: 'headermatch'<br>-        id: '0'<br>-        conditions:<br>-            match:<br>-                Event: 'Newexten'<br>-                Channel: 'Local/play@default-00000000;2'<br>-                Application: 'NoOp'<br>-        requirements:<br>-            match:<br>-                AppData: 'AMI 1.3'<br>-        count: '1'<br>-<br>-# The configuration for a pluggable module. See other *-config.yaml.sample files<br>-# for more details.<br>-ami-config-1.4:<br>+ami-config:<br>     -<br>         type: 'headermatch'<br>         id: '0'<br>diff --git a/test-config.yaml b/test-config.yaml<br>index a7e1a8f..2e03fb3 100644<br>--- a/test-config.yaml<br>+++ b/test-config.yaml<br>@@ -140,13 +140,6 @@<br>             - name: 'sip-channels'<br>             - name: 'memory'<br> <br>-config-specific-version:<br>-    properties:<br>-        # Override the version of Asterisk under test to the specified version.<br>-        # This is particularly useful if the version under test is from a team<br>-        # branch not based on Asterisk trunk.<br>-        forced-version: 1.8.0.0<br>-<br> # This section demonstrates how to integrate automatic realtime testing into<br> # the testsuite. If realtime-config is specified, then Asterisk will replace known<br> # configuration file data with realtime equivalents when running tests.<br>diff --git a/tests/apps/bridge/bridge_transfer_callee/run-test b/tests/apps/bridge/bridge_transfer_callee/run-test<br>index 38d06ed..a30f8eb 100755<br>--- a/tests/apps/bridge/bridge_transfer_callee/run-test<br>+++ b/tests/apps/bridge/bridge_transfer_callee/run-test<br>@@ -17,7 +17,6 @@<br> sys.path.append("lib/python")<br> <br> from asterisk.test_case import TestCase<br>-from asterisk.version import AsteriskVersion<br> <br> LOGGER = logging.getLogger(__name__)<br> <br>@@ -39,10 +38,7 @@<br>         """ Register for all events we care about """<br> <br>         ami.registerEvent("UserEvent", self.user_event)<br>-        if AsteriskVersion() >= AsteriskVersion('12'):<br>-            ami.registerEvent("BridgeEnter", self.bridge_enter_event)<br>-        else:<br>-            ami.registerEvent("BridgeExec", self.bridge_event)<br>+        ami.registerEvent("BridgeEnter", self.bridge_enter_event)<br>         #originate the bridgee<br>         df = ami.originate(channel = "Local/local@call1", exten = "call", context = "test_context", priority = 1)<br>         df.addErrback(self.handle_originate_failure)<br>@@ -91,16 +87,6 @@<br>             LOGGER.info("All Bridge Transfer tests complete. Test Successful.")<br>             self.passed = True<br>             self.stop_reactor()<br>-<br>-    def bridge_event(self, ami, event):<br>-        if (event.get('response') == 'Success'):<br>-            channel = event.get('channel1')<br>-            if channel is not None:<br>-                ami.hangup(channel)<br>-            else:<br>-                LOGGER.error("bridge event didn't include a channel1. That's not supposed to happen.")<br>-        else:<br>-            LOGGER.error("A bridge failed. That's rather abnormal.")<br> <br>     def bridge_enter_event(self, ami, event):<br>         if self.hangup_channel is None:<br>diff --git a/tests/apps/confbridge/confbridge_nominal/run-test b/tests/apps/confbridge/confbridge_nominal/run-test<br>index 5e795a6..60e7138 100755<br>--- a/tests/apps/confbridge/confbridge_nominal/run-test<br>+++ b/tests/apps/confbridge/confbridge_nominal/run-test<br>@@ -23,7 +23,6 @@<br> from asterisk.test_state import FailureTestState<br> from asterisk.confbridge import ConfbridgeTestState<br> from asterisk.confbridge import ConfbridgeChannelObject<br>-from asterisk.version import AsteriskVersion<br> <br> logger = logging.getLogger(__name__)<br> <br>@@ -92,20 +91,11 @@<br>     def __handle_confbridge_join(self, channel):<br>         """ Handles when the ConfBridge notifies the users that someone has joined """<br>         self.test_case.reset_timeout()<br>-        if AsteriskVersion() < AsteriskVersion('13.12.0'):<br>-            # Prior to 13.12.0, the join sound was played once to the channel<br>-            # that joined and once to the entire bridge.<br>-            if channel == self.__bridge_channel:<br>-                self.__joined_bridges += 1<br>-            else:<br>-                self.__joined_channels += 1<br>-        else:<br>-            # For 13.12.0 and up, the join sound is only played to the entire<br>-            # bridge. We just go ahead and bump both the joined_channels and<br>-            # joined_bridges counts together and "lie" about having the sound<br>-            # played to the individual channel<br>-            self.__joined_channels += 1<br>-            self.__joined_bridges += 1<br>+        # The join sound is only played to the entire bridge. We just go ahead<br>+        # and bump both the joined_channels and joined_bridges counts together<br>+        # and "lie" about having the sound played to the individual channel<br>+        self.__joined_channels += 1<br>+        self.__joined_bridges += 1<br> <br>         if (self.__joined_bridges == len(self.calls)):<br>             self.test_case.expectedEvents['joinannouncetoall'] = True<br>diff --git a/tests/apps/directed_pickup/pickup_chan/run-test b/tests/apps/directed_pickup/pickup_chan/run-test<br>index 95cce85..c006b49 100755<br>--- a/tests/apps/directed_pickup/pickup_chan/run-test<br>+++ b/tests/apps/directed_pickup/pickup_chan/run-test<br>@@ -15,7 +15,6 @@<br> <br> sys.path.append("lib/python")<br> from asterisk.asterisk import Asterisk<br>-from asterisk.version import AsteriskVersion<br> from asterisk.test_case import TestCase<br> <br> LOGGER = logging.getLogger(__name__)<br>@@ -29,7 +28,6 @@<br>         self.bridgeCount = 0<br>         self.create_asterisk()<br> <br>-        self.bridgingModel12 = False<br>         self.bridge = None<br>         self.firstChannelBridged = False<br>         self.secondChannelBridged = False<br>@@ -40,7 +38,7 @@<br> <br>     def check_test_done(self):<br> <br>-        if self.picked_up and (not self.bridgingModel12 or (self.firstChannelBridged and self.secondChannelBridged)):<br>+        if self.picked_up and self.firstChannelBridged and self.secondChannelBridged:<br>             self.set_passed(True)<br>             self.ami[0].hangup(self.firstChannel).addCallback(self.hangup)<br>             LOGGER.info("Both first and second channel detected; passing test")<br>@@ -91,8 +89,6 @@<br> <br>         LOGGER.info("Detected second channel in Pickup: %s" % self.secondChannel)<br>         self.picked_up = True<br>-        if not self.bridgingModel12:<br>-            self.ami[0].registerEvent('Bridge', self.check_Bridge)<br>         self.check_test_done()<br> <br>     def check_UserEvent(self, ami, event):<br>@@ -105,8 +101,7 @@<br> <br>         self.ami[0].registerEvent('Pickup', self.check_Pickup)<br> <br>-        if self.bridgingModel12:<br>-            self.ami[0].registerEvent('BridgeEnter', self.check_BridgeEnter)<br>+        self.ami[0].registerEvent('BridgeEnter', self.check_BridgeEnter)<br> <br>         LOGGER.info("Originating Pickup attempt")<br>         self.ami[0].originate(<br>@@ -122,15 +117,7 @@<br>         LOGGER.info("Detected first channel %s" % self.firstChannel)<br> <br>     def ami_connect(self, ami):<br>-        running_version = AsteriskVersion()<br>-        post_version = AsteriskVersion("12.0.0")<br>-        if running_version < post_version:<br>-            # Pre-Asterisk 12<br>-            self.ami[0].registerEvent("Dial", self.check_Dial)<br>-        else:<br>-            # Asterisk 12+<br>-            self.bridgingModel12 = True<br>-            self.ami[0].registerEvent("DialBegin", self.check_Dial)<br>+        self.ami[0].registerEvent("DialBegin", self.check_Dial)<br>         self.ami[0].registerEvent("UserEvent", self.check_UserEvent)<br>         LOGGER.info("Originating channel to be picked up")<br>         self.ami[0].originate(<br>diff --git a/tests/apps/queues/queue_baseline/run-test b/tests/apps/queues/queue_baseline/run-test<br>index bd2e5a9..87fb71a 100755<br>--- a/tests/apps/queues/queue_baseline/run-test<br>+++ b/tests/apps/queues/queue_baseline/run-test<br>@@ -20,7 +20,6 @@<br> sys.path.append("lib/python")<br> <br> from asterisk.test_case import TestCase<br>-from asterisk.version import AsteriskVersion<br> <br> logger = logging.getLogger(__name__)<br> <br>@@ -29,20 +28,12 @@<br> <br>     def __init__(self):<br>         super(QueueBaseline, self).__init__()<br>-        self.ast_version = AsteriskVersion()<br>-<br>-        if self.ast_version < AsteriskVersion("12"):<br>-            join = "Join"<br>-            leave = "Leave"<br>-        else:<br>-            join = "QueueCallerJoin"<br>-            leave = "QueueCallerLeave"<br> <br>         self.expected_events = {<br>-            join: False,<br>+            "QueueCallerJoin": False,<br>             "AgentCalled": False,<br>             "AgentConnect": False,<br>-            leave: False,<br>+            "QueueCallerLeave": False,<br>             "AgentComplete": False<br>             }<br>         self.events_received = 0<br>diff --git a/tests/apps/queues/reason_pause_ami/run-test b/tests/apps/queues/reason_pause_ami/run-test<br>index 4f31bed..1e6c87a 100755<br>--- a/tests/apps/queues/reason_pause_ami/run-test<br>+++ b/tests/apps/queues/reason_pause_ami/run-test<br>@@ -13,7 +13,6 @@<br> sys.path.append("lib/python")<br> from asterisk.asterisk import Asterisk<br> from asterisk.test_case import TestCase<br>-from asterisk.version import AsteriskVersion<br> from twisted.internet import reactor, defer<br> from starpy import manager<br> <br>diff --git a/tests/apps/queues/set_penalty/run-test b/tests/apps/queues/set_penalty/run-test<br>index ba8162e..8d78211 100755<br>--- a/tests/apps/queues/set_penalty/run-test<br>+++ b/tests/apps/queues/set_penalty/run-test<br>@@ -13,7 +13,6 @@<br> sys.path.append("lib/python")<br> from asterisk.asterisk import Asterisk<br> from asterisk.test_case import TestCase<br>-from asterisk.version import AsteriskVersion<br> from twisted.internet import reactor, defer<br> from starpy import manager<br> <br>@@ -32,12 +31,6 @@<br>         self.state = 0 # State of the test... determines next action and next event expectations.<br>         self.passed = False<br>         self.state_passed_flags = 0 # Meant to be used like a bit array for storing condition successes on specific states.<br>-        self.ast_version = AsteriskVersion()<br>-<br>-        if self.ast_version < AsteriskVersion("12"):<br>-            self.interface = 'location'<br>-        else:<br>-            self.interface = 'interface'<br> <br>     #Setup loopback for QueueMemberPenalty events and set first test state<br>     def ami_connect(self, ami):<br>@@ -53,7 +46,7 @@<br>     #Evaluates events according to the expectations of a given state and advances the state when finished.<br>     def state_receive(self, event, ami):<br>         if (self.state == 1):<br>-            if (event['queue'] == "queue1" and event[self.interface] == "sip/mem1" and event['penalty'] == "1"):<br>+            if (event['queue'] == "queue1" and event['interface'] == "sip/mem1" and event['penalty'] == "1"):<br>                 logger.info("state 1: Successfully Completed")<br>                 self.state_advance(ami)<br> <br>@@ -62,11 +55,11 @@<br>                 self.stop_reactor()<br> <br>         elif (self.state == 2):<br>-            if (event['queue'] == "queue1" and event[self.interface] == "sip/mem2" and event['penalty'] == "2"):<br>+            if (event['queue'] == "queue1" and event['interface'] == "sip/mem2" and event['penalty'] == "2"):<br>                 logger.info("state 2: verified condition 1")<br>                 self.state_passed_flags = self.state_passed_flags | 1<br> <br>-            elif (event['queue'] == "queue2" and event[self.interface] == "sip/mem2" and event['penalty'] == '2'):<br>+            elif (event['queue'] == "queue2" and event['interface'] == "sip/mem2" and event['penalty'] == '2'):<br>                 logger.info("state 2: verified condition 2")<br>                 self.state_passed_flags = self.state_passed_flags | 2<br> <br>@@ -79,15 +72,15 @@<br>                 self.state_advance(ami)<br> <br>         elif (self.state == 3):<br>-            if (event['queue'] == "queue1" and event[self.interface] == "sip/mem3" and event['penalty'] == '3'):<br>+            if (event['queue'] == "queue1" and event['interface'] == "sip/mem3" and event['penalty'] == '3'):<br>                 logger.info("state 3: verified condition 1")<br>                 self.state_passed_flags = self.state_passed_flags | 1<br> <br>-            elif (event['queue'] == "queue2" and event[self.interface] == "sip/mem3" and event['penalty'] == '3'):<br>+            elif (event['queue'] == "queue2" and event['interface'] == "sip/mem3" and event['penalty'] == '3'):<br>                 logger.info("state 3: verified condition 2")<br>                 self.state_passed_flags = self.state_passed_flags | 2<br> <br>-            elif (event['queue'] == "queue3" and event[self.interface] == "sip/mem3" and event['penalty'] == '3'):<br>+            elif (event['queue'] == "queue3" and event['interface'] == "sip/mem3" and event['penalty'] == '3'):<br>                 logger.info("state 3: verified condition 3")<br>                 self.state_passed_flags = self.state_passed_flags | 4<br> <br>@@ -100,7 +93,7 @@<br>                 self.state_advance(ami)<br> <br>         elif (self.state == 4):<br>-            if (event['queue'] == "queue3" and event[self.interface] == "sip/mem1" and event['penalty'] == '4'):<br>+            if (event['queue'] == "queue3" and event['interface'] == "sip/mem1" and event['penalty'] == '4'):<br>                 logger.info("state 4: Successfully Completed")<br>                 self.state_advance(ami)<br> <br>diff --git a/tests/bridge/atxfer_nominal/transfer.py b/tests/bridge/atxfer_nominal/transfer.py<br>index e6eb527..97994e3 100644<br>--- a/tests/bridge/atxfer_nominal/transfer.py<br>+++ b/tests/bridge/atxfer_nominal/transfer.py<br>@@ -11,7 +11,6 @@<br> import logging<br> <br> sys.path.append("lib/python")<br>-from version import AsteriskVersion<br> <br> LOGGER = logging.getLogger(__name__)<br> <br>@@ -47,10 +46,7 @@<br>         self._current_feature = None<br> <br>         self.test_object.register_feature_start_observer(self._handle_feature_start)<br>-        if AsteriskVersion() >= AsteriskVersion('12'):<br>-            self.test_object.register_ami_observer(self._handle_ami_connect)<br>-        else:<br>-            self.test_object.register_feature_end_observer(self._handle_feature_end)<br>+        self.test_object.register_ami_observer(self._handle_ami_connect)<br> <br>         if (Transfer.__singleton_instance == None):<br>             Transfer.__singleton_instance = self<br>@@ -71,13 +67,8 @@<br>         LOGGER.debug('Setting current feature to %s' % str(feature))<br>         self._current_feature = feature<br> <br>-    def _handle_feature_end(self, test_object, feature):<br>-        ''' Callback for the BridgeTestCase feature detected event<br>-<br>-        Keyword Arguments:<br>-        test_object The BridgeTestCase object<br>-        feature The specific feature that was executed<br>-        '''<br>+    def _handle_feature_end(self):<br>+        ''' Callback for the BridgeTestCase feature detected event'''<br>         LOGGER.debug("current_feature: %s\n" % self._current_feature)<br>         if self._current_feature['who'] == 'alice':<br>             ami = self.test_object.ami_bob<br>@@ -96,7 +87,7 @@<br>         ''' Handle the AttendedTransfer event. Once the event has<br>         triggered, the call can be torn down. '''<br>         LOGGER.debug('ami %d: received event %s' % (ami.id, event))<br>-        self._handle_feature_end(None, None)<br>+        self._handle_feature_end()<br> <br>     def complete_attended_transfer(self):<br>         '''<br>diff --git a/tests/bridge/blonde_nominal/transfer.py b/tests/bridge/blonde_nominal/transfer.py<br>index bd5ffac..600c28e 100644<br>--- a/tests/bridge/blonde_nominal/transfer.py<br>+++ b/tests/bridge/blonde_nominal/transfer.py<br>@@ -11,7 +11,6 @@<br> import logging<br> <br> sys.path.append("lib/python")<br>-from version import AsteriskVersion<br> <br> LOGGER = logging.getLogger(__name__)<br> <br>@@ -47,8 +46,6 @@<br>         self._current_feature = None<br> <br>         self.test_object.register_feature_start_observer(self._handle_feature_start)<br>-        if AsteriskVersion() < AsteriskVersion('12'):<br>-            self.test_object.register_feature_end_observer(self._handle_feature_end)<br>         self.test_object.register_ami_observer(self._handle_ami_connect)<br> <br>         if (Transfer.__singleton_instance == None):<br>@@ -59,8 +56,7 @@<br>         if (ami.id != 0):<br>             return<br>         ami.registerEvent('Newstate', self._handle_new_state)<br>-        if AsteriskVersion() >= AsteriskVersion('12'):<br>-            ami.registerEvent('AttendedTransfer', self._handle_attended_transfer)<br>+        ami.registerEvent('AttendedTransfer', self._handle_attended_transfer)<br> <br>     def _handle_new_state(self, ami, event):<br>         ''' Handle a new state change. When we get a ringing back on the<br>@@ -87,13 +83,8 @@<br>         LOGGER.debug('Setting current feature to %s' % str(feature))<br>         self._current_feature = feature<br> <br>-    def _handle_feature_end(self, test_object, feature):<br>-        ''' Callback for the BridgeTestCase feature detected event<br>-<br>-        Keyword Arguments:<br>-        test_object The BridgeTestCase object<br>-        feature The specific feature that was executed<br>-        '''<br>+    def _handle_feature_end(self):<br>+        ''' Callback for the BridgeTestCase feature detected event'''<br>         if self._current_feature['who'] == 'alice':<br>             ami = self.test_object.ami_bob<br>             channel = self.test_object.bob_channel<br>@@ -110,5 +101,5 @@<br>     def _handle_attended_transfer(self, ami, event):<br>         ''' Handle the AttendedTransfer event. Once the event has<br>         triggered, the call can be torn down. '''<br>-        self._handle_feature_end(None, None)<br>+        self._handle_feature_end()<br> <br>diff --git a/tests/bridge/dial_LS_options/Tester.py b/tests/bridge/dial_LS_options/Tester.py<br>index af2557b..9ed7b46 100755<br>--- a/tests/bridge/dial_LS_options/Tester.py<br>+++ b/tests/bridge/dial_LS_options/Tester.py<br>@@ -13,7 +13,6 @@<br> import time<br> <br> sys.path.append("lib/python")<br>-from version import AsteriskVersion<br> <br> LOGGER = logging.getLogger(__name__)<br> TOLERANCE = 1.0<br>@@ -52,15 +51,7 @@<br>         self.ami = ami<br>         self.ami.registerEvent('Hangup', self.log_hangup_time)<br>         self.ami.registerEvent('TestEvent', self.log_warnings)<br>-        if AsteriskVersion() >= AsteriskVersion('12'):<br>-            self.ami.registerEvent('BridgeEnter', self.log_bridge_enter_time)<br>-        else:<br>-            self.ami.registerEvent('Bridge', self.log_bridge_time)<br>-<br>-    def log_bridge_time(self, ami, event):<br>-        if not self.bridge_time:<br>-            self.bridge_time = time.time()<br>-            LOGGER.info("Bridge started at time %f" % self.bridge_time)<br>+        self.ami.registerEvent('BridgeEnter', self.log_bridge_enter_time)<br> <br>     def log_bridge_enter_time(self, ami, event):<br>         self.bridge_enters_received += 1<br>@@ -100,8 +91,7 @@<br>             self.test_object.set_passed(False)<br> <br>         max_triggers = 1<br>-        if self.current_call['hangup_style'] == 'BRIDGE_TIMELIMIT' \<br>-            and AsteriskVersion() >= AsteriskVersion('12'):<br>+        if self.current_call['hangup_style'] == 'BRIDGE_TIMELIMIT':<br>             max_triggers = 2<br> <br>         if 1 != self.num_hangup_triggers and max_triggers != self.num_hangup_triggers:<br>diff --git a/tests/bridge/parkcall/Executioner.py b/tests/bridge/parkcall/Executioner.py<br>index a4353bc..27d4813 100755<br>--- a/tests/bridge/parkcall/Executioner.py<br>+++ b/tests/bridge/parkcall/Executioner.py<br>@@ -13,8 +13,6 @@<br> <br> sys.path.append("lib/python")<br> <br>-from version import AsteriskVersion<br>-<br> LOGGER = logging.getLogger(__name__)<br> <br> <br>@@ -25,18 +23,9 @@<br>         test_object.register_ami_observer(self.ami_connect)<br>         self.test_object = test_object<br> <br>-        running_version = AsteriskVersion()<br>-<br>         self.calls = []<br>         self.calls.append({'parker': 'alice', 'parkee': 'bob'})<br>         self.calls.append({'parker': 'bob', 'parkee': 'alice'})<br>-<br>-        # Parking events for this test vary with Asterisk 12 and<br>-        # up from prior versions.<br>-        if (running_version < AsteriskVersion("12.0.0")):<br>-            self.asterisk12Events = False<br>-        else:<br>-            self.asterisk12Events = True<br> <br>         self.parking_events_received = 0<br> <br>@@ -52,11 +41,7 @@<br>         self.ami.registerEvent('ParkedCall', self.check_park)<br> <br>     def check_hangup(self, ami, event):<br>-        # We only hangup when we know that both the channel that initiated<br>-        # park and our zombie channel are gone. There are no zombies in<br>-        # Asterisk 12 mode, so we hang up on the first hangup.<br>-        if not self.asterisk12Events and self.hangups_processed == 1 \<br>-                or self.asterisk12Events and self.hangups_processed == 0:<br>+        if self.hangups_processed == 0:<br>             ami.hangup(self.parked_channel)<br> <br>         self.hangups_processed += 1<br>@@ -67,12 +52,8 @@<br>         this_parker = this_expectation['parker']<br>         this_parkee = this_expectation['parkee']<br> <br>-        if self.asterisk12Events:<br>-            parker_field = 'parkerdialstring'<br>-            parkee_field = 'parkeechannel'<br>-        else:<br>-            parker_field = 'from'<br>-            parkee_field = 'channel'<br>+        parker_field = 'parkerdialstring'<br>+        parkee_field = 'parkeechannel'<br> <br>         this_result_parker = event.get(parker_field)<br>         this_result_parkee = event.get(parkee_field)<br>diff --git a/tests/bridge/parkcall_blindxfer/Hangup.py b/tests/bridge/parkcall_blindxfer/Hangup.py<br>index 9b79be2..84edebb 100755<br>--- a/tests/bridge/parkcall_blindxfer/Hangup.py<br>+++ b/tests/bridge/parkcall_blindxfer/Hangup.py<br>@@ -12,18 +12,11 @@<br> <br> sys.path.append("lib/python")<br> <br>-from version import AsteriskVersion<br>-<br> LOGGER = logging.getLogger(__name__)<br> <br> <br> def handle_parkedcall(ami, event):<br>-    running_version = AsteriskVersion()<br>-<br>-    if running_version >= AsteriskVersion("12.0.0"):<br>-        parkee = event.get('parkeechannel')<br>-    else:<br>-        parkee = event.get('channel')<br>+    parkee = event.get('parkeechannel')<br> <br>     if parkee is None:<br>         LOGGER.error("Receved ParkedCall event without a Parkee.\n")<br>diff --git a/tests/bridge/parkcall_bridgefeatures/Executioner.py b/tests/bridge/parkcall_bridgefeatures/Executioner.py<br>index a4353bc..5061755 100755<br>--- a/tests/bridge/parkcall_bridgefeatures/Executioner.py<br>+++ b/tests/bridge/parkcall_bridgefeatures/Executioner.py<br>@@ -13,8 +13,6 @@<br> <br> sys.path.append("lib/python")<br> <br>-from version import AsteriskVersion<br>-<br> LOGGER = logging.getLogger(__name__)<br> <br> <br>@@ -25,18 +23,9 @@<br>         test_object.register_ami_observer(self.ami_connect)<br>         self.test_object = test_object<br> <br>-        running_version = AsteriskVersion()<br>-<br>         self.calls = []<br>         self.calls.append({'parker': 'alice', 'parkee': 'bob'})<br>         self.calls.append({'parker': 'bob', 'parkee': 'alice'})<br>-<br>-        # Parking events for this test vary with Asterisk 12 and<br>-        # up from prior versions.<br>-        if (running_version < AsteriskVersion("12.0.0")):<br>-            self.asterisk12Events = False<br>-        else:<br>-            self.asterisk12Events = True<br> <br>         self.parking_events_received = 0<br> <br>@@ -55,8 +44,7 @@<br>         # We only hangup when we know that both the channel that initiated<br>         # park and our zombie channel are gone. There are no zombies in<br>         # Asterisk 12 mode, so we hang up on the first hangup.<br>-        if not self.asterisk12Events and self.hangups_processed == 1 \<br>-                or self.asterisk12Events and self.hangups_processed == 0:<br>+        if self.hangups_processed == 0:<br>             ami.hangup(self.parked_channel)<br> <br>         self.hangups_processed += 1<br>@@ -67,12 +55,8 @@<br>         this_parker = this_expectation['parker']<br>         this_parkee = this_expectation['parkee']<br> <br>-        if self.asterisk12Events:<br>-            parker_field = 'parkerdialstring'<br>-            parkee_field = 'parkeechannel'<br>-        else:<br>-            parker_field = 'from'<br>-            parkee_field = 'channel'<br>+        parker_field = 'parkerdialstring'<br>+        parkee_field = 'parkeechannel'<br> <br>         this_result_parker = event.get(parker_field)<br>         this_result_parkee = event.get(parkee_field)<br>diff --git a/tests/bridge/parkcall_timeout/comebacktoorigin_no/Executioner.py b/tests/bridge/parkcall_timeout/comebacktoorigin_no/Executioner.py<br>index be9a186..c08628e 100755<br>--- a/tests/bridge/parkcall_timeout/comebacktoorigin_no/Executioner.py<br>+++ b/tests/bridge/parkcall_timeout/comebacktoorigin_no/Executioner.py<br>@@ -12,8 +12,6 @@<br> <br> sys.path.append("lib/python")<br> <br>-from version import AsteriskVersion<br>-<br> LOGGER = logging.getLogger(__name__)<br> <br> <br>@@ -23,12 +21,6 @@<br>         self.parked_channel = None<br>         test_object.register_ami_observer(self.ami_connect)<br>         self.test_object = test_object<br>-<br>-        running_version = AsteriskVersion()<br>-        if (running_version < AsteriskVersion("12.0.0")):<br>-            self.asterisk12Events = False<br>-        else:<br>-            self.asterisk12Events = True<br> <br>         self.calls = []<br>         self.calls.append({'test': '1', 'parker': 'SIP/alice',<br>@@ -64,19 +56,10 @@<br>         appdata = event.get('appdata')<br>         registrar = event.get('registrar')<br> <br>-        if self.asterisk12Events:<br>-            # Asterisk 12's parking uses a different registrar from previous<br>-            # versions and puts features on channels directly instead of in<br>-            # the dialplan<br>-            if appdata != 'SIP/alice,3':<br>-                not_right = True<br>-            if registrar != 'res_parking':<br>-                not_right = True<br>-        else:<br>-            if appdata != 'SIP/alice,3,Hk':<br>-                not_right = True<br>-            if registrar != 'features':<br>-                not_right = True<br>+        if appdata != 'SIP/alice,3':<br>+            not_right = True<br>+        if registrar != 'res_parking':<br>+            not_right = True<br> <br>         if not_right:<br>             # We don't handle failure here since the last check_user_event<br>diff --git a/tests/bridge/parkcall_timeout/comebacktoorigin_yes/Executioner.py b/tests/bridge/parkcall_timeout/comebacktoorigin_yes/Executioner.py<br>index 69166c8..26c62d8 100755<br>--- a/tests/bridge/parkcall_timeout/comebacktoorigin_yes/Executioner.py<br>+++ b/tests/bridge/parkcall_timeout/comebacktoorigin_yes/Executioner.py<br>@@ -14,8 +14,6 @@<br> <br> LOGGER = logging.getLogger(__name__)<br> <br>-from version import AsteriskVersion<br>-<br> <br> class Executioner(object):<br>     def __init__(self, module_config, test_object):<br>@@ -24,12 +22,6 @@<br>         self.parked_channel = None<br>         test_object.register_ami_observer(self.ami_connect)<br>         self.test_object = test_object<br>-<br>-        running_version = AsteriskVersion()<br>-        if (running_version < AsteriskVersion("12.0.0")):<br>-            self.asterisk12Events = False<br>-        else:<br>-            self.asterisk12Events = True<br> <br>         self.calls = []<br>         self.calls.append({'parker': 'SIP/alice', 'lot': 'parkinglot_test1',<br>@@ -82,13 +74,10 @@<br>         if (event.get('status') != self.current_call['status']):<br>             num_failures += 1<br> <br>-        if self.asterisk12Events:<br>-            # These values aren't set in Asterisk 11 when<br>-            # comebacktoorigin = yes, but they are in 12.<br>-            if (event.get('slot') != self.current_call['slot']):<br>-                num_failures += 1<br>-            if (event.get('lot') != self.current_call['lot']):<br>-                num_failures += 1<br>+        if (event.get('slot') != self.current_call['slot']):<br>+            num_failures += 1<br>+        if (event.get('lot') != self.current_call['lot']):<br>+            num_failures += 1<br> <br>         if (num_failures):<br>             LOGGER.info("Failing event: %s" % event)<br>diff --git a/tests/callparking/run-test b/tests/callparking/run-test<br>index ac6207a..cc78670 100755<br>--- a/tests/callparking/run-test<br>+++ b/tests/callparking/run-test<br>@@ -13,7 +13,6 @@<br> <br> sys.path.append("lib/python")<br> from asterisk.test_case import TestCase<br>-from asterisk.version import AsteriskVersion<br> <br> logger = logging.getLogger(__name__)<br> <br>@@ -23,10 +22,7 @@<br>         TestCase.__init__(self)<br> <br>         self.ami_count = 0<br>-        self.parking_var = "exten"<br>-<br>-        if AsteriskVersion() >= AsteriskVersion('12'):<br>-            self.parking_var = "parkingspace"<br>+        self.parking_var = "parkingspace"<br> <br>         # Initial parked call subtest.<br>         self.expected_space = 701<br>diff --git a/tests/callparking_retrieval/run-test b/tests/callparking_retrieval/run-test<br>index fd93f4a..08de7dd 100755<br>--- a/tests/callparking_retrieval/run-test<br>+++ b/tests/callparking_retrieval/run-test<br>@@ -13,7 +13,6 @@<br> <br> sys.path.append("lib/python")<br> from asterisk.test_case import TestCase<br>-from asterisk.version import AsteriskVersion<br> <br> LOGGER = logging.getLogger(__name__)<br> <br>@@ -24,11 +23,6 @@<br>     def __init__(self):<br>         """Prepare the test object"""<br>         TestCase.__init__(self)<br>-<br>-        self.mode_12 = False<br>-<br>-        if AsteriskVersion() >= AsteriskVersion('12'):<br>-            self.mode_12 = True<br> <br>         self.channel_parked = None<br>         self.times_parked = 0<br>@@ -49,10 +43,7 @@<br>     def check_parkedcall(self, ami, event):<br>         """Check the values of a ParkedCall event against expectations"""<br>         self.times_parked += 1<br>-        if self.mode_12:<br>-            parkee = event.get('parkeechannel')<br>-        else:<br>-            parkee = event.get('channel')<br>+        parkee = event.get('parkeechannel')<br>         LOGGER.info("Parkee: %s" % parkee)<br> <br>         if not "IAX2/usera-" in parkee:<br>@@ -87,10 +78,7 @@<br>     def check_unparkedcall(self, ami, event):<br>         """Check the values of an UnParkedCall event against expectations"""<br>         self.times_unparked += 1<br>-        if self.mode_12:<br>-            retriever = event.get('retrieverchannel')<br>-        else:<br>-            retriever = event.get('from')<br>+        retriever = event.get('retrieverchannel')<br> <br>         LOGGER.info("Retriever: %s" % retriever)<br> <br>diff --git a/tests/channels/SIP/SDP_attribute_passthrough/run-test b/tests/channels/SIP/SDP_attribute_passthrough/run-test<br>index 79b8e75..5512e5a 100755<br>--- a/tests/channels/SIP/SDP_attribute_passthrough/run-test<br>+++ b/tests/channels/SIP/SDP_attribute_passthrough/run-test<br>@@ -15,7 +15,6 @@<br> sys.path.append("lib/python")<br> <br> from asterisk.asterisk import Asterisk<br>-from asterisk.version import AsteriskVersion<br> from asterisk.test_case import TestCase<br> from asterisk.sipp import SIPpScenario<br> from twisted.internet import reactor<br>@@ -29,17 +28,10 @@<br>         self.create_asterisk()<br>         self.sipp_phone_a_scenarios = [{'scenario':'phone_A_speex.xml','-i':'127.0.0.2','-p':'5065'},]<br>         self.sipp_phone_b_scenarios = [{'scenario':'phone_B_speex.xml','-i':'127.0.0.3','-p':'5066'},]<br>-        if (AsteriskVersion() < AsteriskVersion("13")):<br>-            self.sipp_phone_a_scenarios.extend([{'scenario':'phone_A_h263.xml','-i':'127.0.0.2','-p':'5061'},<br>-                                                {'scenario':'phone_A_h264.xml','-i':'127.0.0.2','-p':'5062'},])<br>-                                           <br>-            self.sipp_phone_b_scenarios.extend([{'scenario':'phone_B_h263.xml','-i':'127.0.0.3','-p':'5063'},<br>-                                                {'scenario':'phone_B_h264.xml','-i':'127.0.0.3','-p':'5064'},])<br>-        else:<br>-            self.sipp_phone_a_scenarios.extend([{'scenario':'phone_A_h263_13.xml','-i':'127.0.0.2','-p':'5061'},<br>-                                                {'scenario':'phone_A_h264_13.xml','-i':'127.0.0.2','-p':'5062'},])<br>-            self.sipp_phone_b_scenarios.extend([{'scenario':'phone_B_h263_13.xml','-i':'127.0.0.3','-p':'5063'},<br>-                                                {'scenario':'phone_B_h264_13.xml','-i':'127.0.0.3','-p':'5064'},])<br>+        self.sipp_phone_a_scenarios.extend([{'scenario':'phone_A_h263_13.xml','-i':'127.0.0.2','-p':'5061'},<br>+                                            {'scenario':'phone_A_h264_13.xml','-i':'127.0.0.2','-p':'5062'},])<br>+        self.sipp_phone_b_scenarios.extend([{'scenario':'phone_B_h263_13.xml','-i':'127.0.0.3','-p':'5063'},<br>+                                            {'scenario':'phone_B_h264_13.xml','-i':'127.0.0.3','-p':'5064'},])<br> <br>         self.passed = True<br>         self.__test_counter = 0<br>diff --git a/tests/channels/SIP/SDP_attribute_passthrough/sipp/phone_A_h263.xml b/tests/channels/SIP/SDP_attribute_passthrough/sipp/phone_A_h263.xml<br>deleted file mode 100644<br>index f36c678..0000000<br>--- a/tests/channels/SIP/SDP_attribute_passthrough/sipp/phone_A_h263.xml<br>+++ /dev/null<br>@@ -1,97 +0,0 @@<br>-<?xml version="1.0" encoding="ISO-8859-1" ?><br>-<!DOCTYPE scenario SYSTEM "sipp.dtd"><br>-<br>-<scenario name="Channel Test"><br>-  <send retrans="500"><br>-    <![CDATA[<br>-<br>-      INVITE sip:test-h263@[remote_ip]:[remote_port] SIP/2.0<br>-      Via: SIP/2.0/[transport] [local_ip]:[local_port];branch=[branch]<br>-      From: test1 <sip:phoneA@[local_ip]:[local_port]>;tag=[call_number]<br>-      To: test <sip:test@[remote_ip]:[remote_port]><br>-      Call-ID: [call_id]<br>-      CSeq: 1 INVITE<br>-      Contact: sip:test@[local_ip]:[local_port]<br>-      Max-Forwards: 70<br>-      Subject: Performance Test<br>-      User-Agent: Channel Param Test<br>-      Content-Type: application/sdp<br>-      Content-Length: [len]<br>-<br>-      v=0<br>-      o=phoneA 53655765 2353687637 IN IP[local_ip_type] [local_ip]<br>-      s=-<br>-      c=IN IP[media_ip_type] [media_ip]<br>-      t=0 0<br>-      m=audio 6000 RTP/AVP 0<br>-      a=rtpmap:0 PCMU/8000<br>-      m=video 6002 RTP/AVP 34<br>-      a=rtpmap:34 H263/90000<br>-      a=fmtp:34 SQCIF=1;QCIF=1;CIF=1;CIF4=1;CIF16=1;F=1;I=1;J=1;T=1;K=1;N=1;PAR=255:255;BPP=65535;HRD=1<br>-<br>-    ]]><br>-  </send><br>-<br>-  <recv response="100"<br>-        optional="true"><br>-  </recv><br>-<br>-  <recv response="180" optional="true"><br>-  </recv><br>-<br>-  <recv response="183" optional="true"><br>-  </recv><br>-<br>-  <recv response="200" rtd="true"><br>-    <action><br>-      <ereg regexp="m=video [0-9]{1,5} RTP/AVP( [0-9]{1,3})+..*a=rtpmap:34 H263/90000.*a=fmtp:34 SQCIF=1;QCIF=1;CIF=1;CIF4=1;CIF16=1;F=1;I=1;J=1;T=1;K=1;N=1;PAR=255:255;BPP=65535;HRD=1"<br>-            search_in="body" check_it="true" assign_to="1"/><br>-      <strcmp assign_to="1" variable="1" value=""/><br>-    </action><br>-  </recv><br>-<br>-  <send><br>-    <![CDATA[<br>-<br>-      ACK sip:test-h263@[remote_ip]:[remote_port] SIP/2.0<br>-      Via: SIP/2.0/[transport] [local_ip]:[local_port];branch=[branch]<br>-      From: test1 <sip:phoneA@[local_ip]:[local_port]>;tag=[call_number]<br>-      To: test <sip:test@[remote_ip]:[remote_port]>[peer_tag_param]<br>-      Call-ID: [call_id]<br>-      CSeq: 1 ACK<br>-      Contact: sip:kartoffelsalat@[local_ip]:[local_port]<br>-      Max-Forwards: 70<br>-      Subject: Performance Test<br>-      Content-Length: 0<br>-<br>-    ]]><br>-  </send><br>-<br>-  <send retrans="500"><br>-    <![CDATA[<br>-<br>-      BYE sip:test-h263@[remote_ip]:[remote_port] SIP/2.0<br>-      Via: SIP/2.0/[transport] [local_ip]:[local_port];branch=[branch]<br>-      From: test1 <sip:phoneA@[local_ip]:[local_port]>;tag=[call_number]<br>-      To: test <sip:test@[remote_ip]:[remote_port]>[peer_tag_param]<br>-      Call-ID: [call_id]<br>-      CSeq: 2 BYE<br>-      Contact: sip:kartoffelsalat@[local_ip]:[local_port]<br>-      Max-Forwards: 70<br>-      Subject: Performance Test<br>-      Content-Length: 0<br>-<br>-    ]]><br>-  </send><br>-<br>-  <recv response="200" crlf="true"><br>-  </recv><br>-<br>-  <!-- definition of the response time repartition table (unit is ms)   --><br>-  <ResponseTimeRepartition value="10, 20, 30, 40, 50, 100, 150, 200"/><br>-<br>-  <!-- definition of the call length repartition table (unit is ms)     --><br>-  <CallLengthRepartition value="10, 50, 100, 500, 1000, 5000, 10000"/><br>-<br>-</scenario><br>-<br>diff --git a/tests/channels/SIP/SDP_attribute_passthrough/sipp/phone_A_h264.xml b/tests/channels/SIP/SDP_attribute_passthrough/sipp/phone_A_h264.xml<br>deleted file mode 100644<br>index c0703eb..0000000<br>--- a/tests/channels/SIP/SDP_attribute_passthrough/sipp/phone_A_h264.xml<br>+++ /dev/null<br>@@ -1,97 +0,0 @@<br>-<?xml version="1.0" encoding="ISO-8859-1" ?><br>-<!DOCTYPE scenario SYSTEM "sipp.dtd"><br>-<br>-<scenario name="Channel Test"><br>-  <send retrans="500"><br>-    <![CDATA[<br>-<br>-      INVITE sip:test-h264@[remote_ip]:[remote_port] SIP/2.0<br>-      Via: SIP/2.0/[transport] [local_ip]:[local_port];branch=[branch]<br>-      From: test1 <sip:phoneA@[local_ip]:[local_port]>;tag=[call_number]<br>-      To: test <sip:test@[remote_ip]:[remote_port]><br>-      Call-ID: [call_id]<br>-      CSeq: 1 INVITE<br>-      Contact: sip:test@[local_ip]:[local_port]<br>-      Max-Forwards: 70<br>-      Subject: Performance Test<br>-      User-Agent: Channel Param Test<br>-      Content-Type: application/sdp<br>-      Content-Length: [len]<br>-<br>-      v=0<br>-      o=phoneA 53655765 2353687637 IN IP[local_ip_type] [local_ip]<br>-      s=-<br>-      c=IN IP[media_ip_type] [media_ip]<br>-      t=0 0<br>-      m=audio 6000 RTP/AVP 0<br>-      a=rtpmap:0 PCMU/8000<br>-      m=video 6002 RTP/AVP 99<br>-      a=rtpmap:99 H264/90000<br>-      a=fmtp:99 profile-level-id=42801e;packetization-mode=1;max-mbps=48600<br>-<br>-    ]]><br>-  </send><br>-<br>-  <recv response="100"<br>-        optional="true"><br>-  </recv><br>-<br>-  <recv response="180" optional="true"><br>-  </recv><br>-<br>-  <recv response="183" optional="true"><br>-  </recv><br>-<br>-  <recv response="200" rtd="true"><br>-    <action><br>-      <ereg regexp="m=video [0-9]{1,5} RTP/AVP( [0-9]{1,3})+..*a=rtpmap:99 H264/90000.*a=fmtp:99 profile-level-id=42801E;max-mbps=48600;packetization-mode=1"<br>-            search_in="body" check_it="true" assign_to="1"/><br>-      <strcmp assign_to="1" variable="1" value=""/><br>-    </action><br>-  </recv><br>-<br>-  <send><br>-    <![CDATA[<br>-<br>-      ACK sip:test-h264@[remote_ip]:[remote_port] SIP/2.0<br>-      Via: SIP/2.0/[transport] [local_ip]:[local_port];branch=[branch]<br>-      From: test1 <sip:phoneA@[local_ip]:[local_port]>;tag=[call_number]<br>-      To: test <sip:test@[remote_ip]:[remote_port]>[peer_tag_param]<br>-      Call-ID: [call_id]<br>-      CSeq: 1 ACK<br>-      Contact: sip:kartoffelsalat@[local_ip]:[local_port]<br>-      Max-Forwards: 70<br>-      Subject: Performance Test<br>-      Content-Length: 0<br>-<br>-    ]]><br>-  </send><br>-<br>-  <send retrans="500"><br>-    <![CDATA[<br>-<br>-      BYE sip:test-h264@[remote_ip]:[remote_port] SIP/2.0<br>-      Via: SIP/2.0/[transport] [local_ip]:[local_port];branch=[branch]<br>-      From: test1 <sip:phoneA@[local_ip]:[local_port]>;tag=[call_number]<br>-      To: test <sip:test@[remote_ip]:[remote_port]>[peer_tag_param]<br>-      Call-ID: [call_id]<br>-      CSeq: 2 BYE<br>-      Contact: sip:kartoffelsalat@[local_ip]:[local_port]<br>-      Max-Forwards: 70<br>-      Subject: Performance Test<br>-      Content-Length: 0<br>-<br>-    ]]><br>-  </send><br>-<br>-  <recv response="200" crlf="true"><br>-  </recv><br>-<br>-  <!-- definition of the response time repartition table (unit is ms)   --><br>-  <ResponseTimeRepartition value="10, 20, 30, 40, 50, 100, 150, 200"/><br>-<br>-  <!-- definition of the call length repartition table (unit is ms)     --><br>-  <CallLengthRepartition value="10, 50, 100, 500, 1000, 5000, 10000"/><br>-<br>-</scenario><br>-<br>diff --git a/tests/channels/SIP/SDP_attribute_passthrough/sipp/phone_B_h263.xml b/tests/channels/SIP/SDP_attribute_passthrough/sipp/phone_B_h263.xml<br>deleted file mode 100644<br>index bb2159e..0000000<br>--- a/tests/channels/SIP/SDP_attribute_passthrough/sipp/phone_B_h263.xml<br>+++ /dev/null<br>@@ -1,89 +0,0 @@<br>-<?xml version="1.0" encoding="ISO-8859-1" ?><br>-<!DOCTYPE scenario SYSTEM "sipp.dtd"><br>-<br>-<scenario name="Phone B INVITE with H.263 and answer with H.263"><br>- <Global variables="global_call_id"/><br>-<br>-      <recv request="INVITE" crlf="true"><br>-                <action><br>-                       <ereg regexp=".*"<br>-                               header="Call-ID:"<br>-                          search_in="hdr"<br>-                            check_it="true"<br>-                            assign_to="global_call_id"/><br>-                    <ereg regexp="m=video [0-9]{1,5} RTP/AVP( [0-9]{1,3})+..*a=rtpmap:34 H263/90000.*a=fmtp:34 SQCIF=1;QCIF=1;CIF=1;CIF4=1;CIF16=1;F=1;I=1;J=1;T=1;K=1;N=1;PAR=255:255;BPP=65535;HRD=1"<br>-                           search_in="body" check_it="true" assign_to="1"/><br>-                      <strcmp assign_to="1" variable="1" value=""/><br>-<br>-         </action><br>-      </recv><br>-<br>-     <send><br>-         <![CDATA[<br>-                 SIP/2.0 100 Trying<br>-                   [last_Via:]<br>-                  [last_From:]<br>-                 [last_To:];tag=[call_number]<br>-                 [last_Call-ID:]<br>-                      [last_CSeq:]<br>-                 Contact: <sip:bob@[local_ip]:[local_port];transport=[transport]><br>-                       User-Agent: PolycomSoundPointIP-SPIP_430-UA/3.2.3.1734<br>-                       Accept-Language: en<br>-                  Content-Length: 0<br>-            ]]><br>-       </send><br>-<br>-     <pause milliseconds="200"/><br>-<br>-       <send retrans="500"><br>-         <![CDATA[<br>-                 SIP/2.0 200 OK<br>-                       [last_Via:]<br>-                  [last_From:]<br>-                 [last_To:];tag=[call_number]<br>-                 [last_Call-ID:]<br>-                      [last_CSeq:]<br>-                 Contact: <sip:bob@[local_ip]:[local_port];transport=[transport]><br>-                       Allow: INVITE, ACK, BYE, CANCEL, OPTIONS, INFO, MESSAGE, SUBSCRIBE, NOTIFY, PRACK, UPDATE, REFER<br>-                     Supported: 100rel,replaces<br>-                   User-Agent: PolycomSoundPointIP-SPIP_430-UA/3.2.3.1734<br>-                       Accept-Language: en<br>-                  Content-Type: application/sdp<br>-                        Content-Length: [len]<br>-<br>-                     v=0<br>-                  o=guest3 53655765 2353687637 IN IP[local_ip_type] [local_ip]<br>-                 s=-<br>-                  c=IN IP[media_ip_type] [media_ip]<br>-                    t=0 0<br>-                        m=video 6002 RTP/AVP 34<br>-                      a=rtpmap:34 H263/90000<br>-                       a=fmtp:34 SQCIF=1;QCIF=1;CIF=1;CIF4=1;CIF16=1;F=1;I=1;J=1;T=1;K=1;N=1;PAR=255:255;BPP=65535;HRD=1<br>-<br>-         ]]><br>-       </send><br>-<br>-     <!-- RECV ACK --><br>-      <recv request="ACK"/><br>-<br>-     <recv request="BYE"/><br>-<br>-        <send retrans="500"><br>-                <![CDATA[<br>-                        SIP/2.0 200 OK<br>-                        [last_Via:]<br>-                        [last_From:]<br>-                        [last_To:];tag=[call_number]<br>-                        [last_Call-ID:]<br>-                        [last_CSeq:]<br>-                        Contact: <sip:bob@[local_ip]:[local_port];transport=[transport]><br>-                        Allow: INVITE, ACK, BYE, CANCEL, OPTIONS, INFO, MESSAGE, SUBSCRIBE, NOTIFY, PRACK, UPDATE, REFER<br>-                        Supported: 100rel,replaces<br>-                        User-Agent: PolycomSoundPointIP-SPIP_430-UA/3.2.3.1734<br>-                        Accept-Language: en<br>-                        Content-Type: application/sdp<br>-                        Content-Length: 0<br>-                ]]><br>-        </send><br>-<br>-</scenario><br>diff --git a/tests/channels/SIP/SDP_attribute_passthrough/sipp/phone_B_h264.xml b/tests/channels/SIP/SDP_attribute_passthrough/sipp/phone_B_h264.xml<br>deleted file mode 100644<br>index 1716969..0000000<br>--- a/tests/channels/SIP/SDP_attribute_passthrough/sipp/phone_B_h264.xml<br>+++ /dev/null<br>@@ -1,89 +0,0 @@<br>-<?xml version="1.0" encoding="ISO-8859-1" ?><br>-<!DOCTYPE scenario SYSTEM "sipp.dtd"><br>-<br>-<scenario name="Phone B INVITE with H.264 and answer with H.264"><br>-  <Global variables="global_call_id"/><br>-<br>-      <recv request="INVITE" crlf="true"><br>-                <action><br>-                       <ereg regexp=".*"<br>-                               header="Call-ID:"<br>-                          search_in="hdr"<br>-                            check_it="true"<br>-                            assign_to="global_call_id"/><br>-                    <ereg regexp="m=video [0-9]{1,5} RTP/AVP( [0-9]{1,3})+..*a=rtpmap:9[6-9]|1{0,1}[0-9]|12[0-7] H264/90000.*a=fmtp:9[6-9]|1{0,1}[0-9]|12[0-7] profile-level-id=42801E;max-mbps=48600;packetization-mode=1"<br>-                       search_in="body" check_it="true" assign_to="1"/><br>-                      <strcmp assign_to="1" variable="1" value=""/><br>-<br>-         </action><br>-      </recv><br>-<br>-     <send><br>-         <![CDATA[<br>-                 SIP/2.0 100 Trying<br>-                   [last_Via:]<br>-                  [last_From:]<br>-                 [last_To:];tag=[call_number]<br>-                 [last_Call-ID:]<br>-                      [last_CSeq:]<br>-                 Contact: <sip:bob@[local_ip]:[local_port];transport=[transport]><br>-                       User-Agent: PolycomSoundPointIP-SPIP_430-UA/3.2.3.1734<br>-                       Accept-Language: en<br>-                  Content-Length: 0<br>-            ]]><br>-       </send><br>-<br>-     <pause milliseconds="200"/><br>-<br>-       <send retrans="500"><br>-         <![CDATA[<br>-                 SIP/2.0 200 OK<br>-                       [last_Via:]<br>-                  [last_From:]<br>-                 [last_To:];tag=[call_number]<br>-                 [last_Call-ID:]<br>-                      [last_CSeq:]<br>-                 Contact: <sip:bob@[local_ip]:[local_port];transport=[transport]><br>-                       Allow: INVITE, ACK, BYE, CANCEL, OPTIONS, INFO, MESSAGE, SUBSCRIBE, NOTIFY, PRACK, UPDATE, REFER<br>-                     Supported: 100rel,replaces<br>-                   User-Agent: PolycomSoundPointIP-SPIP_430-UA/3.2.3.1734<br>-                       Accept-Language: en<br>-                  Content-Type: application/sdp<br>-                        Content-Length: [len]<br>-<br>-                     v=0<br>-                  o=guest3 53655765 2353687637 IN IP[local_ip_type] [local_ip]<br>-                 s=-<br>-                  c=IN IP[media_ip_type] [media_ip]<br>-                    t=0 0<br>-                        m=video 6002 RTP/AVP 99<br>-                      a=rtpmap:99 H264/90000<br>-                       a=fmtp:99 profile-level-id=42801e;packetization-mode=1;max-mbps=48600<br>-<br>-             ]]><br>-       </send><br>-<br>-     <!-- RECV ACK --><br>-      <recv request="ACK"/><br>-<br>-     <recv request="BYE"/><br>-<br>-        <send retrans="500"><br>-                <![CDATA[<br>-                        SIP/2.0 200 OK<br>-                        [last_Via:]<br>-                        [last_From:]<br>-                        [last_To:];tag=[call_number]<br>-                        [last_Call-ID:]<br>-                        [last_CSeq:]<br>-                        Contact: <sip:bob@[local_ip]:[local_port];transport=[transport]><br>-                        Allow: INVITE, ACK, BYE, CANCEL, OPTIONS, INFO, MESSAGE, SUBSCRIBE, NOTIFY, PRACK, UPDATE, REFER<br>-                        Supported: 100rel,replaces<br>-                        User-Agent: PolycomSoundPointIP-SPIP_430-UA/3.2.3.1734<br>-                        Accept-Language: en<br>-                        Content-Type: application/sdp<br>-                        Content-Length: 0<br>-                ]]><br>-        </send><br>-<br>-</scenario><br>diff --git a/tests/channels/SIP/SDP_offer_answer/run-test b/tests/channels/SIP/SDP_offer_answer/run-test<br>index d11f55c..47a5f03 100755<br>--- a/tests/channels/SIP/SDP_offer_answer/run-test<br>+++ b/tests/channels/SIP/SDP_offer_answer/run-test<br>@@ -14,7 +14,6 @@<br> <br> from twisted.internet import reactor<br> from asterisk.sipp import SIPpTest<br>-from asterisk.version import AsteriskVersion<br> <br> <br> WORKING_DIR = "SIP/SDP_offer_answer"<br>@@ -41,11 +40,8 @@<br> <br> # generate SIPP scenarios with appropriate port numbers and the config to go with it<br> def main():<br>-    if AsteriskVersion() > AsteriskVersion("11"):<br>-        SIPP_SCENARIOS.append({'scenario' : 'decline_multistream.xml'})<br>-        SIPP_SCENARIOS.append({'scenario' : 'decline_unsupported_image_multi.xml'})<br>-    else:<br>-        SIPP_SCENARIOS.append({'scenario' : 'decline_unsupported_image_multi_1.8.xml'})<br>+    SIPP_SCENARIOS.append({'scenario' : 'decline_multistream.xml'})<br>+    SIPP_SCENARIOS.append({'scenario' : 'decline_unsupported_image_multi.xml'})<br>     test = SIPpTest(WORKING_DIR, TEST_DIR, SIPP_SCENARIOS)<br>     reactor.run()<br>     if not test.passed:<br>diff --git a/tests/channels/SIP/SDP_offer_answer/sipp/decline_unsupported_image_multi_1.8.xml b/tests/channels/SIP/SDP_offer_answer/sipp/decline_unsupported_image_multi_1.8.xml<br>deleted file mode 100644<br>index b4772b5..0000000<br>--- a/tests/channels/SIP/SDP_offer_answer/sipp/decline_unsupported_image_multi_1.8.xml<br>+++ /dev/null<br>@@ -1,118 +0,0 @@<br>-<?xml version="1.0" encoding="ISO-8859-1" ?><br>-<!DOCTYPE scenario SYSTEM "sipp.dtd"><br>-<br>-<scenario name="Channel Test"><br>-  <send retrans="500"><br>-    <![CDATA[<br>-      INVITE sip:test@[remote_ip]:[remote_port] SIP/2.0<br>-      Via: SIP/2.0/[transport] [local_ip]:[local_port];branch=[branch]<br>-      From: test1 <sip:guest1@[local_ip]:[local_port]>;tag=[call_number]<br>-      To: test <sip:test@[remote_ip]:[remote_port]><br>-      Call-ID: [call_id]<br>-      CSeq: 1 INVITE<br>-      Contact: sip:test@[local_ip]:[local_port]<br>-      Max-Forwards: 70<br>-      Subject: Performance Test<br>-      User-Agent: Channel Param Test<br>-      Content-Type: application/sdp<br>-      Content-Length: [len]<br>-<br>-      v=0<br>-      o=guest1 53655765 2353687637 IN IP[local_ip_type] [local_ip]<br>-      s=-<br>-      c=IN IP[media_ip_type] [media_ip]<br>-      t=0 0<br>-      m=image 27598 RTP/AVP t38<br>-      a=T38MaxBitRate:14400<br>-      a=T38FaxRateManagement:transferredTCF<br>-      a=T38FaxFillBitRemoval:0<br>-      a=T38FaxTranscodingMMR:0<br>-      a=T38FaxTranscodingJBIG:0<br>-      a=T38FaxVersion:0<br>-      a=T38FaxUdpEC:t38UDPRedundancy<br>-      a=sendrecv<br>-      m=image 34380 RTP/SAVP t38<br>-      a=T38MaxBitRate:14400<br>-      a=T38FaxRateManagement:transferredTCF<br>-      a=T38FaxFillBitRemoval:0<br>-      a=T38FaxTranscodingMMR:0<br>-      a=T38FaxTranscodingJBIG:0<br>-      a=T38FaxVersion:0<br>-      a=T38FaxUdpEC:t38UDPRedundancy<br>-      a=sendrecv<br>-      a=key-mgmt:mikey AQAVgPwtOloCAAAAAAAAAAAAAABZ+s2kAAAAAAUBAAVtaWtleQsA1kMaMwAAAAAKFPhiiuMYI6Rr/kmTTbCu0sR43a/HAQAA<br>-      ADYCAQEDBAAAAKAEBAAAAHALBAAAAFAAAQEBBAAAAIAJAQAGAQAFAQAIAQEKAQEHAQEMBAAAAAAAAAAkABAAENR6NqV530allXc23CkfQucADmG1yYfFo<br>-      +6Tw3+ofqCTAA==<br>-      a=crypto:1 AES_CM_128_HMAC_SHA1_80 inline:qa7LFKEFmfQF4exgJl2q78jJnxTGgsJGVjZqqg3u<br>-      m=image 34740 udptl t38<br>-      a=T38MaxBitRate:14400<br>-      a=T38FaxRateManagement:transferredTCF<br>-      a=T38FaxFillBitRemoval:0<br>-      a=T38FaxTranscodingMMR:0<br>-      a=T38FaxTranscodingJBIG:0<br>-      a=T38FaxVersion:0<br>-      a=T38FaxUdpEC:t38UDPRedundancy<br>-      a=sendrecv<br>-<br>-    ]]><br>-  </send><br>-<br>-  <recv response="100" optional="true" /><br>-<br>-  <recv response="180" optional="true" /><br>-<br>-  <recv response="183" optional="true" /><br>-<br>-  <recv response="200" rtd="true"><br>-    <action><br>-      <ereg regexp="m=image [0-9]{1,5} udptl t38"<br>-            search_in="body" check_it="true" assign_to="1"/><br>-    </action><br>-  </recv><br>-  <Reference variables="1" /><br>-<br>-  <send><br>-    <![CDATA[<br>-<br>-      ACK sip:test@[remote_ip]:[remote_port] SIP/2.0<br>-      Via: SIP/2.0/[transport] [local_ip]:[local_port];branch=[branch]<br>-      From: test1 <sip:guest1@[local_ip]:[local_port]>;tag=[call_number]<br>-      To: test <sip:test@[remote_ip]:[remote_port]>[peer_tag_param]<br>-      Call-ID: [call_id]<br>-      CSeq: 1 ACK<br>-      Contact: sip:kartoffelsalat@[local_ip]:[local_port]<br>-      Max-Forwards: 70<br>-      Subject: Performance Test<br>-      Content-Length: 0<br>-<br>-    ]]><br>-  </send><br>-<br>-  <send retrans="500"><br>-    <![CDATA[<br>-<br>-      BYE sip:test@[remote_ip]:[remote_port] SIP/2.0<br>-      Via: SIP/2.0/[transport] [local_ip]:[local_port];branch=[branch]<br>-      From: test1 <sip:guest1@[local_ip]:[local_port]>;tag=[call_number]<br>-      To: test <sip:test@[remote_ip]:[remote_port]>[peer_tag_param]<br>-      Call-ID: [call_id]<br>-      CSeq: 2 BYE<br>-      Contact: sip:kartoffelsalat@[local_ip]:[local_port]<br>-      Max-Forwards: 70<br>-      Subject: Performance Test<br>-      Content-Length: 0<br>-<br>-    ]]><br>-  </send><br>-<br>-  <recv response="200" crlf="true"><br>-  </recv><br>-<br>-  <!-- definition of the response time repartition table (unit is ms)   --><br>-  <ResponseTimeRepartition value="10, 20, 30, 40, 50, 100, 150, 200"/><br>-<br>-  <!-- definition of the call length repartition table (unit is ms)     --><br>-  <CallLengthRepartition value="10, 50, 100, 500, 1000, 5000, 10000"/><br>-<br>-</scenario><br>-<br>diff --git a/tests/channels/SIP/info_dtmf/run-test b/tests/channels/SIP/info_dtmf/run-test<br>index 91f3802..862ae1a 100755<br>--- a/tests/channels/SIP/info_dtmf/run-test<br>+++ b/tests/channels/SIP/info_dtmf/run-test<br>@@ -17,7 +17,6 @@<br> <br> sys.path.append("lib/python")<br> <br>-from asterisk.version import AsteriskVersion<br> from asterisk.sipp import SIPpScenario, SIPpScenarioSequence<br> from asterisk.test_case import TestCase<br> <br>@@ -54,10 +53,7 @@<br>         Keyword Arguments:<br>         ami    -    The StarPY manager object that connected<br>         """<br>-        if (AsteriskVersion() >= AsteriskVersion('12')):<br>-            ami.registerEvent('DTMFEnd', self.handle_dtmf_end_event)<br>-        else:<br>-            ami.registerEvent('DTMF', self.handle_dtmf_event)<br>+        ami.registerEvent('DTMFEnd', self.handle_dtmf_end_event)<br>         sipp_scenario_params = [{'scenario':'dtmf-relay.xml','-p':'5061'}, {'scenario':'dtmf.xml','-p':'5061'}]<br>         sequence = SIPpScenarioSequence(test_case = self)<br>         for scenario_param in sipp_scenario_params:<br>@@ -81,22 +77,6 @@<br>             LOGGER.info("Received all expected events, stopping test")<br>             self.stop_reactor()<br> <br>-    def handle_dtmf_event(self, ami, event):<br>-        """<br>-        Callback handler for a DTMF Event received over AMI.<br>-<br>-        Keyword Arguments:<br>-        ami    -    The instance of AMI that received this event<br>-        event    -    The AMI event object<br>-        """<br>-        digit = event["digit"]<br>-        end = event["end"]<br>-        if (end == "Yes"):<br>-            LOGGER.debug("Received end of DTMF digit %s" % digit)<br>-            self.received_events.append(digit)<br>-        if (len(self.received_events) == len(self.expected_events)):<br>-            LOGGER.info("Received all expected events, stopping test")<br>-            self.stop_reactor()<br> <br> def main():<br>     """<br>diff --git a/tests/channels/SIP/nat_supertest/run-test b/tests/channels/SIP/nat_supertest/run-test<br>index ebd3fa1..4e652f2 100755<br>--- a/tests/channels/SIP/nat_supertest/run-test<br>+++ b/tests/channels/SIP/nat_supertest/run-test<br>@@ -23,21 +23,8 @@<br> logger = logging.getLogger(__name__)<br> INJECT_FILE = TEST_DIR + "/sipp/inject.csv"<br> <br>-expected_failures = {<br>-    'branch-1.4': [4, 6, 8, 10],<br>-    'branch-1.6.2': [4, 6, 8, 10],<br>-    'branch-1.8': [4, 8],<br>-    'branch-10': [4, 8],<br>-    'trunk': [4, 8]<br>-}<br>-<br>-nat_modes = {<br>-    'branch-1.4': {False: 'no', True: 'route'},<br>-    'branch-1.6.2': {False: 'no', True: 'route'},<br>-    'branch-1.8': {False: 'no', True: 'force_rport'},<br>-    'branch-10': {False: 'no', True: 'force_rport'},<br>-    'trunk': {False: 'no', True: 'force_rport'},<br>-}<br>+expected_failures = [4, 8]<br>+nat_modes = {False: 'no', True: 'force_rport'}<br> <br> def compute_value(val):<br>     """ Take an iterable of booleans (MSB-first) and return their integer value<br>@@ -63,7 +50,7 @@<br>         self.create_ami_factory()<br> <br>     def get_nat_value(self, route):<br>-        return nat_modes[self.ast[0].ast_version.branch][route]<br>+        return nat_modes[route]<br> <br>     def update_config(self, general_nat, peer_nat):<br>         global_nat = self.get_nat_value(general_nat)<br>@@ -131,15 +118,11 @@<br>                 # order of variables is least significant first!<br>                 qm = QM(["port_matches_via", "rport_specified", "peer_nat", "general_nat"])<br>                 logger.debug("Failures: %s" % (self.failures,))<br>-                try:<br>-                    if self.failures == expected_failures[self.ast[0].ast_version.branch]:<br>-                        self.passed = True<br>-                        logger.info(qm.get_function(qm.solve(self.failures, [])[1]))<br>-                    else:<br>-                        logger.warn(qm.get_function(qm.solve(self.failures, [])[1]))<br>-                except KeyError:<br>-                    log.error("We don't know the expected failures for branch: %s\n" % (self.ast[0].ast_version.branch,))<br>+                if self.failures == expected_failures:<br>                     self.passed = True<br>+                    logger.info(qm.get_function(qm.solve(self.failures, [])[1]))<br>+                else:<br>+                    logger.warn(qm.get_function(qm.solve(self.failures, [])[1]))<br>             return result<br> <br>         self.__test_counter = 0<br>diff --git a/tests/channels/SIP/sip_attended_transfer/attended_transfer.py b/tests/channels/SIP/sip_attended_transfer/attended_transfer.py<br>index 1915f8e..f5fc840 100644<br>--- a/tests/channels/SIP/sip_attended_transfer/attended_transfer.py<br>+++ b/tests/channels/SIP/sip_attended_transfer/attended_transfer.py<br>@@ -10,7 +10,6 @@<br> import pjsua as pj<br> import sys<br> <br>-from version import AsteriskVersion<br> from twisted.internet import reactor<br> <br> LOGGER = logging.getLogger(__name__)<br>@@ -141,83 +140,6 @@<br>         return self.bridge2.bridged<br> <br> <br>-class BridgeStateEleven(object):<br>-    '''Tracker of bridge state for Asterisk 11-<br>-<br>-    Since in Asterisk versions prior to 12, there are no bridge objects, the<br>-    only way we can track the state of bridges in Asterisk is via Bridge events<br>-    and our own channel count. We count unique bridges by using the "channel2"<br>-    header in Bridge events from Asterisk.<br>-    '''<br>-    def __init__(self, test_object, controller, ami):<br>-        self.test_object = test_object<br>-        self.controller = controller<br>-        self.ami = ami<br>-        self.bridge_channels = []<br>-        self.final_bridge_participants = 0<br>-<br>-        self.ami.registerEvent('Bridge', self.bridge)<br>-        self.ami.registerEvent('VarSet', self.bridge_peer)<br>-<br>-    def bridge(self, _, event):<br>-        '''AMI Bridge event callback.<br>-<br>-        The Bridge callback in Asterisk 11- can fire at seemingly random<br>-        times, but it always has two channels indicated in it. This function<br>-        will log each unique 'channel2' channel that it sees, and assume that<br>-        a newly-discovered 'channel2' indicates that a new bridge has been<br>-        formed.<br>-        '''<br>-<br>-        if event['channel2'] in self.bridge_channels:<br>-            LOGGER.debug('channel {0} already seen in previous Bridge event. '<br>-                         'Ignoring'.format(event['channel2']))<br>-            return<br>-<br>-        LOGGER.debug('New bridge between {0} and {1} detected'.format(<br>-            event['channel1'], event['channel2']))<br>-        self.bridge_channels.append(event['channel2'])<br>-        numchans = len(self.bridge_channels)<br>-        if numchans == 1:<br>-            LOGGER.debug('Bridge between Alice and Bob established')<br>-            self.controller.call_carol()<br>-        elif numchans == 2:<br>-            LOGGER.debug('Bridge between Alice and Carol established')<br>-            self.controller.transfer_call()<br>-<br>-    def bridge_peer(self, _, event):<br>-        '''AMI VarSet event callback.<br>-<br>-        We are interested in BRIDGEPEER settings. When we get a BRIDGEPEER<br>-        that indicates that Bob and Carol have been bridged, then we consider<br>-        the transfer to have succeeded<br>-        '''<br>-<br>-        if event['variable'] != "BRIDGEPEER" or len(self.bridge_channels) < 2:<br>-            return<br>-<br>-        LOGGER.debug("After transfer, {0} is bridged to {1}".format(<br>-            event['channel'], event['value']))<br>-<br>-        # We should get an event indicating that the Bob channel's<br>-        # BRIDGEPEER variable is set to Carol's channel, and vice versa<br>-        if self.bridge_channels[:2] == [event['channel'], event['value']] or\<br>-            self.bridge_channels[:2] == [event['value'], event['channel']]:<br>-            self.final_bridge_participants += 1<br>-            if self.final_bridge_participants == 2:<br>-                LOGGER.debug("Bob and Carol bridged. Scenario complete.")<br>-                # success!<br>-                self.controller.hangup_calls()<br>-<br>-    def bridge1_bridged(self):<br>-        '''Indicates that Alice and Bob have been bridged'''<br>-        return len(self.bridge_channels) == 1<br>-<br>-    def bridge2_bridged(self):<br>-        '''Indicates that Alice and Carol have been bridged'''<br>-        return len(self.bridge_channels) == 2<br>-<br>-<br> class Transfer(object):<br>     '''Controller for attended transfer test<br> <br>@@ -230,10 +152,7 @@<br>         super(Transfer, self).__init__()<br>         self.ami = test_object.ami[0]<br> <br>-        if AsteriskVersion() < AsteriskVersion('12'):<br>-            self.bridge_state = BridgeStateEleven(test_object, self, self.ami)<br>-        else:<br>-            self.bridge_state = BridgeStateTwelve(test_object, self, self.ami)<br>+        self.bridge_state = BridgeStateTwelve(test_object, self, self.ami)<br> <br>         self.bob_call_answered = False<br>         self.carol_call_answered = False<br>diff --git a/tests/channels/SIP/sip_blind_transfer/callee_refer_only/run-test b/tests/channels/SIP/sip_blind_transfer/callee_refer_only/run-test<br>index cb76fe0..b5e56d2 100755<br>--- a/tests/channels/SIP/sip_blind_transfer/callee_refer_only/run-test<br>+++ b/tests/channels/SIP/sip_blind_transfer/callee_refer_only/run-test<br>@@ -20,7 +20,6 @@<br> sys.path.append("lib/python")<br> from asterisk.asterisk import Asterisk<br> from asterisk.test_case import TestCase<br>-from asterisk.version import AsteriskVersion<br> <br> logger = logging.getLogger(__name__)<br> <br>@@ -60,12 +59,8 @@<br>     def ami_connect(self, ami):<br>         TestCase.ami_connect(self, ami)<br> <br>-        if AsteriskVersion() >= AsteriskVersion("12"):<br>-            ami.registerEvent('BridgeEnter', self.bridge_enter_event_handler)<br>-            ami.registerEvent('BlindTransfer', self.blind_transfer_event_handler)<br>-        else:<br>-            ami.registerEvent('Bridge', self.bridge_event_handler)<br>-            ami.registerEvent('Transfer', self.transfer_event_handler)<br>+        ami.registerEvent('BridgeEnter', self.bridge_enter_event_handler)<br>+        ami.registerEvent('BlindTransfer', self.blind_transfer_event_handler)<br>         ami.registerEvent('Hangup', self.hangup_event_handler)<br> <br>         self.a_call_b()<br>@@ -90,41 +85,11 @@<br>         else:<br>             logger.warning("Unexpected bridge (%s and %s) received!" % (self.channel1, channel2))<br> <br>-    def bridge_event_handler(self, ami, event):<br>-        bridgetype = event['bridgetype'].lower()<br>-        bridgestate = event['bridgestate'].lower()<br>-        channel1 = event['channel1']<br>-        channel2 = event['channel2']<br>-        logger.debug("Received bridge type %s (%s) for channel %s and %s" % (bridgetype, bridgestate, channel1, channel2))<br>-        if (bridgetype == 'core' and bridgestate == 'link'):<br>-            if (channel1 == BlindTransfer.phone_a_channel and channel2 == BlindTransfer.phone_b_channel):<br>-                logger.debug("Starting transfer of Phone B to Phone C")<br>-                self.b_transfer_a_to_c()<br>-            elif (channel1 == BlindTransfer.phone_a_channel and channel2 == BlindTransfer.phone_c_channel):<br>-                self.ami_check_bridge()<br>-            else:<br>-                logger.warning("Unexpected bridge (%s and %s) received!" % (channel1, channel2))<br>-        elif bridgetype != 'core' or bridgestate != 'unlink':<br>-            logger.warning("Unexpected bridgetype %s or bridgestate %s received!" % (bridgetype, bridgestate))<br>-<br>     def blind_transfer_event_handler(self, ami, event):<br>         if event['isexternal'].lower() != 'yes':<br>             logger.warn("Unexpected transfer type: Internal")<br>         else:<br>             logger.debug("Received blind external transfer initiated by %(transfererchannel)s to %(extension)s@%(context)s" % event)<br>-            self.transfer_event_received = True<br>-<br>-    def transfer_event_handler(self, ami, event):<br>-        transfertype = event['transfertype'].lower()<br>-        transfermethod = event['transfermethod'].lower()<br>-        channel = event['channel']<br>-        targetchannel = event['targetchannel']<br>-        logger.debug("Received %s %s transfer initiated by %s on %s" % (transfermethod, transfertype, channel, targetchannel))<br>-        if transfertype != 'blind':<br>-            logger.warn("Unexpected transfer type: %s" % transfertype)<br>-        elif transfermethod != 'sip':<br>-            logger.warn("Unexpected transfer method: %s" % transfermethod)<br>-        else:<br>             self.transfer_event_received = True<br> <br>     def hangup_event_handler(self, ami, event):<br>@@ -140,32 +105,8 @@<br>             self.read_result()<br>             return<br> <br>-        if AsteriskVersion() >= AsteriskVersion('12'):<br>-            # the following has already been verified using bridgeenter messages so exit early<br>-            self.passed = True<br>-            self.hangup_channel_c()<br>-            return<br>-<br>-        logger.debug('Results %s' % str(results))<br>-        """<br>-        Multiple results may be returned.  For example, at times, you may get a message<br>-        back that states "channel state will follow".  Iterate through each and only fail<br>-        if we don't get a match<br>-        """<br>-        i = 0<br>-        for result in results:<br>-            if "bridgedchannel" not in result:<br>-                logger.debug("'bridgedchannel' not found in result %d" % i)<br>-            elif result['bridgedchannel'] == BlindTransfer.phone_c_channel:<br>-                self.passed = True<br>-            i += 1<br>-<br>-        if self.passed == True:<br>-            logger.debug("Found Bridge!!!")<br>-            self.hangup_channel_c()<br>-        else:<br>-            logger.warn("Detecting Bridge failed")<br>-            self.read_result()<br>+        self.passed = True<br>+        self.hangup_channel_c()<br> <br>     def check_bridge_error(self, reason):<br>         logger.error(reason.getTraceback())<br>diff --git a/tests/channels/SIP/sip_blind_transfer/callee_with_reinvite/run-test b/tests/channels/SIP/sip_blind_transfer/callee_with_reinvite/run-test<br>index e6f6ae1..daf7474 100755<br>--- a/tests/channels/SIP/sip_blind_transfer/callee_with_reinvite/run-test<br>+++ b/tests/channels/SIP/sip_blind_transfer/callee_with_reinvite/run-test<br>@@ -20,7 +20,6 @@<br> sys.path.append("lib/python")<br> from asterisk.asterisk import Asterisk<br> from asterisk.test_case import TestCase<br>-from asterisk.version import AsteriskVersion<br> <br> logger = logging.getLogger(__name__)<br> <br>@@ -60,12 +59,8 @@<br>     def ami_connect(self, ami):<br>         TestCase.ami_connect(self, ami)<br> <br>-        if AsteriskVersion() >= AsteriskVersion("12"):<br>-            ami.registerEvent('BridgeEnter', self.bridge_enter_event_handler)<br>-            ami.registerEvent('BlindTransfer', self.blind_transfer_event_handler)<br>-        else:<br>-            ami.registerEvent('Bridge', self.bridge_event_handler)<br>-            ami.registerEvent('Transfer', self.transfer_event_handler)<br>+        ami.registerEvent('BridgeEnter', self.bridge_enter_event_handler)<br>+        ami.registerEvent('BlindTransfer', self.blind_transfer_event_handler)<br>         ami.registerEvent('Hangup', self.hangup_event_handler)<br> <br>         self.a_call_b()<br>@@ -90,41 +85,11 @@<br>         else:<br>             logger.warning("Unexpected bridge (%s and %s) received!" % (self.channel1, channel2))<br> <br>-    def bridge_event_handler(self, ami, event):<br>-        bridgetype = event['bridgetype'].lower()<br>-        bridgestate = event['bridgestate'].lower()<br>-        channel1 = event['channel1']<br>-        channel2 = event['channel2']<br>-        logger.debug("Received bridge type %s (%s) for channel %s and %s" % (bridgetype, bridgestate, channel1, channel2))<br>-        if (bridgetype == 'core' and bridgestate == 'link'):<br>-            if (channel1 == BlindTransfer.phone_a_channel and channel2 == BlindTransfer.phone_b_channel):<br>-                logger.debug("Starting transfer of Phone B to Phone C")<br>-                self.b_transfer_a_to_c()<br>-            elif (channel1 == BlindTransfer.phone_a_channel and channel2 == BlindTransfer.phone_c_channel):<br>-                self.ami_check_bridge()<br>-            else:<br>-                logger.warning("Unexpected bridge (%s and %s) received!" % (channel1, channel2))<br>-        elif bridgetype != 'core' or bridgestate != 'unlink':<br>-            logger.warning("Unexpected bridgetype %s or bridgestate %s received!" % (bridgetype, bridgestate))<br>-<br>     def blind_transfer_event_handler(self, ami, event):<br>         if event['isexternal'].lower() != 'yes':<br>             logger.warn("Unexpected transfer type: Internal")<br>         else:<br>             logger.debug("Received blind external transfer initiated by %(transfererchannel)s to %(extension)s@%(context)s" % event)<br>-            self.transfer_event_received = True<br>-<br>-    def transfer_event_handler(self, ami, event):<br>-        transfertype = event['transfertype'].lower()<br>-        transfermethod = event['transfermethod'].lower()<br>-        channel = event['channel']<br>-        targetchannel = event['targetchannel']<br>-        logger.debug("Received %s %s transfer initiated by %s on %s" % (transfermethod, transfertype, channel, targetchannel))<br>-        if transfertype != 'blind':<br>-            logger.warn("Unexpected transfer type: %s" % transfertype)<br>-        elif transfermethod != 'sip':<br>-            logger.warn("Unexpected transfer method: %s" % transfermethod)<br>-        else:<br>             self.transfer_event_received = True<br> <br>     def hangup_event_handler(self, ami, event):<br>@@ -140,32 +105,8 @@<br>             self.read_result()<br>             return<br> <br>-        if AsteriskVersion() >= AsteriskVersion('12'):<br>-            # the following has already been verified using bridgeenter messages so exit early<br>-            self.passed = True<br>-            self.hangup_channel_c()<br>-            return<br>-<br>-        logger.debug('Results %s' % str(results))<br>-        """<br>-        Multiple results may be returned.  For example, at times, you may get a message<br>-        back that states "channel state will follow".  Iterate through each and only fail<br>-        if we don't get a match<br>-        """<br>-        i = 0<br>-        for result in results:<br>-            if "bridgedchannel" not in result:<br>-                logger.debug("'bridgedchannel' not found in result %d" % i)<br>-            elif result['bridgedchannel'] == BlindTransfer.phone_c_channel:<br>-                self.passed = True<br>-            i += 1<br>-<br>-        if self.passed == True:<br>-            logger.debug("Found Bridge!!!")<br>-            self.hangup_channel_c()<br>-        else:<br>-            logger.warn("Detecting Bridge failed")<br>-            self.read_result()<br>+        self.passed = True<br>+        self.hangup_channel_c()<br> <br>     def check_bridge_error(self, reason):<br>         logger.error(reason.getTraceback())<br>diff --git a/tests/channels/SIP/sip_blind_transfer/caller_refer_only/run-test b/tests/channels/SIP/sip_blind_transfer/caller_refer_only/run-test<br>index 2287adc..19dbfd7 100755<br>--- a/tests/channels/SIP/sip_blind_transfer/caller_refer_only/run-test<br>+++ b/tests/channels/SIP/sip_blind_transfer/caller_refer_only/run-test<br>@@ -20,7 +20,6 @@<br> sys.path.append("lib/python")<br> from asterisk.asterisk import Asterisk<br> from asterisk.test_case import TestCase<br>-from asterisk.version import AsteriskVersion<br> <br> logger = logging.getLogger(__name__)<br> <br>@@ -60,12 +59,8 @@<br>     def ami_connect(self, ami):<br>         TestCase.ami_connect(self, ami)<br> <br>-        if AsteriskVersion() >= AsteriskVersion("12"):<br>-            ami.registerEvent('BridgeEnter', self.bridge_enter_event_handler)<br>-            ami.registerEvent('BlindTransfer', self.blind_transfer_event_handler)<br>-        else:<br>-            ami.registerEvent('Bridge', self.bridge_event_handler)<br>-            ami.registerEvent('Transfer', self.transfer_event_handler)<br>+        ami.registerEvent('BridgeEnter', self.bridge_enter_event_handler)<br>+        ami.registerEvent('BlindTransfer', self.blind_transfer_event_handler)<br>         ami.registerEvent('Hangup', self.hangup_event_handler)<br> <br>         self.a_call_b()<br>@@ -90,41 +85,11 @@<br>         else:<br>             logger.warning("Unexpected bridge (%s and %s) received!" % (self.channel1, channel2))<br> <br>-    def bridge_event_handler(self, ami, event):<br>-        bridgetype = event['bridgetype'].lower()<br>-        bridgestate = event['bridgestate'].lower()<br>-        channel1 = event['channel1']<br>-        channel2 = event['channel2']<br>-        logger.debug("Received bridge type %s (%s) for channel %s and %s" % (bridgetype, bridgestate, channel1, channel2))<br>-        if (bridgetype == 'core' and bridgestate == 'link'):<br>-            if (channel1 == BlindTransfer.phone_a_channel and channel2 == BlindTransfer.phone_b_channel):<br>-                logger.debug("Starting transfer of Phone B to Phone C")<br>-                self.a_transfer_b_to_c()<br>-            elif (channel1 == BlindTransfer.phone_b_channel and channel2 == BlindTransfer.phone_c_channel):<br>-                self.ami_check_bridge()<br>-            else:<br>-                logger.warning("Unexpected bridge (%s and %s) received!" % (channel1, channel2))<br>-        elif bridgetype != 'core' or bridgestate != 'unlink':<br>-            logger.warning("Unexpected bridgetype %s or bridgestate %s received!" % (bridgetype, bridgestate))<br>-<br>     def blind_transfer_event_handler(self, ami, event):<br>         if event['isexternal'].lower() != 'yes':<br>             logger.warn("Unexpected transfer type: Internal")<br>         else:<br>             logger.debug("Received blind external transfer initiated by %(transfererchannel)s to %(extension)s@%(context)s" % event)<br>-            self.transfer_event_received = True<br>-<br>-    def transfer_event_handler(self, ami, event):<br>-        transfertype = event['transfertype'].lower()<br>-        transfermethod = event['transfermethod'].lower()<br>-        channel = event['channel']<br>-        targetchannel = event['targetchannel']<br>-        logger.debug("Received %s %s transfer initiated by %s on %s" % (transfermethod, transfertype, channel, targetchannel))<br>-        if transfertype != 'blind':<br>-            logger.warn("Unexpected transfer type: %s" % transfertype)<br>-        elif transfermethod != 'sip':<br>-            logger.warn("Unexpected transfer method: %s" % transfermethod)<br>-        else:<br>             self.transfer_event_received = True<br> <br>     def hangup_event_handler(self, ami, event):<br>@@ -140,32 +105,9 @@<br>             self.read_result()<br>             return<br> <br>-        if AsteriskVersion() >= AsteriskVersion('12'):<br>-            # the following has already been verified using bridgeenter messages so exit early<br>-            self.passed = True<br>-            self.hangup_channel_c()<br>-            return<br>-<br>-        logger.debug('Results %s' % str(results))<br>-        """<br>-        Multiple results may be returned.  For example, at times, you may get a message<br>-        back that states "channel state will follow".  Iterate through each and only fail<br>-        if we don't get a match<br>-        """<br>-        i = 0<br>-        for result in results:<br>-            if "bridgedchannel" not in result:<br>-                logger.debug("'bridgedchannel' not found in result %d" % i)<br>-            elif result['bridgedchannel'] == BlindTransfer.phone_c_channel:<br>-                self.passed = True<br>-            i += 1<br>-<br>-        if self.passed == True:<br>-            logger.debug("Found Bridge!!!")<br>-            self.hangup_channel_c()<br>-        else:<br>-            logger.warn("Detecting Bridge failed")<br>-            self.read_result()<br>+        self.passed = True<br>+        self.hangup_channel_c()<br>+        return<br> <br>     def check_bridge_error(self, reason):<br>         logger.error(reason.getTraceback())<br>diff --git a/tests/channels/SIP/sip_blind_transfer/caller_with_reinvite/run-test b/tests/channels/SIP/sip_blind_transfer/caller_with_reinvite/run-test<br>index 9d03a94..880ab88 100755<br>--- a/tests/channels/SIP/sip_blind_transfer/caller_with_reinvite/run-test<br>+++ b/tests/channels/SIP/sip_blind_transfer/caller_with_reinvite/run-test<br>@@ -20,7 +20,6 @@<br> sys.path.append("lib/python")<br> from asterisk.asterisk import Asterisk<br> from asterisk.test_case import TestCase<br>-from asterisk.version import AsteriskVersion<br> <br> logger = logging.getLogger(__name__)<br> <br>@@ -60,12 +59,8 @@<br>     def ami_connect(self, ami):<br>         TestCase.ami_connect(self, ami)<br> <br>-        if AsteriskVersion() >= AsteriskVersion("12"):<br>-            ami.registerEvent('BridgeEnter', self.bridge_enter_event_handler)<br>-            ami.registerEvent('BlindTransfer', self.blind_transfer_event_handler)<br>-        else:<br>-            ami.registerEvent('Bridge', self.bridge_event_handler)<br>-            ami.registerEvent('Transfer', self.transfer_event_handler)<br>+        ami.registerEvent('BridgeEnter', self.bridge_enter_event_handler)<br>+        ami.registerEvent('BlindTransfer', self.blind_transfer_event_handler)<br>         ami.registerEvent('Hangup', self.hangup_event_handler)<br> <br>         self.a_call_b()<br>@@ -90,41 +85,11 @@<br>         else:<br>             logger.warning("Unexpected bridge (%s and %s) received!" % (self.channel1, channel2))<br> <br>-    def bridge_event_handler(self, ami, event):<br>-        bridgetype = event['bridgetype'].lower()<br>-        bridgestate = event['bridgestate'].lower()<br>-        channel1 = event['channel1']<br>-        channel2 = event['channel2']<br>-        logger.debug("Received bridge type %s (%s) for channel %s and %s" % (bridgetype, bridgestate, channel1, channel2))<br>-        if (bridgetype == 'core' and bridgestate == 'link'):<br>-            if (channel1 == BlindTransfer.phone_a_channel and channel2 == BlindTransfer.phone_b_channel):<br>-                logger.debug("Starting transfer of Phone B to Phone C")<br>-                self.a_transfer_b_to_c()<br>-            elif (channel1 == BlindTransfer.phone_b_channel and channel2 == BlindTransfer.phone_c_channel):<br>-                self.ami_check_bridge()<br>-            else:<br>-                logger.warning("Unexpected bridge (%s and %s) received!" % (channel1, channel2))<br>-        elif bridgetype != 'core' or bridgestate != 'unlink':<br>-            logger.warning("Unexpected bridgetype %s or bridgestate %s received!" % (bridgetype, bridgestate))<br>-<br>     def blind_transfer_event_handler(self, ami, event):<br>         if event['isexternal'].lower() != 'yes':<br>             logger.warn("Unexpected transfer type: Internal")<br>         else:<br>             logger.debug("Received blind external transfer initiated by %(transfererchannel)s to %(extension)s@%(context)s" % event)<br>-            self.transfer_event_received = True<br>-<br>-    def transfer_event_handler(self, ami, event):<br>-        transfertype = event['transfertype'].lower()<br>-        transfermethod = event['transfermethod'].lower()<br>-        channel = event['channel']<br>-        targetchannel = event['targetchannel']<br>-        logger.debug("Received %s %s transfer initiated by %s on %s" % (transfermethod, transfertype, channel, targetchannel))<br>-        if transfertype != 'blind':<br>-            logger.warn("Unexpected transfer type: %s" % transfertype)<br>-        elif transfermethod != 'sip':<br>-            logger.warn("Unexpected transfer method: %s" % transfermethod)<br>-        else:<br>             self.transfer_event_received = True<br> <br>     def hangup_event_handler(self, ami, event):<br>@@ -140,32 +105,10 @@<br>             self.read_result()<br>             return<br> <br>-        if AsteriskVersion() >= AsteriskVersion('12'):<br>-            # the following has already been verified using bridgeenter messages so exit early<br>-            self.passed = True<br>-            self.hangup_channel_c()<br>-            return<br>-<br>-        logger.debug('Results %s' % str(results))<br>-        """<br>-        Multiple results may be returned.  For example, at times, you may get a message<br>-        back that states "channel state will follow".  Iterate through each and only fail<br>-        if we don't get a match<br>-        """<br>-        i = 0<br>-        for result in results:<br>-            if "bridgedchannel" not in result:<br>-                logger.debug("'bridgedchannel' not found in result %d" % i)<br>-            elif result['bridgedchannel'] == BlindTransfer.phone_c_channel:<br>-                self.passed = True<br>-            i += 1<br>-<br>-        if self.passed == True:<br>-            logger.debug("Found Bridge!!!")<br>-            self.hangup_channel_c()<br>-        else:<br>-            logger.warn("Detecting Bridge failed")<br>-            self.read_result()<br>+        # the following has already been verified using bridgeenter messages so exit early<br>+        self.passed = True<br>+        self.hangup_channel_c()<br>+        return<br> <br>     def check_bridge_error(self, reason):<br>         logger.error(reason.getTraceback())<br>diff --git a/tests/channels/SIP/sip_hold/run-test b/tests/channels/SIP/sip_hold/run-test<br>index 818375a..d164f88 100755<br>--- a/tests/channels/SIP/sip_hold/run-test<br>+++ b/tests/channels/SIP/sip_hold/run-test<br>@@ -17,7 +17,6 @@<br> from asterisk.test_case import TestCase<br> from asterisk.sipp import SIPpScenario<br> from twisted.internet import reactor<br>-from asterisk.version import AsteriskVersion<br> <br> logger = logging.getLogger(__name__)<br> INJECT_FILE_BYPASS = "inject_bypass.csv"<br>@@ -27,14 +26,6 @@<br>     def __init__(self):<br>         TestCase.__init__(self)<br>         self.create_asterisk()<br>-<br>-        running_version = AsteriskVersion()<br>-<br>-        if (running_version < AsteriskVersion("12.0.0")):<br>-            #Pre-12<br>-            self.asterisk12Events = False<br>-        else:<br>-            self.asterisk12Events = True<br> <br>         self.sipp_phone_a_scenarios = [{'scenario':'phone_A.xml','-i':'127.0.0.2','-p':'5060','-inf':INJECT_FILE_BYPASS},<br>             {'scenario':'phone_A.xml','-i':'127.0.0.2','-p':'5060','-inf':INJECT_FILE_BYPASS},<br>@@ -63,11 +54,8 @@<br>         TestCase.ami_connect(self, ami)<br>         ami.registerEvent('UserEvent', self.user_event_handler)<br> <br>-        if self.asterisk12Events:<br>-            ami.registerEvent('MusicOnHoldStart', self.moh_start_event_handler)<br>-            ami.registerEvent('MusicOnHoldStop', self.moh_stop_event_handler)<br>-        else:<br>-            ami.registerEvent('MusicOnHold', self.moh_event_handler)<br>+        ami.registerEvent('MusicOnHoldStart', self.moh_start_event_handler)<br>+        ami.registerEvent('MusicOnHoldStop', self.moh_stop_event_handler)<br> <br>         logger.info("Starting SIP scenario")<br>         self.execute_scenarios()<br>@@ -119,14 +107,6 @@<br>     def moh_stop_event_handler(self, ami, event):<br>         logger.debug("Received MOH stop event")<br>         self.moh_stop_events += 1<br>-<br>-    def moh_event_handler(self, ami, event):<br>-        if event['state'] == "Start":<br>-            logger.debug("Received MOH start event")<br>-            self.moh_start_events += 1<br>-        elif event['state'] == "Stop":<br>-            logger.debug("Received MOH stop event")<br>-            self.moh_stop_events += 1<br> <br>     def run(self):<br>         TestCase.run(self)<br>diff --git a/tests/channels/SIP/sip_hold_direct_media/run-test b/tests/channels/SIP/sip_hold_direct_media/run-test<br>index c9bc535..6eb47d5 100755<br>--- a/tests/channels/SIP/sip_hold_direct_media/run-test<br>+++ b/tests/channels/SIP/sip_hold_direct_media/run-test<br>@@ -17,7 +17,6 @@<br> from asterisk.test_case import TestCase<br> from asterisk.sipp import SIPpScenario<br> from twisted.internet import reactor<br>-from asterisk.version import AsteriskVersion<br> <br> LOGGER = logging.getLogger(__name__)<br> INJECT_FILE_BRIDGE = "inject_bridge.csv"<br>@@ -26,14 +25,6 @@<br>     def __init__(self):<br>         TestCase.__init__(self)<br>         self.create_asterisk()<br>-<br>-        running_version = AsteriskVersion()<br>-<br>-        if (running_version < AsteriskVersion("12.0.0")):<br>-            #Pre-12<br>-            self.asterisk12Events = False<br>-        else:<br>-            self.asterisk12Events = True<br> <br>         self.sipp_phone_a_scenarios = [<br>             {'scenario':'phone_A.xml','-i':'127.0.0.2','-p':'5060','-inf':INJECT_FILE_BRIDGE},<br>@@ -56,11 +47,8 @@<br>         TestCase.ami_connect(self, ami)<br>         ami.registerEvent('UserEvent', self.user_event_handler)<br> <br>-        if self.asterisk12Events:<br>-            ami.registerEvent('MusicOnHoldStart', self.moh_start_event_handler)<br>-            ami.registerEvent('MusicOnHoldStop', self.moh_stop_event_handler)<br>-        else:<br>-            ami.registerEvent('MusicOnHold', self.moh_event_handler)<br>+        ami.registerEvent('MusicOnHoldStart', self.moh_start_event_handler)<br>+        ami.registerEvent('MusicOnHoldStop', self.moh_stop_event_handler)<br> <br>         LOGGER.info("Starting SIP scenario")<br>         self.execute_scenarios()<br>@@ -112,14 +100,6 @@<br>     def moh_stop_event_handler(self, ami, event):<br>         LOGGER.debug("Received MOH stop event")<br>         self.moh_stop_events += 1<br>-<br>-    def moh_event_handler(self, ami, event):<br>-        if event['state'] == "Start":<br>-            LOGGER.debug("Received MOH start event")<br>-            self.moh_start_events += 1<br>-        elif event['state'] == "Stop":<br>-            LOGGER.debug("Received MOH stop event")<br>-            self.moh_stop_events += 1<br> <br>     def run(self):<br>         TestCase.run(self)<br>diff --git a/tests/channels/SIP/sip_hold_ice/run-test b/tests/channels/SIP/sip_hold_ice/run-test<br>index bae0af8..4cdf174 100755<br>--- a/tests/channels/SIP/sip_hold_ice/run-test<br>+++ b/tests/channels/SIP/sip_hold_ice/run-test<br>@@ -15,7 +15,6 @@<br> from asterisk.test_case import TestCase<br> from asterisk.sipp import SIPpScenario<br> from twisted.internet import reactor<br>-from asterisk.version import AsteriskVersion<br> <br> LOGGER = logging.getLogger(__name__)<br> INJECT_FILE_BRIDGE = "inject_bridge.csv"<br>@@ -28,14 +27,6 @@<br>         """ Constructor """<br>         TestCase.__init__(self)<br>         self.create_asterisk()<br>-<br>-        running_version = AsteriskVersion()<br>-<br>-        if (running_version < AsteriskVersion("12.0.0")):<br>-            #Pre-12<br>-            self.asterisk12Events = False<br>-        else:<br>-            self.asterisk12Events = True<br> <br>         self.sipp_phone_a_scenario = {'scenario': 'phone_A.xml',<br>                                       '-i': '127.0.0.2',<br>@@ -59,11 +50,8 @@<br> <br>         ami.registerEvent('TestEvent', self.test_event_handler)<br> <br>-        if self.asterisk12Events:<br>-            ami.registerEvent('MusicOnHoldStart', self.moh_start_event_handler)<br>-            ami.registerEvent('MusicOnHoldStop', self.moh_stop_event_handler)<br>-        else:<br>-            ami.registerEvent('MusicOnHold', self.moh_event_handler)<br>+        ami.registerEvent('MusicOnHoldStart', self.moh_start_event_handler)<br>+        ami.registerEvent('MusicOnHoldStop', self.moh_stop_event_handler)<br> <br>         LOGGER.info("Starting SIP scenario")<br>         self.execute_scenario()<br>@@ -125,22 +113,6 @@<br>         if self.check_list_success_events == 2:<br>             self.evaluate_success()<br>             self.stop_reactor()<br>-<br>-    def moh_event_handler(self, ami, event):<br>-        """ Reacts to MusicOnHold events (legacy events from Asterisk <= 11)<br>-<br>-        :param ami: AMI connection the event was received from<br>-        :param event: Event that was received<br>-        """<br>-        if event.get('state') == "Start":<br>-            LOGGER.debug("Received MOH start event")<br>-            self.moh_start_event = True<br>-        elif event.get('state') == "Stop":<br>-            LOGGER.debug("Received MOH stop event")<br>-            self.moh_stop_event = True<br>-            if self.check_list_success_events == 2:<br>-                self.evaluate_success()<br>-                self.stop_reactor()<br> <br>     def run(self):<br>         """ Run the test and create an AMI connection """<br>diff --git a/tests/channels/SIP/sip_one_legged_transfer/run-test b/tests/channels/SIP/sip_one_legged_transfer/run-test<br>index 3a62192..fd3597c 100755<br>--- a/tests/channels/SIP/sip_one_legged_transfer/run-test<br>+++ b/tests/channels/SIP/sip_one_legged_transfer/run-test<br>@@ -16,7 +16,6 @@<br> <br> sys.path.append("lib/python")<br> from asterisk.test_case import TestCase<br>-from asterisk.version import AsteriskVersion<br> <br> LOGGER = logging.getLogger(__name__)<br> <br>@@ -45,10 +44,9 @@<br>     def ami_connect(self, ami):<br>         TestCase.ami_connect(self, ami)<br> <br>-        # register for BridgeEnter and BridgeLeave events for later versions<br>-        if AsteriskVersion() >= AsteriskVersion('12'):<br>-            ami.registerEvent('BridgeEnter', self.handle_bridge_enter)<br>-            ami.registerEvent('BridgeLeave', self.handle_bridge_leave)<br>+        # register for BridgeEnter and BridgeLeave events<br>+        ami.registerEvent('BridgeEnter', self.handle_bridge_enter)<br>+        ami.registerEvent('BridgeLeave', self.handle_bridge_leave)<br> <br>         # start up the processes<br>         self.startProcesses()<br>@@ -76,43 +74,17 @@<br>         channel = event['channel']<br>         self.bridges[bridge].remove(channel)<br> <br>-    def checkBridgeResult(self, results):<br>-        LOGGER.debug('Result %s' % str(results))<br>-        for result in results:<br>-            if "bridgedchannel" not in result:<br>-                LOGGER.debug("bridgedchannel was not a valid key; checking for link")<br>-                if "link" not in result:<br>-                    LOGGER.warn("'link' and 'bridgedchannel' not found")<br>-                elif result['link'] == OneLeggedTransfer.a_channel: # check link for older versions of asterisk<br>-                    self.passed = True<br>-            elif result['bridgedchannel'] == OneLeggedTransfer.a_channel:<br>+    def amiCheckBridge(self):<br>+        '''Check whether A and C are bridged.'''<br>+        LOGGER.debug("Get AMI results")<br>+        for channels in self.bridges.values():<br>+            if OneLeggedTransfer.a_channel in channels and OneLeggedTransfer.c_channel in channels:<br>                 self.passed = True<br> <br>         if self.passed == True:<br>             LOGGER.debug("Found Bridge!!!")<br>         else:<br>             LOGGER.warn("Detecting Bridge failed")<br>-<br>-<br>-    def checkBridgeError(self, reason):<br>-        LOGGER.error(reason.getTraceback())<br>-        LOGGER.error("Checking Bridge failed.  Channel did not exist.")<br>-        reactor.callLater(1, self.readResult)<br>-<br>-    def amiCheckBridge(self):<br>-        '''Check whether A and C are bridged.'''<br>-        LOGGER.debug("Get AMI results")<br>-        if AsteriskVersion() >= AsteriskVersion('12'):<br>-            for channels in self.bridges.values():<br>-                if OneLeggedTransfer.a_channel in channels and OneLeggedTransfer.c_channel in channels:<br>-                    self.passed = True<br>-<br>-            if self.passed == True:<br>-                LOGGER.debug("Found Bridge!!!")<br>-            else:<br>-                LOGGER.warn("Detecting Bridge failed")<br>-        else:<br>-            self.ami[0].status(OneLeggedTransfer.c_channel).addCallbacks(self.checkBridgeResult, self.checkBridgeError)<br>         self.reset_timeout()<br> <br>     def cCallB(self):<br>diff --git a/tests/channels/SIP/sip_tls_call/run-test b/tests/channels/SIP/sip_tls_call/run-test<br>index 4ae522c..92173a3 100755<br>--- a/tests/channels/SIP/sip_tls_call/run-test<br>+++ b/tests/channels/SIP/sip_tls_call/run-test<br>@@ -18,7 +18,6 @@<br> <br> sys.path.append("lib/python")<br> from asterisk.asterisk import Asterisk<br>-from asterisk.version import AsteriskVersion<br> from asterisk.test_case import TestCase<br> from asterisk.cdr import AsteriskCSVCDR, AsteriskCSVCDRLine<br> from starpy import manager<br>@@ -70,10 +69,7 @@<br>         self.tone2 = False<br> <br>     def ami_connect(self, ami):<br>-        if (AsteriskVersion() >= AsteriskVersion('12')):<br>-            ami.registerEvent('DTMFEnd', self.ami_test)<br>-        else:<br>-            ami.registerEvent('DTMF', self.ami_test)<br>+        ami.registerEvent('DTMFEnd', self.ami_test)<br> <br>         # We only want to originate the call on the ast[0]'s manager.<br>         if ami.id == 0:<br>diff --git a/tests/channels/pjsip/sdp_offer_answer/attribute_passthrough/speex_h263_h264/run-test b/tests/channels/pjsip/sdp_offer_answer/attribute_passthrough/speex_h263_h264/run-test<br>index 451f355..677e9a0 100755<br>--- a/tests/channels/pjsip/sdp_offer_answer/attribute_passthrough/speex_h263_h264/run-test<br>+++ b/tests/channels/pjsip/sdp_offer_answer/attribute_passthrough/speex_h263_h264/run-test<br>@@ -15,7 +15,6 @@<br> sys.path.append("lib/python")<br> <br> from asterisk.asterisk import Asterisk<br>-from asterisk.version import AsteriskVersion<br> from asterisk.test_case import TestCase<br> from asterisk.sipp import SIPpScenario<br> from twisted.internet import reactor<br>diff --git a/tests/fax/pjsip/t38_fast_reject/run-test b/tests/fax/pjsip/t38_fast_reject/run-test<br>index a93ef43..9d86e01 100755<br>--- a/tests/fax/pjsip/t38_fast_reject/run-test<br>+++ b/tests/fax/pjsip/t38_fast_reject/run-test<br>@@ -60,8 +60,6 @@<br> <br> def main():<br>     test = SIPpTest(WORKING_DIR, TEST_DIR, SIPP_SCENARIOS)<br>-    logger.info ("Running against asterisk version %s" %test.ast_version)<br>-                  <br>     test.reactor_timeout = 100;<br> <br>     dump_A = WORKING_DIR + "/carrier_rtp.log"<br>diff --git a/tests/feature_call_pickup/run-test b/tests/feature_call_pickup/run-test<br>index ba53fe0..82a46ba 100755<br>--- a/tests/feature_call_pickup/run-test<br>+++ b/tests/feature_call_pickup/run-test<br>@@ -16,7 +16,6 @@<br> <br> sys.path.append("lib/python")<br> from asterisk.asterisk import Asterisk<br>-from asterisk.version import AsteriskVersion<br> from asterisk.test_case import TestCase<br> <br> LOGGER = logging.getLogger(__name__)<br>@@ -31,7 +30,6 @@<br>         self.targetChannel = "SIP/faker-"<br> <br>         self.bridge = None<br>-        self.bridgingModel12 = False<br> <br>         self.bridgeComplete = False<br>         self.pickupComplete = False<br>@@ -76,23 +74,6 @@<br>             else:<br>                 self.bridgeComplete = True<br> <br>-    def check_bridge(self, ami, event):<br>-        if event.get("bridgestate") != "Link":<br>-            return<br>-<br>-        channel1 = event.get("channel1")<br>-        channel2 = event.get("channel2")<br>-<br>-        pattern1 = re.compile(self.pickeeChannel)<br>-        pattern2 = re.compile(self.pickerChannel)<br>-<br>-        if pattern1.match(channel1) and pattern2.match(channel2):<br>-            if self.pickupComplete:<br>-                self.set_passed(True)<br>-                self.ami[0].hangup(channel2).addCallback(self.hangup)<br>-            else:<br>-                self.bridgeComplete = True<br>-<br>     def check_pickup(self, ami, event):<br>         picker = event.get("channel")<br>         target = event.get("targetchannel")<br>@@ -114,10 +95,7 @@<br> <br>         self.ami[0].registerEvent('Pickup', self.check_pickup)<br> <br>-        if self.bridgingModel12:<br>-            self.ami[0].registerEvent('BridgeEnter', self.check_bridge_enter)<br>-        else:<br>-            self.ami[0].registerEvent('Bridge', self.check_bridge)<br>+        self.ami[0].registerEvent('BridgeEnter', self.check_bridge_enter)<br> <br>         LOGGER.info("Originating Pickup attempt")<br> <br>@@ -134,14 +112,7 @@<br>         if self.connectionsEstablished != 2:<br>             return<br> <br>-        running_version = AsteriskVersion()<br>-        post_version = AsteriskVersion("12.0.0")<br>-        if running_version < post_version:<br>-            #Pre-Asterisk 12<br>-            self.ami[0].registerEvent("Dial", self.check_dial)<br>-        else:<br>-            self.bridgingModel12 = True<br>-            self.ami[0].registerEvent("DialBegin", self.check_dial)<br>+        self.ami[0].registerEvent("DialBegin", self.check_dial)<br> <br>         LOGGER.info("Originating channel to be picked up")<br>         self.ami[0].originate(<br>diff --git a/tests/http_server/servername/run-test b/tests/http_server/servername/run-test<br>index 759eee5..ef08392 100755<br>--- a/tests/http_server/servername/run-test<br>+++ b/tests/http_server/servername/run-test<br>@@ -11,17 +11,17 @@<br> import logging<br> import requests<br> import sys<br>+import re<br> <br> sys.path.append("lib/python")<br> <br> from twisted.internet import reactor<br> from asterisk.asterisk import Asterisk<br>-from asterisk.version import AsteriskVersion<br> from asterisk.test_case import TestCase<br> <br> LOGGER = logging.getLogger(__name__)<br> <br>-EXPECTED_NAMES = ["Peabody", "Asterisk/<version>", None]<br>+EXPECTED_NAMES = ["^Peabody$", "^Asterisk/", None]<br> <br> BASE_URL = "http://127.0.0.%d:8088/httpstatus"<br> <br>@@ -43,9 +43,6 @@<br> <br>         for i in range(0, 3):<br>             name = EXPECTED_NAMES[i]<br>-            if name is not None:<br>-                name = name.replace("<version>",<br>-                                str(AsteriskVersion()).rstrip('\n'))<br> <br>             url = BASE_URL % (i+1)<br> <br>@@ -76,7 +73,7 @@<br>         server = resp.headers.get('Server')<br>         LOGGER.debug("[server]: [%s]", server)<br> <br>-        if server != expected_name:<br>+        if (not expected_name and server) or (expected_name is not None and re.match(expected_name, server) is None):<br>             LOGGER.debug("[%s] != [%s]", server, expected_name)<br>             self.set_passed(False)<br>             return<br>diff --git a/tests/masquerade/run-test b/tests/masquerade/run-test<br>index 74c0f79..096202d 100755<br>--- a/tests/masquerade/run-test<br>+++ b/tests/masquerade/run-test<br>@@ -13,7 +13,6 @@<br> <br> sys.path.append("lib/python")<br> from asterisk.test_case import TestCase<br>-from asterisk.version import AsteriskVersion<br> <br> LOGGER = logging.getLogger(__name__)<br> <br>@@ -25,9 +24,7 @@<br>         self.ami_count = 0<br>         self.test_complete = False<br> <br>-        self.parking_space_hdr = "exten"<br>-        if AsteriskVersion() >= AsteriskVersion('12'):<br>-            self.parking_space_hdr = "parkingspace"<br>+        self.parking_space_hdr = "parkingspace"<br> <br>         # Set longer timeout than default.<br>         #<br>@@ -90,13 +87,6 @@<br>             "Initiating test call for a chain length of "<br>             + str(self.chain_length))<br>         exten = self.base_exten + self.chain_length<br>-        if AsteriskVersion() < AsteriskVersion('12'):<br>-            self.ami[0].originate(<br>-                channel="Local/" + str(exten) + "@outgoing",<br>-                context="parked", exten="parkme", priority=1,<br>-                timeout=900, async=True<br>-                ).addErrback(TestCase.handle_originate_failure)<br>-            return<br>         self.ami[0].originate(<br>             channel="Local/start@outgoing",<br>             context="parked", exten="parkme12", priority=1,<br>diff --git a/tests/rest_api/danger/safe/safe.py b/tests/rest_api/danger/safe/safe.py<br>index ef21d89..07aa827 100644<br>--- a/tests/rest_api/danger/safe/safe.py<br>+++ b/tests/rest_api/danger/safe/safe.py<br>@@ -11,8 +11,6 @@<br> <br> LOGGER = logging.getLogger(__name__)<br> <br>-from version import AsteriskVersion<br>-<br> <br> def eq(expected, actual):<br>     if expected != actual:<br>@@ -25,15 +23,10 @@<br>     actual = resp.json()["value"]<br>     eq('works', actual)<br> <br>-    if AsteriskVersion() >= AsteriskVersion('13'):<br>-        ari.set_allow_errors(True)<br>+    ari.set_allow_errors(True)<br>     resp = ari.get('channels', channel_id, 'variable', variable='SHELL(echo -n fail)')<br>-    if AsteriskVersion() >= AsteriskVersion('13'):<br>-        ari.set_allow_errors(False)<br>-        eq(500, resp.status_code)<br>-    else:<br>-        eq(200, resp.status_code)<br>-        eq(resp.json().get('value'), '')<br>+    ari.set_allow_errors(False)<br>+    eq(500, resp.status_code)<br> <br> <br> def on_start(ari, event, test_object):<br>diff --git a/usage.py b/usage.py<br>index 03a9f35..16dea94 100755<br>--- a/usage.py<br>+++ b/usage.py<br>@@ -24,12 +24,6 @@<br> <br>         properties = self.test_config.get('properties', {})<br>         self.tags = properties.get('tags', ['none'])<br>-        self.minversion = properties.get('minversion', 'none')<br>-        if not isinstance(self.minversion, list):<br>-            self.minversion = [self.minversion]<br>-        self.maxversion = properties.get('maxversion', 'none')<br>-        if not isinstance(self.maxversion, list):<br>-            self.maxversion = [self.maxversion]<br>         self.dependencies = [repr(d)<br>                              for d in properties.get('dependencies', [])]<br> <br>@@ -39,10 +33,6 @@<br>             test_objects = [test_objects]<br>         self.test_objects = [obj.get('typename', 'test-run')<br>                              for obj in test_objects]<br>-        self.test_maxversion = [obj.get('maxversion', 'none')<br>-                                for obj in test_objects]<br>-        self.test_minversion = [obj.get('minversion', 'none')<br>-                                for obj in test_objects]<br>         modules = test_modules.get('modules', {})<br>         self.test_modules = [module.get('typename', '-error-')<br>                              for module in modules]<br>@@ -50,9 +40,9 @@<br> <br> class TestSuite:<br>     def __init__(self):<br>-        self.tests = self._parse_test_yaml("tests", '')<br>+        self.tests = self._parse_test_yaml("tests")<br> <br>-    def _parse_test_yaml(self, test_dir, ast_version):<br>+    def _parse_test_yaml(self, test_dir):<br>         tests = []<br> <br>         config = load_yaml_config("%s/%s" % (test_dir, TESTS_CONFIG))<br>@@ -65,7 +55,7 @@<br>                 if val == "test":<br>                     tests.append(Test(path))<br>                 elif val == "dir":<br>-                    tests += self._parse_test_yaml(path, ast_version)<br>+                    tests += self._parse_test_yaml(path)<br> <br>         return tests<br> <br>@@ -127,8 +117,6 @@<br>     test_suite.results_for('test_objects')<br>     test_suite.results_for('test_modules')<br>     test_suite.results_for('dependencies')<br>-    test_suite.results_for('maxversion')<br>-    test_suite.results_for('minversion')<br> <br> if __name__ == "__main__":<br>     sys.exit(main() or 0)<br></pre><p>To view, visit <a href="https://gerrit.asterisk.org/8712">change 8712</a>. To unsubscribe, visit <a href="https://gerrit.asterisk.org/settings">settings</a>.</p><div itemscope itemtype="http://schema.org/EmailMessage"><div itemscope itemprop="action" itemtype="http://schema.org/ViewAction"><link itemprop="url" href="https://gerrit.asterisk.org/8712"/><meta itemprop="name" content="View Change"/></div></div>

<div style="display:none"> Gerrit-Project: testsuite </div>
<div style="display:none"> Gerrit-Branch: 15 </div>
<div style="display:none"> Gerrit-MessageType: merged </div>
<div style="display:none"> Gerrit-Change-Id: I1ef916e1e52b9712b3c25bf63ee750b4b456f09e </div>
<div style="display:none"> Gerrit-Change-Number: 8712 </div>
<div style="display:none"> Gerrit-PatchSet: 1 </div>
<div style="display:none"> Gerrit-Owner: Corey Farrell <git@cfware.com> </div>
<div style="display:none"> Gerrit-Reviewer: Benjamin Keith Ford <bford@digium.com> </div>
<div style="display:none"> Gerrit-Reviewer: George Joseph <gjoseph@digium.com> </div>
<div style="display:none"> Gerrit-Reviewer: Jenkins2 </div>