From 7e12673934ae7c9a4e24fa94513a6562688a15eb Mon Sep 17 00:00:00 2001
From: Simon Morlat <simon.morlat@linphone.org>
Date: Mon, 7 Nov 2011 11:02:59 +0100
Subject: [PATCH] add setting to reject duplicate calls

---
 coreapi/callbacks.c | 3 ++-
 1 file changed, 2 insertions(+), 1 deletion(-)

diff --git a/coreapi/callbacks.c b/coreapi/callbacks.c
index bfdfde8ee7..7b79a78d6d 100644
--- a/coreapi/callbacks.c
+++ b/coreapi/callbacks.c
@@ -148,6 +148,7 @@ static void call_received(SalOp *h){
 	LinphoneAddress *from_addr, *to_addr;
 	SalMediaDescription *md;
 	bool_t propose_early_media=lp_config_get_int(lc->config,"sip","incoming_calls_early_media",FALSE);
+	bool_t prevent_colliding_calls=lp_config_get_int(lc->config,"sip","prevent_colliding_calls",TRUE);
 	const char *ringback_tone=linphone_core_get_remote_ringback_tone (lc);
 	
 	/* first check if we can answer successfully to this invite */
@@ -176,7 +177,7 @@ static void call_received(SalOp *h){
 	from_addr=linphone_address_new(from);
 	to_addr=linphone_address_new(to);
 
-	if (already_a_call_with_remote_address(lc,from_addr) || already_a_call_pending(lc)){
+	if ((already_a_call_with_remote_address(lc,from_addr) && prevent_colliding_calls) || already_a_call_pending(lc)){
 		ms_warning("Receiving another call while one is ringing or initiated, refusing this one with busy message.");
 		sal_call_decline(h,SalReasonBusy,NULL);
 		sal_op_release(h);
-- 
GitLab