summaryrefslogtreecommitdiff
path: root/pjsip
diff options
context:
space:
mode:
authorBenny Prijono <bennylp@teluu.com>2007-03-27 11:01:45 +0000
committerBenny Prijono <bennylp@teluu.com>2007-03-27 11:01:45 +0000
commiteb531db72bd93280e47a6a03782da093eb8b2505 (patch)
tree397ce741e174d2d83820b72092b61c9b83556235 /pjsip
parentd700d4a60001dd6a9c0c515e6cb359c9118d00ce (diff)
Fixed ticket #203: Fix error when telephone-event is set as the first format in SDP (thanks Chris Hamilton)
git-svn-id: http://svn.pjsip.org/repos/pjproject/trunk@1109 74dad513-b988-da41-8d7b-12977e46ad98
Diffstat (limited to 'pjsip')
-rw-r--r--pjsip/src/pjsua-lib/pjsua_call.c11
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 2441f8ed..b0e420eb 100644
--- a/pjsip/src/pjsua-lib/pjsua_call.c
+++ b/pjsip/src/pjsua-lib/pjsua_call.c
@@ -708,6 +708,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));
@@ -1035,6 +1038,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);