[asterisk-dev] [Code Review] AMI Setvar: Return error when function does not exist or generate error

Olle E Johansson oej at edvina.net
Mon Nov 30 14:48:29 CST 2009


-----------------------------------------------------------
This is an automatically generated e-mail. To reply, visit:
https://reviewboard.asterisk.org/r/437/
-----------------------------------------------------------

Review request for Asterisk Developers.


Summary
-------

When setting a function, like GLOBAL(skrep) with AMI Setvar - it always return success. You can set a function called MYSTUPIDFUNCTION(noop) and it still returns success, regardless if the function exists and the return value from the function.

Found out that the pbx_builtin_setvar_helper() is declared as void and does not capture errors from functions. This patch changes this and makes sure that manager setvar returns an error.

This patch is for 1.4 - but needs to be forwardported to 1.6.x and trunk. (https://origsvn.digium.com/svn/asterisk/team/oej/manager-set-function-fail)


Diffs
-----

  /team/oej/manager-set-function-fail/include/asterisk/pbx.h 231597 
  /team/oej/manager-set-function-fail/main/manager.c 231597 
  /team/oej/manager-set-function-fail/main/pbx.c 231597 

Diff: https://reviewboard.asterisk.org/r/437/diff


Testing
-------

Tried setting values in non-existing functions. Setvar now returns error.


Thanks,

Olle E




More information about the asterisk-dev mailing list