diff options
author | Liong Sauw Ming <ming@teluu.com> | 2014-04-07 06:56:06 +0000 |
---|---|---|
committer | Liong Sauw Ming <ming@teluu.com> | 2014-04-07 06:56:06 +0000 |
commit | 010192a1bb7af7a7f4a9a2ab32cecf465789d69b (patch) | |
tree | c165edf2750da92d7eeec97cd4e3a2cb557e29b0 /pjsip-apps/src | |
parent | d60b9879e2b9b4b6e718db04efe9ac33f880349a (diff) |
Re #1751 (misc): Add feature in Python API to enable mwi and modify account (thanks to John Bigelow for the patch). This is to update the old API. If possible, application is recommended to use the new API based on pjsua2 instead (please refer to pjsua2 book).
git-svn-id: http://svn.pjsip.org/repos/pjproject/trunk@4810 74dad513-b988-da41-8d7b-12977e46ad98
Diffstat (limited to 'pjsip-apps/src')
-rw-r--r-- | pjsip-apps/src/python/pjsua.py | 15 |
1 files changed, 15 insertions, 0 deletions
diff --git a/pjsip-apps/src/python/pjsua.py b/pjsip-apps/src/python/pjsua.py index 9b2fbfe6..d6acafaf 100644 --- a/pjsip-apps/src/python/pjsua.py +++ b/pjsip-apps/src/python/pjsua.py @@ -775,6 +775,7 @@ class AccountConfig: use_srtp = 0 srtp_secure_signaling = 1 rtp_transport_cfg = None + mwi_enabled = False def __init__(self, domain="", username="", password="", display="", registrar="", proxy=""): @@ -865,6 +866,7 @@ class AccountConfig: self.ka_data = cfg.ka_data self.use_srtp = cfg.use_srtp self.srtp_secure_signaling = cfg.srtp_secure_signaling + self.mwi_enabled = cfg.mwi_enabled if (self.rtp_transport_cfg is not None): self.rtp_transport_cfg._cvt_from_pjsua(cfg.rtp_transport_cfg) @@ -896,6 +898,7 @@ class AccountConfig: cfg.ka_data = self.ka_data cfg.use_srtp = self.use_srtp cfg.srtp_secure_signaling = self.srtp_secure_signaling + cfg.mwi_enabled = self.mwi_enabled if (self.rtp_transport_cfg is not None): cfg.rtp_transport_cfg = self.rtp_transport_cfg._cvt_to_pjsua() @@ -2337,6 +2340,18 @@ class Lib: self._err_check("create_account_for_transport()", self, err) return Account(self, acc_id, cb) + def modify_account(self, acc_id, acc_config): + """Modify configuration of a pjsua account. + + Keyword arguments: + acc_id -- ID of the account to be modified. + acc_config -- New account configuration. + + """ + lck = self.auto_lock() + err = _pjsua.acc_modify(acc_id, acc_config._cvt_to_pjsua()) + self._err_check("modify_account()", self, err) + def hangup_all(self): """Hangup all calls. |