Commit b92e8b55 authored by Adrian Georgescu's avatar Adrian Georgescu

Added pstn prefix setting

parent 6e6b42bd
...@@ -14,6 +14,7 @@ from blink.configuration.datatypes import ApplicationDataPath, CustomSoundFile, ...@@ -14,6 +14,7 @@ from blink.configuration.datatypes import ApplicationDataPath, CustomSoundFile,
class PSTNSettingsExtension(PSTNSettings): class PSTNSettingsExtension(PSTNSettings):
idd_prefix = Setting(type=unicode, default=None, nillable=True) idd_prefix = Setting(type=unicode, default=None, nillable=True)
prefix = Setting(type=unicode, default=None, nillable=True)
class RTPSettingsExtension(RTPSettings): class RTPSettingsExtension(RTPSettings):
......
...@@ -1810,6 +1810,8 @@ class SessionManager(object): ...@@ -1810,6 +1810,8 @@ class SessionManager(object):
address = cls.number_strip_re.sub('', address) address = cls.number_strip_re.sub('', address)
if isinstance(account, Account) and account.pstn.idd_prefix is not None: if isinstance(account, Account) and account.pstn.idd_prefix is not None:
address = re.sub(r'^\+', account.pstn.idd_prefix, address) address = re.sub(r'^\+', account.pstn.idd_prefix, address)
if isinstance(account, Account) and account.pstn.prefix is not None:
address = account.pstn.prefix + address
return address return address
def _remove_session(self, session): def _remove_session(self, session):
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment