In article <[EMAIL PROTECTED]>, Janahan Vivekanandan <[EMAIL PROTECTED]> wrote: > Hi, > > I'm trying to figure out how to cancel a call before the other side answers. > > It looks like I can do this by issueing a HangUp Action using the ChannelId > that asterisk > initiates the call on. Unfortunately, I don't know of a way to associate the > NewChannel > Event which contains the ChannelId, to the Originate Action. I'm using the > Async mode of the > Originate Action, and it looks like the UniqueID in the Response to the > Originate Action is > null. > > I know that I can use the ActionID to accomplish this once I receive the > OriginateSuccess > event, but I need to be able to cancel the call before it is answered(I'm > pretty sure > OriginateSuccess is only sent after the call is answered, correct me if I'm > wrong...:-)
I don't know whether the ActionID gets propagated to the new channel in SVN trunk, but that would be a good enhancement. Apart from that, the only way I have found to do it is to use a Local channel for the outgiong call, to encode a serial number in the extension part of the channel, and strip it out in the dialplan before dialling the number. e.g. Action: Originate Channel: Local/[EMAIL PROTECTED] etc. Where 123 is a unique serial number and 0987654321 is the number to dial. Then in extensions.conf, context [outgoing], use CUT() to discard the serial number and call Dial with the actual phone number. When you see the Newchannel event for Local/[EMAIL PROTECTED],2 you can match it on the prefix part and associate it with the Originate. The serial number doesn't need to get used anywhere - it is just to make sure that every channel identifier is unique. You will have to make sure you correctly track Rename, Link and Unlink events, since Local channels optimise themselves out when the call is set up. Hope this helps! Cheers Tony -- Tony Mountifield Work: [EMAIL PROTECTED] - http://www.softins.co.uk Play: [EMAIL PROTECTED] - http://tony.mountifield.org _______________________________________________ --Bandwidth and Colocation provided by Easynews.com -- asterisk-users mailing list To UNSUBSCRIBE or update options visit: http://lists.digium.com/mailman/listinfo/asterisk-users
