summaryrefslogtreecommitdiff
path: root/pjsip
diff options
context:
space:
mode:
authorBenny Prijono <bennylp@teluu.com>2007-03-27 10:53:57 +0000
committerBenny Prijono <bennylp@teluu.com>2007-03-27 10:53:57 +0000
commit3ee079edf0730eed604f2b4f41fbd445c2f7de25 (patch)
treeda211417aa8ecf9bc3dea3beb1db1bd5cad29e96 /pjsip
parent58297f1c1073e824a711fba33cf7e941338744f2 (diff)
Fixed ticket #202: Fix telephone-event order in SDP (thanks Chris Hamilton)
git-svn-id: http://svn.pjsip.org/repos/pjproject/branches/pjproject-0.5-stable@1107 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 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);