How to kill AMI ORIGINATE on-the-fly

Home » Asterisk Users » How to kill AMI ORIGINATE on-the-fly
Asterisk Users 2 Comments

My application fires several calls thru AMI ORIGINATE command.

For example if I have 3 operators I do 3 ORIGINATEs.

My trouble is when one operator quit for some reason, I should kill the
corresponding ORIGINATE.

Of course, I could let the call ring and hangup after the customer pick-up.

But this is not the case, I do have to kill the corresponding ORIGINATE.

I could execute a soft hangup, but I am not aware the channel that ORIGINATE
is using until customer either pick-up or not answer – generating a
OriginateResponse event.

I have tried to send a STATUS command on the ActionId, but the answer is
assync and I can’t trust on it.

I would appreciate any help.

Thanks,

Valter

2 thoughts on - How to kill AMI ORIGINATE on-the-fly

  • That would be really difficult to do, to keep track of all three channel
    events while they are originating and to hangup the failed ones .

    Easy solution in asterisk for this would be to originate using Local channel
    and in dialplan use Dial command to make call to all the operators using ‘&’
    operator. And dial command automatically hangups rest of the channels if one
    channel succeeds.

    http://blog.godson.in/2010/10/asterisk-vs-freeswitch-channel-tracking.html

  • With the Originate command, set a Channel Variable to a unique value. When you receive the Channel variable date, you know which Channel is for which Originate request.