Well I had to surf a lot to find the exact command to hangup calls in the latest Free PBX so here I will show you in easy steps for how to hangup active calls on PBX.
Login to your asterisk CLI console
asterisk2*CLI> core show channels Channel Location State Application(Data) SIP/3224-00000a19 s@macro-dial-one:42 Up Dial(SIP/4027,15,trI) IAX2/IAX_Trunk_to_US (None) Up AppDial((Outgoing Line)) SIP/4003-00000a2f s@macro-dialout-trun Up Dial(IAX2/IAX_Trunk_to_US/1001 SIP/4001-0000089e s-CHANUNAVAIL@macro- Up VoiceMail(3102@default,u"") SIP/3117-00000102 s-NOANSWER@macro-vm: Up VoiceMail(3106@default,u"") SIP/4027-00000a1a (None) Up AppDial((Outgoing Line)) 6 active channels 4 active calls 1553 calls processedAs you can see in my case there are 4 active channels and I want to disconnect user 4003 for example.
asterisk2*CLI> channel request hangup SIP/4003-00000a2f Requested Hangup on channel 'SIP/4003-00000a30' -- Executing [h@macro-dialout-trunk:1] Macro("SIP/4003-00000a30", "hangupcall,") in new stack -- Executing [s@macro-hangupcall:1] GotoIf("SIP/4003-00000a30", "1?theend") in new stack -- Goto (macro-hangupcall,s,3) -- Executing [s@macro-hangupcall:3] ExecIf("SIP/4003-00000a30", "0? Set(CDR(recordingfile)=)") in new stack -- Executing [s@macro-hangupcall:4] Hangup("SIP/4003-00000a30", "") in new stack == Spawn extension (macro-hangupcall, s, 4) exited non-zero on 'SIP/4003-00000a30' in macro hangupcall' == Spawn extension (macro-dialout-trunk, h, 1) exited non-zero on 'SIP/4003-00000a30' -- Hungup 'IAX2/IAX_Trunk_to_US-49'Now user 4003 has been disconnected as you can verify below.
asterisk2*CLI> core show channels
Channel Location State Application(Data)
SIP/3224-00000a19 s@macro-dial-one:42 Up Dial(SIP/4027,15,trI)
SIP/4001-0000089e s-CHANUNAVAIL@macro- Up VoiceMail(3102@default,u"")
SIP/3117-00000102 s-NOANSWER@macro-vm: Up VoiceMail(3106@default,u"")
SIP/4027-00000a1a (None) Up AppDial((Outgoing Line))
4 active channels
3 active calls
1554 calls processed
Related Articles
Connecting two IP PBX box using SIP Trunk
Follow the below links for more tutorials:
15 tips to enhance security of your Linux machine
Why is Linux more secure than windows and any other OS
What is the difference between "su" and "su -" in Linux?
What is swappiness and how do we change its value?
How to log iptables messages in different log file
What are the s and k scripts in the etc rcx.d directories
How to check all the currently running services in Linux
How to auto start service after reboot in Linux
What is virtual memory, paging and swap space?
How does a DNS query works when you type a URL on your browser?
Thanks for the guide! It was a real lifesaver a moment ago when one agent got stuck in a conference call and was unable to leave it.
ReplyDeleteThank You! Works like a charm!
ReplyDeleteI have a big problem.
ReplyDeleteWe have Elastix here, but some calls no matter what extensions hangs out, and our knowledge in IP telephony is not good enough. So, could anybody help me out to find what is wrong with.
I really apprecciate your help!
Awesome! Saved a fortune for me.
ReplyDeleteVery helpful thanks the commands work.
ReplyDelete