]> git.ipfire.org Git - thirdparty/freeswitch.git/commitdiff
only allow barge-in on SCA mode when calls are from their own line
authorAnthony Minessale <anthony.minessale@gmail.com>
Mon, 22 Mar 2010 17:28:22 +0000 (17:28 +0000)
committerAnthony Minessale <anthony.minessale@gmail.com>
Mon, 22 Mar 2010 17:28:22 +0000 (17:28 +0000)
git-svn-id: http://svn.freeswitch.org/svn/freeswitch/trunk@17067 d0543943-73ff-0310-b7d9-9358b9ac24b2

src/mod/endpoints/mod_sofia/sofia.c

index c38d917268f8200da815d003bb21bc277a97faf6..f0ea91b8bb880935a4a676c2d5ba86735363e0ac 100644 (file)
@@ -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++;
                        }