diff options
author | Mikhail Zabaluev <mikhail.zabaluev@nokia.com> | 2008-10-24 12:21:49 +0300 |
---|---|---|
committer | Mikhail Zabaluev <mikhail.zabaluev@nokia.com> | 2008-10-24 14:19:35 +0300 |
commit | 77bdbfa71e7d16ddc8994fa680988d88cc70ef03 (patch) | |
tree | 6e836bcd93f85c59d5722439446097f59d292cfc | |
parent | 069726215d331d4db80f64b3093f577d503c7a73 (diff) |
Bind the test SIP proxy to the loopback interface only
Also tell it to use 127.0.0.1 and the port number in Via headers.
-rw-r--r-- | 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@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): |