From 4e554cc92e6ada58bfbcebd7cb24fd0d38ce5f9a Mon Sep 17 00:00:00 2001 From: Anthony Minessale Date: Mon, 22 Mar 2010 17:28:22 +0000 Subject: [PATCH] only allow barge-in on SCA mode when calls are from their own line git-svn-id: http://svn.freeswitch.org/svn/freeswitch/trunk@17067 d0543943-73ff-0310-b7d9-9358b9ac24b2 --- src/mod/endpoints/mod_sofia/sofia.c | 17 ++++++++--------- 1 file changed, 8 insertions(+), 9 deletions(-) diff --git a/src/mod/endpoints/mod_sofia/sofia.c b/src/mod/endpoints/mod_sofia/sofia.c index c38d917268..f0ea91b8bb 100644 --- a/src/mod/endpoints/mod_sofia/sofia.c +++ b/src/mod/endpoints/mod_sofia/sofia.c @@ -6335,23 +6335,22 @@ void sofia_handle_sip_i_invite(nua_t *nua, sofia_profile_t *profile, nua_handle_ char cid[512] = ""; char *str; char *p = NULL; - const char *user = NULL, *host = NULL; + const char *user = NULL, *host = NULL, *from_user = NULL, *from_host = NULL; if (sip->sip_to && sip->sip_to->a_url) { user = sip->sip_to->a_url->url_user; host = sip->sip_to->a_url->url_host; } - if (!user || !host) { - if (sip->sip_from && sip->sip_from->a_url) { - if (!user) - user = sip->sip_from->a_url->url_user; - if (!host) - host = sip->sip_from->a_url->url_host; - } + if (sip->sip_from && sip->sip_from->a_url) { + from_user = sip->sip_from->a_url->url_user; + from_host = sip->sip_from->a_url->url_host; } - if (user && host) { + if (!user) user = from_user; + if (!host) user = from_host; + + if (user && host && from_user && !strcmp(user, from_user)) { if ((p = strchr(call_info_str, ';'))) { p++; }