Action for hold/unhold using asterisk ami

Hey everyone
I am using latest asterisk ami
My scenario is, agent receives a call on his extension now he wants to put the call channel on hold for sometime and later retrieve the call and continue communication.

  1. Agent puts the call on hold
  2. Call channel goes into hold state
  3. Agent takes the call off hold and starts communicating again

How can we achieve this using asterisk ami as i don’t see any action to put channel on hold in the documentation https://docs.asterisk.org/Asterisk_16_Documentation/API_Documentation/AMI_Actions

I think this function already exist and you don’t need to write your own.

Typically people park the call, although directing it to dialplan running MusicOnHold may work in many cases.

@voip.com.vn which function are you talking about ?

@david551 can you please elaborate this on how park can help me achieve this scenario i have explained (maybe a flow of logic with asterisk ami actions ) :slightly_smiling_face:

What are you trying to do? Usually you would do this with the hold button on your phone.

But try looking at these actions:

I’d assume you can use the BlindTransfer action to resume the call from the parking lot, or Originate to make a new call for resuming the parked call.

But I’ve never used parking lots myself, we just use our hold button instead, would you like to explain your scenario, and what you are trying to make, where normal hold is not possible?

@Chano so i am using asterisk ami for performing action on the call channel when an agent and user talks.
now for agent he wants to put the call on hold and retrieve it after some time.
1] for this i dont think asterisk provide any action to put the call channel on hold
2] now for the park, it requires a parking lot which will be configured by the asterisk administrator.so it will be different for each client who will use that.
Can you give an idea on how did you implement hold without using park
will be a great help

If they are in a call, the agent should have a hold button either on their physical phone, or the softphone they are using. Doing it with AMI is the wrong way, in almost any case that involves handling your own calls.

I have a very hard time understanding WHY you want to do this with AMI, when it should be possible using the phone in which the agent is already talking. Even analogue lines can put the call on hold, as far as I’m aware. (At least for using DAHDI devices, and most ATA’s)

If you want to implement hold without the parking feature, you need to fake the required SIP packets (I’m not completely sure what, but something about a new INVITE for the call, with SDP set in a certain way).

I can not see any way to put the call on hold, using AMI, without faking it with the call parking feature.

But I’m still curious why this would even be needed, when most or less any endpoint driver in Asterisk already has support for putting calls on hold. To me that sounds more or less like using square wheels on your car. You WILL be able to drive, but the experience will never be great.

@Chano so idea is agent wont be using a physical phone, he will be performing action through phone application developed with JS framework, so when he press hold we can perform this action on asterisk ami.
In this case i am not seeing any option to put the call channel on hold

Sounds like an unnecessarily complicated solution, why not built the phone features into the JS application? In that way you would not have to let EVERY agent know your AMI password, letting them manipulate basically every call they want, or create some middleware between the agent and Asterisk.

What you want to do, is possible using the parking feature through AMI, however, it will require a lot more development time, than just moving the phone on the agents desk a bit closer, making it possible for them to press the hold button.

As Asterisk supports WEBRTC, you could also integrate the phone features into the JS application. That’s the solution I’d personally go for, if PC control of the feature were required.

A final option might be to remote control the phone through the application instead, I know SNOM phones have this ability, but I’ve got no practical experience with other brands. The keywords you’d be looking for would probably be “remote control” or “CTI”.

But what you want to do is not, to my knowledge, possible with AMI, in exactly the way you want it to work. The closest you’ll be able to get, is a flow like this:

  1. Agent receives a call
  2. Agent presses button in application, call is parked and hung up. Caller gets MOH.
  3. Agent presses button in application to resume call.
  4. Agents phone rings.
  5. Agent answers the call, and the call is unparked.

This actually has an advantage over normal hold, in that you could share the parking lot number with another agent and have them resume the call instead. But from a UX point of view, it’s horrible as a plain old hold feature.

This topic was automatically closed 30 days after the last reply. New replies are no longer allowed.