change var parser to ${func(arg)}

git-svn-id: http://svn.freeswitch.org/svn/freeswitch/trunk@5979 d0543943-73ff-0310-b7d9-9358b9ac24b2
This commit is contained in:
Anthony Minessale 2007-10-18 21:36:57 +00:00
parent d4422c5970
commit 65b2ec6990

View File

@ -1301,9 +1301,10 @@ SWITCH_DECLARE(char *) switch_channel_expand_variables(switch_channel_t *channel
if (*p == '$' && !nv) {
if (*(p+1)) {
vtype = 1;
if (*(p + 1) != '{') {
vtype = 2;
if (*(p+1) == '{') {
vtype = 1;
} else {
nv = 1;
}
} else {
nv = 1;
@ -1331,31 +1332,26 @@ SWITCH_DECLARE(char *) switch_channel_expand_variables(switch_channel_t *channel
e = s;
vname = s;
while (*e) {
if (!br && *e == ' ') {
*e++ = '\0';
sp++;
break;
}
if (br == 1 && *e == '}') {
br = 0;
*e++ = '\0';
break;
}
if (vtype == 2) {
if (*e == '(') {
*e++ = '\0';
vval = e;
br = 2;
}
if (br == 2 && *e == ')') {
*e++ = '\0';
br = 0;
break;
}
}
e++;
}
p = e;
if ((vval = strchr(vname, '('))) {
e = vval - 1;
*vval++ = '\0';
while(*e == ' ') {
*e-- = '\0';
}
if ((e = strchr(vval, ')'))) {
*e = '\0';
}
vtype = 2;
}
if (vtype == 1) {
sub_val = switch_channel_get_variable(channel, vname);