[Telepathy-commits] [telepathy-sofiasip/master] Bind the test SIP proxy to the loopback interface only
Mikhail Zabaluev
mikhail.zabaluev at nokia.com
Fri Oct 24 02:21:49 PDT 2008
Also tell it to use 127.0.0.1 and the port number in Via headers.
---
tests/twisted/sofiatest.py | 12 +++++++-----
1 files changed, 7 insertions(+), 5 deletions(-)
diff --git a/tests/twisted/sofiatest.py b/tests/twisted/sofiatest.py
index db5ade4..1c4472c 100644
--- a/tests/twisted/sofiatest.py
+++ b/tests/twisted/sofiatest.py
@@ -35,23 +35,25 @@ class SipProxy(sip.RegisterProxy):
def prepare_test(event_func, register_cb, params=None):
- default_params = {
+ actual_params = {
'account': 'testacc at 127.0.0.1',
'password': 'testpwd',
'proxy-host': '127.0.0.1',
'port': dbus.UInt16(9090),
+ 'local-ip-address': '127.0.0.1'
}
if params is not None:
- default_params.update(params)
+ actual_params.update(params)
bus, conn = servicetest.prepare_test(event_func,
- 'sofiasip', 'sip', default_params)
+ 'sofiasip', 'sip', actual_params)
- sip = SipProxy()
+ port = int(actual_params['port'])
+ sip = SipProxy(host=actual_params['proxy-host'], port=port)
sip.event_func = event_func
sip.registrar_handler = register_cb
- reactor.listenUDP(int(default_params['port']), sip)
+ reactor.listenUDP(port, sip)
return bus, conn, sip
def default_register_cb(message, host, port):
--
1.5.6.5
More information about the Telepathy-commits
mailing list