Call state control


basically I need to complete an action when the call enters in a certain state. Example: I initiate a call and when it enters in “ringing” state, I need to hang it up, so the called phone doesn’t answer it but only gets the acknowledgement it was called.
I’ve tried to set the WaitTime to limit the ringing duration, but due to floating connection time between my pbx and destination phone, which is made through several gates, ringing state can be too long. In CLI I can see when the call enters into ringing state, but I could not find any method to set some action when it gets there.
I was wondering if anyone did some similar stuff in the past or have an idea how to do it.
Thanks in advance.

Use AMI events.

It would help if you explained why you are trying to do this. It is not a normal thing to do, and if the outgoing call is a toll one, may violate the provider’s fair use policy.

I suspect you are assuming that the downstream network makes guarantees that it doesn’t really make.

Thank you for your reply, David
In fact this is a service for a cell phone provider. Let’s say user A wants to call user B, but it doesn’t have sufficient funds to do it. We are doing some sort of a CallMe request.
I will check if there’s any AMI documentation about events handling. If anyone have a good tutorial on this, I would really appreciate it.
Thank you.

hi sergiony

iam also looking for solution for this, if u found any please help me…