How to ring a phone once and disconnect

I am new in asterisk and tying to use PHPAGI, I am dialing a call though .call file and inseting the response in mysql though PHPAGI. I am looking to dial a number and when it rings once then disconnect the call, please guide how I can achieve this ?

This can’t be done reliably, as you don’t have accurate control over the the start of ringing, the ringing cadence phase (in the case of analogue systems), or even the ringing cadence.

The best you could do, given your self imposed requirement to use AGI, is to use EXEC, to allow you to run a dialplan application, then run dial with a timeout parameter calibrated to produce one ring, most of the time, in your specific environment.

If the callee is quick off the mark, they could answer before the call times out, in which case you would have to use L to force a termination on the call.

Actually the dialplan Originate action may be more appropriate than Dial, as it sounds like you don’t want to connect the channel running AGI to hear any media from the callee.

I’ve assumed that PHPAGI is for AGI. If it also does AMI, you could use AMI Originate, again with a timeout calibrated for your environment.

Note that some providers will penalise customers who generate significant numbers of short, abandoned, calls.

This topic was automatically closed 30 days after the last reply. New replies are no longer allowed.