Added prefix-resolution if no default proxy is set and the number is not absolute
This commit is contained in:
parent
97079c7171
commit
4558c0f1b2
1 changed files with 7 additions and 2 deletions
|
@ -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):
|
|||
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__':
|
|||
pass
|
||||
except KeyboardInterrupt:
|
||||
phone.stop()
|
||||
|
||||
|
||||
|
|
Loading…
Reference in a new issue