[asterisk-users] OriginateResponse 'reason' property.

Jan du Toit Jan.du.Toit at decisionworx.com
Wed Apr 25 02:38:17 MST 2007

Hi all.

I'm trying to determine the reason for call failure (busy, no answer, no 
such number, etc...). Calls are made via the Manager API using the 
Originate manager command. Originally I thought that the 'reason' 
property within the OriginateResponse could be used for this purpose, 
but with Asterisk 1.2.* versions the reason always returned a '1' for 
all types of failures (busy, no answer, no such number, etc...) and a 
'4' in the event of success/call was answered. I have asked around on 
this mailing list about this issue before and got a reply that the 
reason code is a bit of mess and that it is set according to the last 
communication frame read from the originated channel.

I recently installed Asterisk 1.4.2 and noticed that its returning 
somewhat different reason values for different types of failure. From my 
limited tests (using only SIP channels) I got the following:

0 = No such extension / number.
1 = No answer.
4 = Call answered.
8 = Congested / unavailable.

I can't seem to find any formal documentation on the 'reason' property 
and the values it can take on. Can somebody please tell me whether one 
can indeed use this 'reason' property to determine type of failure? If 
this is the case what values can it take on and what are their meanings?

Thank you.
Regards, Jan.

More information about the asterisk-users mailing list