Twilio Stream Socket

This channel allows to make inbound and outbound calls using Twilio.com streams.

The platform supports both inbound and outbound phone calls via Twilio.com platform streams via web socket endpoint /call provided by Core Application.

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

if (session.isInitiated) toOutbound else toInbound

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

<?xml version="1.0" encoding="UTF-8"?>
<Response>
  <Connect>
    <Stream url="wss://core.flowstorm.com/call/">
      <Parameter name="locale" value="en-US" />
      <Parameter name="sender" value="{{From}}" />
      <Parameter name="appKey" value="<key>" />
    </Stream>
  </Connect>
</Response>

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).

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

promethist call --account <accountSID> --token <authToken> --to <recipientPhoneNumber> --from <callerPhoneNumber> --key <key>

Phone numbers have to start with + sign (e.g. +420608123456)

Web

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 updated