diff options
Diffstat (limited to 'pjsip/src/pjsua-lib/pjsua_call.c')
-rw-r--r-- | pjsip/src/pjsua-lib/pjsua_call.c | 11 |
1 files changed, 11 insertions, 0 deletions
diff --git a/pjsip/src/pjsua-lib/pjsua_call.c b/pjsip/src/pjsua-lib/pjsua_call.c index 68eba778..d39825d6 100644 --- a/pjsip/src/pjsua-lib/pjsua_call.c +++ b/pjsip/src/pjsua-lib/pjsua_call.c @@ -689,6 +689,9 @@ pj_bool_t pjsua_call_on_incoming(pjsip_rx_data *rdata) if (status != PJ_SUCCESS) pjsua_perror(THIS_FILE, "Error answering session", status); + /* Note that inv may be invalid if 200/OK has caused error in + * starting the media. + */ PJ_LOG(4,(THIS_FILE, "Disconnecting replaced call %d", replaced_call->index)); @@ -1016,6 +1019,14 @@ PJ_DEF(pj_status_t) pjsua_call_answer( pjsua_call_id call_id, return status; } + /* Call might have been disconnected if application is answering with + * 200/OK and the media failed to start. + */ + if (call->inv == NULL) { + pjsip_dlg_dec_lock(dlg); + return PJSIP_ESESSIONTERMINATED; + } + /* Add additional headers etc */ pjsua_process_msg_data( tdata, msg_data); |