Skip to main content
Setting up a SIP Trunk in FreePBX
Updated over a week ago

This guide provides step-by-step instructions on how to add a new SIP trunk in FreePBX.


Make sure you have the following:

  • an installed and running FreePBX server

  • a SIP account from CommPeak

The SIP credentials and domain details that you need are available in your account at CommPeak Portal in Setup -> SIP Accounts:

  • User - click SHOW under Username/IP in a SIP account line

  • Password - click Reset Password if you forgot it

  • Domain -

Adding a SIP Trunk

Step 1: Access FreePBX

Open a web browser and navigate to your FreePBX server's IP address or domain. Log in to the server with your admin credentials.

Step 2: Navigate to Trunk Management

Once logged in, go to the top menu and hover over Connectivity. In the dropdown menu, click Trunks.

Step 3: Add SIP Trunk

Click the Add Trunk button on the Trunks page, then select Add SIP (chan_pjsip) Trunk.

Step 4: General Settings

Enter the following data on the General tab:

  • Trunk Name: enter any name for the trunk, e.g., MyTrunk

  • Outbound CallerID: this is your Caller ID

  • Maximum Channels: this is the maximum number of simultaneous calls you can have; leave it blank for no limit.

Step 5: pjsip Settings

Enter the following data on the pjsip Settings tab:

  • Username: this is your SIP username

  • Secret: this is your SIP password

  • SIP Server: this is your SIP domain

  • Context: set this to from-internal, which ensures the trunk acts as if calls are originating from internal extensions

Step 6: Codecs

On the pjsip Settings tab, scroll down to Codecs and allow the ulaw and alaw codecs.

Click the Submit button at the bottom of the page to save your changes.

Step 7: Apply Changes

Click the Apply Config button at the top of the page to apply the changes.

Step 8: Configure Outbound Routes

To use this trunk for outbound calls, you must configure outbound routes.

  1. Go to Connectivity -> Outbound Routes.

  2. Click Add Outbound Route.

  3. Provide a route name. In the Trunk Sequence section, select your new trunk.

  4. Add patterns for the numbers you want to route in the Dial Patterns section.

  5. Click the Submit button at the bottom of the page to save your changes. Then click Apply Config at the top-right again.

Step 9: Test the SIP Trunk

Finally, you can make a test call to verify that everything works correctly. You can do this from a registered SIP device (softphone or IP phone) configured to use your FreePBX server.


If you encounter any issues, go to Reports -> Asterisk Logfiles in your FreePBX to view logs for troubleshooting.

Did this answer your question?