Browse Source

Added prefix-resolution if no default proxy is set and the number is not absolute

pull/1/head
klonfish 10 years ago
parent
commit
4558c0f1b2
  1. 9
      phoneinterface.py

9
phoneinterface.py

@ -62,7 +62,6 @@ class PhoneInterface(object): @@ -62,7 +62,6 @@ class PhoneInterface(object):
pconf.publish_enabled = False
pconf.realm = p.realm
pconf.register_enabled = True
pconf.register_enabled = True
pconf.server_addr = p.proxy
self.__core.add_proxy_config(pconf)
pconf.done()
@ -153,6 +152,12 @@ class PhoneInterface(object): @@ -153,6 +152,12 @@ class PhoneInterface(object):
self.__event_cbs.append(cb)
def call(self, number):
if '@' not in number and self.__core.default_proxy_config is None:
# Try to resolve prefix
for p in self.__config.proxies:
if number.startswith(p.prefix):
number += '@' + p.realm
break
self.__core.invite(number)
def accept_call(self):
@ -208,4 +213,4 @@ if __name__ == '__main__': @@ -208,4 +213,4 @@ if __name__ == '__main__':
pass
except KeyboardInterrupt:
phone.stop()

Loading…
Cancel
Save