mirror of
https://github.com/signalwire/freeswitch.git
synced 2025-04-15 16:39:14 +00:00
mod_commands: Allow cond API to allow returning empty false value
This commit is contained in:
parent
7d5ca1c086
commit
c8a897b90c
@ -1387,7 +1387,7 @@ SWITCH_STANDARD_API(cond_function)
|
|||||||
|
|
||||||
argc = switch_separate_string(mydata, ':', argv, (sizeof(argv) / sizeof(argv[0])));
|
argc = switch_separate_string(mydata, ':', argv, (sizeof(argv) / sizeof(argv[0])));
|
||||||
|
|
||||||
if (argc != 3) {
|
if (! (argc >= 2 && argc <= 3)) {
|
||||||
goto error;
|
goto error;
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -1464,7 +1464,12 @@ SWITCH_STANDARD_API(cond_function)
|
|||||||
}
|
}
|
||||||
switch_safe_free(s_a);
|
switch_safe_free(s_a);
|
||||||
switch_safe_free(s_b);
|
switch_safe_free(s_b);
|
||||||
stream->write_function(stream, "%s", is_true ? argv[1] : argv[2]);
|
|
||||||
|
if ((argc == 2 && !is_true)) {
|
||||||
|
stream->write_function(stream, "");
|
||||||
|
} else {
|
||||||
|
stream->write_function(stream, "%s", is_true ? argv[1] : argv[2]);
|
||||||
|
}
|
||||||
goto ok;
|
goto ok;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
Loading…
x
Reference in New Issue
Block a user