Merge pull request #326 in FS/freeswitch from ~LAZEDO/freeswitch:feature/fs-7759 to master

* commit '46d98d4a19cffdf77d181a45a6edcd5bc92f211b':
  FS-7759 #resolve added a channel var to suppress setting the completed elsewhere cause
This commit is contained in:
Mike Jerris 2015-07-02 11:57:55 -05:00
commit b6dae4c087
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));