Skip to main content
Audience: Asterisk admin comfortable editing pjsip.conf. Time: 10 minutes. Driver: chan_pjsip.

Prerequisites

  • Asterisk 16 or later (17, 18, 20, 21 all work)
  • chan_pjsip loaded (pjsip show version)
  • Outbound UDP 5060 allowed
  • SIP ALG disabled upstream

Step 1: create trunk in SmartAlex

SIP Trunk wizard, pick Asterisk. Save and copy credentials.

Step 2: pjsip.conf configuration

Append to /etc/asterisk/pjsip.conf (or use a separate conf file):
Replace YOUR_USERNAME and YOUR_PASSWORD with values from SmartAlex.

Step 3: extensions.conf dialplan

Add a context for inbound calls from SmartAlex:
Reload:

Step 4: verify registration

Expected: smartalex showing Registered.

Step 5: add extensions in SmartAlex

Settings, then PBX. Populate the directory. Agent Studio, then Telephony tab. Link the trunk. Call, verify, transfer.

Alternative: Native Extension Mode

The setup above has Asterisk register OUT to SmartAlex. The inverse, SmartAlex registers as an extension on YOUR Asterisk box, is also supported and often simpler when you already have Asterisk as your source-of-truth. See Native Extension Mode. The pjsip endpoint you provision for SmartAlex looks like any other softphone, username, password, codecs, transport. SmartAlex registers, sits in your pjsip show endpoints, and you route DIDs to its extension number through your normal dialplan.

Asterisk-specific notes

  • SIP tracing: asterisk -rvvvv then pjsip set logger on.
  • TLS transport: add a type=transport section with protocol=tls and point to your cert bundle. Use port 5061.
  • Custom headers: use PJSIP_HEADER() in dialplan if you need to inspect P-Asserted-Identity or other SIP headers on transferred calls.
  • Multiple SmartAlex trunks: each trunk needs its own unique section names (append -2, -3, etc.).

Next steps

FreePBX

GUI on top of Asterisk.

Troubleshooting

Error reference.