Ignore:
Timestamp:
May 10, 2016 2:58:41 PM (5 years ago)
Author:
riza
Message:

Fixed #1914: onCreateMediaTransport() callback might not be called on PJSUA2.

File:
1 edited

Legend:

Unmodified
Added
Removed
  • pjproject/trunk/pjsip/src/pjsua2/endpoint.cpp

    r5287 r5288  
    603603    } 
    604604 
     605    pjsua_call *call = &pjsua_var.calls[call_id]; 
     606    if (!call->incoming_data) { 
     607        /* This happens when the incoming call callback has been called from  
     608         * inside the on_create_media_transport() callback. So we simply  
     609         * return here to avoid calling the callback twice.  
     610         */ 
     611        return; 
     612    } 
     613 
    605614    /* call callback */ 
    606615    OnIncomingCallParam prm; 
     
    609618 
    610619    acc->onIncomingCall(prm); 
     620 
     621    /* Free cloned rdata. */ 
     622    pjsip_rx_data_free_cloned(call->incoming_data); 
     623    call->incoming_data = NULL; 
    611624 
    612625    /* disconnect if callback doesn't handle the call */ 
     
    12261239    Call *call = Call::lookup(call_id); 
    12271240    if (!call) { 
    1228         return base_tp; 
     1241        pjsua_call *in_call = &pjsua_var.calls[call_id]; 
     1242        if (in_call->incoming_data) { 
     1243            /* This can happen when there is an incoming call but the 
     1244             * on_incoming_call() callback hasn't been called. So we need to  
     1245             * call the callback here. 
     1246             */ 
     1247            on_incoming_call(in_call->acc_id, call_id, in_call->incoming_data); 
     1248 
     1249            /* New call should already be created by app. */ 
     1250            call = Call::lookup(call_id); 
     1251            if (!call) { 
     1252                return base_tp; 
     1253            } 
     1254        } else { 
     1255            return base_tp; 
     1256        } 
    12291257    } 
    12301258     
Note: See TracChangeset for help on using the changeset viewer.