Call Status

Is it possible to get the status of a called phone number within asterisk, such as if the number is disconnected, not assigned, or invalid?


as far as i know asterisk only give status of current channel if call drop channel dissolved … but u can get the status of called phone from
/var/log/asterisk/cdr-csv/master.cvs this file contain the detail about call.

I know about that file, it is the cdr file, and it only stores the dial status, if answered, busy, congested etc…

What I need is the status of the line I called, for example if I call a number that was disconnected, unassigned or that do no exist.

Thank you

${HANGUPCAUSE} may help, but it will depend on the technology used and whether the downstream network encodes the condition sensibly.

I believe someone submitted a patch to return the SIP status code.

I have tried the hangup cause variable, but when I call an unassigned number, I just get cause 34, which is congestion. Because I think the operator just block the call when he knows the number is not valid. So cause 34 does not really mean the number is unassigned or disconnected. The operator always congest an invalid or unassigned number. In the case that the number is disconnected, the operator will answer, play a message that says it is disconnected and hangup, so most likely asterisk will detect that as a normal hangup, but no cause code that says it is disconnected.

So there has to be a solution to go around that. Does anybody knows how?

Change your operator.

Or, at least discuss it with them, they may have configurable options.


david 55, what will changing his operator do? Are you saying that his operator can change some config option to recognise the call to a disconnected #, as disconnected as opposed to recognising it as congestion?

Unless the connection is purely analogue, the connection protocol should allow “unassigned number” to be signalled (e.g. SIP status 404).

If the current service provider isn’t doing that properly, either he needs to find one that will do it properly, or get the current one to do it properly.