FreePBX PJSIP setup

Setup guides / FreePBX / FreePBX 14/15 PjSIP

1. In the section Connectivity -> Trunks add SIP(chan_pjsip) trunk.

Enter the trunk name in the field Trunk Name and go to tab pjsip settings

Data is shown in the example:

  • 111111: Your SIP-number from your personal account.
  • Secret: Your SIP-number password from the section “Settings – SIP Connection” from your personal account.
  • SIP Server:

The following settings have to be completed as shown on the screenshot.

Tab PJSIP Settings – Advanced, change the parameters in the following fields:

  • Contact User: 111111
  • From Domain:
  • From User: 111111
  • Client URI:
  • Server URI:
  • AOR Contact:

PJSIP Settings – Codecs:

Leave codecs alaw and ulaw, as shown on the screenshot.

3. In the section Connectivity -> Inbound Routes create routing for incoming calls.

  • Description: Zadarma-in
  • DID Number: 111111

In the section Set Destination you can determine where an incoming call be directed, it can be FreePBX extension number, call group, IVR etc.

4. Enter the section Connectivity -> Outbound Routes and create routing for outgoing calls Zadarma-out.

  • Route Name: Zadarma-out
  • Route CID: 111111
  • Trunk sequence for matched routes: Zadarma

In the section Dial Patterns in the field "match pattern" enter a full stop (.) (shown on the next screenshot with a red arrow) and create routing. If you do not put a full stop, you will not be able to make outgoing calls.

The setup is complete.

Enabling encryption

1. Go to Settings - Asterisk SIP Settings - tab SIP Settings[chan_pjsip] - section TLS/SSL/SRTP Settings

Certificate Manager value default

SSL Method value tlsv1_2

Verify Client value NO

Verify Server value NO

In (tls) in the field Port to Listen On enter 5061

2. Then go to your track settings and in SIP Server Port enter 5061, in Transport choose

In extended trunk settings also change port 5060 to 5061 in Client URI, Server URI and AOR Contact

In the Media Encryption field change it to SRTP via IN-SDP(recommended)