Twilio Calls
How to make inbound and outbound calls using Twilio.com service.
The platform supports both inbound and outbound phone calls via Twilio.com platform.
If you need to differentiate between inbound and outbound in main dialogue, use session.isInitiated property (which indicated that session has been created from server initiative) in functional code following #intro action
1
if (session.isInitiated) toOutbound else toInbound
Copied!

Inbound

To redirect calls to particular application or specific dialogue, you have to allocate phone number and link it to TwiML bin - see following example
1
<?xml version="1.0" encoding="UTF-8"?>
2
<Response>
3
<Connect>
4
<Stream url="wss://core.flowstorm.com/call/">
5
<Parameter name="locale" value="en-US" />
6
<Parameter name="sender" value="{{From}}" />
7
<Parameter name="appKey" value="<key>" />
8
</Stream>
9
</Connect>
10
</Response>
Copied!
where key is valid conversational key (:<appId> or :<dialogueId>). Please note that in case of non-public application or particular dialogue unknown caller will be prompted to do pairing using spelled code first. To prevent this implicit behaviour, public application must be referenced in key (in that case any caller will be represented by anonymous user object in platform).
Starting platform version 2.9, you can also let platform define TwiML for particular application instead of using custom TwiML bin. Just use URL https://admin.promethist.com/initiations/call/<appId> as incoming call web hook using GET method.

Outbound

Call from particular application of specific dialogue can be initiated by standalone (CLI) client or from web interface (TODO). Twilio Account SID, Auth Token and phone number with outbound calls allowed for specified geolocations (see https://www.twilio.com/console/voice/calls/geo-permissions/) are required.

Standalone

Standalone client can be used to initiate outbound call
1
promethist call --account <accountSID> --token <authToken> --to <recipientPhoneNumber> --from <callerPhoneNumber> --key <key>
Copied!
Phone numbers have to start with + sign (e.g. +420608123456)

Web

app.flowstorm.ai > New > Session Initiation OR Data > Sessions > + Initiate
Before initiating session please in ensure that a) application linked to initiated session has set valid Twilio phone number which as allowed outbound calls for user geolocation (Access > Applications) and b) your organization has set valid combination of Twilio account SID and auth token (Main > Organization).
Last modified 7mo ago