[asterisk-users] How to write a function with a return value in Asterisk

Andrew Kohlsmith
Wed, 08 Aug 2007 15:34:49 -0000

On Wednesday 08 August 2007 11:24:45 am Mike wrote:
> Is it possible to write a function in Asterisk, that returns a value?  Sort
> of like any programming language allows?

Digium has taken the stance that it's better to set arbitrary variable names
to arbitrary values rather than allow what many would consider the perfectly
accepted method of using a $? type of return code in addition to any
application-specific variables.

It's been a long-standing sore point with me for sure, since there is no
standard way to see if an application returned successfully or not; you have
to consult the individual application to see what it sets.

-A.