Changeset 5288
- Timestamp:
- May 10, 2016 2:58:41 PM (9 years ago)
- Location:
- pjproject/trunk/pjsip
- Files:
-
- 3 edited
Legend:
- Unmodified
- Added
- Removed
-
pjproject/trunk/pjsip/include/pjsua-lib/pjsua_internal.h
r5273 r5288 190 190 pj_bool_t reinv_pending;/**< Pending until CONFIRMED state. */ 191 191 pj_bool_t reinv_ice_sent;/**< Has reinvite for ICE upd sent? */ 192 pjsip_rx_data *incoming_data;/**< Cloned incoming call rdata. 193 On pjsua2, when handling incoming 194 call, onCreateMediaTransport() will 195 not be called since the call isn't 196 created yet. This temporary 197 variable is used to handle such 198 case, see ticket #1916. */ 192 199 }; 193 200 -
pjproject/trunk/pjsip/src/pjsua-lib/pjsua_call.c
r5252 r5288 1101 1101 pjsip_inv_session *inv = NULL; 1102 1102 int acc_id; 1103 pjsua_call *call ;1103 pjsua_call *call = NULL; 1104 1104 int call_id = -1; 1105 1105 int sip_err_code = PJSIP_SC_INTERNAL_SERVER_ERROR; … … 1222 1222 goto on_return; 1223 1223 } 1224 } 1225 1226 if (!replaced_dlg) { 1227 /* Clone rdata. */ 1228 pjsip_rx_data_clone(rdata, 0, &call->incoming_data); 1224 1229 } 1225 1230 … … 1637 1642 if (dlg) { 1638 1643 pjsip_dlg_dec_lock(dlg); 1644 } 1645 1646 if (call && call->incoming_data) { 1647 pjsip_rx_data_free_cloned(call->incoming_data); 1648 call->incoming_data = NULL; 1639 1649 } 1640 1650 -
pjproject/trunk/pjsip/src/pjsua2/endpoint.cpp
r5287 r5288 603 603 } 604 604 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 605 614 /* call callback */ 606 615 OnIncomingCallParam prm; … … 609 618 610 619 acc->onIncomingCall(prm); 620 621 /* Free cloned rdata. */ 622 pjsip_rx_data_free_cloned(call->incoming_data); 623 call->incoming_data = NULL; 611 624 612 625 /* disconnect if callback doesn't handle the call */ … … 1226 1239 Call *call = Call::lookup(call_id); 1227 1240 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 } 1229 1257 } 1230 1258
Note: See TracChangeset
for help on using the changeset viewer.