Tasks
Transfer Call
Transfers a phone call to another extension on your phone system (PBX). Useful for handing a caller over to a person, eg "press 4 to speak to an agent", or when the caller asks for a human.
Run this task on an answered phone call (see Answer Call). Stubber asks your phone system to put the caller through to the extension, the same way a desk phone does a blind transfer. The phone system rings the extension. Once the extension answers, the caller is connected to it, and the voice call with the assistant ends.
The task doesn't wait for the extension to answer: it returns transferring as soon as the phone system accepts the transfer. How it went follows later, in an _update_from_call with call_data.event set to transfer:
result: "transferred": the caller is through to the extension. The voice call has ended.result: "failed": the transfer didn't work, eg the extension was busy or nobody answered. The caller is still on the line with the assistant.
This moves the phone call to another extension on your phone system, eg a person's desk phone or a queue. To move a live voice call to another stub, with the caller still talking to an assistant, see Voice Session Transfer.
Basic usage
Parameters
calluuid required string
The id of the call, from call_data.calluuid of the incoming call event. Save it on the stub when the call comes in, so later actions can use it. The call must be answered.
extension required string
The extension to transfer the caller to, on the same phone system the call came in on. Digits only, eg 802. It can be anything the phone system lets an extension dial internally, eg a person's extension, a ring group or a queue. A number is accepted too.
Result
The outcome follows later, in a transfer event on _update_from_call:
Errors
These are conceptual errors. After an error the caller is still with the assistant.
Things to know
- Let the assistant say it first. Tell the caller they're being transferred before the task runs. Stubber lets what the assistant is saying finish playing before it transfers, but tasks run before notifications in an action, so a voice notification in the same action comes too late. Have the assistant say it and then delegate, or transfer when the caller asked by pressing a key.
- When the voice call ends. On a successful transfer the voice call ends, and
_update_from_voicereportssession_endedas usual. - The transfer event goes to this stub, the one that ran the task, even when the call came in on another stub.
- What the phone system reports differs. 3CX reports success once the extension answers, so a busy or unanswered extension comes back as
failed. Other phone systems, eg Asterisk, may report success as soon as they've taken the call over. A busy extension then goes wherever the phone system sends it, eg voicemail, and the stub isn't told. - Phone system. Stubber's extension must be allowed to transfer calls, and the target extension must be reachable from it.
- Extensions only. Calls can't be transferred to outside phone numbers.
Examples
Press 4 to speak to a person
Add a fourth option to a keypad menu (see Collect Call Digits), and transfer straight away when the caller presses it. The caller asked for it, so the assistant doesn't need to announce it. On the menu answer:
When the transfer fails
On the transfer event with result: "failed", tell the assistant, which is still on the line:
When the caller asks for a person
Tell the voice assistant, in the instructions of Start Voice Chat, to say "I'm transferring you now" and then delegate when the caller asks for a person. In the backend agent's prompt, have it call an action that runs this task when it gets that delegation. The assistant has finished speaking by then, so the caller hears the announcement before the transfer.