Changeset 4810


Ignore:
Timestamp:
Apr 7, 2014 6:56:06 AM (6 years ago)
Author:
ming
Message:

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).

File:
1 edited

Legend:

Unmodified
Added
Removed
  • pjproject/trunk/pjsip-apps/src/python/pjsua.py

    r4724 r4810  
    776776    srtp_secure_signaling = 1 
    777777    rtp_transport_cfg = None 
     778    mwi_enabled = False 
    778779 
    779780    def __init__(self, domain="", username="", password="",  
     
    866867        self.use_srtp = cfg.use_srtp 
    867868        self.srtp_secure_signaling = cfg.srtp_secure_signaling 
     869        self.mwi_enabled = cfg.mwi_enabled 
    868870        if (self.rtp_transport_cfg is not None): 
    869871            self.rtp_transport_cfg._cvt_from_pjsua(cfg.rtp_transport_cfg) 
     
    897899        cfg.use_srtp = self.use_srtp 
    898900        cfg.srtp_secure_signaling = self.srtp_secure_signaling 
     901        cfg.mwi_enabled = self.mwi_enabled 
    899902 
    900903        if (self.rtp_transport_cfg is not None): 
     
    23382341        return Account(self, acc_id, cb) 
    23392342 
     2343    def modify_account(self, acc_id, acc_config): 
     2344        """Modify configuration of a pjsua account. 
     2345 
     2346        Keyword arguments: 
     2347        acc_id      -- ID of the account to be modified. 
     2348        acc_config  -- New account configuration. 
     2349 
     2350        """ 
     2351        lck = self.auto_lock() 
     2352        err = _pjsua.acc_modify(acc_id, acc_config._cvt_to_pjsua()) 
     2353        self._err_check("modify_account()", self, err) 
     2354 
    23402355    def hangup_all(self): 
    23412356        """Hangup all calls. 
Note: See TracChangeset for help on using the changeset viewer.