Detecte and avoid cell phone greeting message

I need to send notification messages to the employees of a company, and I need to be sure that they have, at least, answered the phone. The problem is that when their phone is turned off and they does not have an active mailbox the cell operator sends a greeting message sayng this phone is turned off or out of coverage area, and asterisk take this as an aswered call and the VOIP operator charges me for a call that was not actualy completed.

I’m using AMI to send the Originate command in order to make the calls, is there any way to asterisk detect this greeting message and abort the call and avoid the VOIP operator charge?

I even tried to call the sleep on the “__ast_channel_alloc_ap” function on channel.c hoping that asterisk detectes tha hangup and abort the call, but I had no sucess.

Thank you for any help.

Flavio

have you tried the Answer Machine Detect?

voip-info.org/wiki/index.php … sk+cmd+AMD

Not perfect but a start.