IVR in LiveAgent is configured using a YAML script. Check out these examples of how it works:
Basic example:
offline: - play: https://www.liveagent.com/fileadmin/ivr/we-are-currently-not-available-check-website.mp3 - voicemail online: - play: https://www.liveagent.com/fileadmin/ivr/connect-first-available-agent.mp3 - ring queue: - play: https://www.liveagent.com/fileadmin/ivr/next-in-queue.mp3
There are 3 mandatory sections:
offline - this section is used when no agent is online for calls
online - this section is used when there are agents online for calls
queue - this section is used after the ring command when a caller needs to wait in the queue
In the example above, when nobody is online to take a call, the offline announcement https://www.liveagent.com/fileadmin/ivr/we-are-currently-not-available-check-website.mp3 is played, then the voicemail is recorded.
When agents are online, https://www.liveagent.com/fileadmin/ivr/connect-first-available-agent.mp3 is played and the call will ring to the first available agent. If all agents are occupied, the call is placed in the queue and the https://www.liveagent.com/fileadmin/ivr/next-in-queue.mp3 in queue music is played.
Advanced example:
start: - play: https://www.liveagent.com/fileadmin/ivr/connect-first-available-agent.mp3 - choice: 1: name: Sales department play: https://www.liveagent.com/fileadmin/ivr/press-one-for-sales.mp3 do: - transfer: to: salesDepartmentID if: online: - play: https://www.liveagent.com/fileadmin/ivr/connect-first-available-agent.mp3 - ring offline: - goto: voicemail 2: name: Technical department play: https://www.liveagent.com/fileadmin/ivr/press-two-for-technical-support.mp3 do: - transfer: to: techDepID if: online: - ring offline: - goto: offline 3: name: Request calback play: https://www.liveagent.com/fileadmin/ivr/press_2_to_request_callback.mp3 do: - callback voicemail: - play: https://www.liveagent.com/fileadmin/ivr/leave-a-voicemail.mp3 - voicemail offline: - play: https://www.liveagent.com/fileadmin/ivr/we-are-currently-not-available-check-website.mp3 queue: - play: https://www.liveagent.com/fileadmin/ivr/next-in-queue.mp3 - choice: 0: name: Wait play: https://www.liveagent.com/fileadmin/ivr/press-zero-to-wait-in-queue.mp3 goto: queue 1: name: Leave voicemail play: https://www.liveagent.com/fileadmin/ivr/press-one-to-leave-a-voicemail.mp3 goto: voicemail
IVR starts in the start section:
- https://www.liveagent.com/fileadmin/ivr/connect-first-available-agent.mp3 welcome message is played
- https://www.liveagent.com/fileadmin/ivr/press-one-for-sales.mp3 and https://www.liveagent.com/fileadmin/ivr/press-two-for-technical-support.mp3 choice messages are played in loop (user has to wait for it to be played)
- now the system waits for the user's choice
- in case of 1, the call is transferred to the Sales department, you must provide correct ID.
- if there are some agents online in Sales department:
- https://www.liveagent.com/fileadmin/ivr/connect-first-available-agent.mp3 message is played
- call starts ringing to agents in sales departments
- if nobody is online in Sales department:
- the call continues in voicemail section
- in case of 2, the call is transferred to Technical department
- if there are some agents online in Technical department:
- call starts ringing to agents in the tech department
- if nobody is online in Sales department:
- the call continues in offline section
- in case of 3, the call is to hang up and transferred to a queue
- if there are some agents online and available to receive calls, it will start ringing to him and upon the answer he will be calling back to the customer
- if nobody is online to answer calls till the queued call is processed the offline ticket about callback will be created.
Offline section plays https://www.liveagent.com/fileadmin/ivr/we-are-currently-not-available-check-website.mp3 message and stops the call.
Voicemail section plays https://www.liveagent.com/fileadmin/ivr/press-one-to-leave-a-voicemail.mp3 and lets user to record voicemail
If the caller is placed in the queue, the queue music will start to play. After the music is finished, the user is given the choice to continue waiting or leave a voicemail.
Note: There are two ways how to write choice command. One can be seen in start section and second in queue section. You can choose one that is more convenient for you.
Dynamic IVR example:
start: - fetch: url: https://my.dynamic.script onError: offline params: from: {$from_number} to: {$to_number} ticket: {$conv_code} offline: - play: https://www.liveagent.com/fileadmin/ivr/leave-a-voicemail.mp3 queue: - play: https://www.liveagent.com/fileadmin/ivr/next-in-queue.mp3
In case you want to generate IVR script dynamically (e.g. based on who is calling) you can use fetch command.
IVR starts in the start section:
- as a first and only step, it fetches IVR from URL https://mydomain.com/scripts/ivr and continues at the start section of this fetched IVR.
You can pass multiple parameters to the script. And ivrs parameter is added automatically. It is list of IVR names from the main script so you can use them in goto commands (in this case it will be: start, offline, queue)
Lets say that our script returns following IVR:
start: - play: https://hello.peter - ring
Your script detected that you know the caller number, so you generate a personalized welcome message. Play it to a customer and then let the call ring to agents.
The fetch command should return plain text reply with correct IVR script, with correct formatting, indents, spaces and so on. Alternatively you can even return a YAML object/file and set the mimetype to ‘application/yaml’.
Note: If your script does not generate valid IVR, a call will hang up.
DTMF input example: (version 5.3.3.4 and above)
start: - play: https://enter.your.dtmf.input.and.press.#.to.confirm - dtmf: url: https://my.dynamic.script onError: offline params: ticket: {$conv_code} value: DTMF_VALUE offline: - play: https://www.liveagent.com/fileadmin/ivr/we-are-currently-not-available-check-website.mp3 queue: - play: https://www.liveagent.com/fileadmin/ivr/next-in-queue.mp3
In case you want to get some input from caller, you can use dtmf command. It waits for the user DTMF input ended by # sign.
When finished, it passes the result to the dynamic ivr script (see section above). DTMF_VALUE placeholder in params will be replaced with actual dtmf input.
List of available general IVR sounds you can use:
# Please wait while we connect you to the first available agent https://www.liveagent.com/fileadmin/ivr/connect-first-available-agent.mp3 # We are currently not available. Please check our website for information on call availability. https://www.liveagent.com/fileadmin/ivr/we-are-currently-not-available-check-website.mp3 # Please wait, you are the next in queue. https://www.liveagent.com/fileadmin/ivr/next-in-queue.mp3 # Press one for sales https://www.liveagent.com/fileadmin/ivr/press-one-for-sales.mp3 # Press two for technical support https://www.liveagent.com/fileadmin/ivr/press-two-for-technical-support.mp3 # Press two to request callback https://www.liveagent.com/fileadmin/ivr/press_2_to_request_callback.mp3 # Press one to leave a voicemail https://www.liveagent.com/fileadmin/ivr/press-one-to-leave-a-voicemail.mp3 # We are currently not available, please leave us a voicemail. https://www.liveagent.com/fileadmin/ivr/leave-a-voicemail.mp3 # Please note that his call will be recorded https://www.liveagent.com/fileadmin/ivr/call-will-be-recorded.mp3
Tips and tricks:
If you don't want the customer to press anything to "wait in queue" and press 1 to go to voicemail then you can write the queue section like this:
queue: - play: THERE_IS_QUEUE_NOTIFICATION.MP3 - choice: 0: name: Hidden option with music file play: QUEUE_MUSIC.MP3 goto: queue 1: name: Leave voicemail play: PRESS_ONE_TO_LEAVE_A_VOICEMAIL.MP3 goto: voicemail
When a customer calls and ends up in queue the THERE_IS_QUEUE_NOTIFICATION.MP3 will be played and then the choices will loop, so QUEUE_MUSIC.MP3 is played, then the PRESS_ONE_TO_LEAVE_A_VOICEMAIL.MP3 is played, then again QUEUE_MUSIC.MP3, then again PRESS_ONE_TO_LEAVE_A_VOICEMAIL.MP3 and so on. Since you never tell the customer to press anything else than 1 the customer will simply stay on the line until he either presses 1 to leave a voicemail or until there is a free agent available to receive his call.
If you want to offer IVR in multiple languages, eg. English and German, it can look like this example:
start: - play: https://www.liveagent.com/fileadmin/ivr/connect-first-available-agent.mp3 - choice: 1: name: English play: https://www.liveagent.com/fileadmin/ivr/press-one-for-english-langauge.mp3 goto: english 2: name: German play: https://www.liveagent.com/fileadmin/ivr/press-two-for-german-language.mp3 goto: german english: - play: https://www.liveagent.com/fileadmin/ivr/connect-first-available-agent.mp3 - choice: 1: name: Sales department play: https://www.liveagent.com/fileadmin/ivr/press-one-for-sales.mp3 do: - transfer: to: SalesDepartmentID if: online: - ring offline: - goto: voicemail 2: name: Technical department play: https://www.liveagent.com/fileadmin/ivr/press-two-for-technical-support.mp3 do: - transfer: to: TechnicalDepartmentID if: online: - ring offline: - goto: offline german: - play: https://www.liveagent.com/fileadmin/ivr/connect-first-available-agent.mp3 - choice: 1: name: German Sales department play: https://www.liveagent.com/fileadmin/ivr/press-one-for-sales.mp3 do: - transfer: to: germanSalesDepartmentID if: online: - ring offline: - goto: germanvoicemail queue: - goto: germanqueue 2: name: German Technical department play: https://www.liveagent.com/fileadmin/ivr/press-two-for-technical-support.mp3 do: - transfer: to: germanTechnicalDepartmentID if: online: - ring offline: - goto: germanoffline queue: - goto: germanqueue voicemail: - play: https://www.liveagent.com/fileadmin/ivr/leave-a-voicemail.mp3 - voicemail offline: - play: https://www.liveagent.com/fileadmin/ivr/we-are-currently-not-available-check-website.mp3 queue: - play: https://www.liveagent.com/fileadmin/ivr/next-in-queue.mp3 germanvoicemail: - play: https://www.liveagent.com/fileadmin/ivr/leave-a-voicemail-german-language.mp3 - voicemail germanoffline: - play: https://www.liveagent.com/fileadmin/ivr/we-are-currently-not-available-check-website-german-language.mp3 germanqueue: - play: https://www.liveagent.com/fileadmin/ivr/next-in-queue-german-language.mp3