[Asterisk-Dev] question about agi handle_exec

Tilghman Lesher tilghman at mail.jeffandtilghman.com
Tue Feb 15 15:31:00 MST 2005


On Tuesday 15 February 2005 16:01, Todd wrote:
> Hello,
>
> I spent several hours debugging my fast agi application only to learn
> that you can't return certain values when using handle_exec.  If you
> return the value 1 from an application, handle_exec will return this
> value.  But this is equivalent to the macro RESULT_SHOWUSAGE.  The
> result is that exec sends the correct result over TCP but then sends
> the usage error message. All of the other handle functions return
> RESULT_SUCCESS, so there is no way this can happen.  And there is
> really no reason to return the result since it is sent over tcp
> anyway.  I'm not sure if this is a mistake, but it was very hard to
> track down the problem without any documentation.

To repeat something which has been said many times, there are only
two useful return values from applications:  0 and non-zero (usually
-1).  0 is returned from all applications to indicate that no error
occurred and no hangup was detected.  A non-zero return value from
an application indicates that an error occurred, and the dialplan should
not attempt to resume from where it left off.

-- 
Tilghman



More information about the asterisk-dev mailing list