Changeset 5976


Ignore:
Timestamp:
May 6, 2019 10:05:03 AM (6 years ago)
Author:
ming
Message:

Fixed #2194: onStreamDestroyed callback is not called upon call disconnection

Location:
pjproject/trunk/pjsip/src/pjsua2
Files:
2 edited

Legend:

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

    r5972 r5976  
    2525using namespace pj; 
    2626using namespace std; 
     27 
     28#include <pjsua-lib/pjsua_internal.h> 
    2729 
    2830#define THIS_FILE               "call.cpp" 
     
    901903        pj_ci.state == PJSIP_INV_STATE_DISCONNECTED) 
    902904    { 
     905        pjsua_call *call = &pjsua_var.calls[id]; 
     906 
     907        /* We are going to remove the Call object association below, 
     908         * so we need to call onStreamDestroyed() callback here. 
     909         */ 
     910        for (mi = 0; mi < call->med_cnt; ++mi) { 
     911            pjsua_call_media *call_med = &call->media[mi]; 
     912            if (call_med->type == PJMEDIA_TYPE_AUDIO && 
     913                call_med->strm.a.stream) 
     914            { 
     915                OnStreamDestroyedParam prm; 
     916                prm.stream = call_med->strm.a.stream; 
     917                prm.streamIdx = mi; 
     918     
     919                onStreamDestroyed(prm);          
     920            } 
     921        } 
     922 
    903923        /* Clear medias. */ 
    904924        for (mi = 0; mi < medias.size(); mi++) { 
  • pjproject/trunk/pjsip/src/pjsua2/endpoint.cpp

    r5972 r5976  
    11191119    Call *call = Call::lookup(call_id); 
    11201120    if (!call) { 
     1121        /* This can happen for call disconnection case. The callback 
     1122         * should have been called from on_call_state() instead. 
     1123         */ 
    11211124        return; 
    11221125    } 
Note: See TracChangeset for help on using the changeset viewer.