[asterisk-dev] [Code Review] Make the parameter separator backward compatible, and error messages more consistent.

Mark Michelson mmichelson at digium.com
Fri Dec 19 19:17:02 CST 2008


-----------------------------------------------------------
This is an automatically generated e-mail. To reply, visit:
http://reviewboard.digium.com/r/79/#review279
-----------------------------------------------------------


There are still many places in the code which are not yet converted properly, especially when it comes to code which runs another Asterisk application internally.

If you search the code for "pbx_findapp," "pbx_exec," "ast_pbx_run," and "ast_pbx_start," you should find several instances of this. An example is in app_queue and app_dial, look at the gosub handling there. Another example is in app_page, look at how it constructs the application call to Meetme. There are several others in the source, too, but those are a few I happened to know of just from having worked with them frequently.


/trunk/main/pbx.c
<http://reviewboard.digium.com/r/79/#comment594>

    This is a very minor point, but ast_copy_string is guaranteed to terminate the copied string with a \0 character, so you don't have to add 1 to the last parameter.
    
    Also, since you are specifically allocating enough space for the length of the string, you could actually use strcpy() safely here.


- Mark


On 2008-12-09 11:14:57, Eliel Sardañons wrote:
> 
> -----------------------------------------------------------
> This is an automatically generated e-mail. To reply, visit:
> http://reviewboard.digium.com/r/79/
> -----------------------------------------------------------
> 
> (Updated 2008-12-09 11:14:57)
> 
> 
> Review request for Asterisk Developers.
> 
> 
> Summary
> -------
> 
> This patch implements an asterisk.conf [compat] option called app_delim, to make applications and functions parameter delimiter backward compatible. if app_delim < 1.5 then, then app/fun delimited should be | (pipe), otherwise it should be "," comma.
> Also there are a number of functions that where not using STANDARD_APP_ARG to parse the app/fun parameters, so, that was changed to use AST_STANDARD_APP_DELIM.
> When printing error messages, we where printing the "syntax" with a hardcoded parameter separator, now the syntax being printed is the one generated with the xml documentation, so the error messages will be consistent with the actual parameter separator, and also with the actual app/fun syntax.
> 
> 
> Diffs
> -----
> 
>   /trunk/apps/app_dial.c 161945 
>   /trunk/apps/app_macro.c 161945 
>   /trunk/apps/app_meetme.c 161945 
>   /trunk/apps/app_readfile.c 161945 
>   /trunk/funcs/func_callerid.c 161945 
>   /trunk/funcs/func_cut.c 161945 
>   /trunk/funcs/func_env.c 161945 
>   /trunk/funcs/func_realtime.c 161945 
>   /trunk/funcs/func_strings.c 161945 
>   /trunk/include/asterisk/app.h 161945 
>   /trunk/include/asterisk/pbx.h 161945 
>   /trunk/main/pbx.c 161945 
>   /trunk/main/xmldoc.c 161945 
>   /trunk/pbx/pbx_lua.c 161945 
> 
> Diff: http://reviewboard.digium.com/r/79/diff
> 
> 
> Testing
> -------
> 
> Developer testing.
> 
> 
> Thanks,
> 
> Eliel
> 
>




More information about the asterisk-dev mailing list