Asterisk channel status


i need to capture the ringing i get in the cli so i can hangup the call on ringing (making a missed call)
can this be done in the dialplan.

thanks guys

Please expand; I don’t understand the question.

Note that it is not possible to clear analogue FXO calls without answering them; that is in the nature of analogue signalling, not Asterisk.

If you mean Calling Line ID, rather than Command Line Interface, assuming the channel technology supports it, use ex-girlfriend logic (google) or explicit tests on ${CALLERID(num)} to direct the call into a Hangup() call.

I have a Dialogic bord connected to the asterisk server and to it E1’s are connected i generate the call as a sip call and send it to the Dialogic to perform outgoing calls.
what i want to do is let’s say USER A is calling USER B
i need to know that the B end is ringing so i can hangup the call (perform a missed call) without the ability of the B User to answer the call.
any ideas?

You would need to use AMI.

I hope this is not valid number checking prior to a phone spam run.

If you actually want the phone to ring, note that the network may well indicate the call is ringing before any sound has been generated, and before the transmission of the caller ID is complete. Also note that it may be against the reasonable use policies of the network to do this.

Hey no it’s actually a service for an operator not a spam my server is placed at their data center .
do u have any idea how i can do this i never used AMI before :confused:

Monitor for a NewState event with the value of 5 (AST_STATE_RINGING) and issue a Hangup action a suitable time afterwards.

Hey man thank you very much for your help
i am actually new to asterisk in general and never used AMI so if you can please help me with the following simple example i will be more than thankful.

exten => 666,1,Answer
exten => 666,n,DIAL(sip/200)
exten => h,1,hangup

let’s say i call extension 666 from sip/100 the extension will answer and send the call to the next app where it will dial sip/200. how can i use AST_STATE_RINGING to get the ringing status and send it to hangup?

thank you in advance

exten => h,1,hangup

serves no useful purpose.

exten => 666,1,Answer

is usually inappropriate, as well. There may be cases where it is needed to pass inband call progress, but if done on an incoming call is likely to result in the caller being charged, even for unanswered calls, and it also makes the call appear to have succeeded for other purposes.

For the main question, see: … k-AMI.html

Hey man i managed to get the ringing with ami tested it over sip it worked perfectly.

the thing is when connected to a dialogic with ss7 it does not response with ringing all the time it depends on the operators MSC but in the trace i always get the 183 progress is it possible to catch this because with AMI it’s not showing in the response any ideas.