[Asterisk-Dev] Dev Meeting list
Matthew Boehm
mboehm at cytelcom.com
Thu Apr 28 20:59:07 MST 2005
Gotta throw in my $0.02.
What I think would work is having every app return different result codes
for different "happenings" during the app. It is then up to the Asterisk
manager to do the checking and jumping.
I'm going to relate this to the mysql C API cause I am familiar with that.
Just about all of the functions return result codes. Those codes are clearly
published. None of the functions jump internally to other functions upon
error.
Along the same lines as mysql, it would be published in the Dial docs (sorta
like man page format) that Dial will return the following results:
1 - Dialed Successfully
2 - Busy
3 - No Answer
4 - Unable to create channel
5 - Unknown error
It 'will' be the responsibility of the apps to modify the built-in channel
var ${RESULTCODE} (or something similar). If the variable isn't defined,
create it. That way ${RESULTCODE} always contains the result of the most
recent app. Then Goto's and other jumps are easily handled. Perhaps even a
Switch app could be created instead of many goto's?
If the asterisk manager doesn't throw in a jump for a particular result
code, there needs to be some sort of 'catch all'.
-Matthew
More information about the asterisk-dev
mailing list