Search code examples
c#asteriskasteriskami

How to Unpark a Call


I want to hold/unhold my calls using Asterisk AMI. I have used Park AMI Action. Then, My phone disconnects, and Senders phone plays a music. How to Unpark this Call ? Can anybody help me Please ?

  UnParkAction upac = new UnParkAction(channel, channel1, "360000");
  ManagerResponse rr = ApplicationVariables.manager.SendAction(upac); //Sending it to Manager COnnection

Solution

  • You can use Redirect AMI command.

    This solves the unparking issue but with a difference that the initiator will still need to answer a call. In other words he does not fully retrieve the call without any action at all.

    In more detail:

    When you park the call you need to have both channels:

    (1) Channel to be parked

    (2) Channel that makes the park

    Store in a static variable (1).

    Then when you finished parking do the following:

    Initiate redirect call from the Channel parked (essentially what you have stored) and as destination, your number.

    Example URL:

    https://<YOUR AMI URL>?action=Redirect&channel=" + channelParked + "&context=" + context + "&priority=1&Exten=" + myPhoneNumber;