sippy 2.2.2__tar.gz → 2.2.3__tar.gz
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- {sippy-2.2.2/sippy.egg-info → sippy-2.2.3}/PKG-INFO +1 -1
- {sippy-2.2.2 → sippy-2.2.3}/setup.py +1 -1
- {sippy-2.2.2 → sippy-2.2.3}/sippy/CLIManager.py +32 -9
- {sippy-2.2.2 → sippy-2.2.3}/sippy/Rtp_proxy/Client/Worker/external.py +8 -6
- {sippy-2.2.2 → sippy-2.2.3}/sippy/Rtp_proxy/Client/stream.py +6 -3
- {sippy-2.2.2 → sippy-2.2.3}/sippy/Rtp_proxy/Client/udp.py +3 -1
- {sippy-2.2.2 → sippy-2.2.3}/sippy/Rtp_proxy/Cmd/sequencer.py +5 -1
- {sippy-2.2.2 → sippy-2.2.3}/sippy/Rtp_proxy/client.py +6 -4
- {sippy-2.2.2 → sippy-2.2.3}/sippy/Rtp_proxy/session.py +2 -2
- {sippy-2.2.2 → sippy-2.2.3}/sippy/b2bua.py +1 -0
- {sippy-2.2.2 → sippy-2.2.3/sippy.egg-info}/PKG-INFO +1 -1
- {sippy-2.2.2 → sippy-2.2.3}/LICENSE +0 -0
- {sippy-2.2.2 → sippy-2.2.3}/MANIFEST.in +0 -0
- {sippy-2.2.2 → sippy-2.2.3}/README.md +0 -0
- {sippy-2.2.2 → sippy-2.2.3}/pyproject.toml +0 -0
- {sippy-2.2.2 → sippy-2.2.3}/requirements.txt +0 -0
- {sippy-2.2.2 → sippy-2.2.3}/setup.cfg +0 -0
- {sippy-2.2.2 → sippy-2.2.3}/sippy/B2B/Route.py +0 -0
- {sippy-2.2.2 → sippy-2.2.3}/sippy/B2B/SimpleAPI.py +0 -0
- {sippy-2.2.2 → sippy-2.2.3}/sippy/B2B/States.py +0 -0
- {sippy-2.2.2 → sippy-2.2.3}/sippy/B2B/Transforms.py +0 -0
- {sippy-2.2.2 → sippy-2.2.3}/sippy/B2B/__init__.py +0 -0
- {sippy-2.2.2 → sippy-2.2.3}/sippy/CCEvents.py +0 -0
- {sippy-2.2.2 → sippy-2.2.3}/sippy/Core/EventDispatcher.py +0 -0
- {sippy-2.2.2 → sippy-2.2.3}/sippy/Core/Exceptions.py +0 -0
- {sippy-2.2.2 → sippy-2.2.3}/sippy/Core/__init__.py +0 -0
- {sippy-2.2.2 → sippy-2.2.3}/sippy/ESipHeaderCSV.py +0 -0
- {sippy-2.2.2 → sippy-2.2.3}/sippy/ESipHeaderIgnore.py +0 -0
- {sippy-2.2.2 → sippy-2.2.3}/sippy/Exceptions/RtpProxyError.py +0 -0
- {sippy-2.2.2 → sippy-2.2.3}/sippy/Exceptions/SdpParseError.py +0 -0
- {sippy-2.2.2 → sippy-2.2.3}/sippy/Exceptions/SipHandlingError.py +0 -0
- {sippy-2.2.2 → sippy-2.2.3}/sippy/Exceptions/SipParseError.py +0 -0
- {sippy-2.2.2 → sippy-2.2.3}/sippy/Exceptions/__init__.py +0 -0
- {sippy-2.2.2 → sippy-2.2.3}/sippy/External_command.py +0 -0
- {sippy-2.2.2 → sippy-2.2.3}/sippy/FakeAccounting.py +0 -0
- {sippy-2.2.2 → sippy-2.2.3}/sippy/Math/__init__.py +0 -0
- {sippy-2.2.2 → sippy-2.2.3}/sippy/Math/recfilter.py +0 -0
- {sippy-2.2.2 → sippy-2.2.3}/sippy/MsgBody.py +0 -0
- {sippy-2.2.2 → sippy-2.2.3}/sippy/MultipartMixBody.py +0 -0
- {sippy-2.2.2 → sippy-2.2.3}/sippy/MyConfigParser.py +0 -0
- {sippy-2.2.2 → sippy-2.2.3}/sippy/Network_server.py +0 -0
- {sippy-2.2.2 → sippy-2.2.3}/sippy/RadiusAccounting.py +0 -0
- {sippy-2.2.2 → sippy-2.2.3}/sippy/RadiusAuthorisation.py +0 -0
- {sippy-2.2.2 → sippy-2.2.3}/sippy/Radius_client.py +0 -0
- {sippy-2.2.2 → sippy-2.2.3}/sippy/Rtp_proxy/Client/Worker/__init__.py +0 -0
- {sippy-2.2.2 → sippy-2.2.3}/sippy/Rtp_proxy/Client/Worker/internal.py +0 -0
- {sippy-2.2.2 → sippy-2.2.3}/sippy/Rtp_proxy/Client/__init__.py +0 -0
- {sippy-2.2.2 → sippy-2.2.3}/sippy/Rtp_proxy/Client/internal.py +0 -0
- {sippy-2.2.2 → sippy-2.2.3}/sippy/Rtp_proxy/Client/local.py +0 -0
- {sippy-2.2.2 → sippy-2.2.3}/sippy/Rtp_proxy/Client/net.py +0 -0
- {sippy-2.2.2 → sippy-2.2.3}/sippy/Rtp_proxy/Cmd/__init__.py +0 -0
- {sippy-2.2.2 → sippy-2.2.3}/sippy/Rtp_proxy/Session/__init__.py +0 -0
- {sippy-2.2.2 → sippy-2.2.3}/sippy/Rtp_proxy/Session/side.py +0 -0
- {sippy-2.2.2 → sippy-2.2.3}/sippy/Rtp_proxy/Session/subcommand.py +0 -0
- {sippy-2.2.2 → sippy-2.2.3}/sippy/Rtp_proxy/Session/subcommand_ice.py +0 -0
- {sippy-2.2.2 → sippy-2.2.3}/sippy/Rtp_proxy/Session/update.py +0 -0
- {sippy-2.2.2 → sippy-2.2.3}/sippy/Rtp_proxy/Session/webrtc.py +0 -0
- {sippy-2.2.2 → sippy-2.2.3}/sippy/Rtp_proxy/__init__.py +0 -0
- {sippy-2.2.2 → sippy-2.2.3}/sippy/Rtp_proxy/cmd.py +0 -0
- {sippy-2.2.2 → sippy-2.2.3}/sippy/SdpBody.py +0 -0
- {sippy-2.2.2 → sippy-2.2.3}/sippy/SdpConnecton.py +0 -0
- {sippy-2.2.2 → sippy-2.2.3}/sippy/SdpGeneric.py +0 -0
- {sippy-2.2.2 → sippy-2.2.3}/sippy/SdpMedia.py +0 -0
- {sippy-2.2.2 → sippy-2.2.3}/sippy/SdpMediaDescription.py +0 -0
- {sippy-2.2.2 → sippy-2.2.3}/sippy/SdpOrigin.py +0 -0
- {sippy-2.2.2 → sippy-2.2.3}/sippy/Security/SipNonce.py +0 -0
- {sippy-2.2.2 → sippy-2.2.3}/sippy/Security/__init__.py +0 -0
- {sippy-2.2.2 → sippy-2.2.3}/sippy/Signal.py +0 -0
- {sippy-2.2.2 → sippy-2.2.3}/sippy/SipAddress.py +0 -0
- {sippy-2.2.2 → sippy-2.2.3}/sippy/SipAddressHF.py +0 -0
- {sippy-2.2.2 → sippy-2.2.3}/sippy/SipAllow.py +0 -0
- {sippy-2.2.2 → sippy-2.2.3}/sippy/SipAlso.py +0 -0
- {sippy-2.2.2 → sippy-2.2.3}/sippy/SipAuthorization.py +0 -0
- {sippy-2.2.2 → sippy-2.2.3}/sippy/SipCCDiversion.py +0 -0
- {sippy-2.2.2 → sippy-2.2.3}/sippy/SipCSeq.py +0 -0
- {sippy-2.2.2 → sippy-2.2.3}/sippy/SipCallId.py +0 -0
- {sippy-2.2.2 → sippy-2.2.3}/sippy/SipCiscoGUID.py +0 -0
- {sippy-2.2.2 → sippy-2.2.3}/sippy/SipConf.py +0 -0
- {sippy-2.2.2 → sippy-2.2.3}/sippy/SipContact.py +0 -0
- {sippy-2.2.2 → sippy-2.2.3}/sippy/SipContentLength.py +0 -0
- {sippy-2.2.2 → sippy-2.2.3}/sippy/SipContentType.py +0 -0
- {sippy-2.2.2 → sippy-2.2.3}/sippy/SipDiversion.py +0 -0
- {sippy-2.2.2 → sippy-2.2.3}/sippy/SipExpires.py +0 -0
- {sippy-2.2.2 → sippy-2.2.3}/sippy/SipFrom.py +0 -0
- {sippy-2.2.2 → sippy-2.2.3}/sippy/SipGenericHF.py +0 -0
- {sippy-2.2.2 → sippy-2.2.3}/sippy/SipHeader.py +0 -0
- {sippy-2.2.2 → sippy-2.2.3}/sippy/SipLogger.py +0 -0
- {sippy-2.2.2 → sippy-2.2.3}/sippy/SipMaxForwards.py +0 -0
- {sippy-2.2.2 → sippy-2.2.3}/sippy/SipMsg.py +0 -0
- {sippy-2.2.2 → sippy-2.2.3}/sippy/SipNumericHF.py +0 -0
- {sippy-2.2.2 → sippy-2.2.3}/sippy/SipPAssertedIdentity.py +0 -0
- {sippy-2.2.2 → sippy-2.2.3}/sippy/SipPath.py +0 -0
- {sippy-2.2.2 → sippy-2.2.3}/sippy/SipProxyAuthenticate.py +0 -0
- {sippy-2.2.2 → sippy-2.2.3}/sippy/SipProxyAuthorization.py +0 -0
- {sippy-2.2.2 → sippy-2.2.3}/sippy/SipRAck.py +0 -0
- {sippy-2.2.2 → sippy-2.2.3}/sippy/SipRSeq.py +0 -0
- {sippy-2.2.2 → sippy-2.2.3}/sippy/SipReason.py +0 -0
- {sippy-2.2.2 → sippy-2.2.3}/sippy/SipRecordRoute.py +0 -0
- {sippy-2.2.2 → sippy-2.2.3}/sippy/SipReferTo.py +0 -0
- {sippy-2.2.2 → sippy-2.2.3}/sippy/SipReferredBy.py +0 -0
- {sippy-2.2.2 → sippy-2.2.3}/sippy/SipRegistrationAgent.py +0 -0
- {sippy-2.2.2 → sippy-2.2.3}/sippy/SipReplaces.py +0 -0
- {sippy-2.2.2 → sippy-2.2.3}/sippy/SipRequest.py +0 -0
- {sippy-2.2.2 → sippy-2.2.3}/sippy/SipResponse.py +0 -0
- {sippy-2.2.2 → sippy-2.2.3}/sippy/SipRoute.py +0 -0
- {sippy-2.2.2 → sippy-2.2.3}/sippy/SipServer.py +0 -0
- {sippy-2.2.2 → sippy-2.2.3}/sippy/SipSupported.py +0 -0
- {sippy-2.2.2 → sippy-2.2.3}/sippy/SipTo.py +0 -0
- {sippy-2.2.2 → sippy-2.2.3}/sippy/SipTransactionManager.py +0 -0
- {sippy-2.2.2 → sippy-2.2.3}/sippy/SipURL.py +0 -0
- {sippy-2.2.2 → sippy-2.2.3}/sippy/SipUserAgent.py +0 -0
- {sippy-2.2.2 → sippy-2.2.3}/sippy/SipVia.py +0 -0
- {sippy-2.2.2 → sippy-2.2.3}/sippy/SipWWWAuthenticate.py +0 -0
- {sippy-2.2.2 → sippy-2.2.3}/sippy/SipWarning.py +0 -0
- {sippy-2.2.2 → sippy-2.2.3}/sippy/StatefulProxy.py +0 -0
- {sippy-2.2.2 → sippy-2.2.3}/sippy/Time/MonoTime.py +0 -0
- {sippy-2.2.2 → sippy-2.2.3}/sippy/Time/Timeout.py +0 -0
- {sippy-2.2.2 → sippy-2.2.3}/sippy/Time/__init__.py +0 -0
- {sippy-2.2.2 → sippy-2.2.3}/sippy/Time/clock_dtime.py +0 -0
- {sippy-2.2.2 → sippy-2.2.3}/sippy/UA.py +0 -0
- {sippy-2.2.2 → sippy-2.2.3}/sippy/UaStateConnected.py +0 -0
- {sippy-2.2.2 → sippy-2.2.3}/sippy/UaStateDead.py +0 -0
- {sippy-2.2.2 → sippy-2.2.3}/sippy/UaStateDisconnected.py +0 -0
- {sippy-2.2.2 → sippy-2.2.3}/sippy/UaStateFailed.py +0 -0
- {sippy-2.2.2 → sippy-2.2.3}/sippy/UaStateGeneric.py +0 -0
- {sippy-2.2.2 → sippy-2.2.3}/sippy/UacStateCancelling.py +0 -0
- {sippy-2.2.2 → sippy-2.2.3}/sippy/UacStateIdle.py +0 -0
- {sippy-2.2.2 → sippy-2.2.3}/sippy/UacStateRinging.py +0 -0
- {sippy-2.2.2 → sippy-2.2.3}/sippy/UacStateTrying.py +0 -0
- {sippy-2.2.2 → sippy-2.2.3}/sippy/UacStateUpdating.py +0 -0
- {sippy-2.2.2 → sippy-2.2.3}/sippy/UasStateIdle.py +0 -0
- {sippy-2.2.2 → sippy-2.2.3}/sippy/UasStateRinging.py +0 -0
- {sippy-2.2.2 → sippy-2.2.3}/sippy/UasStateTrying.py +0 -0
- {sippy-2.2.2 → sippy-2.2.3}/sippy/UasStateUpdating.py +0 -0
- {sippy-2.2.2 → sippy-2.2.3}/sippy/Udp_server.py +0 -0
- {sippy-2.2.2 → sippy-2.2.3}/sippy/Wss_server.py +0 -0
- {sippy-2.2.2 → sippy-2.2.3}/sippy/XMPP_server.py +0 -0
- {sippy-2.2.2 → sippy-2.2.3}/sippy/__init__.py +0 -0
- {sippy-2.2.2 → sippy-2.2.3}/sippy/b2bua_simple.py +0 -0
- {sippy-2.2.2 → sippy-2.2.3}/sippy/dictionary +0 -0
- {sippy-2.2.2 → sippy-2.2.3}/sippy/misc.py +0 -0
- {sippy-2.2.2 → sippy-2.2.3}/sippy.egg-info/SOURCES.txt +0 -0
- {sippy-2.2.2 → sippy-2.2.3}/sippy.egg-info/dependency_links.txt +0 -0
- {sippy-2.2.2 → sippy-2.2.3}/sippy.egg-info/entry_points.txt +0 -0
- {sippy-2.2.2 → sippy-2.2.3}/sippy.egg-info/requires.txt +0 -0
- {sippy-2.2.2 → sippy-2.2.3}/sippy.egg-info/top_level.txt +0 -0
- {sippy-2.2.2 → sippy-2.2.3}/tests/__init__.py +0 -0
- {sippy-2.2.2 → sippy-2.2.3}/tests/test_B2BRoute.py +0 -0
- {sippy-2.2.2 → sippy-2.2.3}/tests/test_B2BTransforms.py +0 -0
- {sippy-2.2.2 → sippy-2.2.3}/tests/test_Multipart.py +0 -0
- {sippy-2.2.2 → sippy-2.2.3}/tests/test_SdbBody.py +0 -0
- {sippy-2.2.2 → sippy-2.2.3}/tests/test_Udp_server.py +0 -0
|
@@ -27,7 +27,7 @@
|
|
|
27
27
|
|
|
28
28
|
from __future__ import print_function
|
|
29
29
|
|
|
30
|
-
from os import remove, chown, chmod
|
|
30
|
+
from os import remove, chown, chmod, pipe, read, write, close
|
|
31
31
|
import socket
|
|
32
32
|
from errno import EPIPE, ENOTCONN, EBADF, ECONNABORTED
|
|
33
33
|
from select import poll, POLLIN, POLLNVAL
|
|
@@ -48,19 +48,30 @@ class _Acceptor(Thread):
|
|
|
48
48
|
pollobj = None
|
|
49
49
|
fileno = None
|
|
50
50
|
|
|
51
|
-
def __init__(self, clicm):
|
|
51
|
+
def __init__(self, clicm, wakeup_r):
|
|
52
52
|
Thread.__init__(self)
|
|
53
53
|
self.clicm = clicm
|
|
54
54
|
self.pollobj = poll()
|
|
55
55
|
self.fileno = self.clicm.serversock.fileno()
|
|
56
|
+
self.wakeup_r = wakeup_r
|
|
56
57
|
self.pollobj.register(self.fileno, POLLIN)
|
|
58
|
+
self.pollobj.register(self.wakeup_r, POLLIN)
|
|
57
59
|
self.start()
|
|
58
60
|
|
|
59
61
|
def run(self):
|
|
60
62
|
#print(self.run, 'enter')
|
|
61
63
|
while True:
|
|
62
64
|
#print(self.run, 'cycle')
|
|
63
|
-
|
|
65
|
+
revents = dict(self.pollobj.poll())
|
|
66
|
+
if self.wakeup_r in revents and (revents[self.wakeup_r] & POLLIN):
|
|
67
|
+
try:
|
|
68
|
+
# drain the pipe (best-effort)
|
|
69
|
+
read(self.wakeup_r, 1024)
|
|
70
|
+
except OSError:
|
|
71
|
+
dump_exception('CLIConnectionManager: unhandled exception draining wakeup socket')
|
|
72
|
+
pass
|
|
73
|
+
break
|
|
74
|
+
pollret = revents.get(self.fileno, 0)
|
|
64
75
|
if pollret & POLLNVAL != 0:
|
|
65
76
|
break
|
|
66
77
|
if pollret & POLLIN == 0:
|
|
@@ -74,16 +85,18 @@ class _Acceptor(Thread):
|
|
|
74
85
|
break
|
|
75
86
|
else:
|
|
76
87
|
raise
|
|
77
|
-
except Exception
|
|
78
|
-
dump_exception('CLIConnectionManager: unhandled exception
|
|
88
|
+
except Exception:
|
|
89
|
+
dump_exception('CLIConnectionManager: unhandled exception accepting incoming connection')
|
|
79
90
|
break
|
|
80
91
|
#print(self.run, 'handle_accept')
|
|
81
92
|
ED2.callFromThread(self.clicm.handle_accept, clientsock, addr)
|
|
82
93
|
self.clicm = None
|
|
94
|
+
close(self.wakeup_r)
|
|
83
95
|
#print(self.run, 'exit')
|
|
84
96
|
|
|
85
97
|
class CLIConnectionManager(object):
|
|
86
98
|
command_cb = None
|
|
99
|
+
address = None
|
|
87
100
|
tcp = False
|
|
88
101
|
accept_list: list = None
|
|
89
102
|
serversock = None
|
|
@@ -116,7 +129,9 @@ class CLIConnectionManager(object):
|
|
|
116
129
|
if sock_mode != None:
|
|
117
130
|
chmod(address, sock_mode)
|
|
118
131
|
self.serversock.listen(backlog)
|
|
119
|
-
self.
|
|
132
|
+
wakeup_r, self._wakeup_w = pipe()
|
|
133
|
+
self.atr = _Acceptor(self, wakeup_r)
|
|
134
|
+
self.address = address
|
|
120
135
|
|
|
121
136
|
def handle_accept(self, conn, address):
|
|
122
137
|
#print(self.handle_accept)
|
|
@@ -126,15 +141,23 @@ class CLIConnectionManager(object):
|
|
|
126
141
|
return
|
|
127
142
|
try:
|
|
128
143
|
cm = CLIManager(conn, self.command_cb)
|
|
129
|
-
except Exception
|
|
130
|
-
dump_exception('CLIConnectionManager: unhandled exception
|
|
144
|
+
except Exception:
|
|
145
|
+
dump_exception('CLIConnectionManager: unhandled exception setting up incoming connection handler')
|
|
131
146
|
conn.close()
|
|
132
147
|
return
|
|
133
148
|
|
|
134
149
|
def shutdown(self):
|
|
150
|
+
try:
|
|
151
|
+
write(self._wakeup_w, b'\x01')
|
|
152
|
+
except OSError:
|
|
153
|
+
dump_exception('CLIConnectionManager: unhandled exception waking up acceptor')
|
|
154
|
+
pass
|
|
155
|
+
close(self._wakeup_w)
|
|
135
156
|
self.serversock.close()
|
|
136
157
|
self.command_cb = None
|
|
137
158
|
self.atr.join()
|
|
159
|
+
if not self.tcp:
|
|
160
|
+
remove(self.address)
|
|
138
161
|
|
|
139
162
|
class _CLIManager_w(Thread):
|
|
140
163
|
daemon = True
|
|
@@ -257,7 +280,7 @@ class CLIManager(object):
|
|
|
257
280
|
try:
|
|
258
281
|
self.command_cb(self, cmd)
|
|
259
282
|
except:
|
|
260
|
-
dump_exception('CLIManager: unhandled exception
|
|
283
|
+
dump_exception('CLIManager: unhandled exception processing incoming data')
|
|
261
284
|
self.close()
|
|
262
285
|
|
|
263
286
|
def send(self, data):
|
|
@@ -101,21 +101,23 @@ class RTPPLWorker_external(Thread):
|
|
|
101
101
|
if wi == None:
|
|
102
102
|
break
|
|
103
103
|
command, result_callback, callback_parameters = wi
|
|
104
|
+
ex = None
|
|
104
105
|
try:
|
|
105
106
|
data, rtpc_delay = self.send_raw(command)
|
|
106
107
|
if len(data) == 0:
|
|
107
108
|
data, rtpc_delay = None, None
|
|
108
109
|
except Exception as e:
|
|
110
|
+
data, rtpc_delay, ex = None, None, e
|
|
111
|
+
if result_callback is not None:
|
|
112
|
+
ED2.callFromThread(self.dispatch, result_callback, data, ex, callback_parameters)
|
|
113
|
+
elif ex is not None:
|
|
109
114
|
dump_exception('RTPPLWorker_external: unhandled exception I/O RTPproxy')
|
|
110
|
-
|
|
111
|
-
if result_callback != None:
|
|
112
|
-
ED2.callFromThread(self.dispatch, result_callback, data, callback_parameters)
|
|
113
|
-
if rtpc_delay != None:
|
|
115
|
+
if rtpc_delay is not None:
|
|
114
116
|
ED2.callFromThread(self.userv.register_delay, rtpc_delay)
|
|
115
117
|
self.userv = None
|
|
116
118
|
|
|
117
|
-
def dispatch(self, result_callback, data, callback_parameters):
|
|
119
|
+
def dispatch(self, result_callback, data, ex, callback_parameters):
|
|
118
120
|
try:
|
|
119
|
-
result_callback(data, *callback_parameters)
|
|
121
|
+
result_callback(data, *callback_parameters, ex=ex)
|
|
120
122
|
except:
|
|
121
123
|
dump_exception('RTPPLWorker_external: unhandled exception when processing RTPproxy reply')
|
|
@@ -88,15 +88,18 @@ def test(class_obj):
|
|
|
88
88
|
class robj(object):
|
|
89
89
|
rval = None
|
|
90
90
|
r = robj()
|
|
91
|
-
def display(res, ro, arg):
|
|
91
|
+
def display(res, ro, arg, ex=None):
|
|
92
92
|
print(res, arg)
|
|
93
|
-
ro.rval = (res, arg)
|
|
93
|
+
ro.rval = (res, arg, ex)
|
|
94
94
|
ED2.breakLoop()
|
|
95
95
|
rc = class_obj({'_sip_address':'1.2.3.4'})
|
|
96
96
|
rc.send_command('VF 123456', display, r, 'abcd')
|
|
97
97
|
ED2.loop()
|
|
98
98
|
rc.shutdown()
|
|
99
|
-
|
|
99
|
+
res, arg, ex = r.rval
|
|
100
|
+
if ex:
|
|
101
|
+
raise ex
|
|
102
|
+
assert((res, arg) == (u'0', u'abcd'))
|
|
100
103
|
print('passed')
|
|
101
104
|
|
|
102
105
|
if __name__ == '__main__':
|
|
@@ -181,8 +181,10 @@ class Rtp_proxy_client_udp(Rtp_proxy_client_net):
|
|
|
181
181
|
|
|
182
182
|
class selftest(object):
|
|
183
183
|
|
|
184
|
-
def gotreply(self, ED2, rtpc, *args):
|
|
184
|
+
def gotreply(self, ED2, rtpc, *args, ex=None):
|
|
185
185
|
print(args)
|
|
186
|
+
if ex:
|
|
187
|
+
print("Error:", ex)
|
|
186
188
|
rtpc.shutdown()
|
|
187
189
|
ED2.breakLoop()
|
|
188
190
|
|
|
@@ -24,6 +24,8 @@
|
|
|
24
24
|
# (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS
|
|
25
25
|
# SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
|
|
26
26
|
|
|
27
|
+
from sippy.Core.Exceptions import dump_exception
|
|
28
|
+
|
|
27
29
|
class Rtp_proxy_cmd_sequencer(object):
|
|
28
30
|
rtp_proxy_client = None
|
|
29
31
|
comqueue = None
|
|
@@ -43,7 +45,9 @@ class Rtp_proxy_cmd_sequencer(object):
|
|
|
43
45
|
self.inflight = (command, result_callback, callback_parameters)
|
|
44
46
|
self.rtp_proxy_client.send_command(command, self.result_callback)
|
|
45
47
|
|
|
46
|
-
def result_callback(self, result):
|
|
48
|
+
def result_callback(self, result, ex=None):
|
|
49
|
+
if ex is not None:
|
|
50
|
+
dump_exception('Rtp_proxy_cmd_sequencer: unhandled exception I/O RTPproxy')
|
|
47
51
|
command, result_callback, callback_parameters = self.inflight
|
|
48
52
|
self.inflight = None
|
|
49
53
|
if self.rtp_proxy_client != None and len(self.comqueue) > 0:
|
|
@@ -48,7 +48,7 @@ class Rtpp_caps_checker(object):
|
|
|
48
48
|
self.caps_requested += 1
|
|
49
49
|
rtpc.send_command('VF %s' % vers, self.caps_query_done, vers)
|
|
50
50
|
|
|
51
|
-
def caps_query_done(self, result, vers):
|
|
51
|
+
def caps_query_done(self, result, vers, ex=None):
|
|
52
52
|
self.caps_received += 1
|
|
53
53
|
vname = CAPSTABLE[vers]
|
|
54
54
|
if result == '1':
|
|
@@ -207,7 +207,7 @@ class Rtp_proxy_client(Rtp_proxy_client_udp, Rtp_proxy_client_stream):
|
|
|
207
207
|
return
|
|
208
208
|
self.send_command('V', self.version_check_reply)
|
|
209
209
|
|
|
210
|
-
def version_check_reply(self, version):
|
|
210
|
+
def version_check_reply(self, version, ex=None):
|
|
211
211
|
if self.shut_down:
|
|
212
212
|
return
|
|
213
213
|
if version == '20040107':
|
|
@@ -225,7 +225,7 @@ class Rtp_proxy_client(Rtp_proxy_client_udp, Rtp_proxy_client_stream):
|
|
|
225
225
|
return
|
|
226
226
|
self.send_command('Ib', self.heartbeat_reply)
|
|
227
227
|
|
|
228
|
-
def heartbeat_reply(self, stats):
|
|
228
|
+
def heartbeat_reply(self, stats, ex=None):
|
|
229
229
|
#print('heartbeat_reply', self.address, stats, self.online)
|
|
230
230
|
if self.shut_down:
|
|
231
231
|
return
|
|
@@ -293,8 +293,10 @@ class Rtp_proxy_client(Rtp_proxy_client_udp, Rtp_proxy_client_stream):
|
|
|
293
293
|
def test(cmd = 'VF 123456', **kwargs):
|
|
294
294
|
from sippy.Core.EventDispatcher import ED2
|
|
295
295
|
from sippy.Time.Timeout import Timeout
|
|
296
|
-
def display(*args):
|
|
296
|
+
def display(*args, ex=None):
|
|
297
297
|
print(args)
|
|
298
|
+
if ex:
|
|
299
|
+
print("Error:", ex)
|
|
298
300
|
ED2.breakLoop()
|
|
299
301
|
def waitonline(rpc):
|
|
300
302
|
if rpc.online:
|
|
@@ -94,7 +94,7 @@ class Rtp_proxy_session(object):
|
|
|
94
94
|
def version(self, result_callback):
|
|
95
95
|
self.rtp_proxy_client.send_command('V', self.version_result, result_callback)
|
|
96
96
|
|
|
97
|
-
def version_result(self, result, result_callback):
|
|
97
|
+
def version_result(self, result, result_callback, ex=None):
|
|
98
98
|
result_callback(result)
|
|
99
99
|
|
|
100
100
|
def play_caller(self, prompt_name, times = 1, result_callback = None, index = 0):
|
|
@@ -167,7 +167,7 @@ class Rtp_proxy_session(object):
|
|
|
167
167
|
command = 'Q %s %s %s' % ('%s-%d' % (self.call_id, index), self.from_tag, self.to_tag)
|
|
168
168
|
self.rtp_proxy_client.send_command(command, self.stats_result, (result_callback, callback_parameters))
|
|
169
169
|
|
|
170
|
-
def stats_result(self, result, args):
|
|
170
|
+
def stats_result(self, result, args, ex=None):
|
|
171
171
|
t1 = result.split()
|
|
172
172
|
result_callback, callback_parameters = args
|
|
173
173
|
if len(t1) == 1:
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|