make IF dialplan function handle quoted strings properly (bug #4322, with API mods)

git-svn-id: https://origsvn.digium.com/svn/asterisk/trunk@5750 65c4cc65-6c06-0410-ace0-fbb531ad65f3
This commit is contained in:
Kevin P. Fleming
2005-05-20 16:30:13 +00:00
parent dd0c01fc2f
commit 102c76a9c8
3 changed files with 69 additions and 11 deletions

View File

@@ -55,6 +55,12 @@ static char *builtin_function_if(struct ast_channel *chan, char *cmd, char *data
}
if (expr && iftrue) {
expr = ast_strip_quoted(expr, "\"", "\"");
iftrue = ast_strip_quoted(iftrue, "\"", "\"");
if (iffalse) {
iffalse = ast_strip_quoted(iffalse, "\"", "\"");
}
ret = ast_true(expr) ? iftrue : iffalse;
if (ret) {
ast_copy_string(buf, ret, len);