]> git.ipfire.org Git - thirdparty/freeswitch.git/commitdiff
FS-7759 #resolve added a channel var to suppress setting the completed elsewhere...
authorkarl anderson <karl@2600hz.com>
Thu, 2 Apr 2015 23:25:25 +0000 (19:25 -0400)
committerLuis Azedo <luis@2600hz.com>
Thu, 2 Jul 2015 16:02:47 +0000 (17:02 +0100)
src/mod/endpoints/mod_sofia/mod_sofia.c

index 89c88c7b43c7283e0f2bf61db4628f3f2a14172f..a90ec9c2caab404fb4f73fa837eb58659cdc6011 100644 (file)
@@ -462,7 +462,8 @@ switch_status_t sofia_on_hangup(switch_core_session_t *session)
                        if ((val = switch_channel_get_variable(tech_pvt->channel, "sip_reason"))) {
                                switch_snprintf(reason, sizeof(reason), "%s", val);
                        } else {
-                               if (switch_channel_test_flag(channel, CF_INTERCEPT) || cause == SWITCH_CAUSE_PICKED_OFF || cause == SWITCH_CAUSE_LOSE_RACE) {
+                               if ((switch_channel_test_flag(channel, CF_INTERCEPT) || cause == SWITCH_CAUSE_PICKED_OFF || cause == SWITCH_CAUSE_LOSE_RACE)
+                                       && switch_false(switch_channel_get_variable(channel, "ignore_completed_elsewhere"))) {
                                        switch_snprintf(reason, sizeof(reason), "SIP;cause=200;text=\"Call completed elsewhere\"");
                                } else if (cause > 0 && cause < 128) {
                                        switch_snprintf(reason, sizeof(reason), "Q.850;cause=%d;text=\"%s\"", cause, switch_channel_cause2str(cause));