if (fail_on_single_reject_var) {
const char *cause_str = switch_channel_cause2str(reason);
+ int neg = *fail_on_single_reject_var == '!';
+ int pos = !!switch_stristr(cause_str, fail_on_single_reject_var);
+
+ if (neg) {
+ pos = !pos;
+ }
+
check_reject = 0;
- if (fail_on_single_reject == 1 || switch_stristr(cause_str, fail_on_single_reject_var)) {
+ if (fail_on_single_reject == 1 || pos) {
force_reason = reason;
status = SWITCH_STATUS_FALSE;
goto outer_for;
pchannel = switch_core_session_get_channel(originate_status[i].peer_session);
if (switch_channel_down(pchannel)) {
+ int neg, pos;
cause_str = switch_channel_cause2str(switch_channel_get_cause(pchannel));
- if (switch_stristr(cause_str, fail_on_single_reject_var)) {
+ neg = *fail_on_single_reject_var == '!';
+ pos = !!switch_stristr(cause_str, fail_on_single_reject_var);
+
+ if (neg) {
+ pos = !pos;
+ }
+
+ if (pos) {
ok = 0;
break;
}
pchannel = switch_core_session_get_channel(originate_status[i].peer_session);
wait_for_cause(pchannel);
if (switch_channel_down(pchannel)) {
+ int neg, pos;
+
cause_str = switch_channel_cause2str(switch_channel_get_cause(pchannel));
- if (switch_stristr(cause_str, fail_on_single_reject_var)) {
+
+ neg = *fail_on_single_reject_var == '!';
+ pos = !!switch_stristr(cause_str, fail_on_single_reject_var);
+
+ if (neg) {
+ pos = !pos;
+ }
+
+
+ if (pos) {
ok = 0;
break;
}