Tasks
Make Call
Calls a phone number or extension through your phone system (PBX), with a voice assistant on the line. Useful for calling a lead, calling a customer back, or reminding someone of an appointment.
The call is made from a SIP connection's extension, the same way someone would dial from that desk phone. Your phone system's outbound rules pick the trunk, the caller ID and the number format. Extensions on the same phone system work too, which is a cheap way to test.
Start the voice call first with Start Voice Chat, then run this task with its voice_session_uuid. The assistant is ready the moment the person picks up.
The task doesn't wait for the call to be answered: it returns calling as soon as the call is placed. How it went follows later, in an _update_from_call with call_data.event set to outgoing:
result: "answered": the person picked up and is talking to the assistant.busy,no_answer,declinedorfailed: nobody is on the line.call_data.reasonsays more.
Outgoing calls must be allowed on the SIP connection first. In the manage platform, open the connection under Notifications → SIP and turn on Allow outgoing calls in the Outgoing Calls section. See Who may be called.
Basic usage
Parameters
sipconnectionuuid required string
The SIP connection to call from, in your organization. Its extension makes the call. Find it in the manage platform under Notifications → SIP, or in call_data.sipconnectionuuid of a call that came in on it.
to required string
The number or extension to call, eg 0821234567, +27821234567 or 802. Digits with an optional leading +, at most 20. Spaces, dashes, dots and brackets are removed first. The number is passed to your phone system as it is, and its outbound rules turn it into what the trunk needs.
voice_session_uuid required string
The voice call the person talks to once they pick up, from Start Voice Chat with channel set to call. Start it in the same action, just before this task.
ring_timeout_seconds optional number
How long to let the phone ring before giving up, from 5 to 50 seconds. When it runs out, the call is cancelled and the outgoing event comes back with result: "no_answer" and reason: "ring_timeout".
Default: 30
Result
Save calluuid on the stub. Once the call is answered, Collect Call Digits and Transfer Call work on it the same as on an incoming call.
The outcome follows later, in an outgoing event on _update_from_call:
Common reasons for failed:
Errors
These are conceptual errors: no call was made. A technical error with message: "call_failed" means the call couldn't be set up on Stubber's side.
Who may be called
Outgoing calls cost money on your trunk, so each SIP connection decides what its template may call. Set these in the manage platform, in the connection's Outgoing Calls section:
Your phone system's own outbound rules apply as well.
Things to know
- Who speaks first. With a
greetingon Start Voice Chat, the assistant speaks as soon as the person picks up. Without one, it waits for their "hello" and answers it. - Audio format. Start the voice call as
audio/pcmaat 8000 (A-law, used in most of the world), oraudio/pcmu(μ-law) in North America and Japan. Stubber offers both to your phone system, and converts if it picks the other one, so either works.call_data.audio_formatin theoutgoingevent says which one the phone system picked. - Caller ID. The person sees the caller ID your phone system sends for the extension, set on the extension or the trunk. The task can't change it. Many providers refuse calls whose caller ID isn't one of the trunk's own numbers, often with
403 Forbidden. - Phone system setup. The extension needs an outbound rule for the numbers it calls (in 3CX: Outbound Rules). Check that the rule matches every form your template sends, eg a rule limited to 10 digits matches
0821234567but not+27821234567. - Unanswered calls. The voice call you started waits about a minute for the call to be answered, then ends by itself. To try again straight away, end it first with a
hangup, because a stub can only have one live voice call. - The
outgoingevent goes to this stub, the one that ran the task. - Ending the call. End an answered call like any voice call, eg with a
hangupvoice notification. When the person hangs up,_update_from_voicereportssession_endedas usual.
Examples
Call a lead back
A form action that calls the number saved on the stub, with the assistant speaking first:
Try again later when nobody answers
On the outgoing event, schedule another attempt when the call wasn't answered:
Then, with the condition stubpost.data._incoming_call_data.call_data.result in ['busy', 'no_answer'], run Schedule Task to run the calling action again later.