Ignore:
Timestamp:
Oct 2, 2013 3:19:54 AM (11 years ago)
Author:
nanang
Message:

Close #1701: added received message info into incoming call callback

File:
1 edited

Legend:

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

    r4581 r4609  
    898898        cfg.srtp_secure_signaling = self.srtp_secure_signaling 
    899899 
    900         cfg.rtp_transport_cfg = self.rtp_transport_cfg._cvt_to_pjsua() 
     900        if (self.rtp_transport_cfg is not None): 
     901            cfg.rtp_transport_cfg = self.rtp_transport_cfg._cvt_to_pjsua() 
    901902         
    902903        return cfg 
     
    979980        """Notification about incoming call. 
    980981 
    981         Unless this callback is implemented, the default behavior is to 
    982         reject the call with default status code. 
     982        Application should implement one of on_incoming_call() or 
     983        on_incoming_call2(), otherwise, the default behavior is to 
     984        reject the call with default status code. Note that if both are 
     985        implemented, only on_incoming_call2() will be called. 
    983986 
    984987        Keyword arguments: 
     
    987990        call.hangup() 
    988991 
     992    def on_incoming_call2(self, call, rdata): 
     993        """Notification about incoming call, with received SIP message info. 
     994 
     995        Application should implement one of on_incoming_call() or 
     996        on_incoming_call2(), otherwise, the default behavior is to 
     997        reject the call with default status code. Note that if both are 
     998        implemented, only on_incoming_call2() will be called. 
     999 
     1000        Keyword arguments: 
     1001        call    -- the new incoming call 
     1002        rdata   -- the received message 
     1003        """ 
     1004        call.hangup() 
     1005         
    9891006    def on_incoming_subscribe(self, buddy, from_uri, contact_uri, pres_obj): 
    9901007        """Notification when incoming SUBSCRIBE request is received.  
     
    27422759        acc = self._lookup_account(acc_id) 
    27432760        if acc: 
    2744             acc._cb.on_incoming_call( Call(self, call_id) ) 
     2761            if 'on_incoming_call2' in acc._cb.__class__.__dict__: 
     2762                acc._cb.on_incoming_call2( Call(self, call_id), rdata ) 
     2763            else: 
     2764                acc._cb.on_incoming_call( Call(self, call_id) ) 
    27452765        else: 
    27462766            _pjsua.call_hangup(call_id, 603, None, None) 
Note: See TracChangeset for help on using the changeset viewer.