FS-7759 #resolve added a channel var to suppress setting the completed elsewhere cause

This commit is contained in:
karl anderson 2015-04-02 19:25:25 -04:00 committed by Luis Azedo
parent c6ccf1c513
commit 46d98d4a19
1 changed files with 2 additions and 1 deletions

View 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));