[Asterisk-Dev] Using the return codes from extension.conf commands/applications

Tilghman Lesher tilghman at mail.jeffandtilghman.com
Mon Aug 9 10:11:15 MST 2004


On Monday 09 August 2004 11:57, Andreas Sikkema wrote:
> I can't seem to find information on this, so I'll ask here.
>
> See http://www.voip-info.org/wiki-Asterisk+cmd+Playback (or similar).
>
> There's a section called Return Code which describes what Playback will
> return when it succeeds or fails. Nowhere in the online documentation or
> examples I can find how to use these return codes.
>
> Is it at all possible to do something meaningfull with them? Or did I
> miss an example/manual?

Return codes suggest to Asterisk how to handle the exit of the application.
There are really only two useful states:

0: application returned normally, Asterisk continues through the dialplan.
non-zero: application returned with a fault, Asterisk hangs up the channel.

By convention, most applications in Asterisk which return non-zero return -1.

If you wish to return a meaningful value from your application, I suggest that
you set a channel variable at the conclusion of your application, before
returning 0.

-- 
Tilghman



More information about the asterisk-dev mailing list