summaryrefslogtreecommitdiff
path: root/pjsip/src/pjsua-lib/pjsua_call.c
diff options
context:
space:
mode:
authorNanang Izzuddin <nanang@teluu.com>2012-09-28 08:56:08 +0000
committerNanang Izzuddin <nanang@teluu.com>2012-09-28 08:56:08 +0000
commitbea8edcb195eda3e316b67c29ecceca22db3ef1e (patch)
tree2fadbb443980b7c32c501ba4b211f2c302ef011f /pjsip/src/pjsua-lib/pjsua_call.c
parentf9699a50372fce5b374b3e768fd433296403e894 (diff)
Re #1587:
- Don't answer call replace request with 200 if the replaced call hasn't reach confirmed state and has UAS role. - Only apply accept_replace_in_early_state when call is in early state. git-svn-id: http://svn.pjsip.org/repos/pjproject/trunk@4268 74dad513-b988-da41-8d7b-12977e46ad98
Diffstat (limited to 'pjsip/src/pjsua-lib/pjsua_call.c')
-rw-r--r--pjsip/src/pjsua-lib/pjsua_call.c17
1 files changed, 13 insertions, 4 deletions
diff --git a/pjsip/src/pjsua-lib/pjsua_call.c b/pjsip/src/pjsua-lib/pjsua_call.c
index a92874bb..c374f0dc 100644
--- a/pjsip/src/pjsua-lib/pjsua_call.c
+++ b/pjsip/src/pjsua-lib/pjsua_call.c
@@ -825,11 +825,20 @@ static pj_status_t process_incoming_call_replace(pjsua_call *call,
pjsua_var.ua_cfg.cb.on_call_replaced(replaced_call->index,
call->index);
- PJ_LOG(4,(THIS_FILE, "Answering replacement call %d with 200/OK",
- call->index));
+ if (replaced_call->inv->state <= PJSIP_INV_STATE_EARLY &&
+ replaced_call->inv->role != PJSIP_ROLE_UAC)
+ {
+ /* Replaced call is not in confirmed state yet and we are not
+ * the call initiator, should not answer with 200 response here.
+ */
+ } else {
+ PJ_LOG(4,(THIS_FILE, "Answering replacement call %d with 200/OK",
+ call->index));
+
+ /* Answer the new call with 200 response */
+ status = pjsip_inv_answer(call->inv, 200, NULL, NULL, &tdata);
+ }
- /* Answer the new call with 200 response */
- status = pjsip_inv_answer(call->inv, 200, NULL, NULL, &tdata);
if (status == PJ_SUCCESS)
status = pjsip_inv_send_msg(call->inv, tdata);