Docs
GuidesAPI referenceWebhooksWeb widget

Phone

Connect Asterisk

Let the AI answer calls from Asterisk (PJSIP configuration files) and transfer them back to your team. Connect your phone system with these steps.

First create a trunk on Phone numbers → PBX / SIP and choose Asterisk. In the steps below, SIP_SERVER, USERNAME and TRUNK_PASSWORD are the values shown on your trunk page, which also shows this snippet with your values filled in.

#Steps

  1. Add the snippet below to pjsip.conf, or a file it includes, and run pjsip reload.

  2. Route calls to the AI with Dial(PJSIP/7777@bluepenguin) from any dialplan context.

  3. Transfers from the AI come back over the same trunk to the extension you set as a transfer target.

pjsip.conf
[bluepenguin]
type=registration
outbound_auth=bluepenguin-auth
server_uri=sip:SIP_SERVER:5060
client_uri=sip:USERNAME@SIP_SERVER
retry_interval=60

[bluepenguin-auth]
type=auth
auth_type=userpass
username=USERNAME
password=TRUNK_PASSWORD

[bluepenguin]
type=aor
contact=sip:SIP_SERVER:5060

[bluepenguin]
type=endpoint
context=from-bluepenguin
disallow=all
allow=ulaw,alaw
outbound_auth=bluepenguin-auth
aors=bluepenguin
from_user=USERNAME
direct_media=no

[bluepenguin]
type=identify
endpoint=bluepenguin
match=SIP_SERVER_IP

#Check it works

  1. The trunk page shows Registered (for username and password trunks).
  2. Dial 7777 from an internal extension. The AI should answer.
  3. Ask to be transferred to a person, and check the call reaches the extension you set.

Problems? See Troubleshoot SIP.