Starting with FreePBX version 12, the PJSIP libraries were introduced. In FreePBX version 13, these libraries are used by default on port 5060, while the traditional CHAN_SIP_C libraries were relegated to port 5061. You can create a trunk using either library. The SIP.US module uses the traditional library by default. However, some people wish to use PJSIP for one reason or another. These instructions will help you set up a trunk using PJSIP on FreePBX 13.
When you create a trunk with PJSIP, you should be dropped off into a screen similar to the one below. The only field which is important at this time is the "Trunk Name." You must enter some sort of distinctive name for this trunk.
Select the "pjsip Settings" tab and edit the settings under the "General" sub-tab. Enter your SIP.US Trunk Number (usually starts with 52) as the username. The "Secret" is the password for your trunk found under the "show password" link in your SIP.US portal (THIS IS NOT THE SAME AS YOUR LOGIN PASSWORD FOR SIP.US). "Authentication" should be set to "Outbound," and "Registration" should be set to "Send." Enter "gw1.sip.us" in the "SIP Server" field, and "5060" in the "SIP Server Port."
Select the "Advanced" sub-tab under the "pjsip Settings" tab. Look at the image below. You must edit the "From Domain" field to say gw1.sip.us. Additional Note: You will need to add the trunk number in the From User field which is directly under the From Domain.
Select the "Codecs" sub-tab under the "pjsip Settings" tab. Here you should select only G711ulaw. All other boxes should be unchecked.
It is time to create an "Outbound Route" so we can dial out through SIP.US. Select "Connectivity" then "Outbound Routes." To create a new "Outbound Route," you must first enter a distinctive "Route Name." Then select the trunk you just created as the top route in "Trunk Sequence for Matched Routes."
Select the "Dial Patterns" tab. Enter dial patterns exactly like the image below. They will allow for you to dial 3 digits (think 911), 10 Digits (U.S. Calling), 11 Digits (North American Calling), and International Calls (starting with 011). After entering this info, and hitting "Submit" then "Apply Config." You can dial outbound through your SIP.US trunk.
To direct calls from SIP.US to an extension you must create an inbound route. To start select "Inbound Routes" from the "Connectivity" menu on your FreePBX interface. The image below demonstrates an inbound route that will send ANY call to a certain extension. To direct a specific number to a specific extension you would create a route and set the "DID Number" field to your 11 digit DID with SIP.US (for instance 15557778888).
To add redundancy to your system, follow the steps to create a trunk and substitute gw2.sip.us anywhere you had gw1.sip.us. Then add this additional trunk to your outbound route as the second entry. This will provide a redundant path to call through SIP.US in case you cannot reach gw1.sip.us for some reason.
After following this guide, your PBX should be successfully registered, and you can make outbound and inbound calls. If you have any issues, please use the support link to open a ticket.