Summary:ASTERISK-04102: stale code in pbx.c ?
Reporter:Luigi Rizzo (rizzo)Labels:
Date Opened:2005-05-07 04:56:16Date Closed:2011-06-07 14:10:34
Versions:Frequency of
Description:the snippet of code near line 1439 in pbx.c (listed below) seems to contain some stale statements. We are in pbx_substitute_variables_helper_full(), in the branch in charge of evaluating variables, so my understanding is that we should not evaluate functions. Am I wrong ?
If i am right, we only need to call pbx_retrieve_variable()


    if (var[len - 1] == ')') {
        /* Evaluate function */
        cp4 = ast_func_read(c, vars, workspace,sizeof(workspace));
        ast_log(LOG_DEBUG, "Function result is '%s'\n",cp4 ?cp4:"(null)");
    } else {
        /* Retrieve variable value */
        pbx_retrieve_variable(c, vars, &cp4, workspace,sizeof(workspace), headp);
Comments:By: Russell Bryant (russell) 2005-05-07 08:25:37

Yeah, actually, I do believe that you are wrong here.  :)

A dialplan function is executed like ... ${MD5(mystring)} ... so, that code is indeed correct.

Feel free to re-open if you feel that there is still a problem.

By: Russell Bryant (russell) 2005-05-07 08:27:08

In the future, if you're not sure something is a bug, try consulting the mailing list or IRC before posting it to the bug tracker.