<p>Michael Bradeen has uploaded this change for <strong>review</strong>.</p><p><a href="https://gerrit.asterisk.org/c/testsuite/+/18199">View Change</a></p><pre style="font-family: monospace,monospace; white-space: pre-wrap;">testsuite: Python 3 compatibility inital commit<br><br>Multiple changes for compatibility.  Requires latest version of all<br>pre-requisites and assumes a change in starpy to replace the now<br>protected data field async with asyncrn.<br><br>Changes also to print, replaced old library references, broke up<br>sub-parameters, etc.<br><br>Change-Id: Ic7a1d72b174df59107370fcb03fae9dc4cdfc9d3<br>---<br>M contrib/scripts/cel-to-yaml.py<br>M contrib/scripts/rlmi_demo.py<br>M lib/python/asterisk/matcher_listener.py<br>M lib/python/asterisk/pluggable_modules.py<br>M lib/python/asterisk/realtime_test_module.py<br>M lib/python/asterisk/syncami.py<br>M lib/python/asterisk/test_case.py<br>M lib/python/asterisk/test_runner.py<br>M lib/python/protocols/ipstack.py<br>M lib/python/protocols/layer4/tcp.py<br>M tests/agi/nominal/run-test<br>M tests/apps/chanspy/chanspy_w_mixmonitor/run-test<br>M tests/apps/directory/directory_attendant_exit/run-test<br>M tests/apps/directory/directory_context_operator_exit/run-test<br>M tests/apps/directory/directory_operator_exit/run-test<br>M tests/apps/voicemail/check_voicemail_options_change_password/voicemailpwcheck.py<br>M tests/blind-transfer-parkingtimeout/run-test<br>M tests/bridge/bridge_action/bridge_action.py<br>M tests/channels/SIP/noload_res_srtp/run-test<br>M tests/channels/SIP/noload_res_srtp_attempt_srtp/run-test<br>M tests/channels/SIP/refer_replaces_to_self/run-test<br>M tests/channels/SIP/secure_bridge_media/run-test<br>M tests/channels/SIP/sip_blind_transfer/caller_refer_only/run-test<br>M tests/channels/SIP/sip_one_legged_transfer_v6/run-test<br>M tests/channels/SIP/sip_srtp/srtp_call/run-test<br>M tests/channels/SIP/tcpauthtimeout/timeout_should_happen/timeout.py<br>M tests/channels/pjsip/resolver/naptr/explicit_transport_configured/dns_zones/example.com<br>M tests/channels/pjsip/resolver/naptr/order/dns_zones/example.com<br>M tests/channels/pjsip/resolver/naptr/preference/dns_zones/example.com<br>M tests/channels/pjsip/resolver/naptr/preference_failover/dns_zones/example.com<br>M tests/channels/pjsip/resolver/naptr/restricted_transport/dns_zones/example.com<br>M tests/channels/pjsip/resolver/naptr/transport_tcp/dns_zones/example.com<br>M tests/channels/pjsip/resolver/naptr/transport_udp/dns_zones/example.com<br>M tests/channels/pjsip/resolver/naptr/transport_unspecified/dns_zones/example.com<br>M tests/channels/pjsip/rtp/bind_rtp_to_media_address/rtp.py<br>M tests/channels/pjsip/rtp/rtp_keepalive/base/rtp.py<br>M tests/channels/pjsip/rtp/rtp_keepalive/direct_media/rtp.py<br>M tests/codecs/audio_analyzer.py<br>M tests/fastagi/channel-status/run-test<br>M tests/fastagi/connect/run-test<br>M tests/fastagi/database/run-test<br>M tests/fastagi/record-file/run-test<br>M tests/fastagi/stream-file/run-test<br>M tests/fastagi/wait-for-digit/run-test<br>M tests/fax/pjsip/t38_fast_reject/check_reinvite_rtt.py<br>M tests/fax/sip/gateway_g711_t38/run-test<br>M tests/fax/sip/gateway_mix1/run-test<br>M tests/fax/sip/gateway_mix3/run-test<br>M tests/fax/sip/gateway_mix4/run-test<br>M tests/fax/sip/gateway_native_t38/run-test<br>M tests/fax/sip/gateway_no_t38/run-test<br>M tests/fax/sip/gateway_t38_g711/run-test<br>M tests/fax/sip/gateway_timeout1/run-test<br>M tests/fax/sip/gateway_timeout2/run-test<br>M tests/fax/sip/gateway_timeout3/run-test<br>M tests/fax/sip/gateway_timeout4/run-test<br>M tests/fax/sip/gateway_timeout5/run-test<br>M tests/funcs/func_srv/run-test<br>M tests/hep/hep_capture_node.py<br>M tests/manager/userevent/event.py<br>M tests/masquerade/run-test<br>M tests/rtp/strict_rtp/strict_rtp_seqno/strict_rtp.py<br>M tests/rtp/strict_rtp/strict_rtp_yes/strict_rtp.py<br>63 files changed, 397 insertions(+), 384 deletions(-)<br><br></pre><pre style="font-family: monospace,monospace; white-space: pre-wrap;">git pull ssh://gerrit.asterisk.org:29418/testsuite refs/changes/99/18199/1</pre><pre style="font-family: monospace,monospace; white-space: pre-wrap;"><span>diff --git a/contrib/scripts/cel-to-yaml.py b/contrib/scripts/cel-to-yaml.py</span><br><span>index f91aa0e..67c6c70 100755</span><br><span>--- a/contrib/scripts/cel-to-yaml.py</span><br><span>+++ b/contrib/scripts/cel-to-yaml.py</span><br><span>@@ -48,7 +48,7 @@</span><br><span>         result.append(blob)</span><br><span>     raw_yaml = yaml.dump(result)</span><br><span>     raw_yaml = raw_yaml.replace(',', '\n').replace('}', '').replace('{', '')</span><br><span style="color: hsl(0, 100%, 40%);">-    print raw_yaml</span><br><span style="color: hsl(120, 100%, 40%);">+    print(raw_yaml)</span><br><span> </span><br><span>     return 0</span><br><span> </span><br><span>diff --git a/contrib/scripts/rlmi_demo.py b/contrib/scripts/rlmi_demo.py</span><br><span>index 3e9daf9..14f00f3 100755</span><br><span>--- a/contrib/scripts/rlmi_demo.py</span><br><span>+++ b/contrib/scripts/rlmi_demo.py</span><br><span>@@ -1,5 +1,5 @@</span><br><span> #!/usr/bin/env python</span><br><span style="color: hsl(0, 100%, 40%);">-"""Demonstration of parsing and printing RLMI XML document.</span><br><span style="color: hsl(120, 100%, 40%);">+"""Demonstration of parsing and print(ing RLMI XML document.</span><br><span> </span><br><span> This script is meant to demonstrate how, given an RLMI XML document, one can use</span><br><span> the pyxb-generated rlmi module to parse the XML document into easy-to peruse</span><br><span>@@ -23,46 +23,46 @@</span><br><span> list_elem = rlmi.CreateFromDocument(xml)</span><br><span> </span><br><span> # The outermost XML element in an RLMI document is the 'list' element.</span><br><span style="color: hsl(0, 100%, 40%);">-print 'list'</span><br><span style="color: hsl(120, 100%, 40%);">+print( 'list'</span><br><span> # pyxb performs type-checking and type conversion of elements that it comes</span><br><span> # across in XML documents. In this case, the list element's version attribute is</span><br><span> # an integer, and the fullState attribute is a boolean. This is why the str()</span><br><span> # function is necessary in order to convert to string for the concatenation.</span><br><span style="color: hsl(0, 100%, 40%);">-print '\t' + str(list_elem.version)</span><br><span style="color: hsl(0, 100%, 40%);">-print '\t' + str(list_elem.fullState)</span><br><span style="color: hsl(0, 100%, 40%);">-print '\t' + list_elem.uri</span><br><span style="color: hsl(120, 100%, 40%);">+print('\t' + str(list_elem.version))</span><br><span style="color: hsl(120, 100%, 40%);">+print('\t' + str(list_elem.fullState))</span><br><span style="color: hsl(120, 100%, 40%);">+print('\t' + list_elem.uri)</span><br><span> # A list element may have zero or more name elements in it. This is a</span><br><span> # user-visible name for the list. The main reason why more than one name may</span><br><span> # exist for a list would be because it is expressed in multiple languages.</span><br><span> # Asterisk RLMI lists will have only a single name.</span><br><span> for name in list_elem.name:</span><br><span style="color: hsl(0, 100%, 40%);">-    print '\tname'</span><br><span style="color: hsl(120, 100%, 40%);">+    print('\tname')</span><br><span>     # Parsed XML documents have their attributes accessed as members on an</span><br><span>     # object.</span><br><span style="color: hsl(0, 100%, 40%);">-    print '\t\t' + name.lang</span><br><span style="color: hsl(120, 100%, 40%);">+    print('\t\t' + name.lang)</span><br><span>     # The content of XML elements is accessed through the value() member.</span><br><span style="color: hsl(0, 100%, 40%);">-    print '\t\t' + name.value()</span><br><span style="color: hsl(120, 100%, 40%);">+    print('\t\t' + name.value())</span><br><span> # A list element may have zero or more resource elements in it. The resources</span><br><span> # represent the resources that make up the list (duh).</span><br><span> for resource in list_elem.resource:</span><br><span style="color: hsl(0, 100%, 40%);">-    print '\tresource'</span><br><span style="color: hsl(0, 100%, 40%);">-    print '\t\t' + resource.uri</span><br><span style="color: hsl(120, 100%, 40%);">+    print('\tresource')</span><br><span style="color: hsl(120, 100%, 40%);">+    print('\t\t' + resource.uri)</span><br><span>     # Resources may have names associated with them, just like the list does.</span><br><span>     # Asterisk will use the name of the list from the configuration file here.</span><br><span>     for name in resource.name:</span><br><span style="color: hsl(0, 100%, 40%);">-        print '\t\tname'</span><br><span style="color: hsl(0, 100%, 40%);">-        print '\t\t\t' + name.value()</span><br><span style="color: hsl(120, 100%, 40%);">+        print('\t\tname')()</span><br><span style="color: hsl(120, 100%, 40%);">+        print('\t\t\t' + name.value())</span><br><span>     # Resources may have zero or more instance elements on them. The reason that</span><br><span>     # more than one instance element may exist for a resource is that a resource</span><br><span>     # may correspond to a single subscription that forks, resulting in multiple</span><br><span>     # instances of the resource being represented. In Asterisk's case, there</span><br><span>     # will be a single instance per resource.</span><br><span>     for instance in resource.instance:</span><br><span style="color: hsl(0, 100%, 40%);">-        print '\t\tinstance'</span><br><span style="color: hsl(0, 100%, 40%);">-        print '\t\t\t' + instance.id</span><br><span style="color: hsl(0, 100%, 40%);">-        print '\t\t\t' + instance.state</span><br><span style="color: hsl(120, 100%, 40%);">+        print('\t\tinstance')</span><br><span style="color: hsl(120, 100%, 40%);">+        print('\t\t\t' + instance.id)</span><br><span style="color: hsl(120, 100%, 40%);">+        print('\t\t\t' + instance.state)</span><br><span>         # If an instance has a cid, it indicates that there is a body element</span><br><span>         # in the multipart body that corresponds to the instance. The cid</span><br><span>         # corresponds to the Content-ID header in that body part.</span><br><span>         if instance.cid:</span><br><span style="color: hsl(0, 100%, 40%);">-            print '\t\t\t' + instance.cid</span><br><span style="color: hsl(120, 100%, 40%);">+            print('\t\t\t' + instance.cid)</span><br><span>diff --git a/lib/python/asterisk/matcher_listener.py b/lib/python/asterisk/matcher_listener.py</span><br><span>index cd2ca5a..18ed16d 100644</span><br><span>--- a/lib/python/asterisk/matcher_listener.py</span><br><span>+++ b/lib/python/asterisk/matcher_listener.py</span><br><span>@@ -72,5 +72,6 @@</span><br><span>         msg -- The message received via the udp</span><br><span>         """</span><br><span> </span><br><span style="color: hsl(0, 100%, 40%);">-        if not any(f for f in self.filter_msgs if re.match(f, msg)):</span><br><span style="color: hsl(120, 100%, 40%);">+        msgstring = msg.decode('utf8')</span><br><span style="color: hsl(120, 100%, 40%);">+        if not any(f for f in self.filter_msgs if re.match(f, msgstring)):</span><br><span>             self.check(msg)</span><br><span>diff --git a/lib/python/asterisk/pluggable_modules.py b/lib/python/asterisk/pluggable_modules.py</span><br><span>index 22da37e..a696123 100644</span><br><span>--- a/lib/python/asterisk/pluggable_modules.py</span><br><span>+++ b/lib/python/asterisk/pluggable_modules.py</span><br><span>@@ -50,7 +50,7 @@</span><br><span>             'scenario-name': None,</span><br><span>             'id': '0',</span><br><span>             'account': None,</span><br><span style="color: hsl(0, 100%, 40%);">-            'async': 'False',</span><br><span style="color: hsl(120, 100%, 40%);">+            'asyncrn': 'False',</span><br><span>             'event': None,</span><br><span>             'timeout': None,</span><br><span>             'codecs': None,</span><br><span>@@ -124,7 +124,7 @@</span><br><span>                                        timeout=self.config['timeout'],</span><br><span>                                        account=self.config['account'],</span><br><span>                                        codecs=self.config['codecs'],</span><br><span style="color: hsl(0, 100%, 40%);">-                                       async=self.config['async'])</span><br><span style="color: hsl(120, 100%, 40%);">+                                       asyncrn=self.config['asyncrn'])</span><br><span>         else:</span><br><span>             defer = self.ami.originate(channel=self.config['channel'],</span><br><span>                                        application=self.config['application'],</span><br><span>@@ -132,7 +132,7 @@</span><br><span>                                        timeout=self.config['timeout'],</span><br><span>                                        account=self.config['account'],</span><br><span>                                        codecs=self.config['codecs'],</span><br><span style="color: hsl(0, 100%, 40%);">-                                       async=self.config['async'])</span><br><span style="color: hsl(120, 100%, 40%);">+                                       asyncrn=self.config['asyncrn'])</span><br><span>         defer.addErrback(self.failure)</span><br><span> </span><br><span>     def scenario_started(self, result):</span><br><span>diff --git a/lib/python/asterisk/realtime_test_module.py b/lib/python/asterisk/realtime_test_module.py</span><br><span>index da97422..bffdf46 100644</span><br><span>--- a/lib/python/asterisk/realtime_test_module.py</span><br><span>+++ b/lib/python/asterisk/realtime_test_module.py</span><br><span>@@ -6,9 +6,10 @@</span><br><span> This program is free software, distributed under the terms of</span><br><span> the GNU General Public License Version 2.</span><br><span> """</span><br><span style="color: hsl(120, 100%, 40%);">+from encodings import utf_8</span><br><span> import logging</span><br><span> import sys</span><br><span style="color: hsl(0, 100%, 40%);">-import cgi</span><br><span style="color: hsl(120, 100%, 40%);">+import html</span><br><span> import re</span><br><span> </span><br><span> from twisted.internet import reactor</span><br><span>@@ -101,7 +102,7 @@</span><br><span>         :returns: List of rows that match the given input.</span><br><span>         :raises: Keyerror if a table does not exist with name table_name</span><br><span>         """</span><br><span style="color: hsl(0, 100%, 40%);">-        return self._filter_rows(self.tables[table_name], where)</span><br><span style="color: hsl(120, 100%, 40%);">+        return self._filter_rows(self.tables[table_name.decode("utf-8")], where)</span><br><span> </span><br><span>     def update_rows(self, table_name, where, update):</span><br><span>         """Update row data in a table.</span><br><span>@@ -192,7 +193,8 @@</span><br><span>         these resources represents an operation to perform on the table.</span><br><span>         """</span><br><span>         try:</span><br><span style="color: hsl(0, 100%, 40%);">-            return getattr(THIS_MODULE, "_" + name + "Resource")(</span><br><span style="color: hsl(120, 100%, 40%);">+            attr_str = "_" + str(name, 'utf_8') + "Resource"</span><br><span style="color: hsl(120, 100%, 40%);">+            return getattr(THIS_MODULE, attr_str)(</span><br><span>                 self.table_name, self.rt_data</span><br><span>             )</span><br><span>         except AttributeError as ex:</span><br><span>@@ -260,7 +262,7 @@</span><br><span>         Example input: {'foo': 'cat, 'bar': 'dog', 'baz: 'donkey'}</span><br><span>         Example output: 'foo=cat&bar=dog&baz=donkey'</span><br><span>         """</span><br><span style="color: hsl(0, 100%, 40%);">-        string = '&'.join(['{0}={1}'.format(cgi.escape(key), cgi.escape(val))</span><br><span style="color: hsl(120, 100%, 40%);">+        string = '&'.join(['{0}={1}'.format(html.escape(key), html.escape(val))</span><br><span>                            for key, val in row.items()])</span><br><span>         LOGGER.debug("Returning response %s" % string)</span><br><span>         return string</span><br><span>@@ -449,7 +451,11 @@</span><br><span>         LOGGER.debug("Asked to render GET in the static resource")</span><br><span>         # Forego a more complicated unpack since the file is the only thing we</span><br><span>         # care about</span><br><span style="color: hsl(0, 100%, 40%);">-        where = {'filename': request.args['file'][0], 'commented': '0'}</span><br><span style="color: hsl(120, 100%, 40%);">+        where = {'filename': (request.args[b'file'][0]).decode("utf-8"), 'commented': '0'}</span><br><span style="color: hsl(120, 100%, 40%);">+        LOGGER.info("where string:")</span><br><span style="color: hsl(120, 100%, 40%);">+        LOGGER.info(where)</span><br><span style="color: hsl(120, 100%, 40%);">+        LOGGER.info(self.rt_data.retrieve_rows(self.table_name, where))</span><br><span style="color: hsl(120, 100%, 40%);">+        LOGGER.info(self.encode_multi_row(self.rt_data.retrieve_rows(self.table_name, where)))</span><br><span>         try:</span><br><span>             return self.encode_multi_row(</span><br><span>                 self.rt_data.retrieve_rows(self.table_name, where)</span><br><span>diff --git a/lib/python/asterisk/syncami.py b/lib/python/asterisk/syncami.py</span><br><span>index 917e9e4..f9d2e4c 100644</span><br><span>--- a/lib/python/asterisk/syncami.py</span><br><span>+++ b/lib/python/asterisk/syncami.py</span><br><span>@@ -15,7 +15,7 @@</span><br><span>     # python 3 import</span><br><span>     from urllib.parse import urlencode</span><br><span> </span><br><span style="color: hsl(0, 100%, 40%);">-from StringIO import StringIO</span><br><span style="color: hsl(120, 100%, 40%);">+from io import StringIO</span><br><span> from email.parser import HeaderParser</span><br><span> try:</span><br><span>     from httplib import *</span><br><span>diff --git a/lib/python/asterisk/test_case.py b/lib/python/asterisk/test_case.py</span><br><span>index c4cde27..6cdbd55 100644</span><br><span>--- a/lib/python/asterisk/test_case.py</span><br><span>+++ b/lib/python/asterisk/test_case.py</span><br><span>@@ -860,8 +860,8 @@</span><br><span>         msg = "Originating call to %s" % call_details['channel']</span><br><span>         if 'account' not in call_details:</span><br><span>             call_details['account'] = None</span><br><span style="color: hsl(0, 100%, 40%);">-        if 'async' not in call_details:</span><br><span style="color: hsl(0, 100%, 40%);">-            call_details['async'] = False</span><br><span style="color: hsl(120, 100%, 40%);">+        if 'asyncrn' not in call_details:</span><br><span style="color: hsl(120, 100%, 40%);">+            call_details['asyncrn'] = False</span><br><span>         if 'channelid' not in call_details:</span><br><span>             call_details['channelid'] = None</span><br><span>         if 'otherchannelid' not in call_details:</span><br><span>@@ -873,7 +873,7 @@</span><br><span>                 application=call_details['application'],</span><br><span>                 variable=call_details['variable'],</span><br><span>                 account=call_details['account'],</span><br><span style="color: hsl(0, 100%, 40%);">-                async=call_details['async'],</span><br><span style="color: hsl(120, 100%, 40%);">+                asyncrn=call_details['asyncrn'],</span><br><span>                 channelid=call_details['channelid'],</span><br><span>                 otherchannelid=call_details['otherchannelid'])</span><br><span>         else:</span><br><span>@@ -887,7 +887,7 @@</span><br><span>                 priority=call_details['priority'],</span><br><span>                 variable=call_details['variable'],</span><br><span>                 account=call_details['account'],</span><br><span style="color: hsl(0, 100%, 40%);">-                async=call_details['async'],</span><br><span style="color: hsl(120, 100%, 40%);">+                asyncrn=call_details['asyncrn'],</span><br><span>                 channelid=call_details['channelid'],</span><br><span>                 otherchannelid=call_details['otherchannelid'])</span><br><span>         if self._ignore_originate_failures:</span><br><span>diff --git a/lib/python/asterisk/test_runner.py b/lib/python/asterisk/test_runner.py</span><br><span>index 588a6bb..942181e 100644</span><br><span>--- a/lib/python/asterisk/test_runner.py</span><br><span>+++ b/lib/python/asterisk/test_runner.py</span><br><span>@@ -11,11 +11,11 @@</span><br><span> """</span><br><span> </span><br><span> import sys</span><br><span style="color: hsl(0, 100%, 40%);">-import imp</span><br><span> import logging</span><br><span> import logging.config</span><br><span> import os</span><br><span> import yaml</span><br><span style="color: hsl(120, 100%, 40%);">+from importlib.machinery import SourceFileLoader</span><br><span> </span><br><span> try:</span><br><span>     from yaml import CSafeLoader as MyLoader</span><br><span>@@ -86,7 +86,7 @@</span><br><span>         else:</span><br><span>             mod = sys.modules.setdefault(</span><br><span>                 fullname,</span><br><span style="color: hsl(0, 100%, 40%);">-                imp.load_source(fullname, self._get_filename(fullname)))</span><br><span style="color: hsl(120, 100%, 40%);">+                SourceFileLoader(fullname, self._get_filename(fullname)).load_module())</span><br><span> </span><br><span>         return mod</span><br><span> </span><br><span>diff --git a/lib/python/protocols/ipstack.py b/lib/python/protocols/ipstack.py</span><br><span>index cd63fce..74d3f22 100644</span><br><span>--- a/lib/python/protocols/ipstack.py</span><br><span>+++ b/lib/python/protocols/ipstack.py</span><br><span>@@ -6,14 +6,17 @@</span><br><span> """</span><br><span> from binascii import unhexlify</span><br><span> #import six</span><br><span style="color: hsl(0, 100%, 40%);">-from construct import Struct, HexDump, Switch, Pass, Computed, Hex, Bytes, setGlobalPrintFullStrings</span><br><span style="color: hsl(120, 100%, 40%);">+#from construct import Struct, HexDump, Switch, Pass, Computed, Hex, Bytes, setGlobalPrintFullStrings</span><br><span style="color: hsl(120, 100%, 40%);">+#from construct import Struct, HexDump, Switch, Pass, Computed, Hex, Bytes, setglobalfullprinting</span><br><span style="color: hsl(120, 100%, 40%);">+from construct import Struct, HexDump, Switch, Pass, Computed, Hex, Bytes</span><br><span> from protocols.layer2.ethernet import ethernet_header</span><br><span> from protocols.layer3.ipv4 import ipv4_header</span><br><span> from protocols.layer3.ipv6 import ipv6_header</span><br><span> from protocols.layer4.tcp import tcp_header</span><br><span> from protocols.layer4.udp import udp_header</span><br><span> </span><br><span style="color: hsl(0, 100%, 40%);">-setGlobalPrintFullStrings(True)</span><br><span style="color: hsl(120, 100%, 40%);">+#setglobalfullprinting(True)</span><br><span style="color: hsl(120, 100%, 40%);">+#setGlobalPrintFullStrings(True)</span><br><span> </span><br><span> layer4_tcp = "layer4_tcp" / Struct(</span><br><span>     "layer" / Computed(4),</span><br><span>diff --git a/lib/python/protocols/layer4/tcp.py b/lib/python/protocols/layer4/tcp.py</span><br><span>index b2d3162..d13dfcb 100644</span><br><span>--- a/lib/python/protocols/layer4/tcp.py</span><br><span>+++ b/lib/python/protocols/layer4/tcp.py</span><br><span>@@ -6,8 +6,6 @@</span><br><span> from construct import *</span><br><span> from construct.core import *</span><br><span> </span><br><span style="color: hsl(0, 100%, 40%);">-setGlobalPrintFullStrings(True)</span><br><span style="color: hsl(0, 100%, 40%);">-</span><br><span> tcp_header = "tcp_header" / BitStruct(</span><br><span>     "source" / Bytewise(Int16ub),</span><br><span>     "destination" / Bytewise(Int16ub),</span><br><span>diff --git a/tests/agi/nominal/run-test b/tests/agi/nominal/run-test</span><br><span>index a78fda4..3a1cb44 100755</span><br><span>--- a/tests/agi/nominal/run-test</span><br><span>+++ b/tests/agi/nominal/run-test</span><br><span>@@ -72,7 +72,7 @@</span><br><span>         Checks to see if the AGI script was completed as expected.</span><br><span>         """</span><br><span>         if event['userevent'] != 'AgiCompleted':</span><br><span style="color: hsl(0, 100%, 40%);">-            print event['userevent']</span><br><span style="color: hsl(120, 100%, 40%);">+            print(event['userevent'])</span><br><span>             return</span><br><span> </span><br><span>         self.call_count += 1</span><br><span>diff --git a/tests/apps/chanspy/chanspy_w_mixmonitor/run-test b/tests/apps/chanspy/chanspy_w_mixmonitor/run-test</span><br><span>index 612a3ab..930e665 100755</span><br><span>--- a/tests/apps/chanspy/chanspy_w_mixmonitor/run-test</span><br><span>+++ b/tests/apps/chanspy/chanspy_w_mixmonitor/run-test</span><br><span>@@ -99,8 +99,8 @@</span><br><span>         name The name to call the instance</span><br><span>         """</span><br><span>         LOGGER.info("%s Calling into Playback" % name)</span><br><span style="color: hsl(0, 100%, 40%);">-        pjsua.stdin.write("m\n")</span><br><span style="color: hsl(0, 100%, 40%);">-        pjsua.stdin.write("sip:play_exten@127.0.0.1:5060\n")</span><br><span style="color: hsl(120, 100%, 40%);">+        pjsua.stdin.write(b"m\n")</span><br><span style="color: hsl(120, 100%, 40%);">+        pjsua.stdin.write(b"sip:play_exten@127.0.0.1:5060\n")</span><br><span> </span><br><span>     def hangup_pjsua(self, pjsua, name):</span><br><span>         """Hangup some PJSUA instance</span><br><span>@@ -110,7 +110,7 @@</span><br><span>         name The name to call the instance</span><br><span>         """</span><br><span>         LOGGER.info("Hanging up %s" % name)</span><br><span style="color: hsl(0, 100%, 40%);">-        pjsua.stdin.write("h\n")</span><br><span style="color: hsl(120, 100%, 40%);">+        pjsua.stdin.write(b"h\n")</span><br><span> </span><br><span>     def start_processes(self):</span><br><span>         """Start up the PJSUA processes"""</span><br><span>diff --git a/tests/apps/directory/directory_attendant_exit/run-test b/tests/apps/directory/directory_attendant_exit/run-test</span><br><span>index 1721880..91eebcc 100755</span><br><span>--- a/tests/apps/directory/directory_attendant_exit/run-test</span><br><span>+++ b/tests/apps/directory/directory_attendant_exit/run-test</span><br><span>@@ -26,13 +26,13 @@</span><br><span>       ami.registerEvent('UserEvent', self.user_event)</span><br><span> </span><br><span>       if ami.id == 0:</span><br><span style="color: hsl(0, 100%, 40%);">-         print "sending a call from ast1 to ast2"</span><br><span style="color: hsl(120, 100%, 40%);">+         print("sending a call from ast1 to ast2")</span><br><span> </span><br><span>          df = ami.originate("sip/ast2/1234", "senddtmf", "1234", 1)</span><br><span> </span><br><span>          def handle_failure(reason):</span><br><span style="color: hsl(0, 100%, 40%);">-            print "error sending originate:"</span><br><span style="color: hsl(0, 100%, 40%);">-            print reason.getTraceback()</span><br><span style="color: hsl(120, 100%, 40%);">+            print("error sending originate:")</span><br><span style="color: hsl(120, 100%, 40%);">+            print(reason.getTraceback())</span><br><span>             self.stop_reactor()</span><br><span> </span><br><span>             return reason</span><br><span>@@ -45,11 +45,11 @@</span><br><span> </span><br><span>       if event['result'] == "pass":</span><br><span>          self.passed = True</span><br><span style="color: hsl(0, 100%, 40%);">-         print "app_directory successfully exited"</span><br><span style="color: hsl(120, 100%, 40%);">+         print("app_directory successfully exited")</span><br><span>       else:</span><br><span style="color: hsl(0, 100%, 40%);">-         print "app_directory did not successfully exit:"</span><br><span style="color: hsl(0, 100%, 40%);">-         print "result: %s" % (event['result'],)</span><br><span style="color: hsl(0, 100%, 40%);">-         print "error: %s" % (event['error'],)</span><br><span style="color: hsl(120, 100%, 40%);">+         print("app_directory did not successfully exit:")</span><br><span style="color: hsl(120, 100%, 40%);">+         print("result: %s" % (event['result'],))</span><br><span style="color: hsl(120, 100%, 40%);">+         print("error: %s" % (event['error'],))</span><br><span> </span><br><span>       self.stop_reactor()</span><br><span> </span><br><span>diff --git a/tests/apps/directory/directory_context_operator_exit/run-test b/tests/apps/directory/directory_context_operator_exit/run-test</span><br><span>index 1721880..91eebcc 100755</span><br><span>--- a/tests/apps/directory/directory_context_operator_exit/run-test</span><br><span>+++ b/tests/apps/directory/directory_context_operator_exit/run-test</span><br><span>@@ -26,13 +26,13 @@</span><br><span>       ami.registerEvent('UserEvent', self.user_event)</span><br><span> </span><br><span>       if ami.id == 0:</span><br><span style="color: hsl(0, 100%, 40%);">-         print "sending a call from ast1 to ast2"</span><br><span style="color: hsl(120, 100%, 40%);">+         print("sending a call from ast1 to ast2")</span><br><span> </span><br><span>          df = ami.originate("sip/ast2/1234", "senddtmf", "1234", 1)</span><br><span> </span><br><span>          def handle_failure(reason):</span><br><span style="color: hsl(0, 100%, 40%);">-            print "error sending originate:"</span><br><span style="color: hsl(0, 100%, 40%);">-            print reason.getTraceback()</span><br><span style="color: hsl(120, 100%, 40%);">+            print("error sending originate:")</span><br><span style="color: hsl(120, 100%, 40%);">+            print(reason.getTraceback())</span><br><span>             self.stop_reactor()</span><br><span> </span><br><span>             return reason</span><br><span>@@ -45,11 +45,11 @@</span><br><span> </span><br><span>       if event['result'] == "pass":</span><br><span>          self.passed = True</span><br><span style="color: hsl(0, 100%, 40%);">-         print "app_directory successfully exited"</span><br><span style="color: hsl(120, 100%, 40%);">+         print("app_directory successfully exited")</span><br><span>       else:</span><br><span style="color: hsl(0, 100%, 40%);">-         print "app_directory did not successfully exit:"</span><br><span style="color: hsl(0, 100%, 40%);">-         print "result: %s" % (event['result'],)</span><br><span style="color: hsl(0, 100%, 40%);">-         print "error: %s" % (event['error'],)</span><br><span style="color: hsl(120, 100%, 40%);">+         print("app_directory did not successfully exit:")</span><br><span style="color: hsl(120, 100%, 40%);">+         print("result: %s" % (event['result'],))</span><br><span style="color: hsl(120, 100%, 40%);">+         print("error: %s" % (event['error'],))</span><br><span> </span><br><span>       self.stop_reactor()</span><br><span> </span><br><span>diff --git a/tests/apps/directory/directory_operator_exit/run-test b/tests/apps/directory/directory_operator_exit/run-test</span><br><span>index 1721880..91eebcc 100755</span><br><span>--- a/tests/apps/directory/directory_operator_exit/run-test</span><br><span>+++ b/tests/apps/directory/directory_operator_exit/run-test</span><br><span>@@ -26,13 +26,13 @@</span><br><span>       ami.registerEvent('UserEvent', self.user_event)</span><br><span> </span><br><span>       if ami.id == 0:</span><br><span style="color: hsl(0, 100%, 40%);">-         print "sending a call from ast1 to ast2"</span><br><span style="color: hsl(120, 100%, 40%);">+         print("sending a call from ast1 to ast2")</span><br><span> </span><br><span>          df = ami.originate("sip/ast2/1234", "senddtmf", "1234", 1)</span><br><span> </span><br><span>          def handle_failure(reason):</span><br><span style="color: hsl(0, 100%, 40%);">-            print "error sending originate:"</span><br><span style="color: hsl(0, 100%, 40%);">-            print reason.getTraceback()</span><br><span style="color: hsl(120, 100%, 40%);">+            print("error sending originate:")</span><br><span style="color: hsl(120, 100%, 40%);">+            print(reason.getTraceback())</span><br><span>             self.stop_reactor()</span><br><span> </span><br><span>             return reason</span><br><span>@@ -45,11 +45,11 @@</span><br><span> </span><br><span>       if event['result'] == "pass":</span><br><span>          self.passed = True</span><br><span style="color: hsl(0, 100%, 40%);">-         print "app_directory successfully exited"</span><br><span style="color: hsl(120, 100%, 40%);">+         print("app_directory successfully exited")</span><br><span>       else:</span><br><span style="color: hsl(0, 100%, 40%);">-         print "app_directory did not successfully exit:"</span><br><span style="color: hsl(0, 100%, 40%);">-         print "result: %s" % (event['result'],)</span><br><span style="color: hsl(0, 100%, 40%);">-         print "error: %s" % (event['error'],)</span><br><span style="color: hsl(120, 100%, 40%);">+         print("app_directory did not successfully exit:")</span><br><span style="color: hsl(120, 100%, 40%);">+         print("result: %s" % (event['result'],))</span><br><span style="color: hsl(120, 100%, 40%);">+         print("error: %s" % (event['error'],))</span><br><span> </span><br><span>       self.stop_reactor()</span><br><span> </span><br><span>diff --git a/tests/apps/voicemail/check_voicemail_options_change_password/voicemailpwcheck.py b/tests/apps/voicemail/check_voicemail_options_change_password/voicemailpwcheck.py</span><br><span>index d7a66d4..452255c 100755</span><br><span>--- a/tests/apps/voicemail/check_voicemail_options_change_password/voicemailpwcheck.py</span><br><span>+++ b/tests/apps/voicemail/check_voicemail_options_change_password/voicemailpwcheck.py</span><br><span>@@ -46,20 +46,20 @@</span><br><span> </span><br><span> # Enforce a password length of at least 6 characters</span><br><span> if len(new_pw) < REQUIRED_LENGTH:</span><br><span style="color: hsl(0, 100%, 40%);">-    print "INVALID: Password is too short (%d) - must be at least %d" % \</span><br><span style="color: hsl(0, 100%, 40%);">-            (len(new_pw), REQUIRED_LENGTH)</span><br><span style="color: hsl(120, 100%, 40%);">+    print("INVALID: Password is too short (%d) - must be at least %d" % \</span><br><span style="color: hsl(120, 100%, 40%);">+            (len(new_pw), REQUIRED_LENGTH))</span><br><span>     sys.exit(0)</span><br><span> </span><br><span> for regex, error in REGEX_BLACKLIST:</span><br><span>     if re.search(regex, new_pw):</span><br><span style="color: hsl(0, 100%, 40%);">-        print "INVALID: %s" % error</span><br><span style="color: hsl(120, 100%, 40%);">+        print("INVALID: %s" % error)</span><br><span>         sys.exit(0)</span><br><span> </span><br><span> for pw in PW_BLACKLIST:</span><br><span>     if new_pw.find(pw) != -1:</span><br><span style="color: hsl(0, 100%, 40%);">-        print "INVALID: %s is forbidden in a password" % pw</span><br><span style="color: hsl(120, 100%, 40%);">+        print("INVALID: %s is forbidden in a password" % pw)</span><br><span>         sys.exit(0)</span><br><span> </span><br><span style="color: hsl(0, 100%, 40%);">-print "VALID"</span><br><span style="color: hsl(120, 100%, 40%);">+print("VALID")</span><br><span> </span><br><span> sys.exit(0)</span><br><span>diff --git a/tests/blind-transfer-parkingtimeout/run-test b/tests/blind-transfer-parkingtimeout/run-test</span><br><span>index 5a22a21..2f64832 100755</span><br><span>--- a/tests/blind-transfer-parkingtimeout/run-test</span><br><span>+++ b/tests/blind-transfer-parkingtimeout/run-test</span><br><span>@@ -66,7 +66,7 @@</span><br><span>              "'core show globals' in log for more detailed failure results.")</span><br><span> </span><br><span>         if reactor.running:</span><br><span style="color: hsl(0, 100%, 40%);">-            print "Stopping Reactor ..."</span><br><span style="color: hsl(120, 100%, 40%);">+            print("Stopping Reactor ...")</span><br><span>             reactor.stop()</span><br><span> </span><br><span>     # This is a blind transfer test with parkingtimeout.</span><br><span>@@ -89,7 +89,7 @@</span><br><span>         self.ast2.stop()</span><br><span> </span><br><span>     def log_last_step(self, step):</span><br><span style="color: hsl(0, 100%, 40%);">-        print step</span><br><span style="color: hsl(120, 100%, 40%);">+        print(step)</span><br><span>         self.last_step = step</span><br><span> </span><br><span>     def run(self):</span><br><span>diff --git a/tests/bridge/bridge_action/bridge_action.py b/tests/bridge/bridge_action/bridge_action.py</span><br><span>index 3682ae5..4ed2409 100644</span><br><span>--- a/tests/bridge/bridge_action/bridge_action.py</span><br><span>+++ b/tests/bridge/bridge_action/bridge_action.py</span><br><span>@@ -53,7 +53,7 @@</span><br><span>                       context='default',</span><br><span>                       exten='waiting_area',</span><br><span>                       priority=1,</span><br><span style="color: hsl(0, 100%, 40%);">-                      async=True).addErrback(self.test_object.</span><br><span style="color: hsl(120, 100%, 40%);">+                      asyncrn=True).addErrback(self.test_object.</span><br><span>                                              handle_originate_failure)</span><br><span> </span><br><span>     def _new_channel_handler(self, ami, event):</span><br><span>@@ -71,7 +71,7 @@</span><br><span>                           context='default',</span><br><span>                           exten='waiting_area',</span><br><span>                           priority=1,</span><br><span style="color: hsl(0, 100%, 40%);">-                          async=True).addErrback(self.test_object.</span><br><span style="color: hsl(120, 100%, 40%);">+                          asyncrn=True).addErrback(self.test_object.</span><br><span>                                                  handle_originate_failure)</span><br><span> </span><br><span>     def _stop_handler(self, result):</span><br><span>diff --git a/tests/channels/SIP/noload_res_srtp/run-test b/tests/channels/SIP/noload_res_srtp/run-test</span><br><span>index f9f3646..9dc7608 100755</span><br><span>--- a/tests/channels/SIP/noload_res_srtp/run-test</span><br><span>+++ b/tests/channels/SIP/noload_res_srtp/run-test</span><br><span>@@ -34,14 +34,14 @@</span><br><span>     def run(self):</span><br><span>         TestCase.run(self)</span><br><span> </span><br><span style="color: hsl(0, 100%, 40%);">-        print "Initiating test call"</span><br><span style="color: hsl(120, 100%, 40%);">+        print("Initiating test call")</span><br><span>         self.ast[0].cli_originate(</span><br><span>             "SIP/2000/2000 extension 1000@siptest1")</span><br><span> </span><br><span>     # This is called by each Asterisk instance if the call gets connected.</span><br><span>     def fastagi_connect(self, agi):</span><br><span>         def get_test_result(val):</span><br><span style="color: hsl(0, 100%, 40%);">-            print "Connection result '%s'" % val</span><br><span style="color: hsl(120, 100%, 40%);">+            print("Connection result '%s'" % val)</span><br><span>             if val.split("-")[0] == "SIP/2000":</span><br><span>                 # Outgoing call on Ast1</span><br><span>                 self.connected_chan1 = True</span><br><span>@@ -53,10 +53,10 @@</span><br><span>                 if val.split("=")[1] == "":</span><br><span>                     self.connected_no_srtp2 = True</span><br><span>             else:</span><br><span style="color: hsl(0, 100%, 40%);">-                print "Don't know which side is connected."</span><br><span style="color: hsl(120, 100%, 40%);">+                print("Don't know which side is connected.")</span><br><span> </span><br><span>             if self.connected_chan1 and self.connected_no_srtp1 and self.connected_chan2 and self.connected_no_srtp2:</span><br><span style="color: hsl(0, 100%, 40%);">-                print "Test passed"</span><br><span style="color: hsl(120, 100%, 40%);">+                print("Test passed")</span><br><span>                 for a in self.agis:</span><br><span>                     a.finish()</span><br><span>                 self.agis = []</span><br><span>@@ -74,10 +74,10 @@</span><br><span>         TestCase.stop_asterisk(self)</span><br><span> </span><br><span>         # Determine if the test passed</span><br><span style="color: hsl(0, 100%, 40%);">-        print "self.connected_chan1:   %s" % (self.connected_chan1)</span><br><span style="color: hsl(0, 100%, 40%);">-        print "self.connected_no_srtp1:%s" % (self.connected_no_srtp1)</span><br><span style="color: hsl(0, 100%, 40%);">-        print "self.connected_chan2:   %s" % (self.connected_chan2)</span><br><span style="color: hsl(0, 100%, 40%);">-        print "self.connected_no_srtp2:%s" % (self.connected_no_srtp2)</span><br><span style="color: hsl(120, 100%, 40%);">+        print("self.connected_chan1:   %s" % (self.connected_chan1))</span><br><span style="color: hsl(120, 100%, 40%);">+        print("self.connected_no_srtp1:%s" % (self.connected_no_srtp1))</span><br><span style="color: hsl(120, 100%, 40%);">+        print("self.connected_chan2:   %s" % (self.connected_chan2))</span><br><span style="color: hsl(120, 100%, 40%);">+        print("self.connected_no_srtp2:%s" % (self.connected_no_srtp2))</span><br><span> </span><br><span> def main():</span><br><span>     test = SIPCallTest()</span><br><span>diff --git a/tests/channels/SIP/noload_res_srtp_attempt_srtp/run-test b/tests/channels/SIP/noload_res_srtp_attempt_srtp/run-test</span><br><span>index 3272245..0f94750 100755</span><br><span>--- a/tests/channels/SIP/noload_res_srtp_attempt_srtp/run-test</span><br><span>+++ b/tests/channels/SIP/noload_res_srtp_attempt_srtp/run-test</span><br><span>@@ -40,24 +40,23 @@</span><br><span> </span><br><span>     # Once the AMI Factory connects to Asterisk, this function fires.</span><br><span>     def ami_connect(self, ami):</span><br><span style="color: hsl(0, 100%, 40%);">-        print "AMI - connected"</span><br><span style="color: hsl(120, 100%, 40%);">+        print("AMI - connected")</span><br><span> </span><br><span>         # Register for the AMI event we are interested in.</span><br><span>         self.ami[ami.id].registerEvent("VarSet", self.ami_test_varset)</span><br><span> </span><br><span style="color: hsl(0, 100%, 40%);">-        print "Initiating test call"</span><br><span style="color: hsl(120, 100%, 40%);">+        print("Initiating test call")</span><br><span>         self.ast[0].cli_originate("SIP/2000/2000 extension 1000@siptest1")</span><br><span> </span><br><span>     # This is called whenever an AMI VarSet event occurs on Ast1.</span><br><span>     def ami_test_varset(self, ami, event):</span><br><span style="color: hsl(0, 100%, 40%);">-        print "Received VarSet event from AMI"</span><br><span style="color: hsl(0, 100%, 40%);">-        #print event</span><br><span style="color: hsl(120, 100%, 40%);">+        print("Received VarSet event from AMI")</span><br><span>         if not event.has_key("variable") or not event.has_key("value"):</span><br><span>             # These entries should always be in the VarSet event.</span><br><span style="color: hsl(0, 100%, 40%);">-            print "Event is missing 'variable' or 'value' entry"</span><br><span style="color: hsl(120, 100%, 40%);">+            print("Event is missing 'variable' or 'value' entry")</span><br><span>             return</span><br><span style="color: hsl(0, 100%, 40%);">-        print "  Value of event[variable] = %s" % (event["variable"])</span><br><span style="color: hsl(0, 100%, 40%);">-        print "  Value of event[value] = %s" % (event["value"])</span><br><span style="color: hsl(120, 100%, 40%);">+        print("  Value of event[variable] = %s" % (event["variable"]))</span><br><span style="color: hsl(120, 100%, 40%);">+        print("  Value of event[value] = %s" % (event["value"]))</span><br><span>         if event["variable"].startswith("~HASH~SIP_CAUSE~"):</span><br><span>             cause_code = event["value"].split(" ")[1]</span><br><span>             if cause_code == "488":</span><br><span>@@ -70,7 +69,7 @@</span><br><span>     # This is called by each Asterisk instance if the call gets connected.</span><br><span>     def fastagi_connect(self, agi):</span><br><span>         def get_test_result(val):</span><br><span style="color: hsl(0, 100%, 40%);">-            print "Connection result '%s'" % val</span><br><span style="color: hsl(120, 100%, 40%);">+            print("Connection result '%s'" % val)</span><br><span>             if val.split("-")[0] == "SIP/2000":</span><br><span>                 # Outgoing call on Ast1</span><br><span>                 self.connected_chan1 = True</span><br><span>@@ -82,7 +81,7 @@</span><br><span>                 if val.split("=")[1] == "1":</span><br><span>                     self.connected_srtp2 = True</span><br><span>             else:</span><br><span style="color: hsl(0, 100%, 40%);">-                print "Don't know which side is connected."</span><br><span style="color: hsl(120, 100%, 40%);">+                print("Don't know which side is connected.")</span><br><span> </span><br><span>             # Hold the AGI connection until the reactor times out</span><br><span>             # so the other side has a chance to get its test result.</span><br><span>@@ -95,13 +94,13 @@</span><br><span>         TestCase.stop_asterisk(self)</span><br><span> </span><br><span>         # Determine if the test passed</span><br><span style="color: hsl(0, 100%, 40%);">-        print "self.connected_chan1:%s" % (self.connected_chan1)</span><br><span style="color: hsl(0, 100%, 40%);">-        print "self.connected_srtp1:%s" % (self.connected_srtp1)</span><br><span style="color: hsl(0, 100%, 40%);">-        print "self.not_acceptable1:%s" % (self.not_acceptable1)</span><br><span style="color: hsl(0, 100%, 40%);">-        print "self.connected_chan2:%s" % (self.connected_chan2)</span><br><span style="color: hsl(0, 100%, 40%);">-        print "self.connected_srtp2:%s" % (self.connected_srtp2)</span><br><span style="color: hsl(120, 100%, 40%);">+        print("self.connected_chan1:%s" % (self.connected_chan1))</span><br><span style="color: hsl(120, 100%, 40%);">+        print("self.connected_srtp1:%s" % (self.connected_srtp1))</span><br><span style="color: hsl(120, 100%, 40%);">+        print("self.not_acceptable1:%s" % (self.not_acceptable1))</span><br><span style="color: hsl(120, 100%, 40%);">+        print("self.connected_chan2:%s" % (self.connected_chan2))</span><br><span style="color: hsl(120, 100%, 40%);">+        print("self.connected_srtp2:%s" % (self.connected_srtp2))</span><br><span>         if not self.connected_chan1 and not self.connected_srtp1 and self.not_acceptable1 and not self.connected_chan2 and not self.connected_srtp2:</span><br><span style="color: hsl(0, 100%, 40%);">-            print "Test passed"</span><br><span style="color: hsl(120, 100%, 40%);">+            print("Test passed")</span><br><span>             self.passed = True</span><br><span> </span><br><span> def main():</span><br><span>diff --git a/tests/channels/SIP/refer_replaces_to_self/run-test b/tests/channels/SIP/refer_replaces_to_self/run-test</span><br><span>index 2fb31f6..97fc149 100755</span><br><span>--- a/tests/channels/SIP/refer_replaces_to_self/run-test</span><br><span>+++ b/tests/channels/SIP/refer_replaces_to_self/run-test</span><br><span>@@ -19,7 +19,7 @@</span><br><span> testdir = "tests/%s" % workingdir</span><br><span> </span><br><span> def log_cb(level, str, len=len(str(str))):</span><br><span style="color: hsl(0, 100%, 40%);">-    print str,</span><br><span style="color: hsl(120, 100%, 40%);">+    print(str,)</span><br><span> </span><br><span> class TestAccountCallback(pj.AccountCallback):</span><br><span> </span><br><span>@@ -60,28 +60,28 @@</span><br><span> </span><br><span>             if call_sem:</span><br><span>                 call_sem.release()</span><br><span style="color: hsl(0, 100%, 40%);">- </span><br><span style="color: hsl(120, 100%, 40%);">+</span><br><span> </span><br><span> class ReplaceSelfTest:</span><br><span>     def __init__(self):</span><br><span>         reactor.callWhenRunning(self.run)</span><br><span> </span><br><span style="color: hsl(0, 100%, 40%);">-        print "Creating Asterisk instance ..."</span><br><span style="color: hsl(120, 100%, 40%);">+        print("Creating Asterisk instance ...")</span><br><span> </span><br><span>         self.ast1 = Asterisk(base=workingdir)</span><br><span>         self.ast1.install_configs("%s/configs" % (testdir))</span><br><span> </span><br><span>     def stop_reactor(self):</span><br><span style="color: hsl(0, 100%, 40%);">-        print "Stopping Reactor ..."</span><br><span style="color: hsl(120, 100%, 40%);">+        print("Stopping Reactor ...")</span><br><span>         if reactor.running:</span><br><span>             reactor.stop()</span><br><span> </span><br><span>     def start_asterisk(self):</span><br><span style="color: hsl(0, 100%, 40%);">-        print "Starting Asterisk instance ..."</span><br><span style="color: hsl(120, 100%, 40%);">+        print("Starting Asterisk instance ...")</span><br><span>         self.ast1.start()</span><br><span> </span><br><span>     def stop_asterisk(self):</span><br><span style="color: hsl(0, 100%, 40%);">-        print "Stopping Asterisk instance ..."</span><br><span style="color: hsl(120, 100%, 40%);">+        print("Stopping Asterisk instance ...")</span><br><span>         self.ast1.stop()</span><br><span> </span><br><span>     def run(self):</span><br><span>@@ -126,7 +126,7 @@</span><br><span>             self.stop_reactor()</span><br><span> </span><br><span>         except pj.Error, e:</span><br><span style="color: hsl(0, 100%, 40%);">-            print "Exception: " + str(e)</span><br><span style="color: hsl(120, 100%, 40%);">+            print("Exception: " + str(e))</span><br><span>             self.stop_reactor()</span><br><span> </span><br><span> def main():</span><br><span>@@ -136,10 +136,10 @@</span><br><span> </span><br><span>     global passed</span><br><span>     if passed:</span><br><span style="color: hsl(0, 100%, 40%);">-        print "PASSED"</span><br><span style="color: hsl(120, 100%, 40%);">+        print("PASSED")</span><br><span>         return 0</span><br><span> </span><br><span style="color: hsl(0, 100%, 40%);">-    print "FAILED"</span><br><span style="color: hsl(120, 100%, 40%);">+    print("FAILED")</span><br><span>     return 1</span><br><span> </span><br><span> </span><br><span>diff --git a/tests/channels/SIP/secure_bridge_media/run-test b/tests/channels/SIP/secure_bridge_media/run-test</span><br><span>index c61fa6d..c84f1ab 100755</span><br><span>--- a/tests/channels/SIP/secure_bridge_media/run-test</span><br><span>+++ b/tests/channels/SIP/secure_bridge_media/run-test</span><br><span>@@ -33,13 +33,13 @@</span><br><span>     def run(self):</span><br><span>         TestCase.run(self)</span><br><span> </span><br><span style="color: hsl(0, 100%, 40%);">-        print "Initiating test call"</span><br><span style="color: hsl(120, 100%, 40%);">+        print("Initiating test call")</span><br><span>         self.ast[0].cli_originate("Local/1000@siptest1 application playback tt-monkeys")</span><br><span> </span><br><span>     # This is called by each Asterisk instance if the call gets connected.</span><br><span>     def fastagi_connect(self, agi):</span><br><span>         def get_test_result(val):</span><br><span style="color: hsl(0, 100%, 40%);">-            print "Connection result '%s'" % val</span><br><span style="color: hsl(120, 100%, 40%);">+            print("Connection result '%s'" % val)</span><br><span>             if val.split("-")[0] == "Local/1000@siptest1":</span><br><span>                 # Outgoing call on Ast1</span><br><span>                 self.connected_chan1 = True</span><br><span>@@ -51,13 +51,13 @@</span><br><span>                 if val.split("=")[1] == "1":</span><br><span>                     self.connected_srtp2 = True</span><br><span>             else:</span><br><span style="color: hsl(0, 100%, 40%);">-                print "Don't know which side is connected."</span><br><span style="color: hsl(120, 100%, 40%);">+                print("Don't know which side is connected.")</span><br><span> </span><br><span>             # Drop the AGI connection</span><br><span>             agi.finish()</span><br><span> </span><br><span>             if self.connected_chan2 and self.connected_srtp2:</span><br><span style="color: hsl(0, 100%, 40%);">-                print "Test passed"</span><br><span style="color: hsl(120, 100%, 40%);">+                print("Test passed")</span><br><span>                 self.passed = True</span><br><span>                 self.stop_reactor()</span><br><span> </span><br><span>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</span><br><span>index 5f3a398..f40e194 100755</span><br><span>--- a/tests/channels/SIP/sip_blind_transfer/caller_refer_only/run-test</span><br><span>+++ b/tests/channels/SIP/sip_blind_transfer/caller_refer_only/run-test</span><br><span>@@ -121,17 +121,17 @@</span><br><span> </span><br><span>     def a_call_b(self):</span><br><span>         logger.debug("Phone A Calling Phone B (%s)" % BlindTransfer.phone_b_uri)</span><br><span style="color: hsl(0, 100%, 40%);">-        self.pja.stdin.write("m\n")</span><br><span style="color: hsl(0, 100%, 40%);">-        self.pja.stdin.write("%s\n" % BlindTransfer.phone_b_uri)</span><br><span style="color: hsl(120, 100%, 40%);">+        self.pja.stdin.write(b"m\n")</span><br><span style="color: hsl(120, 100%, 40%);">+        self.pja.stdin.write(b"%s\n" % BlindTransfer.phone_b_uri)</span><br><span> </span><br><span>     def a_transfer_b_to_c(self):</span><br><span>         logger.debug("Phone A Transferring Phone B to Phone C (%s)" % BlindTransfer.phone_c_uri)</span><br><span style="color: hsl(0, 100%, 40%);">-        self.pja.stdin.write("x\n")</span><br><span style="color: hsl(0, 100%, 40%);">-        self.pja.stdin.write("%s\n" % BlindTransfer.phone_c_uri)</span><br><span style="color: hsl(120, 100%, 40%);">+        self.pja.stdin.write(b"x\n")</span><br><span style="color: hsl(120, 100%, 40%);">+        self.pja.stdin.write(b"%s\n" % BlindTransfer.phone_c_uri)</span><br><span> </span><br><span>     def hangup_channel_c(self):</span><br><span>         logger.debug("Hanging up Phone C")</span><br><span style="color: hsl(0, 100%, 40%);">-        self.pjc.stdin.write("h\n")</span><br><span style="color: hsl(120, 100%, 40%);">+        self.pjc.stdin.write(b"h\n")</span><br><span> </span><br><span>     def start_processes(self):</span><br><span>         logger.debug("Starting Processes")</span><br><span>diff --git a/tests/channels/SIP/sip_one_legged_transfer_v6/run-test b/tests/channels/SIP/sip_one_legged_transfer_v6/run-test</span><br><span>index 387f1fb..0829fc7 100755</span><br><span>--- a/tests/channels/SIP/sip_one_legged_transfer_v6/run-test</span><br><span>+++ b/tests/channels/SIP/sip_one_legged_transfer_v6/run-test</span><br><span>@@ -38,12 +38,12 @@</span><br><span>         self.stopProcesses()</span><br><span> </span><br><span>         if self.passed == True:</span><br><span style="color: hsl(0, 100%, 40%);">-            print 'SIP Attended Transfer Test Passed!'</span><br><span style="color: hsl(120, 100%, 40%);">+            print('SIP Attended Transfer Test Passed!')</span><br><span>         else:</span><br><span style="color: hsl(0, 100%, 40%);">-            print 'SIP Attended Transfer Test Failed'</span><br><span style="color: hsl(120, 100%, 40%);">+            print('SIP Attended Transfer Test Failed')</span><br><span> </span><br><span>         if reactor.running:</span><br><span style="color: hsl(0, 100%, 40%);">-            print "Stopping Reactor ..."</span><br><span style="color: hsl(120, 100%, 40%);">+            print("Stopping Reactor ...")</span><br><span>             reactor.stop()</span><br><span> </span><br><span>     def amiOnConnect(self, ami):</span><br><span>@@ -60,14 +60,14 @@</span><br><span>         self.ami_factory.login('127.0.0.1', 5038).addCallbacks(self.amiOnConnect, self.amiLoginError)</span><br><span> </span><br><span>     def checkBridgeResult(self, result):</span><br><span style="color: hsl(0, 100%, 40%);">-        print 'Result', result</span><br><span style="color: hsl(120, 100%, 40%);">+        print('Result', result)</span><br><span>         if "bridgedchannel" not in result[0]:</span><br><span style="color: hsl(0, 100%, 40%);">-            print "bridgedchannel was not a valid key."</span><br><span style="color: hsl(120, 100%, 40%);">+            print("bridgedchannel was not a valid key.")</span><br><span>         elif result[0]['bridgedchannel'] == 'SIP/end_b-00000001':</span><br><span>             self.passed = True</span><br><span> </span><br><span>         if "link" not in result[0]:</span><br><span style="color: hsl(0, 100%, 40%);">-            print "'link' was not a valid key."</span><br><span style="color: hsl(120, 100%, 40%);">+            print("'link' was not a valid key.")</span><br><span>         elif result[0]['link'] == 'SIP/end_b-00000001': # check link for older versions of asterisk</span><br><span>             self.passed = True</span><br><span> </span><br><span>@@ -78,7 +78,7 @@</span><br><span> </span><br><span> </span><br><span>     def checkBridgeError(self, reason):</span><br><span style="color: hsl(0, 100%, 40%);">-        print reason.getTraceback()</span><br><span style="color: hsl(120, 100%, 40%);">+        print(reason.getTraceback())</span><br><span>         self.logLastStep("Checking Bridge failed.  Channel did not exist.")</span><br><span>         reactor.callLater(1, self.readResult)</span><br><span> </span><br><span>@@ -126,7 +126,7 @@</span><br><span> </span><br><span> </span><br><span>     def logLastStep(self, step):</span><br><span style="color: hsl(0, 100%, 40%);">-        print step</span><br><span style="color: hsl(120, 100%, 40%);">+        print(step)</span><br><span>         self.lastStep = step</span><br><span> </span><br><span>     def run(self):</span><br><span>diff --git a/tests/channels/SIP/sip_srtp/srtp_call/run-test b/tests/channels/SIP/sip_srtp/srtp_call/run-test</span><br><span>index ee9c2fc..5013ee8 100755</span><br><span>--- a/tests/channels/SIP/sip_srtp/srtp_call/run-test</span><br><span>+++ b/tests/channels/SIP/sip_srtp/srtp_call/run-test</span><br><span>@@ -34,13 +34,13 @@</span><br><span>     def run(self):</span><br><span>         TestCase.run(self)</span><br><span> </span><br><span style="color: hsl(0, 100%, 40%);">-        print "Initiating test call"</span><br><span style="color: hsl(120, 100%, 40%);">+        print("Initiating test call")</span><br><span>         self.ast[0].cli_originate("SIP/2000/2000 extension 1000@siptest1")</span><br><span> </span><br><span>     # This is called by each Asterisk instance if the call gets connected.</span><br><span>     def fastagi_connect(self, agi):</span><br><span>         def get_test_result(val):</span><br><span style="color: hsl(0, 100%, 40%);">-            print "Connection result '%s'" % val</span><br><span style="color: hsl(120, 100%, 40%);">+            print("Connection result '%s'" % val)</span><br><span>             if val.split("-")[0] == "SIP/2000":</span><br><span>                 # Outgoing call on Ast1</span><br><span>                 self.connected_chan1 = True</span><br><span>@@ -52,10 +52,10 @@</span><br><span>                 if val.split("=")[1] == "1":</span><br><span>                     self.connected_srtp2 = True</span><br><span>             else:</span><br><span style="color: hsl(0, 100%, 40%);">-                print "Don't know which side is connected."</span><br><span style="color: hsl(120, 100%, 40%);">+                print("Don't know which side is connected.")</span><br><span> </span><br><span>             if self.connected_chan1 and self.connected_srtp1 and self.connected_chan2 and self.connected_srtp2:</span><br><span style="color: hsl(0, 100%, 40%);">-                print "Test passed"</span><br><span style="color: hsl(120, 100%, 40%);">+                print("Test passed")</span><br><span>                 for a in self.agis:</span><br><span>                     a.finish()</span><br><span>                 self.agis = []</span><br><span>diff --git a/tests/channels/SIP/tcpauthtimeout/timeout_should_happen/timeout.py b/tests/channels/SIP/tcpauthtimeout/timeout_should_happen/timeout.py</span><br><span>index 4545136..dee2c92 100644</span><br><span>--- a/tests/channels/SIP/tcpauthtimeout/timeout_should_happen/timeout.py</span><br><span>+++ b/tests/channels/SIP/tcpauthtimeout/timeout_should_happen/timeout.py</span><br><span>@@ -23,12 +23,12 @@</span><br><span> data in all cases.</span><br><span> '''</span><br><span> TCP_MESSAGES = [</span><br><span style="color: hsl(0, 100%, 40%);">-    [],</span><br><span style="color: hsl(0, 100%, 40%);">-    ['hi, this is your tester standby'],</span><br><span style="color: hsl(0, 100%, 40%);">-    ['INVITE sip:service@127.0.0.1:5060 SIP/2.0\r\n'],</span><br><span style="color: hsl(0, 100%, 40%);">-    ['hi, this is your tester standby',</span><br><span style="color: hsl(0, 100%, 40%);">-     'hi, this is your tester, again... standby',</span><br><span style="color: hsl(0, 100%, 40%);">-     'guess who?! yup, your tester... standby\r\n']</span><br><span style="color: hsl(120, 100%, 40%);">+    [b""],</span><br><span style="color: hsl(120, 100%, 40%);">+    [b"hi, this is your tester standby"],</span><br><span style="color: hsl(120, 100%, 40%);">+    [b"INVITE sip:service@127.0.0.1:5060 SIP/2.0\r\n"],</span><br><span style="color: hsl(120, 100%, 40%);">+    [b"hi, this is your tester standby",</span><br><span style="color: hsl(120, 100%, 40%);">+     b"hi, this is your tester, again... standby",</span><br><span style="color: hsl(120, 100%, 40%);">+     b"guess who?! yup, your tester... standby\r\n"]</span><br><span> ]</span><br><span> </span><br><span> </span><br><span>diff --git a/tests/channels/pjsip/resolver/naptr/explicit_transport_configured/dns_zones/example.com b/tests/channels/pjsip/resolver/naptr/explicit_transport_configured/dns_zones/example.com</span><br><span>index 7c734e3..cc8e864 100644</span><br><span>--- a/tests/channels/pjsip/resolver/naptr/explicit_transport_configured/dns_zones/example.com</span><br><span>+++ b/tests/channels/pjsip/resolver/naptr/explicit_transport_configured/dns_zones/example.com</span><br><span>@@ -25,7 +25,7 @@</span><br><span>         minimum = "1H"</span><br><span>     ),</span><br><span> </span><br><span style="color: hsl(0, 100%, 40%);">-    NAPTR('naptr.example.com', 0, 1, 'S', 'SIP+D2U', '', '_sip._udp.example.com'),</span><br><span style="color: hsl(120, 100%, 40%);">+    NAPTR('naptr.example.com', 0, 1, b"S", b"SIP+D2U", b"", '_sip._udp.example.com'),</span><br><span>     SRV('_sip._udp.example.com', 0, 1, 5061, 'main.example.com'),</span><br><span>     A('main.example.com', '127.0.0.1'),</span><br><span>     AAAA('main.example.com', '::1'),</span><br><span>diff --git a/tests/channels/pjsip/resolver/naptr/order/dns_zones/example.com b/tests/channels/pjsip/resolver/naptr/order/dns_zones/example.com</span><br><span>index de1cc60..5ee452f 100644</span><br><span>--- a/tests/channels/pjsip/resolver/naptr/order/dns_zones/example.com</span><br><span>+++ b/tests/channels/pjsip/resolver/naptr/order/dns_zones/example.com</span><br><span>@@ -25,8 +25,8 @@</span><br><span>         minimum = "1H"</span><br><span>     ),</span><br><span> </span><br><span style="color: hsl(0, 100%, 40%);">-    NAPTR('example.com', 50, 50, 'S', 'SIP+D2T', '', '_sip._tcp.example.com'),</span><br><span style="color: hsl(0, 100%, 40%);">-    NAPTR('example.com', 90, 40, 'S', 'SIP+D2U', '', '_sip._udp.example.com'),</span><br><span style="color: hsl(120, 100%, 40%);">+    NAPTR('example.com', 50, 50, b"S", b"SIP+D2T", b"", '_sip._tcp.example.com'),</span><br><span style="color: hsl(120, 100%, 40%);">+    NAPTR('example.com', 90, 40, b"S", b"SIP+D2U", b"", '_sip._udp.example.com'),</span><br><span>     SRV('_sip._tcp.example.com', 0, 1, 5061, 'pbx.example.com'),</span><br><span>     SRV('_sip._udp.example.com', 0, 1, 5061, 'pbx.example.com'),</span><br><span>     A('pbx.example.com', '127.0.0.1'),</span><br><span>diff --git a/tests/channels/pjsip/resolver/naptr/preference/dns_zones/example.com b/tests/channels/pjsip/resolver/naptr/preference/dns_zones/example.com</span><br><span>index 7e563df..dc2631a 100644</span><br><span>--- a/tests/channels/pjsip/resolver/naptr/preference/dns_zones/example.com</span><br><span>+++ b/tests/channels/pjsip/resolver/naptr/preference/dns_zones/example.com</span><br><span>@@ -25,8 +25,8 @@</span><br><span>         minimum = "1H"</span><br><span>     ),</span><br><span> </span><br><span style="color: hsl(0, 100%, 40%);">-    NAPTR('example.com', 50, 50, 'S', 'SIP+D2T', '', '_sip._tcp.example.com'),</span><br><span style="color: hsl(0, 100%, 40%);">-    NAPTR('example.com', 50, 90, 'S', 'SIP+D2U', '', '_sip._udp.example.com'),</span><br><span style="color: hsl(120, 100%, 40%);">+    NAPTR('example.com', 50, 50, b"S", b"SIP+D2T", b"", '_sip._tcp.example.com'),</span><br><span style="color: hsl(120, 100%, 40%);">+    NAPTR('example.com', 50, 90, b"S", b"SIP+D2U", b"", '_sip._udp.example.com'),</span><br><span>     SRV('_sip._tcp.example.com', 0, 1, 5061, 'pbx.example.com'),</span><br><span>     SRV('_sip._udp.example.com', 0, 1, 5061, 'pbx.example.com'),</span><br><span>     A('pbx.example.com', '127.0.0.1'),</span><br><span>diff --git a/tests/channels/pjsip/resolver/naptr/preference_failover/dns_zones/example.com b/tests/channels/pjsip/resolver/naptr/preference_failover/dns_zones/example.com</span><br><span>index aabb875..0389aac 100644</span><br><span>--- a/tests/channels/pjsip/resolver/naptr/preference_failover/dns_zones/example.com</span><br><span>+++ b/tests/channels/pjsip/resolver/naptr/preference_failover/dns_zones/example.com</span><br><span>@@ -25,8 +25,8 @@</span><br><span>         minimum = "1H"</span><br><span>     ),</span><br><span> </span><br><span style="color: hsl(0, 100%, 40%);">-    NAPTR('example.com', 50, 50, 'S', 'SIP+D2T', '', '_sip._tcp.example.com'),</span><br><span style="color: hsl(0, 100%, 40%);">-    NAPTR('example.com', 50, 90, 'S', 'SIP+D2U', '', '_sip._udp.example.com'),</span><br><span style="color: hsl(120, 100%, 40%);">+    NAPTR('example.com', 50, 50, b"S", b"SIP+D2T", b"", '_sip._tcp.example.com'),</span><br><span style="color: hsl(120, 100%, 40%);">+    NAPTR('example.com', 50, 90, b"S", b"SIP+D2U", b"", '_sip._udp.example.com'),</span><br><span>     SRV('_sip._udp.example.com', 0, 1, 5061, 'pbx.example.com'),</span><br><span>     A('pbx.example.com', '127.0.0.1'),</span><br><span> ]</span><br><span>diff --git a/tests/channels/pjsip/resolver/naptr/restricted_transport/dns_zones/example.com b/tests/channels/pjsip/resolver/naptr/restricted_transport/dns_zones/example.com</span><br><span>index 7e563df..dc2631a 100644</span><br><span>--- a/tests/channels/pjsip/resolver/naptr/restricted_transport/dns_zones/example.com</span><br><span>+++ b/tests/channels/pjsip/resolver/naptr/restricted_transport/dns_zones/example.com</span><br><span>@@ -25,8 +25,8 @@</span><br><span>         minimum = "1H"</span><br><span>     ),</span><br><span> </span><br><span style="color: hsl(0, 100%, 40%);">-    NAPTR('example.com', 50, 50, 'S', 'SIP+D2T', '', '_sip._tcp.example.com'),</span><br><span style="color: hsl(0, 100%, 40%);">-    NAPTR('example.com', 50, 90, 'S', 'SIP+D2U', '', '_sip._udp.example.com'),</span><br><span style="color: hsl(120, 100%, 40%);">+    NAPTR('example.com', 50, 50, b"S", b"SIP+D2T", b"", '_sip._tcp.example.com'),</span><br><span style="color: hsl(120, 100%, 40%);">+    NAPTR('example.com', 50, 90, b"S", b"SIP+D2U", b"", '_sip._udp.example.com'),</span><br><span>     SRV('_sip._tcp.example.com', 0, 1, 5061, 'pbx.example.com'),</span><br><span>     SRV('_sip._udp.example.com', 0, 1, 5061, 'pbx.example.com'),</span><br><span>     A('pbx.example.com', '127.0.0.1'),</span><br><span>diff --git a/tests/channels/pjsip/resolver/naptr/transport_tcp/dns_zones/example.com b/tests/channels/pjsip/resolver/naptr/transport_tcp/dns_zones/example.com</span><br><span>index c0baf68..c96b88c 100644</span><br><span>--- a/tests/channels/pjsip/resolver/naptr/transport_tcp/dns_zones/example.com</span><br><span>+++ b/tests/channels/pjsip/resolver/naptr/transport_tcp/dns_zones/example.com</span><br><span>@@ -25,8 +25,8 @@</span><br><span>         minimum = "1H"</span><br><span>     ),</span><br><span> </span><br><span style="color: hsl(0, 100%, 40%);">-    NAPTR('naptr.example.com', 0, 1, 'S', 'SIP+D2T', '', '_sip._tcp.example.com'),</span><br><span style="color: hsl(0, 100%, 40%);">-    NAPTR('naptr.example.com', 0, 2, 'S', 'SIP+D2U', '', '_sip._udp.example.com'),</span><br><span style="color: hsl(120, 100%, 40%);">+    NAPTR('naptr.example.com', 0, 1, b"S", b"SIP+D2T", b"", '_sip._tcp.example.com'),</span><br><span style="color: hsl(120, 100%, 40%);">+    NAPTR('naptr.example.com', 0, 2, b"S", b"SIP+D2U", b"", '_sip._udp.example.com'),</span><br><span>     SRV('_sip._tcp.example.com', 0, 1, 5061, 'pbx.example.com'),</span><br><span>     SRV('_sip._udp.example.com', 0, 1, 5061, 'pbx.example.com'),</span><br><span>     A('pbx.example.com', '127.0.0.1'),</span><br><span>diff --git a/tests/channels/pjsip/resolver/naptr/transport_udp/dns_zones/example.com b/tests/channels/pjsip/resolver/naptr/transport_udp/dns_zones/example.com</span><br><span>index c0baf68..c96b88c 100644</span><br><span>--- a/tests/channels/pjsip/resolver/naptr/transport_udp/dns_zones/example.com</span><br><span>+++ b/tests/channels/pjsip/resolver/naptr/transport_udp/dns_zones/example.com</span><br><span>@@ -25,8 +25,8 @@</span><br><span>         minimum = "1H"</span><br><span>     ),</span><br><span> </span><br><span style="color: hsl(0, 100%, 40%);">-    NAPTR('naptr.example.com', 0, 1, 'S', 'SIP+D2T', '', '_sip._tcp.example.com'),</span><br><span style="color: hsl(0, 100%, 40%);">-    NAPTR('naptr.example.com', 0, 2, 'S', 'SIP+D2U', '', '_sip._udp.example.com'),</span><br><span style="color: hsl(120, 100%, 40%);">+    NAPTR('naptr.example.com', 0, 1, b"S", b"SIP+D2T", b"", '_sip._tcp.example.com'),</span><br><span style="color: hsl(120, 100%, 40%);">+    NAPTR('naptr.example.com', 0, 2, b"S", b"SIP+D2U", b"", '_sip._udp.example.com'),</span><br><span>     SRV('_sip._tcp.example.com', 0, 1, 5061, 'pbx.example.com'),</span><br><span>     SRV('_sip._udp.example.com', 0, 1, 5061, 'pbx.example.com'),</span><br><span>     A('pbx.example.com', '127.0.0.1'),</span><br><span>diff --git a/tests/channels/pjsip/resolver/naptr/transport_unspecified/dns_zones/example.com b/tests/channels/pjsip/resolver/naptr/transport_unspecified/dns_zones/example.com</span><br><span>index c0baf68..6a16279 100644</span><br><span>--- a/tests/channels/pjsip/resolver/naptr/transport_unspecified/dns_zones/example.com</span><br><span>+++ b/tests/channels/pjsip/resolver/naptr/transport_unspecified/dns_zones/example.com</span><br><span>@@ -25,9 +25,10 @@</span><br><span>         minimum = "1H"</span><br><span>     ),</span><br><span> </span><br><span style="color: hsl(0, 100%, 40%);">-    NAPTR('naptr.example.com', 0, 1, 'S', 'SIP+D2T', '', '_sip._tcp.example.com'),</span><br><span style="color: hsl(0, 100%, 40%);">-    NAPTR('naptr.example.com', 0, 2, 'S', 'SIP+D2U', '', '_sip._udp.example.com'),</span><br><span style="color: hsl(120, 100%, 40%);">+    A('pbx.example.com', '127.0.0.1'),</span><br><span>     SRV('_sip._tcp.example.com', 0, 1, 5061, 'pbx.example.com'),</span><br><span>     SRV('_sip._udp.example.com', 0, 1, 5061, 'pbx.example.com'),</span><br><span style="color: hsl(0, 100%, 40%);">-    A('pbx.example.com', '127.0.0.1'),</span><br><span style="color: hsl(120, 100%, 40%);">+    NAPTR('naptr.example.com', 0, 1, b"S", b"SIP+D2T", b"", '_sip._tcp.example.com'),</span><br><span style="color: hsl(120, 100%, 40%);">+    NAPTR('naptr.example.com', 0, 2, b"S", b"SIP+D2U", b"", '_sip._udp.example.com'),</span><br><span style="color: hsl(120, 100%, 40%);">+</span><br><span> ]</span><br><span>diff --git a/tests/channels/pjsip/rtp/bind_rtp_to_media_address/rtp.py b/tests/channels/pjsip/rtp/bind_rtp_to_media_address/rtp.py</span><br><span>index 2c79e5c..abf2949 100644</span><br><span>--- a/tests/channels/pjsip/rtp/bind_rtp_to_media_address/rtp.py</span><br><span>+++ b/tests/channels/pjsip/rtp/bind_rtp_to_media_address/rtp.py</span><br><span>@@ -18,9 +18,10 @@</span><br><span>     def __init__(self, test_object):</span><br><span>         self.test_object = test_object</span><br><span> </span><br><span style="color: hsl(0, 100%, 40%);">-    def datagramReceived(self, data, (host, port)):</span><br><span style="color: hsl(120, 100%, 40%);">+    def datagramReceived(self, data, addr):</span><br><span style="color: hsl(120, 100%, 40%);">+        (host, port) = addr</span><br><span>         if self.packet_count == 0 and host != "127.0.0.3":</span><br><span style="color: hsl(0, 100%, 40%);">-            LOGGER.error("Received RTP from wrong ip address: %s %s" % (host,port))</span><br><span style="color: hsl(120, 100%, 40%);">+            LOGGER.error("Received RTP from wrong ip address: %s %s" % host,port)</span><br><span>             self.test_object.set_passed(False)</span><br><span>         self.packet_count += 1</span><br><span> </span><br><span>diff --git a/tests/channels/pjsip/rtp/rtp_keepalive/base/rtp.py b/tests/channels/pjsip/rtp/rtp_keepalive/base/rtp.py</span><br><span>index 633971d..f069ea1 100644</span><br><span>--- a/tests/channels/pjsip/rtp/rtp_keepalive/base/rtp.py</span><br><span>+++ b/tests/channels/pjsip/rtp/rtp_keepalive/base/rtp.py</span><br><span>@@ -25,7 +25,7 @@</span><br><span>         self.test_object = test_object</span><br><span>         self.test_object.register_stop_observer(self.asterisk_stopped)</span><br><span> </span><br><span style="color: hsl(0, 100%, 40%);">-    def datagramReceived(self, data, (host, port)):</span><br><span style="color: hsl(120, 100%, 40%);">+    def datagramReceived(self, data, addr):</span><br><span>         rtp_header = RTPPacket.rtp_header.parse(data)</span><br><span>         LOGGER.debug("Parsed RTP packet is {0}".format(rtp_header))</span><br><span>         if rtp_header.payload_type == 13:</span><br><span>diff --git a/tests/channels/pjsip/rtp/rtp_keepalive/direct_media/rtp.py b/tests/channels/pjsip/rtp/rtp_keepalive/direct_media/rtp.py</span><br><span>index bd4eff3..5f54078 100644</span><br><span>--- a/tests/channels/pjsip/rtp/rtp_keepalive/direct_media/rtp.py</span><br><span>+++ b/tests/channels/pjsip/rtp/rtp_keepalive/direct_media/rtp.py</span><br><span>@@ -16,7 +16,7 @@</span><br><span>     def __init__(self, test_object):</span><br><span>         self.test_object = test_object</span><br><span> </span><br><span style="color: hsl(0, 100%, 40%);">-    def datagramReceived(self, data, (host, port)):</span><br><span style="color: hsl(120, 100%, 40%);">+    def datagramReceived(self, data, addr):</span><br><span>         LOGGER.error("Received RTP from Asterisk unexpectedly")</span><br><span>         self.test_object.set_passed(False)</span><br><span>         self.test_object.stop_reactor()</span><br><span>diff --git a/tests/codecs/audio_analyzer.py b/tests/codecs/audio_analyzer.py</span><br><span>index 9c01928..630e31e 100644</span><br><span>--- a/tests/codecs/audio_analyzer.py</span><br><span>+++ b/tests/codecs/audio_analyzer.py</span><br><span>@@ -185,7 +185,7 @@</span><br><span>                 'channel': 'PJSIP/audio',</span><br><span>                 'application': 'Record',</span><br><span>                 'data': self.output_file + ',,,k',</span><br><span style="color: hsl(0, 100%, 40%);">-                'async': 'True'</span><br><span style="color: hsl(120, 100%, 40%);">+                'asyncrn': 'True'</span><br><span>             }]</span><br><span> </span><br><span>         super(Analyzer, self).__init__(test_path, test_config)</span><br><span>diff --git a/tests/fastagi/channel-status/run-test b/tests/fastagi/channel-status/run-test</span><br><span>index 7271905..aa95353 100755</span><br><span>--- a/tests/fastagi/channel-status/run-test</span><br><span>+++ b/tests/fastagi/channel-status/run-test</span><br><span>@@ -24,10 +24,10 @@</span><br><span>         self.create_fastagi_factory()</span><br><span> </span><br><span>     def on_answer_failure(self, reason):</span><br><span style="color: hsl(0, 100%, 40%);">-        print 'Could not answer the call:', reason.getTraceback()</span><br><span style="color: hsl(120, 100%, 40%);">+        print('Could not answer the call:', reason.getTraceback())</span><br><span> </span><br><span>     def on_failure(self, reason):</span><br><span style="color: hsl(0, 100%, 40%);">-        print 'Could not run deferred:', reason.getTraceback()</span><br><span style="color: hsl(120, 100%, 40%);">+        print('Could not run deferred:', reason.getTraceback())</span><br><span> </span><br><span>     def on_answer(self, status):</span><br><span>         self.fastagi_connect(self.agi)</span><br><span>@@ -36,10 +36,10 @@</span><br><span>         return agi.channelStatus(agi.variables['agi_channel'])</span><br><span> </span><br><span>     def finish_test(self, status):</span><br><span style="color: hsl(0, 100%, 40%);">-        print "status is", status</span><br><span style="color: hsl(120, 100%, 40%);">+        print("status is", status)</span><br><span>         self.test_status[status] = (self.test == status)</span><br><span>         if self.test == 4:</span><br><span style="color: hsl(0, 100%, 40%);">-            print "Answering call"</span><br><span style="color: hsl(120, 100%, 40%);">+            print("Answering call")</span><br><span>             self.test = 6</span><br><span>             self.agi.answer().addCallback(self.on_answer).addErrback(</span><br><span>                 self.on_answer_failure)</span><br><span>@@ -51,9 +51,9 @@</span><br><span>     def fastagi_connect(self, agi):</span><br><span>         self.agi = agi</span><br><span>         if self.test == 4:</span><br><span style="color: hsl(0, 100%, 40%);">-            print "Connection established. Testing for channel status code 4."</span><br><span style="color: hsl(120, 100%, 40%);">+            print("Connection established. Testing for channel status code 4.")</span><br><span>         elif self.test == 6:</span><br><span style="color: hsl(0, 100%, 40%);">-            print "Testing for channel status code 6."</span><br><span style="color: hsl(120, 100%, 40%);">+            print("Testing for channel status code 6.")</span><br><span> </span><br><span>         return self.get_deferred(agi).addCallback(</span><br><span>             self.finish_test).addErrback(self.on_failure)</span><br><span>@@ -63,15 +63,15 @@</span><br><span>         self.agi.finish()</span><br><span>         self.stop_reactor()</span><br><span>         if self.test_status[4] is True and self.test_status[6] is True:</span><br><span style="color: hsl(0, 100%, 40%);">-            print "Success"</span><br><span style="color: hsl(120, 100%, 40%);">+            print("Success")</span><br><span>         else:</span><br><span style="color: hsl(0, 100%, 40%);">-            print "Failed"</span><br><span style="color: hsl(120, 100%, 40%);">+            print("Failed")</span><br><span> </span><br><span>     def launch_test(self):</span><br><span style="color: hsl(0, 100%, 40%);">-        print "Originating call to begin test."</span><br><span style="color: hsl(120, 100%, 40%);">+        print("Originating call to begin test.")</span><br><span>         self.ast[0].cli_originate("Local/no_answer@agitest extension echo@agitest")</span><br><span> </span><br><span style="color: hsl(0, 100%, 40%);">-    # Read result before timeout </span><br><span style="color: hsl(120, 100%, 40%);">+    # Read result before timeout</span><br><span>     def result_changed(self):</span><br><span>         if self.test_status[6] is not None:</span><br><span>             self.read_result()</span><br><span>diff --git a/tests/fastagi/connect/run-test b/tests/fastagi/connect/run-test</span><br><span>index 491c96a..d2c7f60 100755</span><br><span>--- a/tests/fastagi/connect/run-test</span><br><span>+++ b/tests/fastagi/connect/run-test</span><br><span>@@ -22,13 +22,13 @@</span><br><span>         self.create_fastagi_factory()</span><br><span> </span><br><span>     def fastagi_connect(self, agi):</span><br><span style="color: hsl(0, 100%, 40%);">-        print "Connection established."</span><br><span style="color: hsl(120, 100%, 40%);">+        print("Connection established.")</span><br><span>         self.passed = True</span><br><span>         self.result_changed()</span><br><span>         return agi.finish()</span><br><span> </span><br><span>     def launch_test(self):</span><br><span style="color: hsl(0, 100%, 40%);">-        print "Originating call to begin test."</span><br><span style="color: hsl(120, 100%, 40%);">+        print("Originating call to begin test.")</span><br><span>         self.ast[0].cli_originate("Local/501@agitest extension echo@agitest")</span><br><span> </span><br><span>     def result_changed(self):</span><br><span>diff --git a/tests/fastagi/database/run-test b/tests/fastagi/database/run-test</span><br><span>index 7df64f4..3d98f4e 100755</span><br><span>--- a/tests/fastagi/database/run-test</span><br><span>+++ b/tests/fastagi/database/run-test</span><br><span>@@ -25,55 +25,55 @@</span><br><span>         self.create_fastagi_factory()</span><br><span> </span><br><span>     def on_del_failure(self, reason):</span><br><span style="color: hsl(0, 100%, 40%);">-        print 'Could not delete the data from the database.'</span><br><span style="color: hsl(0, 100%, 40%);">-        print reason.getTraceback()</span><br><span style="color: hsl(120, 100%, 40%);">+        print('Could not delete the data from the database.')</span><br><span style="color: hsl(120, 100%, 40%);">+        print(reason.getTraceback())</span><br><span>         self.passed["Del"] = False</span><br><span>         self.result_changed()</span><br><span> </span><br><span>     def on_set_failure(self, reason):</span><br><span style="color: hsl(0, 100%, 40%);">-        print 'Could not set a new value.'</span><br><span style="color: hsl(0, 100%, 40%);">-        print reason.getTraceback()</span><br><span style="color: hsl(120, 100%, 40%);">+        print('Could not set a new value.')</span><br><span style="color: hsl(120, 100%, 40%);">+        print(reason.getTraceback())</span><br><span>         self.passed["Set"] = False</span><br><span> </span><br><span>     def on_get_failure(self, reason):</span><br><span style="color: hsl(0, 100%, 40%);">-        print 'Could not get the data from the database.'</span><br><span style="color: hsl(0, 100%, 40%);">-        print reason.getTraceback()</span><br><span style="color: hsl(120, 100%, 40%);">+        print('Could not get the data from the database.')</span><br><span style="color: hsl(120, 100%, 40%);">+        print(reason.getTraceback())</span><br><span>         self.passed["Get"] = False</span><br><span> </span><br><span>     # We expect this to get called when we try to select</span><br><span>     # the key we've just deleted from the database.</span><br><span>     def on_get3_failure(self, reason):</span><br><span style="color: hsl(0, 100%, 40%);">-        print "%s is no longer a valid key." % self.key</span><br><span style="color: hsl(120, 100%, 40%);">+        print("%s is no longer a valid key." % self.key)</span><br><span>         self.passed["Del"] = True</span><br><span>         self.result_changed()</span><br><span> </span><br><span>     def on_put_failure(self, reason):</span><br><span style="color: hsl(0, 100%, 40%);">-        print 'Could not put the data into the database.'</span><br><span style="color: hsl(0, 100%, 40%);">-        print reason.getTraceback()</span><br><span style="color: hsl(120, 100%, 40%);">+        print('Could not put the data into the database.')</span><br><span style="color: hsl(120, 100%, 40%);">+        print(reason.getTraceback())</span><br><span>         self.passed["Put"] = False</span><br><span>         self.result_changed()</span><br><span> </span><br><span>     def get_result_from_put(self, result):</span><br><span>         self.passed["Put"] = True</span><br><span>         # 2. Retrieve that key from the database</span><br><span style="color: hsl(0, 100%, 40%);">-        print "Retrieving key from the database."</span><br><span style="color: hsl(120, 100%, 40%);">+        print("Retrieving key from the database.")</span><br><span>         self.agi.databaseGet("secret", self.key).addCallback(</span><br><span>             self.get_result_from_get).addErrback(self.on_get_failure)</span><br><span> </span><br><span>     # 2. Retrieve that key from the database</span><br><span>     def get_result_from_get(self, result):</span><br><span style="color: hsl(0, 100%, 40%);">-        print 'Value of %s is "%s"' % (self.key, result)</span><br><span style="color: hsl(120, 100%, 40%);">+        print('Value of %s is "%s"' % (self.key, result))</span><br><span>         if result == "juststarted":</span><br><span>             self.passed["Get"] = True</span><br><span>         else:</span><br><span>             # If the call to databaseGet() succeeds but the value is wrong,</span><br><span>             # the previous call to databasePut() failed.</span><br><span>             self.passed["Put"] = False</span><br><span style="color: hsl(0, 100%, 40%);">-            print "Call to DATABASE GET succeeded, but value is wrong."</span><br><span style="color: hsl(0, 100%, 40%);">-            print 'Expected value of "juststarted" but got "%s"' % result</span><br><span style="color: hsl(120, 100%, 40%);">+            print("Call to DATABASE GET succeeded, but value is wrong.")</span><br><span style="color: hsl(120, 100%, 40%);">+            print('Expected value of "juststarted" but got "%s"' % result)</span><br><span> </span><br><span>         # 3. Update the value of the key in the database</span><br><span style="color: hsl(0, 100%, 40%);">-        print "Updating value of key."</span><br><span style="color: hsl(120, 100%, 40%);">+        print("Updating value of key.")</span><br><span>         self.agi.databaseSet("secret", self.key, "halfwaydone").addCallback(</span><br><span>             self.get_result_from_set).addErrback(self.on_set_failure)</span><br><span> </span><br><span>@@ -84,25 +84,25 @@</span><br><span>         # This should never happen.</span><br><span>         else:</span><br><span>             self.passed["Set"] = False</span><br><span style="color: hsl(0, 100%, 40%);">-            print "Something went horribly wrong."</span><br><span style="color: hsl(120, 100%, 40%);">+            print("Something went horribly wrong.")</span><br><span> </span><br><span>         # 4. Test for new value</span><br><span style="color: hsl(0, 100%, 40%);">-        print "Checking new value of key."</span><br><span style="color: hsl(120, 100%, 40%);">+        print("Checking new value of key.")</span><br><span>         self.agi.databaseGet("secret",self.key).addCallback(</span><br><span>             self.get_result_from_get2</span><br><span>         ).addErrback(self.on_get_failure)</span><br><span> </span><br><span>     # 4. Test for new value</span><br><span>     def get_result_from_get2(self, result):</span><br><span style="color: hsl(0, 100%, 40%);">-        print 'Value of %s is "%s"' % (self.key, result)</span><br><span style="color: hsl(120, 100%, 40%);">+        print('Value of %s is "%s"' % (self.key, result))</span><br><span>         if result != "halfwaydone":</span><br><span>             self.passed["Set"] = False</span><br><span style="color: hsl(0, 100%, 40%);">-            print "Call to DATABASE SET succeeded, \</span><br><span style="color: hsl(0, 100%, 40%);">-                but value did not get updated."</span><br><span style="color: hsl(0, 100%, 40%);">-            print 'Expected value of "halfwaydone" but got "%s"' % result</span><br><span style="color: hsl(120, 100%, 40%);">+            print("Call to DATABASE SET succeeded, \</span><br><span style="color: hsl(120, 100%, 40%);">+                but value did not get updated.")</span><br><span style="color: hsl(120, 100%, 40%);">+            print('Expected value of "halfwaydone" but got "%s"' % result)</span><br><span> </span><br><span>         # 5. Delete that key from the database</span><br><span style="color: hsl(0, 100%, 40%);">-        print "Deleting key from database."</span><br><span style="color: hsl(120, 100%, 40%);">+        print("Deleting key from database.")</span><br><span>         self.agi.databaseDel("secret",self.key).addCallback(</span><br><span>             self.get_result_from_del).addErrback(self.on_del_failure)</span><br><span> </span><br><span>@@ -113,17 +113,17 @@</span><br><span>         # This should never happen.</span><br><span>         else:</span><br><span>             self.passed["Del"] = False</span><br><span style="color: hsl(0, 100%, 40%);">-            print "Something went horribly wrong."</span><br><span style="color: hsl(120, 100%, 40%);">+            print("Something went horribly wrong.")</span><br><span> </span><br><span>         # 6. Test that key was deleted.</span><br><span style="color: hsl(0, 100%, 40%);">-        print "Checking that key was deleted."</span><br><span style="color: hsl(120, 100%, 40%);">+        print("Checking that key was deleted.")</span><br><span>         self.agi.databaseGet("secret",self.key).addCallback(</span><br><span>             self.get_result_from_get3).addErrback(self.on_get3_failure)</span><br><span> </span><br><span>     # 6. Test that key was deleted.</span><br><span>     # This should never be called if databaseDel() succeeded.</span><br><span>     def get_result_from_get3(self, result):</span><br><span style="color: hsl(0, 100%, 40%);">-        print "Value of %s is %s" % (self.key, result)</span><br><span style="color: hsl(120, 100%, 40%);">+        print("Value of %s is %s" % (self.key, result))</span><br><span>         if result is not None:</span><br><span>             self.passed["Del"] = False</span><br><span>         # This should never happen.</span><br><span>@@ -141,13 +141,13 @@</span><br><span>     # 6. Test that key was deleted.</span><br><span>     def fastagi_connect(self, agi):</span><br><span>         self.agi = agi</span><br><span style="color: hsl(0, 100%, 40%);">-        print "Inserting key into database."</span><br><span style="color: hsl(120, 100%, 40%);">+        print("Inserting key into database.")</span><br><span>         return agi.databaseSet("secret", self.key, "juststarted").addCallback(</span><br><span>             self.get_result_from_put).addErrback(self.on_put_failure)</span><br><span> </span><br><span> </span><br><span>     def launch_test(self):</span><br><span style="color: hsl(0, 100%, 40%);">-        print "Originating call to begin test."</span><br><span style="color: hsl(120, 100%, 40%);">+        print("Originating call to begin test.")</span><br><span>         self.ast[0].cli_originate("Local/506@agitest extension echo@agitest")</span><br><span> </span><br><span>     # Read result before timeout</span><br><span>diff --git a/tests/fastagi/record-file/run-test b/tests/fastagi/record-file/run-test</span><br><span>index b649001..197754a 100755</span><br><span>--- a/tests/fastagi/record-file/run-test</span><br><span>+++ b/tests/fastagi/record-file/run-test</span><br><span>@@ -39,11 +39,11 @@</span><br><span> </span><br><span>     def on_record_failure(self, reason):</span><br><span>         if os.path.exists(self.audio_file):</span><br><span style="color: hsl(0, 100%, 40%);">-            print "file exists"</span><br><span style="color: hsl(0, 100%, 40%);">-            print "file size is", os.path.getsize(self.audio_file)</span><br><span style="color: hsl(120, 100%, 40%);">+            print("file exists")</span><br><span style="color: hsl(120, 100%, 40%);">+            print("file size is", os.path.getsize(self.audio_file))</span><br><span> </span><br><span>         self.results[self.test] = False</span><br><span style="color: hsl(0, 100%, 40%);">-        print 'Could not record file:', reason.getTraceback()</span><br><span style="color: hsl(120, 100%, 40%);">+        print('Could not record file:', reason.getTraceback())</span><br><span>         if self.test is "DTMF":</span><br><span>             self.test = "HANGUP"</span><br><span>             reactor.callLater(0, self.launch_test)</span><br><span>@@ -56,23 +56,23 @@</span><br><span>         except:</span><br><span>             digit = None</span><br><span> </span><br><span style="color: hsl(0, 100%, 40%);">-        print "Recording terminated by %s (%s) after %s bytes." \</span><br><span style="color: hsl(0, 100%, 40%);">-            % (result[1], digit, result[2])</span><br><span style="color: hsl(120, 100%, 40%);">+        print("Recording terminated by %s (%s) after %s bytes." \</span><br><span style="color: hsl(120, 100%, 40%);">+            % (result[1], digit, result[2]))</span><br><span>         if os.path.exists(self.audio_file):</span><br><span>             file_size = os.path.getsize(self.audio_file)</span><br><span>             if file_size == 0:</span><br><span style="color: hsl(0, 100%, 40%);">-                print "The file was created, but it is empty."</span><br><span style="color: hsl(120, 100%, 40%);">+                print("The file was created, but it is empty.")</span><br><span>                 self.results[self.test] = False</span><br><span>             elif result[2] == file_size:</span><br><span style="color: hsl(0, 100%, 40%);">-                print "Data was recorded, and data length matches what was", \</span><br><span style="color: hsl(0, 100%, 40%);">-                    "reported during the %s test." % self.test</span><br><span style="color: hsl(120, 100%, 40%);">+                print("Data was recorded, and data length matches what was", \</span><br><span style="color: hsl(120, 100%, 40%);">+                    "reported during the %s test." % self.test)</span><br><span>                 self.results[self.test] = True</span><br><span>             else:</span><br><span style="color: hsl(0, 100%, 40%);">-                print "Some data was recorded, but the data length does not", \</span><br><span style="color: hsl(0, 100%, 40%);">-                    "match what was reported during the %s test." % self.test</span><br><span style="color: hsl(120, 100%, 40%);">+                print("Some data was recorded, but the data length does not", \</span><br><span style="color: hsl(120, 100%, 40%);">+                    "match what was reported during the %s test." % self.test)</span><br><span>                 self.results[self.test] = False</span><br><span>         else:</span><br><span style="color: hsl(0, 100%, 40%);">-            print "The file doesn't exist."</span><br><span style="color: hsl(120, 100%, 40%);">+            print("The file doesn't exist.")</span><br><span>             self.results[self.test] = False</span><br><span> </span><br><span>         self.agi.finish()</span><br><span>@@ -99,8 +99,8 @@</span><br><span>         if os.path.exists(self.audio_file):</span><br><span>             os.unlink(self.audio_file)</span><br><span> </span><br><span style="color: hsl(0, 100%, 40%);">-        print "Originating call to begin test which terminates recording",\</span><br><span style="color: hsl(0, 100%, 40%);">-            "with", self.test</span><br><span style="color: hsl(120, 100%, 40%);">+        print("Originating call to begin test which terminates recording",\</span><br><span style="color: hsl(120, 100%, 40%);">+            "with", self.test)</span><br><span>         if self.test is "DTMF":</span><br><span>             self.ast[0].cli_originate("Local/508@agitest extension 1@record-file")</span><br><span>         elif self.test is "HANGUP":</span><br><span>diff --git a/tests/fastagi/stream-file/run-test b/tests/fastagi/stream-file/run-test</span><br><span>index d74befe..f31f2e9 100755</span><br><span>--- a/tests/fastagi/stream-file/run-test</span><br><span>+++ b/tests/fastagi/stream-file/run-test</span><br><span>@@ -31,13 +31,13 @@</span><br><span>     # This gets invoked by the dialplan when the call is answered</span><br><span>     # send STREAM FILE command and wait for results</span><br><span>     def fastagi_connect(self, agi):</span><br><span style="color: hsl(0, 100%, 40%);">-        print "Connection established."</span><br><span style="color: hsl(120, 100%, 40%);">+        print("Connection established.")</span><br><span>         self.agi = agi</span><br><span>         return agi.streamFile("beep", "").addCallback(</span><br><span>             self.finish_test)</span><br><span> </span><br><span>     def launch_test(self):</span><br><span style="color: hsl(0, 100%, 40%);">-        print "Originating call to begin test."</span><br><span style="color: hsl(120, 100%, 40%);">+        print("Originating call to begin test.")</span><br><span>         self.ast[0].cli_originate("Local/505@agitest extension echo@agitest")</span><br><span> </span><br><span>     def run(self):</span><br><span>diff --git a/tests/fastagi/wait-for-digit/run-test b/tests/fastagi/wait-for-digit/run-test</span><br><span>index 047b627..6a56673 100755</span><br><span>--- a/tests/fastagi/wait-for-digit/run-test</span><br><span>+++ b/tests/fastagi/wait-for-digit/run-test</span><br><span>@@ -32,16 +32,16 @@</span><br><span>         self.ast1.install_configs("%s/configs/ast1" % (testdir))</span><br><span> </span><br><span>     def on_failure(self, reason):</span><br><span style="color: hsl(0, 100%, 40%);">-        print 'Could not run WAIT FOR DIGIT: ', reason.getTraceback()</span><br><span style="color: hsl(120, 100%, 40%);">+        print('Could not run WAIT FOR DIGIT: ', reason.getTraceback())</span><br><span>         self.agi.finish()</span><br><span> </span><br><span>     # result is (str digits, bool timeout)</span><br><span>     def finish_test(self, result):</span><br><span>         self.passed = True</span><br><span>         if result == 3212:</span><br><span style="color: hsl(0, 100%, 40%);">-            print "Got the input we expected."</span><br><span style="color: hsl(120, 100%, 40%);">+            print("Got the input we expected.")</span><br><span>         else:</span><br><span style="color: hsl(0, 100%, 40%);">-            print "Got '%s' which wasn't what we expected." % result</span><br><span style="color: hsl(120, 100%, 40%);">+            print("Got '%s' which wasn't what we expected." % result)</span><br><span>             self.passed = False</span><br><span> </span><br><span>         self.result_changed()</span><br><span>@@ -50,7 +50,7 @@</span><br><span>     # send WAIT FOR DIGIT command and wait for results</span><br><span>     def do_test(self, agi):</span><br><span>         self.agi = agi</span><br><span style="color: hsl(0, 100%, 40%);">-        print "Connection established."</span><br><span style="color: hsl(120, 100%, 40%);">+        print("Connection established.")</span><br><span>         return agi.waitForDigit(60, 'silence/10', '1234567890*#ABCD', 4, '#').addCallback(</span><br><span>             self.finish_test).addErrback(self.on_failure)</span><br><span> </span><br><span>@@ -58,13 +58,13 @@</span><br><span>         self.stop_reactor()</span><br><span> </span><br><span>         if self.passed is True:</span><br><span style="color: hsl(0, 100%, 40%);">-            print "Success"</span><br><span style="color: hsl(120, 100%, 40%);">+            print("Success")</span><br><span>         else:</span><br><span style="color: hsl(0, 100%, 40%);">-            print "Failed"</span><br><span style="color: hsl(120, 100%, 40%);">+            print("Failed")</span><br><span> </span><br><span>     def stop_reactor(self):</span><br><span>         def __finish_stop(result):</span><br><span style="color: hsl(0, 100%, 40%);">-            print "Stopping Reactor ..."</span><br><span style="color: hsl(120, 100%, 40%);">+            print("Stopping Reactor ...")</span><br><span>             if reactor.running:</span><br><span>                 reactor.stop()</span><br><span>             return result</span><br><span>@@ -73,7 +73,7 @@</span><br><span>         df.addCallback(__finish_stop)</span><br><span> </span><br><span>     def launch_test(self):</span><br><span style="color: hsl(0, 100%, 40%);">-        print "Originating call to begin test."</span><br><span style="color: hsl(120, 100%, 40%);">+        print("Originating call to begin test.")</span><br><span>         self.ast1.cli_originate("Local/basic_agi@agitest extension play_dtmf@agitest")</span><br><span> </span><br><span>     # Read result before timeout</span><br><span>@@ -87,7 +87,7 @@</span><br><span>             reactor.callLater(self.timeout, self.stop_reactor)</span><br><span>             return result</span><br><span> </span><br><span style="color: hsl(0, 100%, 40%);">-        print "Starting Asterisk"</span><br><span style="color: hsl(120, 100%, 40%);">+        print("Starting Asterisk")</span><br><span>         df = self.ast1.start()</span><br><span>         df.addCallback(__finish_start_ops)</span><br><span> </span><br><span>diff --git a/tests/fax/pjsip/t38_fast_reject/check_reinvite_rtt.py b/tests/fax/pjsip/t38_fast_reject/check_reinvite_rtt.py</span><br><span>index 3cd087a..d51bcbb 100755</span><br><span>--- a/tests/fax/pjsip/t38_fast_reject/check_reinvite_rtt.py</span><br><span>+++ b/tests/fax/pjsip/t38_fast_reject/check_reinvite_rtt.py</span><br><span>@@ -9,7 +9,7 @@</span><br><span>     reader = csv.DictReader(csvfile, delimiter=';')</span><br><span>     for row in reader:</span><br><span>         if 'ResponseTimereinvite(P)' not in row:</span><br><span style="color: hsl(0, 100%, 40%);">-            print "column not found! make sure scenario is correct!\n"</span><br><span style="color: hsl(120, 100%, 40%);">+            print("column not found! make sure scenario is correct!\n")</span><br><span>             exit(-1)</span><br><span>         parts = regex.match(row['ResponseTimereinvite(P)'])</span><br><span>         hours = int(parts.group(1))</span><br><span>@@ -17,7 +17,7 @@</span><br><span>         seconds = (minutes * 60) + int(parts.group(3))</span><br><span>         milliseconds = (seconds * 1000) + int(parts.group(4))</span><br><span>         if (milliseconds > 500):</span><br><span style="color: hsl(0, 100%, 40%);">-            print "Slow 488 Rejection detected (" + str(milliseconds) + " ms)!\n"</span><br><span style="color: hsl(120, 100%, 40%);">+            print("Slow 488 Rejection detected (" + str(milliseconds) + " ms)!\n")</span><br><span>             exit(-2)</span><br><span> </span><br><span> csvfile.close()</span><br><span>diff --git a/tests/fax/sip/gateway_g711_t38/run-test b/tests/fax/sip/gateway_g711_t38/run-test</span><br><span>index 8dec923..7c3a38e 100755</span><br><span>--- a/tests/fax/sip/gateway_g711_t38/run-test</span><br><span>+++ b/tests/fax/sip/gateway_g711_t38/run-test</span><br><span>@@ -32,14 +32,14 @@</span><br><span>    def ami_connect(self, ami):</span><br><span>       if ami.id == 0:</span><br><span> </span><br><span style="color: hsl(0, 100%, 40%);">-         print "sending a call from ast1 to ast2"</span><br><span style="color: hsl(120, 100%, 40%);">+         print("sending a call from ast1 to ast2")</span><br><span> </span><br><span>          ami.registerEvent('UserEvent', self.fax_result)</span><br><span>          df = ami.originate("sip/ast2-g711/1234", "sendfax", "1234", 1)</span><br><span> </span><br><span>          def handle_failure(reason):</span><br><span style="color: hsl(0, 100%, 40%);">-            print "error sending originate:"</span><br><span style="color: hsl(0, 100%, 40%);">-            print reason.getTraceback()</span><br><span style="color: hsl(120, 100%, 40%);">+            print("error sending originate:")</span><br><span style="color: hsl(120, 100%, 40%);">+            print(reason.getTraceback())</span><br><span>             self.stop_reactor()</span><br><span> </span><br><span>             return reason</span><br><span>@@ -55,13 +55,13 @@</span><br><span>       self.event_count += 1</span><br><span> </span><br><span>       if event['status'] == "SUCCESS":</span><br><span style="color: hsl(0, 100%, 40%);">-         print "successful gateway operation"</span><br><span style="color: hsl(120, 100%, 40%);">+         print("successful gateway operation")</span><br><span>          self.success_count += 1</span><br><span>       else:</span><br><span style="color: hsl(0, 100%, 40%);">-         print "gateway error:"</span><br><span style="color: hsl(0, 100%, 40%);">-         print "status: %s" % (event['status'],)</span><br><span style="color: hsl(0, 100%, 40%);">-         print "error: %s" % (event['error'],)</span><br><span style="color: hsl(0, 100%, 40%);">-         print "statusstr: %s" % (event['statusstr'],)</span><br><span style="color: hsl(120, 100%, 40%);">+         print("gateway error:")</span><br><span style="color: hsl(120, 100%, 40%);">+         print("status: %s" % (event['status'],))</span><br><span style="color: hsl(120, 100%, 40%);">+         print("error: %s" % (event['error'],))</span><br><span style="color: hsl(120, 100%, 40%);">+         print("statusstr: %s" % (event['statusstr'],))</span><br><span> </span><br><span>       self.are_we_there_yet()</span><br><span> </span><br><span>@@ -72,14 +72,14 @@</span><br><span>       self.event_count += 1</span><br><span> </span><br><span>       if event['status'] == "SUCCESS":</span><br><span style="color: hsl(0, 100%, 40%);">-         print "successful %s through gateway" % (event['operation'],)</span><br><span style="color: hsl(120, 100%, 40%);">+         print("successful %s through gateway" % (event['operation'],))</span><br><span>          self.success_count += 1</span><br><span>       else:</span><br><span style="color: hsl(0, 100%, 40%);">-         print "error sending fax through gateway:"</span><br><span style="color: hsl(0, 100%, 40%);">-         print "operation: %s" % (event['operation'],)</span><br><span style="color: hsl(0, 100%, 40%);">-         print "status: %s" % (event['status'],)</span><br><span style="color: hsl(0, 100%, 40%);">-         print "error: %s" % (event['error'],)</span><br><span style="color: hsl(0, 100%, 40%);">-         print "statusstr: %s" % (event['statusstr'],)</span><br><span style="color: hsl(120, 100%, 40%);">+         print("error sending fax through gateway:")</span><br><span style="color: hsl(120, 100%, 40%);">+         print("operation: %s" % (event['operation'],))</span><br><span style="color: hsl(120, 100%, 40%);">+         print("status: %s" % (event['status'],))</span><br><span style="color: hsl(120, 100%, 40%);">+         print("error: %s" % (event['error'],))</span><br><span style="color: hsl(120, 100%, 40%);">+         print("statusstr: %s" % (event['statusstr'],))</span><br><span> </span><br><span>       self.are_we_there_yet()</span><br><span> </span><br><span>diff --git a/tests/fax/sip/gateway_mix1/run-test b/tests/fax/sip/gateway_mix1/run-test</span><br><span>index 8dec923..7c3a38e 100755</span><br><span>--- a/tests/fax/sip/gateway_mix1/run-test</span><br><span>+++ b/tests/fax/sip/gateway_mix1/run-test</span><br><span>@@ -32,14 +32,14 @@</span><br><span>    def ami_connect(self, ami):</span><br><span>       if ami.id == 0:</span><br><span> </span><br><span style="color: hsl(0, 100%, 40%);">-         print "sending a call from ast1 to ast2"</span><br><span style="color: hsl(120, 100%, 40%);">+         print("sending a call from ast1 to ast2")</span><br><span> </span><br><span>          ami.registerEvent('UserEvent', self.fax_result)</span><br><span>          df = ami.originate("sip/ast2-g711/1234", "sendfax", "1234", 1)</span><br><span> </span><br><span>          def handle_failure(reason):</span><br><span style="color: hsl(0, 100%, 40%);">-            print "error sending originate:"</span><br><span style="color: hsl(0, 100%, 40%);">-            print reason.getTraceback()</span><br><span style="color: hsl(120, 100%, 40%);">+            print("error sending originate:")</span><br><span style="color: hsl(120, 100%, 40%);">+            print(reason.getTraceback())</span><br><span>             self.stop_reactor()</span><br><span> </span><br><span>             return reason</span><br><span>@@ -55,13 +55,13 @@</span><br><span>       self.event_count += 1</span><br><span> </span><br><span>       if event['status'] == "SUCCESS":</span><br><span style="color: hsl(0, 100%, 40%);">-         print "successful gateway operation"</span><br><span style="color: hsl(120, 100%, 40%);">+         print("successful gateway operation")</span><br><span>          self.success_count += 1</span><br><span>       else:</span><br><span style="color: hsl(0, 100%, 40%);">-         print "gateway error:"</span><br><span style="color: hsl(0, 100%, 40%);">-         print "status: %s" % (event['status'],)</span><br><span style="color: hsl(0, 100%, 40%);">-         print "error: %s" % (event['error'],)</span><br><span style="color: hsl(0, 100%, 40%);">-         print "statusstr: %s" % (event['statusstr'],)</span><br><span style="color: hsl(120, 100%, 40%);">+         print("gateway error:")</span><br><span style="color: hsl(120, 100%, 40%);">+         print("status: %s" % (event['status'],))</span><br><span style="color: hsl(120, 100%, 40%);">+         print("error: %s" % (event['error'],))</span><br><span style="color: hsl(120, 100%, 40%);">+         print("statusstr: %s" % (event['statusstr'],))</span><br><span> </span><br><span>       self.are_we_there_yet()</span><br><span> </span><br><span>@@ -72,14 +72,14 @@</span><br><span>       self.event_count += 1</span><br><span> </span><br><span>       if event['status'] == "SUCCESS":</span><br><span style="color: hsl(0, 100%, 40%);">-         print "successful %s through gateway" % (event['operation'],)</span><br><span style="color: hsl(120, 100%, 40%);">+         print("successful %s through gateway" % (event['operation'],))</span><br><span>          self.success_count += 1</span><br><span>       else:</span><br><span style="color: hsl(0, 100%, 40%);">-         print "error sending fax through gateway:"</span><br><span style="color: hsl(0, 100%, 40%);">-         print "operation: %s" % (event['operation'],)</span><br><span style="color: hsl(0, 100%, 40%);">-         print "status: %s" % (event['status'],)</span><br><span style="color: hsl(0, 100%, 40%);">-         print "error: %s" % (event['error'],)</span><br><span style="color: hsl(0, 100%, 40%);">-         print "statusstr: %s" % (event['statusstr'],)</span><br><span style="color: hsl(120, 100%, 40%);">+         print("error sending fax through gateway:")</span><br><span style="color: hsl(120, 100%, 40%);">+         print("operation: %s" % (event['operation'],))</span><br><span style="color: hsl(120, 100%, 40%);">+         print("status: %s" % (event['status'],))</span><br><span style="color: hsl(120, 100%, 40%);">+         print("error: %s" % (event['error'],))</span><br><span style="color: hsl(120, 100%, 40%);">+         print("statusstr: %s" % (event['statusstr'],))</span><br><span> </span><br><span>       self.are_we_there_yet()</span><br><span> </span><br><span>diff --git a/tests/fax/sip/gateway_mix3/run-test b/tests/fax/sip/gateway_mix3/run-test</span><br><span>index a02325e..f226a68 100755</span><br><span>--- a/tests/fax/sip/gateway_mix3/run-test</span><br><span>+++ b/tests/fax/sip/gateway_mix3/run-test</span><br><span>@@ -32,14 +32,14 @@</span><br><span>    def ami_connect(self, ami):</span><br><span>       if ami.id == 0:</span><br><span> </span><br><span style="color: hsl(0, 100%, 40%);">-         print "sending a call from ast1 to ast2"</span><br><span style="color: hsl(120, 100%, 40%);">+         print("sending a call from ast1 to ast2")</span><br><span> </span><br><span>          ami.registerEvent('UserEvent', self.fax_result)</span><br><span>          df = ami.originate("sip/ast2-t38/1234", "sendfax", "1234", 1)</span><br><span> </span><br><span>          def handle_failure(reason):</span><br><span style="color: hsl(0, 100%, 40%);">-            print "error sending originate:"</span><br><span style="color: hsl(0, 100%, 40%);">-            print reason.getTraceback()</span><br><span style="color: hsl(120, 100%, 40%);">+            print("error sending originate:")</span><br><span style="color: hsl(120, 100%, 40%);">+            print(reason.getTraceback())</span><br><span>             self.stop_reactor()</span><br><span> </span><br><span>             return reason</span><br><span>@@ -55,13 +55,13 @@</span><br><span>       self.event_count += 1</span><br><span> </span><br><span>       if event['status'] == "SUCCESS":</span><br><span style="color: hsl(0, 100%, 40%);">-         print "successful gateway operation"</span><br><span style="color: hsl(120, 100%, 40%);">+         print("successful gateway operation")</span><br><span>          self.success_count += 1</span><br><span>       else:</span><br><span style="color: hsl(0, 100%, 40%);">-         print "gateway error:"</span><br><span style="color: hsl(0, 100%, 40%);">-         print "status: %s" % (event['status'],)</span><br><span style="color: hsl(0, 100%, 40%);">-         print "error: %s" % (event['error'],)</span><br><span style="color: hsl(0, 100%, 40%);">-         print "statusstr: %s" % (event['statusstr'],)</span><br><span style="color: hsl(120, 100%, 40%);">+         print("gateway error:")</span><br><span style="color: hsl(120, 100%, 40%);">+         print("status: %s" % (event['status'],))</span><br><span style="color: hsl(120, 100%, 40%);">+         print("error: %s" % (event['error'],))</span><br><span style="color: hsl(120, 100%, 40%);">+         print("statusstr: %s" % (event['statusstr'],))</span><br><span> </span><br><span>       self.are_we_there_yet()</span><br><span> </span><br><span>@@ -72,14 +72,14 @@</span><br><span>       self.event_count += 1</span><br><span> </span><br><span>       if event['status'] == "SUCCESS":</span><br><span style="color: hsl(0, 100%, 40%);">-         print "successful %s through gateway" % (event['operation'],)</span><br><span style="color: hsl(120, 100%, 40%);">+         print("successful %s through gateway" % (event['operation'],))</span><br><span>          self.success_count += 1</span><br><span>       else:</span><br><span style="color: hsl(0, 100%, 40%);">-         print "error sending fax through gateway:"</span><br><span style="color: hsl(0, 100%, 40%);">-         print "operation: %s" % (event['operation'],)</span><br><span style="color: hsl(0, 100%, 40%);">-         print "status: %s" % (event['status'],)</span><br><span style="color: hsl(0, 100%, 40%);">-         print "error: %s" % (event['error'],)</span><br><span style="color: hsl(0, 100%, 40%);">-         print "statusstr: %s" % (event['statusstr'],)</span><br><span style="color: hsl(120, 100%, 40%);">+         print("error sending fax through gateway:")</span><br><span style="color: hsl(120, 100%, 40%);">+         print("operation: %s" % (event['operation'],))</span><br><span style="color: hsl(120, 100%, 40%);">+         print("status: %s" % (event['status'],))</span><br><span style="color: hsl(120, 100%, 40%);">+         print("error: %s" % (event['error'],))</span><br><span style="color: hsl(120, 100%, 40%);">+         print("statusstr: %s" % (event['statusstr'],))</span><br><span> </span><br><span>       self.are_we_there_yet()</span><br><span> </span><br><span>diff --git a/tests/fax/sip/gateway_mix4/run-test b/tests/fax/sip/gateway_mix4/run-test</span><br><span>index 8dec923..7c3a38e 100755</span><br><span>--- a/tests/fax/sip/gateway_mix4/run-test</span><br><span>+++ b/tests/fax/sip/gateway_mix4/run-test</span><br><span>@@ -32,14 +32,14 @@</span><br><span>    def ami_connect(self, ami):</span><br><span>       if ami.id == 0:</span><br><span> </span><br><span style="color: hsl(0, 100%, 40%);">-         print "sending a call from ast1 to ast2"</span><br><span style="color: hsl(120, 100%, 40%);">+         print("sending a call from ast1 to ast2")</span><br><span> </span><br><span>          ami.registerEvent('UserEvent', self.fax_result)</span><br><span>          df = ami.originate("sip/ast2-g711/1234", "sendfax", "1234", 1)</span><br><span> </span><br><span>          def handle_failure(reason):</span><br><span style="color: hsl(0, 100%, 40%);">-            print "error sending originate:"</span><br><span style="color: hsl(0, 100%, 40%);">-            print reason.getTraceback()</span><br><span style="color: hsl(120, 100%, 40%);">+            print("error sending originate:")</span><br><span style="color: hsl(120, 100%, 40%);">+            print(reason.getTraceback())</span><br><span>             self.stop_reactor()</span><br><span> </span><br><span>             return reason</span><br><span>@@ -55,13 +55,13 @@</span><br><span>       self.event_count += 1</span><br><span> </span><br><span>       if event['status'] == "SUCCESS":</span><br><span style="color: hsl(0, 100%, 40%);">-         print "successful gateway operation"</span><br><span style="color: hsl(120, 100%, 40%);">+         print("successful gateway operation")</span><br><span>          self.success_count += 1</span><br><span>       else:</span><br><span style="color: hsl(0, 100%, 40%);">-         print "gateway error:"</span><br><span style="color: hsl(0, 100%, 40%);">-         print "status: %s" % (event['status'],)</span><br><span style="color: hsl(0, 100%, 40%);">-         print "error: %s" % (event['error'],)</span><br><span style="color: hsl(0, 100%, 40%);">-         print "statusstr: %s" % (event['statusstr'],)</span><br><span style="color: hsl(120, 100%, 40%);">+         print("gateway error:")</span><br><span style="color: hsl(120, 100%, 40%);">+         print("status: %s" % (event['status'],))</span><br><span style="color: hsl(120, 100%, 40%);">+         print("error: %s" % (event['error'],))</span><br><span style="color: hsl(120, 100%, 40%);">+         print("statusstr: %s" % (event['statusstr'],))</span><br><span> </span><br><span>       self.are_we_there_yet()</span><br><span> </span><br><span>@@ -72,14 +72,14 @@</span><br><span>       self.event_count += 1</span><br><span> </span><br><span>       if event['status'] == "SUCCESS":</span><br><span style="color: hsl(0, 100%, 40%);">-         print "successful %s through gateway" % (event['operation'],)</span><br><span style="color: hsl(120, 100%, 40%);">+         print("successful %s through gateway" % (event['operation'],))</span><br><span>          self.success_count += 1</span><br><span>       else:</span><br><span style="color: hsl(0, 100%, 40%);">-         print "error sending fax through gateway:"</span><br><span style="color: hsl(0, 100%, 40%);">-         print "operation: %s" % (event['operation'],)</span><br><span style="color: hsl(0, 100%, 40%);">-         print "status: %s" % (event['status'],)</span><br><span style="color: hsl(0, 100%, 40%);">-         print "error: %s" % (event['error'],)</span><br><span style="color: hsl(0, 100%, 40%);">-         print "statusstr: %s" % (event['statusstr'],)</span><br><span style="color: hsl(120, 100%, 40%);">+         print("error sending fax through gateway:")</span><br><span style="color: hsl(120, 100%, 40%);">+         print("operation: %s" % (event['operation'],))</span><br><span style="color: hsl(120, 100%, 40%);">+         print("status: %s" % (event['status'],))</span><br><span style="color: hsl(120, 100%, 40%);">+         print("error: %s" % (event['error'],))</span><br><span style="color: hsl(120, 100%, 40%);">+         print("statusstr: %s" % (event['statusstr'],))</span><br><span> </span><br><span>       self.are_we_there_yet()</span><br><span> </span><br><span>diff --git a/tests/fax/sip/gateway_native_t38/run-test b/tests/fax/sip/gateway_native_t38/run-test</span><br><span>index 1592c70..071a3d9 100755</span><br><span>--- a/tests/fax/sip/gateway_native_t38/run-test</span><br><span>+++ b/tests/fax/sip/gateway_native_t38/run-test</span><br><span>@@ -23,7 +23,7 @@</span><br><span> </span><br><span>    def __init__(self):</span><br><span>       TestCase.__init__(self)</span><br><span style="color: hsl(0, 100%, 40%);">-      self.reactor_timeout = 120      </span><br><span style="color: hsl(120, 100%, 40%);">+      self.reactor_timeout = 120</span><br><span>       self.create_asterisk(2)</span><br><span> </span><br><span>       # copy the tiff file we are going to send to a good known location</span><br><span>@@ -32,14 +32,14 @@</span><br><span>    def ami_connect(self, ami):</span><br><span>       if ami.id == 0:</span><br><span> </span><br><span style="color: hsl(0, 100%, 40%);">-         print "sending a call from ast1 to ast2"</span><br><span style="color: hsl(120, 100%, 40%);">+         print("sending a call from ast1 to ast2")</span><br><span> </span><br><span>          ami.registerEvent('UserEvent', self.fax_result)</span><br><span>          df = ami.originate("sip/ast2-t38/1234", "sendfax", "1234", 1)</span><br><span> </span><br><span>          def handle_failure(reason):</span><br><span style="color: hsl(0, 100%, 40%);">-            print "error sending originate:"</span><br><span style="color: hsl(0, 100%, 40%);">-            print reason.getTraceback()</span><br><span style="color: hsl(120, 100%, 40%);">+            print("error sending originate:")</span><br><span style="color: hsl(120, 100%, 40%);">+            print(reason.getTraceback())</span><br><span>             self.stop_reactor()</span><br><span> </span><br><span>             return reason</span><br><span>@@ -55,13 +55,13 @@</span><br><span>       self.event_count += 1</span><br><span> </span><br><span>       if event['status'] == "SUCCESS" and event['error'] == "NATIVE_T38":</span><br><span style="color: hsl(0, 100%, 40%);">-         print "successful gateway operation"</span><br><span style="color: hsl(120, 100%, 40%);">+         print("successful gateway operation")</span><br><span>          self.success_count += 1</span><br><span>       else:</span><br><span style="color: hsl(0, 100%, 40%);">-         print "gateway result should have been SUCCESS with error NATIVE_T38"</span><br><span style="color: hsl(0, 100%, 40%);">-         print "status: %s" % (event['status'],)</span><br><span style="color: hsl(0, 100%, 40%);">-         print "error: %s" % (event['error'],)</span><br><span style="color: hsl(0, 100%, 40%);">-         print "statusstr: %s" % (event['statusstr'],)</span><br><span style="color: hsl(120, 100%, 40%);">+         print("gateway result should have been SUCCESS with error NATIVE_T38")</span><br><span style="color: hsl(120, 100%, 40%);">+         print("status: %s" % (event['status'],))</span><br><span style="color: hsl(120, 100%, 40%);">+         print("error: %s" % (event['error'],))</span><br><span style="color: hsl(120, 100%, 40%);">+         print("statusstr: %s" % (event['statusstr'],))</span><br><span> </span><br><span>       self.are_we_there_yet()</span><br><span> </span><br><span>@@ -72,14 +72,14 @@</span><br><span>       self.event_count += 1</span><br><span> </span><br><span>       if event['status'] == "SUCCESS":</span><br><span style="color: hsl(0, 100%, 40%);">-         print "successful %s through gateway" % (event['operation'],)</span><br><span style="color: hsl(120, 100%, 40%);">+         print("successful %s through gateway" % (event['operation'],))</span><br><span>          self.success_count += 1</span><br><span>       else:</span><br><span style="color: hsl(0, 100%, 40%);">-         print "error sending fax through gateway:"</span><br><span style="color: hsl(0, 100%, 40%);">-         print "operation: %s" % (event['operation'],)</span><br><span style="color: hsl(0, 100%, 40%);">-         print "status: %s" % (event['status'],)</span><br><span style="color: hsl(0, 100%, 40%);">-         print "error: %s" % (event['error'],)</span><br><span style="color: hsl(0, 100%, 40%);">-         print "statusstr: %s" % (event['statusstr'],)</span><br><span style="color: hsl(120, 100%, 40%);">+         print("error sending fax through gateway:")</span><br><span style="color: hsl(120, 100%, 40%);">+         print("operation: %s" % (event['operation'],))</span><br><span style="color: hsl(120, 100%, 40%);">+         print("status: %s" % (event['status'],))</span><br><span style="color: hsl(120, 100%, 40%);">+         print("error: %s" % (event['error'],))</span><br><span style="color: hsl(120, 100%, 40%);">+         print("statusstr: %s" % (event['statusstr'],))</span><br><span> </span><br><span>       self.are_we_there_yet()</span><br><span> </span><br><span>diff --git a/tests/fax/sip/gateway_no_t38/run-test b/tests/fax/sip/gateway_no_t38/run-test</span><br><span>index fff3de4..97d0606 100755</span><br><span>--- a/tests/fax/sip/gateway_no_t38/run-test</span><br><span>+++ b/tests/fax/sip/gateway_no_t38/run-test</span><br><span>@@ -32,14 +32,14 @@</span><br><span>    def ami_connect(self, ami):</span><br><span>       if ami.id == 0:</span><br><span> </span><br><span style="color: hsl(0, 100%, 40%);">-         print "sending a call from ast1 to ast2"</span><br><span style="color: hsl(120, 100%, 40%);">+         print("sending a call from ast1 to ast2")</span><br><span> </span><br><span>          ami.registerEvent('UserEvent', self.fax_result)</span><br><span>          df = ami.originate("sip/ast2-g711/1234", "sendfax", "1234", 1)</span><br><span> </span><br><span>          def handle_failure(reason):</span><br><span style="color: hsl(0, 100%, 40%);">-            print "error sending originate:"</span><br><span style="color: hsl(0, 100%, 40%);">-            print reason.getTraceback()</span><br><span style="color: hsl(120, 100%, 40%);">+            print("error sending originate:")</span><br><span style="color: hsl(120, 100%, 40%);">+            print(reason.getTraceback())</span><br><span>             self.stop_reactor()</span><br><span> </span><br><span>             return reason</span><br><span>@@ -55,13 +55,13 @@</span><br><span>       self.event_count += 1</span><br><span> </span><br><span>       if event['status'] == "FAILED" and event['error'] == "T38_NEG_ERROR":</span><br><span style="color: hsl(0, 100%, 40%);">-         print "successful gateway operation"</span><br><span style="color: hsl(120, 100%, 40%);">+         print("successful gateway operation")</span><br><span>          self.success_count += 1</span><br><span>       else:</span><br><span style="color: hsl(0, 100%, 40%);">-         print "gateway status should have been FAILED with error T38_NEG_ERROR"</span><br><span style="color: hsl(0, 100%, 40%);">-         print "status: %s" % (event['status'],)</span><br><span style="color: hsl(0, 100%, 40%);">-         print "error: %s" % (event['error'],)</span><br><span style="color: hsl(0, 100%, 40%);">-         print "statusstr: %s" % (event['statusstr'],)</span><br><span style="color: hsl(120, 100%, 40%);">+         print("gateway status should have been FAILED with error T38_NEG_ERROR")</span><br><span style="color: hsl(120, 100%, 40%);">+         print("status: %s" % (event['status'],))</span><br><span style="color: hsl(120, 100%, 40%);">+         print("error: %s" % (event['error'],))</span><br><span style="color: hsl(120, 100%, 40%);">+         print("statusstr: %s" % (event['statusstr'],))</span><br><span> </span><br><span>       self.are_we_there_yet()</span><br><span> </span><br><span>@@ -72,14 +72,14 @@</span><br><span>       self.event_count += 1</span><br><span> </span><br><span>       if event['status'] == "SUCCESS":</span><br><span style="color: hsl(0, 100%, 40%);">-         print "successful %s through gateway" % (event['operation'],)</span><br><span style="color: hsl(120, 100%, 40%);">+         print("successful %s through gateway" % (event['operation'],))</span><br><span>          self.success_count += 1</span><br><span>       else:</span><br><span style="color: hsl(0, 100%, 40%);">-         print "error sending fax through gateway:"</span><br><span style="color: hsl(0, 100%, 40%);">-         print "operation: %s" % (event['operation'],)</span><br><span style="color: hsl(0, 100%, 40%);">-         print "status: %s" % (event['status'],)</span><br><span style="color: hsl(0, 100%, 40%);">-         print "error: %s" % (event['error'],)</span><br><span style="color: hsl(0, 100%, 40%);">-         print "statusstr: %s" % (event['statusstr'],)</span><br><span style="color: hsl(120, 100%, 40%);">+         print("error sending fax through gateway:")</span><br><span style="color: hsl(120, 100%, 40%);">+         print("operation: %s" % (event['operation'],))</span><br><span style="color: hsl(120, 100%, 40%);">+         print("status: %s" % (event['status'],))</span><br><span style="color: hsl(120, 100%, 40%);">+         print("error: %s" % (event['error'],))</span><br><span style="color: hsl(120, 100%, 40%);">+         print("statusstr: %s" % (event['statusstr'],))</span><br><span> </span><br><span>       self.are_we_there_yet()</span><br><span> </span><br><span>diff --git a/tests/fax/sip/gateway_t38_g711/run-test b/tests/fax/sip/gateway_t38_g711/run-test</span><br><span>index a02325e..f226a68 100755</span><br><span>--- a/tests/fax/sip/gateway_t38_g711/run-test</span><br><span>+++ b/tests/fax/sip/gateway_t38_g711/run-test</span><br><span>@@ -32,14 +32,14 @@</span><br><span>    def ami_connect(self, ami):</span><br><span>       if ami.id == 0:</span><br><span> </span><br><span style="color: hsl(0, 100%, 40%);">-         print "sending a call from ast1 to ast2"</span><br><span style="color: hsl(120, 100%, 40%);">+         print("sending a call from ast1 to ast2")</span><br><span> </span><br><span>          ami.registerEvent('UserEvent', self.fax_result)</span><br><span>          df = ami.originate("sip/ast2-t38/1234", "sendfax", "1234", 1)</span><br><span> </span><br><span>          def handle_failure(reason):</span><br><span style="color: hsl(0, 100%, 40%);">-            print "error sending originate:"</span><br><span style="color: hsl(0, 100%, 40%);">-            print reason.getTraceback()</span><br><span style="color: hsl(120, 100%, 40%);">+            print("error sending originate:")</span><br><span style="color: hsl(120, 100%, 40%);">+            print(reason.getTraceback())</span><br><span>             self.stop_reactor()</span><br><span> </span><br><span>             return reason</span><br><span>@@ -55,13 +55,13 @@</span><br><span>       self.event_count += 1</span><br><span> </span><br><span>       if event['status'] == "SUCCESS":</span><br><span style="color: hsl(0, 100%, 40%);">-         print "successful gateway operation"</span><br><span style="color: hsl(120, 100%, 40%);">+         print("successful gateway operation")</span><br><span>          self.success_count += 1</span><br><span>       else:</span><br><span style="color: hsl(0, 100%, 40%);">-         print "gateway error:"</span><br><span style="color: hsl(0, 100%, 40%);">-         print "status: %s" % (event['status'],)</span><br><span style="color: hsl(0, 100%, 40%);">-         print "error: %s" % (event['error'],)</span><br><span style="color: hsl(0, 100%, 40%);">-         print "statusstr: %s" % (event['statusstr'],)</span><br><span style="color: hsl(120, 100%, 40%);">+         print("gateway error:")</span><br><span style="color: hsl(120, 100%, 40%);">+         print("status: %s" % (event['status'],))</span><br><span style="color: hsl(120, 100%, 40%);">+         print("error: %s" % (event['error'],))</span><br><span style="color: hsl(120, 100%, 40%);">+         print("statusstr: %s" % (event['statusstr'],))</span><br><span> </span><br><span>       self.are_we_there_yet()</span><br><span> </span><br><span>@@ -72,14 +72,14 @@</span><br><span>       self.event_count += 1</span><br><span> </span><br><span>       if event['status'] == "SUCCESS":</span><br><span style="color: hsl(0, 100%, 40%);">-         print "successful %s through gateway" % (event['operation'],)</span><br><span style="color: hsl(120, 100%, 40%);">+         print("successful %s through gateway" % (event['operation'],))</span><br><span>          self.success_count += 1</span><br><span>       else:</span><br><span style="color: hsl(0, 100%, 40%);">-         print "error sending fax through gateway:"</span><br><span style="color: hsl(0, 100%, 40%);">-         print "operation: %s" % (event['operation'],)</span><br><span style="color: hsl(0, 100%, 40%);">-         print "status: %s" % (event['status'],)</span><br><span style="color: hsl(0, 100%, 40%);">-         print "error: %s" % (event['error'],)</span><br><span style="color: hsl(0, 100%, 40%);">-         print "statusstr: %s" % (event['statusstr'],)</span><br><span style="color: hsl(120, 100%, 40%);">+         print("error sending fax through gateway:")</span><br><span style="color: hsl(120, 100%, 40%);">+         print("operation: %s" % (event['operation'],))</span><br><span style="color: hsl(120, 100%, 40%);">+         print("status: %s" % (event['status'],))</span><br><span style="color: hsl(120, 100%, 40%);">+         print("error: %s" % (event['error'],))</span><br><span style="color: hsl(120, 100%, 40%);">+         print("statusstr: %s" % (event['statusstr'],))</span><br><span> </span><br><span>       self.are_we_there_yet()</span><br><span> </span><br><span>diff --git a/tests/fax/sip/gateway_timeout1/run-test b/tests/fax/sip/gateway_timeout1/run-test</span><br><span>index 368b896..fe3a6cc 100755</span><br><span>--- a/tests/fax/sip/gateway_timeout1/run-test</span><br><span>+++ b/tests/fax/sip/gateway_timeout1/run-test</span><br><span>@@ -32,14 +32,14 @@</span><br><span>    def ami_connect(self, ami):</span><br><span>       if ami.id == 0:</span><br><span> </span><br><span style="color: hsl(0, 100%, 40%);">-         print "sending a call from ast1 to ast2"</span><br><span style="color: hsl(120, 100%, 40%);">+         print("sending a call from ast1 to ast2")</span><br><span> </span><br><span>          ami.registerEvent('UserEvent', self.fax_result)</span><br><span>          df = ami.originate("sip/ast2-g711/1234", "sendfax", "1234", 1)</span><br><span> </span><br><span>          def handle_failure(reason):</span><br><span style="color: hsl(0, 100%, 40%);">-            print "error sending originate:"</span><br><span style="color: hsl(0, 100%, 40%);">-            print reason.getTraceback()</span><br><span style="color: hsl(120, 100%, 40%);">+            print("error sending originate:")</span><br><span style="color: hsl(120, 100%, 40%);">+            print(reason.getTraceback())</span><br><span>             self.stop_reactor()</span><br><span> </span><br><span>             return reason</span><br><span>@@ -55,13 +55,13 @@</span><br><span>       self.event_count += 1</span><br><span> </span><br><span>       if event['status'] == "FAILED" and event['error'] == "TIMEOUT":</span><br><span style="color: hsl(0, 100%, 40%);">-         print "successful gateway operation"</span><br><span style="color: hsl(120, 100%, 40%);">+         print("successful gateway operation")</span><br><span>          self.success_count += 1</span><br><span>       else:</span><br><span style="color: hsl(0, 100%, 40%);">-         print "test error, expected FAILED and TIMEOUT"</span><br><span style="color: hsl(0, 100%, 40%);">-         print "status: %s" % (event['status'],)</span><br><span style="color: hsl(0, 100%, 40%);">-         print "error: %s" % (event['error'],)</span><br><span style="color: hsl(0, 100%, 40%);">-         print "statusstr: %s" % (event['statusstr'],)</span><br><span style="color: hsl(120, 100%, 40%);">+         print("test error, expected FAILED and TIMEOUT")</span><br><span style="color: hsl(120, 100%, 40%);">+         print("status: %s" % (event['status'],))</span><br><span style="color: hsl(120, 100%, 40%);">+         print("error: %s" % (event['error'],))</span><br><span style="color: hsl(120, 100%, 40%);">+         print("statusstr: %s" % (event['statusstr'],))</span><br><span> </span><br><span>       self.are_we_there_yet()</span><br><span> </span><br><span>@@ -72,14 +72,14 @@</span><br><span>       self.event_count += 1</span><br><span> </span><br><span>       if event['status'] == "SUCCESS":</span><br><span style="color: hsl(0, 100%, 40%);">-         print "successful %s through gateway" % (event['operation'],)</span><br><span style="color: hsl(120, 100%, 40%);">+         print("successful %s through gateway" % (event['operation'],))</span><br><span>          self.success_count += 1</span><br><span>       else:</span><br><span style="color: hsl(0, 100%, 40%);">-         print "error sending fax through gateway:"</span><br><span style="color: hsl(0, 100%, 40%);">-         print "operation: %s" % (event['operation'],)</span><br><span style="color: hsl(0, 100%, 40%);">-         print "status: %s" % (event['status'],)</span><br><span style="color: hsl(0, 100%, 40%);">-         print "error: %s" % (event['error'],)</span><br><span style="color: hsl(0, 100%, 40%);">-         print "statusstr: %s" % (event['statusstr'],)</span><br><span style="color: hsl(120, 100%, 40%);">+         print("error sending fax through gateway:")</span><br><span style="color: hsl(120, 100%, 40%);">+         print("operation: %s" % (event['operation'],))</span><br><span style="color: hsl(120, 100%, 40%);">+         print("status: %s" % (event['status'],))</span><br><span style="color: hsl(120, 100%, 40%);">+         print("error: %s" % (event['error'],))</span><br><span style="color: hsl(120, 100%, 40%);">+         print("statusstr: %s" % (event['statusstr'],))</span><br><span> </span><br><span>       self.are_we_there_yet()</span><br><span> </span><br><span>diff --git a/tests/fax/sip/gateway_timeout2/run-test b/tests/fax/sip/gateway_timeout2/run-test</span><br><span>index 84e2cb4..c4fb6be 100755</span><br><span>--- a/tests/fax/sip/gateway_timeout2/run-test</span><br><span>+++ b/tests/fax/sip/gateway_timeout2/run-test</span><br><span>@@ -32,14 +32,14 @@</span><br><span>    def ami_connect(self, ami):</span><br><span>       if ami.id == 0:</span><br><span> </span><br><span style="color: hsl(0, 100%, 40%);">-         print "sending a call from ast1 to ast2"</span><br><span style="color: hsl(120, 100%, 40%);">+         print("sending a call from ast1 to ast2")</span><br><span> </span><br><span>          ami.registerEvent('UserEvent', self.fax_result)</span><br><span>          df = ami.originate("sip/ast2-t38/1234", "sendfax", "1234", 1)</span><br><span> </span><br><span>          def handle_failure(reason):</span><br><span style="color: hsl(0, 100%, 40%);">-            print "error sending originate:"</span><br><span style="color: hsl(0, 100%, 40%);">-            print reason.getTraceback()</span><br><span style="color: hsl(120, 100%, 40%);">+            print("error sending originate:")</span><br><span style="color: hsl(120, 100%, 40%);">+            print(reason.getTraceback())</span><br><span>             self.stop_reactor()</span><br><span> </span><br><span>             return reason</span><br><span>@@ -55,13 +55,13 @@</span><br><span>       self.event_count += 1</span><br><span> </span><br><span>       if event['status'] == "FAILED" and event['error'] == "TIMEOUT":</span><br><span style="color: hsl(0, 100%, 40%);">-         print "successful gateway operation"</span><br><span style="color: hsl(120, 100%, 40%);">+         print("successful gateway operation")</span><br><span>          self.success_count += 1</span><br><span>       else:</span><br><span style="color: hsl(0, 100%, 40%);">-         print "test error, expected FAILED and TIMEOUT"</span><br><span style="color: hsl(0, 100%, 40%);">-         print "status: %s" % (event['status'],)</span><br><span style="color: hsl(0, 100%, 40%);">-         print "error: %s" % (event['error'],)</span><br><span style="color: hsl(0, 100%, 40%);">-         print "statusstr: %s" % (event['statusstr'],)</span><br><span style="color: hsl(120, 100%, 40%);">+         print("test error, expected FAILED and TIMEOUT")</span><br><span style="color: hsl(120, 100%, 40%);">+         print("status: %s" % (event['status'],))</span><br><span style="color: hsl(120, 100%, 40%);">+         print("error: %s" % (event['error'],))</span><br><span style="color: hsl(120, 100%, 40%);">+         print("statusstr: %s" % (event['statusstr'],))</span><br><span> </span><br><span>       self.are_we_there_yet()</span><br><span> </span><br><span>@@ -72,10 +72,10 @@</span><br><span>       self.event_count += 1</span><br><span> </span><br><span>       if event['status'] == "SUCCESS":</span><br><span style="color: hsl(0, 100%, 40%);">-         print "successful playback"</span><br><span style="color: hsl(120, 100%, 40%);">+         print("successful playback")</span><br><span>          self.success_count += 1</span><br><span>       else:</span><br><span style="color: hsl(0, 100%, 40%);">-         print "this can't happen"</span><br><span style="color: hsl(120, 100%, 40%);">+         print("this can't happen")</span><br><span> </span><br><span>       self.are_we_there_yet()</span><br><span> </span><br><span>diff --git a/tests/fax/sip/gateway_timeout3/run-test b/tests/fax/sip/gateway_timeout3/run-test</span><br><span>index af25d79..cc3d3a4 100755</span><br><span>--- a/tests/fax/sip/gateway_timeout3/run-test</span><br><span>+++ b/tests/fax/sip/gateway_timeout3/run-test</span><br><span>@@ -33,14 +33,14 @@</span><br><span>    def ami_connect(self, ami):</span><br><span>       if ami.id == 0:</span><br><span> </span><br><span style="color: hsl(0, 100%, 40%);">-         print "sending a call from ast1 to ast2"</span><br><span style="color: hsl(120, 100%, 40%);">+         print("sending a call from ast1 to ast2")</span><br><span> </span><br><span>          ami.registerEvent('UserEvent', self.fax_result)</span><br><span>          df = ami.originate("sip/ast2-t38/1234", "sendfax", "1234", 1)</span><br><span> </span><br><span>          def handle_failure(reason):</span><br><span style="color: hsl(0, 100%, 40%);">-            print "error sending originate:"</span><br><span style="color: hsl(0, 100%, 40%);">-            print reason.getTraceback()</span><br><span style="color: hsl(120, 100%, 40%);">+            print("error sending originate:")</span><br><span style="color: hsl(120, 100%, 40%);">+            print(reason.getTraceback())</span><br><span>             self.stop_reactor()</span><br><span> </span><br><span>             return reason</span><br><span>@@ -56,13 +56,13 @@</span><br><span>       self.event_count += 1</span><br><span> </span><br><span>       if event['status'] == "FAILED" and event['error'] == "TIMEOUT":</span><br><span style="color: hsl(0, 100%, 40%);">-         print "successful gateway operation"</span><br><span style="color: hsl(120, 100%, 40%);">+         print("successful gateway operation")</span><br><span>          self.success_count += 1</span><br><span>       else:</span><br><span style="color: hsl(0, 100%, 40%);">-         print "test error, expected FAILED and TIMEOUT"</span><br><span style="color: hsl(0, 100%, 40%);">-         print "status: %s" % (event['status'],)</span><br><span style="color: hsl(0, 100%, 40%);">-         print "error: %s" % (event['error'],)</span><br><span style="color: hsl(0, 100%, 40%);">-         print "statusstr: %s" % (event['statusstr'],)</span><br><span style="color: hsl(120, 100%, 40%);">+         print("test error, expected FAILED and TIMEOUT")</span><br><span style="color: hsl(120, 100%, 40%);">+         print("status: %s" % (event['status'],))</span><br><span style="color: hsl(120, 100%, 40%);">+         print("error: %s" % (event['error'],))</span><br><span style="color: hsl(120, 100%, 40%);">+         print("statusstr: %s" % (event['statusstr'],))</span><br><span> </span><br><span>       self.are_we_there_yet()</span><br><span> </span><br><span>@@ -73,10 +73,10 @@</span><br><span>       self.event_count += 1</span><br><span> </span><br><span>       if event['status'] == "SUCCESS":</span><br><span style="color: hsl(0, 100%, 40%);">-         print "successful playback"</span><br><span style="color: hsl(120, 100%, 40%);">+         print("successful playback")</span><br><span>          self.success_count += 1</span><br><span>       else:</span><br><span style="color: hsl(0, 100%, 40%);">-         print "this can't happen"</span><br><span style="color: hsl(120, 100%, 40%);">+         print("this can't happen")</span><br><span> </span><br><span>       self.are_we_there_yet()</span><br><span> </span><br><span>diff --git a/tests/fax/sip/gateway_timeout4/run-test b/tests/fax/sip/gateway_timeout4/run-test</span><br><span>index 7a80e16..153b6ef 100755</span><br><span>--- a/tests/fax/sip/gateway_timeout4/run-test</span><br><span>+++ b/tests/fax/sip/gateway_timeout4/run-test</span><br><span>@@ -32,14 +32,14 @@</span><br><span>    def ami_connect(self, ami):</span><br><span>       if ami.id == 0:</span><br><span> </span><br><span style="color: hsl(0, 100%, 40%);">-         print "sending a call from ast1 to ast2"</span><br><span style="color: hsl(120, 100%, 40%);">+         print("sending a call from ast1 to ast2")</span><br><span> </span><br><span>          ami.registerEvent('UserEvent', self.fax_result)</span><br><span>          df = ami.originate("sip/ast2-t38/1234", "sendfax", "1234", 1)</span><br><span> </span><br><span>          def handle_failure(reason):</span><br><span style="color: hsl(0, 100%, 40%);">-            print "error sending originate:"</span><br><span style="color: hsl(0, 100%, 40%);">-            print reason.getTraceback()</span><br><span style="color: hsl(120, 100%, 40%);">+            print("error sending originate:")</span><br><span style="color: hsl(120, 100%, 40%);">+            print(reason.getTraceback())</span><br><span>             self.stop_reactor()</span><br><span> </span><br><span>             return reason</span><br><span>@@ -57,10 +57,10 @@</span><br><span>       if event['status'] == "SUCCESS":</span><br><span>          self.success_count += 1</span><br><span>       else:</span><br><span style="color: hsl(0, 100%, 40%);">-         print "test error, expected SUCCESS"</span><br><span style="color: hsl(0, 100%, 40%);">-         print "status: %s" % (event['status'],)</span><br><span style="color: hsl(0, 100%, 40%);">-         print "error: %s" % (event['error'],)</span><br><span style="color: hsl(0, 100%, 40%);">-         print "statusstr: %s" % (event['statusstr'],)</span><br><span style="color: hsl(120, 100%, 40%);">+         print("test error, expected SUCCESS")</span><br><span style="color: hsl(120, 100%, 40%);">+         print("status: %s" % (event['status'],))</span><br><span style="color: hsl(120, 100%, 40%);">+         print("error: %s" % (event['error'],))</span><br><span style="color: hsl(120, 100%, 40%);">+         print("statusstr: %s" % (event['statusstr'],))</span><br><span> </span><br><span>       self.are_we_there_yet()</span><br><span> </span><br><span>diff --git a/tests/fax/sip/gateway_timeout5/run-test b/tests/fax/sip/gateway_timeout5/run-test</span><br><span>index 28a0d54..d27129a 100755</span><br><span>--- a/tests/fax/sip/gateway_timeout5/run-test</span><br><span>+++ b/tests/fax/sip/gateway_timeout5/run-test</span><br><span>@@ -32,14 +32,14 @@</span><br><span>    def ami_connect(self, ami):</span><br><span>       if ami.id == 0:</span><br><span> </span><br><span style="color: hsl(0, 100%, 40%);">-         print "sending a call from ast1 to ast2"</span><br><span style="color: hsl(120, 100%, 40%);">+         print("sending a call from ast1 to ast2")</span><br><span> </span><br><span>          ami.registerEvent('UserEvent', self.fax_result)</span><br><span>          df = ami.originate("sip/ast2-t38/1234", "sendfax", "1234", 1)</span><br><span> </span><br><span>          def handle_failure(reason):</span><br><span style="color: hsl(0, 100%, 40%);">-            print "error sending originate:"</span><br><span style="color: hsl(0, 100%, 40%);">-            print reason.getTraceback()</span><br><span style="color: hsl(120, 100%, 40%);">+            print("error sending originate:")</span><br><span style="color: hsl(120, 100%, 40%);">+            print(reason.getTraceback())</span><br><span>             self.stop_reactor()</span><br><span> </span><br><span>             return reason</span><br><span>@@ -55,13 +55,13 @@</span><br><span>       self.event_count += 1</span><br><span> </span><br><span>       if event['status'] == "SUCCESS":</span><br><span style="color: hsl(0, 100%, 40%);">-         print "successful gateway operation"</span><br><span style="color: hsl(120, 100%, 40%);">+         print("successful gateway operation")</span><br><span>          self.success_count += 1</span><br><span>       else:</span><br><span style="color: hsl(0, 100%, 40%);">-         print "gateway error:"</span><br><span style="color: hsl(0, 100%, 40%);">-         print "status: %s" % (event['status'],)</span><br><span style="color: hsl(0, 100%, 40%);">-         print "error: %s" % (event['error'],)</span><br><span style="color: hsl(0, 100%, 40%);">-         print "statusstr: %s" % (event['statusstr'],)</span><br><span style="color: hsl(120, 100%, 40%);">+         print("gateway error:")</span><br><span style="color: hsl(120, 100%, 40%);">+         print("status: %s" % (event['status'],))</span><br><span style="color: hsl(120, 100%, 40%);">+         print("error: %s" % (event['error'],))</span><br><span style="color: hsl(120, 100%, 40%);">+         print("statusstr: %s" % (event['statusstr'],))</span><br><span> </span><br><span>       self.are_we_there_yet()</span><br><span> </span><br><span>@@ -72,14 +72,14 @@</span><br><span>       self.event_count += 1</span><br><span> </span><br><span>       if event['status'] == "SUCCESS":</span><br><span style="color: hsl(0, 100%, 40%);">-         print "successful %s through gateway" % (event['operation'],)</span><br><span style="color: hsl(120, 100%, 40%);">+         print("successful %s through gateway" % (event['operation'],))</span><br><span>          self.success_count += 1</span><br><span>       else:</span><br><span style="color: hsl(0, 100%, 40%);">-         print "error sending fax through gateway:"</span><br><span style="color: hsl(0, 100%, 40%);">-         print "operation: %s" % (event['operation'],)</span><br><span style="color: hsl(0, 100%, 40%);">-         print "status: %s" % (event['status'],)</span><br><span style="color: hsl(0, 100%, 40%);">-         print "error: %s" % (event['error'],)</span><br><span style="color: hsl(0, 100%, 40%);">-         print "statusstr: %s" % (event['statusstr'],)</span><br><span style="color: hsl(120, 100%, 40%);">+         print("error sending fax through gateway:")</span><br><span style="color: hsl(120, 100%, 40%);">+         print("operation: %s" % (event['operation'],))</span><br><span style="color: hsl(120, 100%, 40%);">+         print("status: %s" % (event['status'],))</span><br><span style="color: hsl(120, 100%, 40%);">+         print("error: %s" % (event['error'],))</span><br><span style="color: hsl(120, 100%, 40%);">+         print("statusstr: %s" % (event['statusstr'],))</span><br><span> </span><br><span>       self.are_we_there_yet()</span><br><span> </span><br><span>diff --git a/tests/funcs/func_srv/run-test b/tests/funcs/func_srv/run-test</span><br><span>index 23ce2c0..6a53d74 100755</span><br><span>--- a/tests/funcs/func_srv/run-test</span><br><span>+++ b/tests/funcs/func_srv/run-test</span><br><span>@@ -23,7 +23,7 @@</span><br><span>         self.weight = weight</span><br><span> </span><br><span>     def match(self, record):</span><br><span style="color: hsl(0, 100%, 40%);">-        print "Matching: %s/%s, %s/%s, %s/%s, %s/%s" % (self.host, record.host, self.port, record.port, self.priority, record.priority, self.weight, record.weight)</span><br><span style="color: hsl(120, 100%, 40%);">+        print("Matching: %s/%s, %s/%s, %s/%s, %s/%s" % (self.host, record.host, self.port, record.port, self.priority, record.priority, self.weight, record.weight))</span><br><span>         if self.host != record.host or self.port != record.port or self.priority != record.priority or self.weight != record.weight:</span><br><span>             return False</span><br><span>         else:</span><br><span>@@ -57,7 +57,7 @@</span><br><span>             return</span><br><span> </span><br><span>         r = srv_record(event.get("recordnum"), event.get("host"), event.get("port"), event.get("priority"), event.get("weight"))</span><br><span style="color: hsl(0, 100%, 40%);">-        print "Got record (%s): Host - %s, Port - %s, Priority - %s, Weight - %s" % (r.record_num, r.host, r.port, r.priority, r.weight)</span><br><span style="color: hsl(120, 100%, 40%);">+        print("Got record (%s): Host - %s, Port - %s, Priority - %s, Weight - %s" % (r.record_num, r.host, r.port, r.priority, r.weight))</span><br><span>         records.append(r)</span><br><span> </span><br><span>         if len(self.srv_records) == len(self.test1_records) and len(self.srv_records) == len(self.test2_records):</span><br><span>@@ -66,7 +66,7 @@</span><br><span>                     if not r.match(t[r.record_num - 1]):</span><br><span>                         # Records with the same priority are ordered randomly, so check 2/3 instead.</span><br><span>                         if not (r.record_num == 2 and r.match(t[2])) and not (r.record_num == 3 and r.match(t[1])):</span><br><span style="color: hsl(0, 100%, 40%);">-                            print "Record #%s did not match." % r.record_num</span><br><span style="color: hsl(120, 100%, 40%);">+                            print("Record #%s did not match." % r.record_num)</span><br><span>                             self.stop_reactor()</span><br><span>                             return</span><br><span> </span><br><span>diff --git a/tests/hep/hep_capture_node.py b/tests/hep/hep_capture_node.py</span><br><span>index 010756a..766c51d 100644</span><br><span>--- a/tests/hep/hep_capture_node.py</span><br><span>+++ b/tests/hep/hep_capture_node.py</span><br><span>@@ -144,9 +144,11 @@</span><br><span>             hep_protocol_type,</span><br><span>             hep_capture_agent_id)</span><br><span> </span><br><span style="color: hsl(0, 100%, 40%);">-    def datagramReceived(self, data, (host, port)):</span><br><span style="color: hsl(120, 100%, 40%);">+    def datagramReceived(self, data, addr):</span><br><span>         """Process a received datagram"""</span><br><span> </span><br><span style="color: hsl(120, 100%, 40%);">+        (host, port) = addr</span><br><span style="color: hsl(120, 100%, 40%);">+</span><br><span>         LOGGER.debug("Received %r from %s:%d (len: %d)" %</span><br><span>             (data, host, port, len(data)))</span><br><span> </span><br><span>diff --git a/tests/manager/userevent/event.py b/tests/manager/userevent/event.py</span><br><span>index 8e91fb8..86eb1cc 100644</span><br><span>--- a/tests/manager/userevent/event.py</span><br><span>+++ b/tests/manager/userevent/event.py</span><br><span>@@ -17,12 +17,12 @@</span><br><span>     def ami_connect(self, ami):</span><br><span>         ami.registerEvent('UserEvent', self.userevent)</span><br><span>         message = [</span><br><span style="color: hsl(0, 100%, 40%);">-            'FootBoneConnectedToThe: AnkleBone',</span><br><span style="color: hsl(0, 100%, 40%);">-            'AnkleBoneConnectedToThe: ShinBone',</span><br><span style="color: hsl(0, 100%, 40%);">-            'Action: UserEvent',</span><br><span style="color: hsl(0, 100%, 40%);">-            'ShinBoneConnectedToThe: KneeBone',</span><br><span style="color: hsl(0, 100%, 40%);">-            'UserEvent: AnatomyLesson',</span><br><span style="color: hsl(0, 100%, 40%);">-            'KneeBoneConnectedToThe: ThighBone',</span><br><span style="color: hsl(120, 100%, 40%);">+            b"FootBoneConnectedToThe: AnkleBone",</span><br><span style="color: hsl(120, 100%, 40%);">+            b"AnkleBoneConnectedToThe: ShinBone",</span><br><span style="color: hsl(120, 100%, 40%);">+            b"Action: UserEvent",</span><br><span style="color: hsl(120, 100%, 40%);">+            b"ShinBoneConnectedToThe: KneeBone",</span><br><span style="color: hsl(120, 100%, 40%);">+            b"UserEvent: AnatomyLesson",</span><br><span style="color: hsl(120, 100%, 40%);">+            b"KneeBoneConnectedToThe: ThighBone",</span><br><span>         ]</span><br><span>         # We have to forego the typical methods of sending an AMI command</span><br><span>         # because the order the headers are sent in matters for this test.</span><br><span>@@ -36,7 +36,7 @@</span><br><span>             message.append(message.pop(0))</span><br><span>             for line in message:</span><br><span>                 ami.sendLine(line)</span><br><span style="color: hsl(0, 100%, 40%);">-            ami.sendLine('')</span><br><span style="color: hsl(120, 100%, 40%);">+            ami.sendLine(b"")</span><br><span> </span><br><span>     def userevent(self, ami, event):</span><br><span>         # This isn't strictly necessary, but without it, the test will take 30</span><br><span>diff --git a/tests/masquerade/run-test b/tests/masquerade/run-test</span><br><span>index 096202d..a9eb285 100755</span><br><span>--- a/tests/masquerade/run-test</span><br><span>+++ b/tests/masquerade/run-test</span><br><span>@@ -90,7 +90,7 @@</span><br><span>         self.ami[0].originate(</span><br><span>             channel="Local/start@outgoing",</span><br><span>             context="parked", exten="parkme12", priority=1,</span><br><span style="color: hsl(0, 100%, 40%);">-            timeout=900, async=True, variable={'DEST': str(exten)}</span><br><span style="color: hsl(120, 100%, 40%);">+            timeout=900, asyncrn=True, variable={'DEST': str(exten)}</span><br><span>             ).addErrback(TestCase.handle_originate_failure)</span><br><span> </span><br><span>     def get_parkedcall(self):</span><br><span>@@ -102,7 +102,7 @@</span><br><span>         self.ami[1].originate(</span><br><span>             channel=tech_prefix + str(self.expected_space),</span><br><span>             context="getit", exten="retrieve", priority=1,</span><br><span style="color: hsl(0, 100%, 40%);">-            timeout=30, async=True</span><br><span style="color: hsl(120, 100%, 40%);">+            timeout=30, asyncrn=True</span><br><span>             ).addErrback(TestCase.handle_originate_failure)</span><br><span> </span><br><span>     def evt_parkedcall(self, ami, event):</span><br><span>diff --git a/tests/rtp/strict_rtp/strict_rtp_seqno/strict_rtp.py b/tests/rtp/strict_rtp/strict_rtp_seqno/strict_rtp.py</span><br><span>index ea58956..969b55d 100644</span><br><span>--- a/tests/rtp/strict_rtp/strict_rtp_seqno/strict_rtp.py</span><br><span>+++ b/tests/rtp/strict_rtp/strict_rtp_seqno/strict_rtp.py</span><br><span>@@ -32,7 +32,7 @@</span><br><span>             """</span><br><span>             self.test_object = test_object</span><br><span> </span><br><span style="color: hsl(0, 100%, 40%);">-        def datagramReceived(self, data, (host, port)):</span><br><span style="color: hsl(120, 100%, 40%);">+        def datagramReceived(self, data, addr):</span><br><span>             """Callback for when a datagram is received.</span><br><span>             We don't want anything to happen here because we do all</span><br><span>             of the handling ourselves via TestEvent.</span><br><span>@@ -41,6 +41,7 @@</span><br><span>             data         The actual packet</span><br><span>             (host, port) Tuple of source host and port</span><br><span>             """</span><br><span style="color: hsl(120, 100%, 40%);">+            (host, port) = addr</span><br><span>             LOGGER.debug('Packet received from {0}:{1}\n{2}'.format(</span><br><span>                 host, port, data))</span><br><span> </span><br><span>diff --git a/tests/rtp/strict_rtp/strict_rtp_yes/strict_rtp.py b/tests/rtp/strict_rtp/strict_rtp_yes/strict_rtp.py</span><br><span>index 57974b5..8984cc0 100644</span><br><span>--- a/tests/rtp/strict_rtp/strict_rtp_yes/strict_rtp.py</span><br><span>+++ b/tests/rtp/strict_rtp/strict_rtp_yes/strict_rtp.py</span><br><span>@@ -34,13 +34,14 @@</span><br><span>             """</span><br><span>             self.test_object = test_object</span><br><span> </span><br><span style="color: hsl(0, 100%, 40%);">-        def datagramReceived(self, data, (host, port)):</span><br><span style="color: hsl(120, 100%, 40%);">+        def datagramReceived(self, data, addr):</span><br><span>             """Callback for when a datagram is received</span><br><span> </span><br><span>             Keyword Arguments:</span><br><span>             data         The actual packet</span><br><span>             (host, port) Tuple of source host and port</span><br><span>             """</span><br><span style="color: hsl(120, 100%, 40%);">+            (host, port) = addr</span><br><span>             LOGGER.debug('Packet received from {0}:{1}\n{2}'.format(</span><br><span>                 host, port, data))</span><br><span> </span><br><span></span><br></pre><p>To view, visit <a href="https://gerrit.asterisk.org/c/testsuite/+/18199">change 18199</a>. To unsubscribe, or for help writing mail filters, 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/c/testsuite/+/18199"/><meta itemprop="name" content="View Change"/></div></div>

<div style="display:none"> Gerrit-Project: testsuite </div>
<div style="display:none"> Gerrit-Branch: development/16/python3 </div>
<div style="display:none"> Gerrit-Change-Id: Ic7a1d72b174df59107370fcb03fae9dc4cdfc9d3 </div>
<div style="display:none"> Gerrit-Change-Number: 18199 </div>
<div style="display:none"> Gerrit-PatchSet: 1 </div>
<div style="display:none"> Gerrit-Owner: Michael Bradeen <mbradeen@sangoma.com> </div>
<div style="display:none"> Gerrit-MessageType: newchange </div>