Zum Hauptinhalt springen

Voip Automation

In questa sezione


Call voip function from response

For Algho VoIP, the following commands are available to be passed in the "payload" field.

PayloadDescription
voip:hangupHangup call
voip:transfer(<ext>)Unattended transfer call: ext phone number
voip:transfer(<ext>,<questionId>)Attended transfer call: ext phone number, questionId (intent)
voip:transfer(<ext>,<questionId>,<callbackQuestionId>)Attended transfer call: ext phone number, questionId (intent), callbackQuestionId (intent)
voip:switch(<botId>,<questionId>)Switch bot during call: questionId (Optional intent)
voip:speak(<text>)Append text to speak
voip:switch_language(<langCode>)Switch bot language if multilanguage is enabled: langCode 2 char language identifier
Info

switch_language is only available on Algho VoIP 3 or higher.

HTTP headers:
Content-Type: application/json; charset=utf-8

Response body:
{
"answers": [
{
"answerText": "Thanks",
"payload": "voip:hangup"
}
]
}

VoIP Call Transfer

In VoIP systems, BlindTransfer and AttendedTransfer are two methods for redirecting calls, each serving different use cases.

BlindTransfer immediately redirects the call to another number without checking if the target extension is available. Once the transfer command is sent, the system (PBX) handles the rest. If the destination is busy or unreachable, the call may be dropped. This method is fast and efficient, often used for transferring calls to queues or automated systems.

AttendedTransfer, on the other hand, involves the assistant first placing the caller on hold, contacting the target extension, and confirming availability before completing the transfer. This allows the assistant to introduce the call or verify that the recipient is ready. It ensures a smoother, more professional interaction but requires more time and system coordination than a BlindTransfer.

In Algho VoIP, two call transfer modes are available: BlindTransfer and AttendedTransfer.

The VoIP commands are specified within the “payload” field of an Algho web service response.

Details

BlindTransfer Payload

voip:transfer(number)

HTTP Headers

Content-Type: application/json; charset=utf-8

Response Body

{
"answers": [
{
"answerText": "I'll put you through to the requested extension",
"payload": "voip:transfer(101)"
}
]
}

This is the standard transfer mode, where the call is directly passed to the specified number.

Everything is managed by the PBX.

If the target extension is busy or unavailable, the call might be dropped.

This mode is generally used to forward calls to operator queues, which can be managed by the PBX flow.

Details

AttendedTransfer Payload

voip:transfer(number, questionId)

HTTP Headers

Content-Type: application/json; charset=utf-8

Response Body

{
"answers": [
{
"answerText": "Please hold while I contact the requested extension",
"payload": "voip:transfer(101, 123456)",
"rawData": {
"voip": "Good morning, Mr. Mario Rossi is on hold:"
}
}
]
}

Flow Description

  1. The user is placed on hold with hold music (managed by the PBX).
  2. The assistant calls extension 101, playing the initial message provided in the voip field of rawData: > “Good morning, Mr. Mario Rossi is on hold.”
  3. Question 123456 is triggered, configured for example with the response “Would you like to answer?” and a form asking “Say YES or NO”, configured in an Algho form. > Note: The questionId refers to the botId configured in Algho VoIP.

START OF DETAILS

If the choice is “NO”

HTTP Headers

Content-Type: application/json; charset=utf-8

Response Body

{
"answers": [
{
"answerText": "Thank you, I’ll let them know",
"payload": "voip:hangup",
"rawData": {
"voip": "I'm sorry, Mario Rossi, but the extension is currently unavailable"
}
}
]
}

The assistant informs the user:

> “I'm sorry, Mario Rossi, but the extension is currently unavailable.”

END OF DETAILS

START OF DETAILS

If the choice is “YES”

HTTP Headers

Content-Type: application/json; charset=utf-8

Response Body

{
"answers": [
{
"answerText": "Perfect, I’ll connect you to Mario Rossi right away",
"payload": "transfer_complete"
}
]
}

The user is then connected to the desired extension.

END OF DETAILS