Asterisk Outgoing Call Status - When Number Not Reachable or Switched Off or Wrong Number

Hello Everyone
Hope you are doing well

I'm looking for the solution where Server generate outgoing call and if number is not reachable or Switched off or Wrong Number or Out of Service will send call status like CONGESTION, FAILED, WRONG NUMBER etc.

Please suggest I’m using Telecom SIP Trunk and PRI both

Awaiting for your valuable feedback

If you are using SIP, it is always a client (UAC) that makes an outgoing call, even if it sitting on a rack in a machine room.

What is wrong with Asterisk’s default behaviour?

If you want a voice announcement, remember that public networks don’t allow early media, and, in many places answered calls get charged for.

If your service provider is sending voice messages, rather than proper statuses, then there is no easy way of going the other way.

Dear David,
My requirement is, to know the status of Wrong/Switched-Off/Busy/Not-reachable phone number status, right now I’m getting only ‘NO ANSWER’ or ‘FAILED’ on each call

If call will pick then there is no issue but when User does not pick the call like Disconnect the call or he is already in call or any other reason in that case we need Dial status
If you have any doubt in my case please let me know

Are we talking about originate/call files, rather than the outbound leg of an ordinary call? If so, you need to convert it into an ordinary outbound call by originate to a local channel, which can look at all the status information provided for a normal B side leg.

Originate call with any method like call file AMI etc. If callee phone number is either switched off, not reachable etc in that case we can capture call status like FAILED, Congestion or Others.

I am able to capture dial status only when the callee receive the call else we are not able to capture

In that case, I’ve already told you the solution.

Thanks David for your quick response.

Can you please share a sample code so that we can test and get the response