- TurnCall connects to Asterisk for ARI: its HTTP server (
http.conf), port 8088, or 8089 with TLS. TurnCall keeps the events WebSocket open. - Asterisk connects to TurnCall for each call’s audio, at
wss://<your TurnCall host>/ws/asterisk-media.
Carrier side
The carrier sends calls for your number to your Asterisk. This is the same setup as for any PBX, so follow your carrier’s own Asterisk guide. TurnCall needs two things from it:- The dialled number, in the request. Asterisk reads it as the extension,
and TurnCall looks the call up by it.
+15551234567and15551234567both work: TurnCall adds a+to bare digits. A national number (5551234567) does not, so map it in the dialplan (below). - Continuous audio. A trunk’s RTP carries silence between words, and turn detection depends on it. Turn off silence suppression (VAD, comfort noise) where your carrier or endpoint offers it.
- Telnyx: a SIP Connection that your Asterisk authenticates to
(
sip.telnyx.com), with the number assigned to it. Under the connection’s Inbound settings, choose a DNIS number format of+E.164orE.164(the default), not National. Telnyx’s Asterisk guide covers the rest. - Twilio: an Elastic SIP Trunk
whose Origination SIP URI is your Asterisk (
sip:pbx.example.com), with the number associated with the trunk. Twilio puts the dialled Twilio number in the request’s user part.
asterisk number, not as a twilio or
telnyx one. On this path the carrier talks to your Asterisk, and TurnCall
never talks to the carrier.
Asterisk side
1. Send the trunk’s calls to a context of their own. The trunk endpoint is your carrier’s configuration; the only line TurnCall cares about is itscontext. With Telnyx’s credentials connection, in pjsip_wizard.conf:
Stasis argument is the number TurnCall looks up. A call TurnCall
cannot take (a number it does not know, or one over the project’s live-call
limit, which also sends call.rejected) comes back to the dialplan
unanswered, at the line after Stasis, so your own fallback takes it. The
caller’s channel carries TURNCALL_CALL_ID from then on.
An agent’s transfer continues the caller in turncall-transfer, with the
target as the extension in E.164 (+15557654321). Your carrier decides what
caller ID it accepts on that outbound leg; Twilio, for example, accepts only
one of your Twilio numbers or a verified caller ID.
3. Turn on ARI for TurnCall’s user:
tlsenable, tlsbindaddr, tlscertfile, tlsprivatekey in
http.conf) and give TurnCall the https:// URL.
4. Tell Asterisk where to send call audio:
TurnCall side
1. Give TurnCall your Asterisk as the project’sasterisk credential:
ari_url is the http(s):// base of ARI. TurnCall connects out to it, so it
must pass BYOM_ALLOWED_URL_PATTERNS, the allowlist for every URL TurnCall
reaches on a project’s behalf. Optional fields, each matching a name in your
Asterisk configuration: app (the Stasis app, default turncall),
media_connection (the websocket_client.conf entry, default turncall) and
transfer_context (default turncall-transfer).
2. Bind the number with carrier: "asterisk", as it arrives on the trunk:
server_url for
Call Init.
3. Run the ARI connection on one replica. Asterisk gives an app’s calls to
one connection only. With several TurnCall replicas, set
ASTERISK_EDGE_ENABLED=false on all but one; the others still serve call
audio and call control.
Call the number. The agent answers, and the call’s events and transcript are
recorded as on any other number.
What differs from a cloud carrier
- Transfers are cold only. A warm transfer, a
transfer_messageor afallback_messageis refused, and the agent is told why. - No outbound calls or SMS from an Asterisk number.