I’m trying to figure out how to determine a channel ID so that I can programatically hang up a call. I’d like to be able to determine the channel ID by providing either a CID or extension number.
The other thing I’m trying to do is to be able to transfer a call based on the extension, to another extension. In this case what I’m trying to do is have a user click on a button that then transfers their current call to a custom extension that plays a message and hangs up.
Use AMI Events to track the call, or have the dialplan set a global variable that is read by AMI.
You transfer calls from devices to extensions. Why not just program a key on the phone with #xxxx where xxxx is the target extension number, and enable transfers in the Dial() options?
Unless you establish your own association then the best you can do is what Asterisk gives you - the endpoint or peer is in the name of the channel and you can look at events to know what is happening. If two channels are up though - how are you supposed to know which to deal with?