I’m trying to originate calls using asterisk AMI originate action ,
everything is working properly ,
but ,
i’m not receiving the failure reasons properly .
It’s always 0 or 3 .
Is there a way to enable receiving failure reasons in OriginateResponse event .
or is there any better approach to achieve that ?
I also tried ARI with no luck .
Use a Local channel in your Originate action, and read the failure value from the HANGUPCAUSE or DIALSTATUS variable. Then, use an AMI user event to generate a custom event with that information.
@ambiorixg12 Thanks for your reply , i have tried both variables , but in all scenariosn i’m getting
NOANSWER in DIALSTATUS
and 16 in HANGUPCAUSE
in all sip responses
that is why i’m asking for the sip response it self.
that is my ami response .
it’s always 0 or 3 what ever happens on the other leg (busy , no answer , no route , un available , congestion , wrong number ).
Failure on OriginateResponse would seem to indicate failure to initiate the call, so something was wrong with the request to Asterisk itself.
For example, for ARI, the hangup cause will be reported in the ChannelDestroyed event. You can see some sample code for picking this up in the track_call_ari_async example here.