Using the Asterisk CLI to hang up on a call

This is another post more for my reference than some new interesting thing I’ve discovered.

It seems difficult to find the correct command for this. Some places say “soft hangup” others say “hangup request” or just tell you to restart asterisk.

The correct command and example is:

channel request hangup PJSIP/itsptrunk-00000002

Where the final thing in the command is the channel you want to hang up.
To find the channel name you may normally type

core show channels

But you may notice it chops off the end of the channel name. If you try to use one copied from that command it will say it can’t find the channel name.

Instead use the command:

core show channels concise

To view the full channel name! copy and paste it (e.g. PJSIP/anonymous-00026032) into the command for example:

channel request hangup PJSIP/anonymous-00026032

Hope this helps!

This entry was posted in Uncategorized. Bookmark the permalink.

2 Responses to Using the Asterisk CLI to hang up on a call

  1. Minh says:

    “channel request hangup all” seems to hangup all channels.

  2. Thanks for the information :)

Comment on this topic