Skip to main content
You will finish with SmartAlex answering calls on a raw Asterisk. It registers as a PJSIP endpoint (Use as PBX extension) or sits as a trunk endpoint your dialplan dials (Forward calls). Both take a few blocks in pjsip.conf and a line or two of dialplan, and these steps assume Asterisk 18 or later with res_pjsip.
In the app: Sidebar → Calls → PBX Extensions (/settings/pbx) → Connect a PBX → PBX platform → Asterisk. The tile starts on UDP, IP Whitelist authentication and G.711 u-law and A-law.

What you need first

  • Shell access to the Asterisk server, and the right to edit pjsip.conf and extensions.conf.
  • A SmartAlex agent that is ready to answer calls.
  • For extension mode: someone who can allow UDP from 34.233.117.97 and 15.240.176.215 on the host firewall and any cloud security group.
  • For Forward calls: outbound SIP to sip.voice.getsmartalex.com. This host has no fixed IP list, so use a hostname rule.

How it connects

This diagram shows the two ways Asterisk connects: SmartAlex registering to an endpoint, or Asterisk dialling a SmartAlex trunk.

Option A: Use as PBX extension

Add an endpoint for the AI: SmartAlex signs in to it over UDP and sends only G.711. Put these three sections in pjsip.conf (the standard Asterisk configuration, usually in /etc/asterisk/).
pjsip.conf

In Asterisk

1

Add the three sections

Add the endpoint, auth and aor sections above to pjsip.conf, with your own long random password.
2

Allow the first SmartAlex address

Let UDP from 34.233.117.97 reach your SIP port and RTP range. Do this on the host firewall (iptables or nftables), any cloud security group, and any acl= sections you use.
3

Allow the second SmartAlex address

Do the same for 15.240.176.215.
4

Ring the endpoint from the dialplan

In extensions.conf, in the context your inbound number lands in, add exten => _X.,1,Dial(PJSIP/850,30).
5

Reload

Run asterisk -rx "pjsip reload" and asterisk -rx "dialplan reload".

In SmartAlex

1

Open PBX Extensions

In the sidebar, click Calls, then PBX Extensions (/settings/pbx). Click Connect a PBX.
2

Pick Asterisk

Under PBX platform, click the Asterisk tile (“Raw Asterisk or custom PBX”).
3

Choose Use as PBX extension

Under Connection Type, choose Use as PBX extension.
The Asterisk tile with Use as PBX extension chosenThe Asterisk tile with Use as PBX extension chosen

Pick Asterisk, then Use as PBX extension.

4

Fill in the form

Fill in the fields in the table below.
5

Connect

Click Connect to PBX. The app says “Connected. SmartAlex is registering to your PBX now.” and shows Finish the connection.
6

Link the agent

Under Which agent answers?, choose your agent and click Link agent.
7

Set up the inbound route

Under Which number rings it?, click Set up the inbound route. The Connect a PBX Extension dialog already knows the connection and the linked agent. It asks only for the Extension, the Number callers dial in full international form, such as +27 11 555 1234, and an optional Label. Click Connect.

Option B: Forward calls (trunk endpoint)

Define SmartAlex as a trunk endpoint, and create the trunk in SmartAlex first, so you have the username and password.

In SmartAlex

1

Open PBX Extensions

In the sidebar, click Calls, then PBX Extensions (/settings/pbx). Click Connect a PBX.
2

Pick Asterisk

Under PBX platform, click the Asterisk tile (“Raw Asterisk or custom PBX”).
3

Choose Forward calls

Under Connection Type, choose Forward calls.
The Asterisk tile with Forward calls chosenThe Asterisk tile with Forward calls chosen

Pick Asterisk, then Forward calls.

4

Fill in the form

Fill in the fields in the table below.
5

Create the trunk and copy the details

Click Create SIP Trunk. The app says “SIP trunk created. Configure your PBX with these details.” With Credentials, copy the Username and Password; the password is not shown again. With IP Whitelist, enter your Asterisk’s public IP under PBX IP Address(es) first.

In Asterisk

Put these sections in pjsip.conf.
pjsip.conf
Leave out outbound_auth if you chose IP Whitelist only, then add a dialplan line that dials the number the AI answers through the trunk.
extensions.conf
Run asterisk -rx "pjsip reload" and asterisk -rx "dialplan reload" after the edits. The number you dial must be in Sidebar → Calls → Numbers (/phone-numbers) with an agent assigned. If it lives with your own carrier, email support@getsmartalex.com about adding it.

Read the SIP log

Look for Received SIP request ... from UDP:34.233.117.97 or 15.240.176.215. The next line is your reply: 401, 403 or 200 OK.

Check it worked

1

The status turns green

Under Sidebar → Calls → PBX Extensions, the card shows Connected as ext 850 in extension mode; for anything else, see Connection status.
2

Diagnostics pass (extension connections)

For an extension connection, open the card’s menu, choose Show diagnostics, and check Registration, PBX reachable and Inbound routing all pass.
3

Asterisk shows the sign-in

Run asterisk -rx "pjsip show contacts" and check endpoint 850 has a contact from one of the two SmartAlex addresses.
4

A call reaches the AI

Call the number from a mobile phone. Your agent answers.
5

A transfer works

Ask the agent to put you through to a colleague, and the call rings that person’s extension.

Next

Fill the extension directory

So the AI can put callers through to your team.

Test before go-live

The full test plan.

Questions people ask

Raw Asterisk trunks are often matched by source address with a type=identify block. Switch to Credentials or Both if you prefer a username and password.
The username= in the endpoint’s auth section, here 850-auth. It does not have to match the extension number.
Keep direct_media=no and rtp_symmetric=yes, set your external address in the transport if Asterisk is behind NAT, and open your RTP range. See Network requirements.
SmartAlex transfers with SIP REFER, so make sure the context the AI lands in can reach the extensions it transfers to. In extension mode, if Asterisk refuses REFER, SmartAlex rings the extension directly for 30 seconds instead.

FreePBX

Asterisk with the FreePBX web interface.

Generic SIP

The settings any SIP system needs.

Call routing and transfers

REFER, attended transfers and fallbacks.

Connection status

What each status means.
Last modified on November 27, 2026