|
@@ -390,13 +390,18 @@ static struct snexpr* pp_snexpr_defval(char *vname)
|
|
|
if(pd->value.s != NULL) {
|
|
|
LM_DBG("define id [%s] at index [%d] found with value - return [%.*s]\n",
|
|
|
vname, idx, pd->value.len, pd->value.s);
|
|
|
- return snexpr_convert_stzl(pd->value.s, pd->value.len, SNE_OP_CONSTSTZ);
|
|
|
+ if(pd->value.len>=2 && (pd->value.s[0]=='"' || pd->value.s[0]=='\'')
|
|
|
+ && pd->value.s[0]==pd->value.s[pd->value.len-1]) {
|
|
|
+ /* strip enclosing quotes for string value */
|
|
|
+ return snexpr_convert_stzl(pd->value.s+1, pd->value.len-1, SNE_OP_CONSTSTZ);
|
|
|
+ } else {
|
|
|
+ return snexpr_convert_stzl(pd->value.s, pd->value.len, SNE_OP_CONSTSTZ);
|
|
|
+ }
|
|
|
} else {
|
|
|
LM_DBG("define id [%s] at index [%d] found without value - return 1\n",
|
|
|
vname, idx);
|
|
|
return snexpr_convert_num(1, SNE_OP_CONSTNUM);
|
|
|
}
|
|
|
-
|
|
|
}
|
|
|
|
|
|
void pp_ifexp_eval(char *exval, int exlen)
|