Hello, never posted to a mailing list before. I've been trying to work out this 
problem for quite awhile now. I have a PHP script which is run whenever an 
emergency situation happens. The script connects to the AMI and originates 
calls to previously defined "emergency" extensions. I'm looking for a way to 
disconnect all calls on a device if it is in use, in order to deliver the 
message. I cannot use SoftHangup with the 'a' option within the dial plan, 
because if the device that is called is busy, then the context is never hit. It 
doesn't appear that their is a way within the AMI or using AGI or even within 
the CLI to disconnect all calls on a device, only is you know the entire 
channel name.

For instance, from the CLI, running 'soft hangup SIP/250-ab627038' will 
disconnect the channel successfully. But the problem is, I have no way of 
finding out the full channel name from within my my script using the AMI. The 
only possibility I see is running the "show channels" CLI command via the AMI 
Command action, grabbing the resulting list and parsing the Channel Name column 
before the script begins calling extensions. Then before each extension is 
called, check to see if the extension exists in the retrieved channel list. If 
so, disconnect it.

Anyways, it seems odd to me that the 'a' option is available from within the 
dial plan, but not anywhere else. That would be the simplest approach to this.

Any help is greatly appreciated. Thanks.
_______________________________________________
--Bandwidth and Colocation Provided by http://www.api-digital.com--

asterisk-users mailing list
To UNSUBSCRIBE or update options visit:
   http://lists.digium.com/mailman/listinfo/asterisk-users

Reply via email to