- Timestamp:
- Apr 23, 2012 1:27:29 PM (13 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
pjproject/trunk/pjsip/src/pjsua-lib/pjsua_call.c
r4052 r4068 851 851 on_return: 852 852 if (status != PJ_SUCCESS) { 853 pjsip_tx_data *tdata; 854 pj_status_t status_; 855 856 status_ = pjsip_inv_end_session(call->inv, sip_err_code, NULL, &tdata); 857 if (status_ == PJ_SUCCESS && tdata) 858 status_ = pjsip_inv_send_msg(call->inv, tdata); 853 /* If the callback is called from pjsua_call_on_incoming(), the 854 * invite's state is PJSIP_INV_STATE_NULL, so the invite session 855 * will be terminated later, otherwise we end the session here. 856 */ 857 if (call->inv->state > PJSIP_INV_STATE_NULL) { 858 pjsip_tx_data *tdata; 859 pj_status_t status_; 860 861 status_ = pjsip_inv_end_session(call->inv, sip_err_code, NULL, 862 &tdata); 863 if (status_ == PJ_SUCCESS && tdata) 864 status_ = pjsip_inv_send_msg(call->inv, tdata); 865 } 859 866 860 867 pjsua_media_channel_deinit(call->index); … … 1226 1233 if (status != PJ_SUCCESS) { 1227 1234 sip_err_code = PJSIP_SC_NOT_ACCEPTABLE; 1235 /* Since the call invite's state is still PJSIP_INV_STATE_NULL, 1236 * the invite session was not ended in 1237 * on_incoming_call_med_tp_complete(), so we need to send 1238 * a response message and terminate the invite here. 1239 */ 1228 1240 pjsip_dlg_respond(dlg, rdata, sip_err_code, NULL, NULL, NULL); 1241 pjsip_inv_terminate(call->inv, sip_err_code, PJ_FALSE); 1242 call->inv = NULL; 1229 1243 goto on_return; 1230 1244 } … … 1232 1246 pjsua_perror(THIS_FILE, "Error initializing media channel", status); 1233 1247 pjsip_dlg_respond(dlg, rdata, sip_err_code, NULL, NULL, NULL); 1248 pjsip_inv_terminate(call->inv, sip_err_code, PJ_FALSE); 1249 call->inv = NULL; 1234 1250 goto on_return; 1235 1251 }
Note: See TracChangeset
for help on using the changeset viewer.