Force phone stop ringing

I move some call files into the spool directory… then some phones start ringing…
How can I force stop ringing using a dialplan?

You need to provide a lot more information. I doubt that many people will be able to guess what you are really trying to say.

If English is a difficult second language for you, try and explain as much as possible in English, then supply a more complete dscription in your own language. Don’t use a machine translation without also providing the text in your own language.


I can see all active channels

Channel Location State Application(Data) SIP/251-00000265 251@from-internal:1 Ringing AppDial((Outgoing Line)) SIP/201-00000264 s@macro-dial:7 Ring Dial(SIP/251,,tr) 2 active channels 1 active call 429 calls processed
and then using

I can foce the hang up of the peer 251.

Can I do the same using a dialplan application? Can I force the hang up of a peer?


Try using channelredirect() to transfer the channel to an extension that simply does hangup().

You will still have to find the channel name. Some devices can have more than one channel at a time.

Third party operations are more normally done from using AMI.

You can also use system() to actually call the CLI command.

I need to find the channel… starting from the peer???

In the general case, you cannot do that, as a peer can have many active channels.

If you know that there is only ever at most one active channel, you will need to use AMI, or write a shell script that uses the CLI. Normally one would use AMI (and use AMI originate, rather than call files).

OK, thanks… I’ll try!!!

You can also set a global variable to ${CHANNEL} for the originating side, just before calling the Dial application. I don’t know why you would want to specifically hangup the called side, but you can find that by importing (IMPORT function) BRIDGE_PEER from the originating side.

I’m not in the call… I’m not the caller or the called peer… I just need to set up a dialplan to force hangup a peer even if I’m not involved into the conversation!

By “you”, I really meant the dialplan.


I can try to set a global array… because I need to hang up a lot of peer!
could you suggest me a script to retrieve the active channel starting from the peer name?

I’m trying with an AGI bash script… could you help me? It’s my first time!

Problem solved!
I call this script using system():


case “$1” in
"") echo “Missing parameter: set the PEER extension”; exit $E_ERR_PARAM;;

out=(asterisk -rx "core show channels" | grep $1-)
out=(asterisk -rx "channel request hangup ${out[0]}")[/code]

What do you think about it?

Neat. I guess. And it works.

Probably better than dialling a pickup extention or feature code and then hanging the phone up manually.