Conditional responses based on the number of rings?

Does Asterisk have the ability to do conditional responses based on the number of rings.

I will further explain what I am doing. I have an Asterisk system hooked to a computer that controls a grain dryer and the computer doing the controlling can not be modified or changed to meet my needs so that’s why i have chosen to use Asterisk. The grain dryer computer, called a Quantum has a voice & data modem which can be used to remotely monitor it. If you call the Quantum and let it ring 2 times and hang up it will call back the number that is programmed into it, not necessarily the number that just called it, which sucks and is the 2nd problem I want to solve. When it calls that programmed number back after 2 rings it will give a verbal (voice) status report. The other options is to call the Quantum and let it ring 4 times and hang up and it will then again call back the same number that is programmed into it but this time it will be in data mode so that it can connect to a computer and be remotely controlled and monitored via a gui. What I would like to be able to do is have Asterisk monitor the number of times I let it ring and when the Quantum calls out have Asterisk do a conditional response to call number ‘X’ for voice or number ‘Y’ for data based on the amount of rings that were placed into the Quantum.

Is this possible and what would it be called in the Asterisk syntax of programming or even in general telephony language


You can never do this accurately on normal phone systems as the ringing current is not synchronised with the ring back tone heard by the caller, and might not start at the same time.

In fact, with SIP phones, the ring back tone is likely to be generated within the phone.

I suspect you will have to do this by setting a call time limit.

I just wanted to say that I realized the problem and understand the synchronization issues with the rings that are heard (ring back) and the actual rings that are received by the Quantum. The only thing that I can figure out is to do this all based on the time just like you said.

Now with that said i just want to further clarify to make sure that I’ve explained the situation clearly and that i don’t miss an opportunity to do exactly what I want, but I realize that I probably won’t be able to.

When I was setting up the Quantum I called tech support to figure out how the modem worked and they informed me that I’ll need to take my cell phone and call the Quantum while standing right next to it and compare the amount of rings heard internally in the Quantum and the number of ring that I hear on my cell pone (I’m assuming this is the ring back you refer to).

They said even if the Quantum is set for 2 rings that I might hear (on my cell phone) 1, 2, or 3 rings (ring back I’m assuming) and that I need to remember the difference, so when I call it I use the adjusted amount of rings to make it work. I told them this was a bad design idea and they agreed but it was to only way they could have the modem know which mode to use when it calls out.

Now what I want to do is only monitor and recored the number of rings received internally by the Quantum, I don’t care about the ring back. When the Quantum calls back out, based on the recorded number of rings from the previous call in it will call number ‘X’ if the recorded amount of rings was 2 or call number ‘Y’ if the recorded amount of rings was 4.

So if there was any confusion I hope this clarifies the situation and I’m assuming the the answer will still be that I will need to do this based on time.

Thanks again,

p.s. Remember that the Quantum is connected to Asterisk and the amount of inbound rings goes through it. Technically it is connected to a Sipura 1000 which is connected to the Asterisk server.

So I have been doing so more serious thinking about this situation and I have come up with another idea.

Being I need to monitor and record the amount of rings accurately, I was thinking I could build some circuitry with a microcontroller that is inline with the phone line going to the Quantum and accurately record the number of rings and connect that to the Asterisk server via rs232 or ethernet with a Lantronix product and have the microcontroller communicate to Asterisk via PHP.

Would this kind of setup work?

Do you think this is my only real way of having an accurate conditional response to an amount of rings with a Asterisk system?

Thanks, TinkerMan