Ask for callback keeping the queue position

In this article we'll see how to use the callback function on a queue without taking the caller out of the queue. 

The most used IVR configuration to use the callback function is the follows:

On the queue timeout, the caller can decide to be called back (by pressing 1) or to stay in waiting for an available agent.

This is a good configuration, simple to build and set up, but it is not always the optimal solution.

Every time the caller decides to stay on hold, the queue position will be resetted as a new incoming call. It could be increase the waiting time.

 

Exit With A Key

To prevent the caller is released and back again in the queue, we can use the "ExitWithKey" queue option. 

It allows the caller to exit from a queue with a key (a single digit)  for further action.

Using this option we built a different IVR configuration:

To use this IVR configuration, we need to make some changes:

  1. The Menu block audio file ("...press 1 for callback..") becomes the queue periodic announce in the QUEUE General Settings (the audio file must be previously uploaded in the audio section)




  2. Set a new QUEUE context, in the QUEUE Advanced Settings (e.g "callback")




  3. Define the new context in the Asterisk configuration file /etc/asterisk/extensions_xcally_custom.conf

    /etc/asterisk/extensions_xcally_custom.conf
    [from-sip-custom]
    
    [callback]
    exten => _1,1,NoOp("TO CALLBACK")


    With this row we allow only the digit 1 (_1) for the context "callback"

  4. Save the file and reload the Asterisk configuration

    [root@localhost ~]# asterisk -r
     
    localhost*CLI> reload



With this configuration, the caller goes to the CALLBACK block only when:
  • reach the queue timeout
  • press the digit 1
Otherwise the caller remains into the queue, keeping the current queue position.