summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorLiong Sauw Ming <ming@teluu.com>2012-05-04 02:04:02 +0000
committerLiong Sauw Ming <ming@teluu.com>2012-05-04 02:04:02 +0000
commit3357b5f442e1666f69ab5f57fbb5180903d3d905 (patch)
treef2055fc9b85b1bcc08fda97f081527d412fccf5a
parent26184eee4b5427c7d0c61ed1d2db57fb124c6d67 (diff)
Fixed #1504: Crash when trying to answer calls but call has been disconnected
git-svn-id: http://svn.pjsip.org/repos/pjproject/trunk@4118 74dad513-b988-da41-8d7b-12977e46ad98
-rw-r--r--pjsip/src/pjsua-lib/pjsua_call.c8
1 files changed, 8 insertions, 0 deletions
diff --git a/pjsip/src/pjsua-lib/pjsua_call.c b/pjsip/src/pjsua-lib/pjsua_call.c
index cbd2afac..a6264f3a 100644
--- a/pjsip/src/pjsua-lib/pjsua_call.c
+++ b/pjsip/src/pjsua-lib/pjsua_call.c
@@ -885,6 +885,14 @@ on_return:
next = answer->next;
pjsua_call_answer(call_id, answer->code, answer->reason,
answer->msg_data);
+
+ /* Call might have been disconnected if application is answering
+ * with 200/OK and the media failed to start.
+ * See pjsua_call_answer() below.
+ */
+ if (!call->inv || !call->inv->pool_prov)
+ break;
+
pj_list_erase(answer);
answer = next;
}