if (switch_channel_up_nosig(channel)) {
switch_channel_set_flag(channel, CF_WINNER);
+ switch_channel_set_variable(channel, "group_dial_status", "winner");
}
goto wbreak;
}
if (!strcmp(collect->key, buf)) {
switch_channel_set_flag(channel, CF_WINNER);
+ switch_channel_set_variable(channel, "group_dial_status", "winner");
goto wbreak;
} else if (collect->error_file) {
switch_ivr_play_file(collect->session, NULL, collect->error_file, NULL);
if (handle->done != 2) {
if (handle->status == SWITCH_STATUS_SUCCESS) {
- switch_channel_hangup(switch_core_session_get_channel(handle->bleg), SWITCH_CAUSE_LOSE_RACE);
+ switch_channel_t *channel = switch_core_session_get_channel(handle->bleg);
+
+ switch_channel_set_variable(channel, "group_dial_status", "loser");
+ switch_channel_hangup(channel, SWITCH_CAUSE_LOSE_RACE);
switch_core_session_rwunlock(handle->bleg);
}
}
switch_ivr_uuid_bridge(holding, switch_core_session_get_uuid(originate_status[i].peer_session));
holding = NULL;
} else {
+ if (force_reason == SWITCH_CAUSE_LOSE_RACE || reason == SWITCH_CAUSE_LOSE_RACE) {
+ switch_channel_set_variable(originate_status[i].peer_channel, "group_dial_status", "loser");
+ }
switch_channel_hangup(originate_status[i].peer_channel, force_reason ? force_reason : reason);
}
}