Setting up a SIP trunk in FreePBX 13


  • Service Provider

    Log in to VoIP.ms and navigate to DID Numbers -> Manage DID(s)
    0_1476638384130_upload-95d4c758-9855-4864-ac61-71f09937efec

    Look for the DID you want to use for the trunk and note the number, routing, and POP.
    0_1476640236234_upload-3fd76fa1-0b52-4475-adb2-6799ac6d8b09

    In FreePBX, navigate to Connectivity -> Trunks
    0_1476640438225_upload-d3a447f9-d56f-4fb2-aaa8-9fe63b0c36b5

    Click +Add Trunk -> +Add SIP (chan_pjsip) Trunk. PJSIP simplifies the setup from the PBX side and is the new default for Asterisk. You can read all about it straight from Digium if you want.
    0_1476640490338_upload-32f5d475-c899-4d90-b8bc-a32c700fd152

    Fill out the General tab as desired. Note the outbound Caller ID format and also set a reasonable maximum channels value to protect against extreme charges if a SIP user's credentials are ever compromised. I generally leave the Caller ID blank and set it on the outbound routes, but it is easy to miss there.
    0_1476640752208_upload-0b156c68-ca0e-4795-b0a7-95fdb58f08f8

    Leave the Dialed Number Manipulation Rules empty. I always recommend handling that on the outbound route(s).
    0_1476640911883_upload-7a494eb4-5f6d-4fde-8faf-b61613554946

    Fill out the General tab on PJSIP Settings with your voip.ms information noted from above. The username is the account number, or if you use a sub account it is the account number _subaccountname. The secret is the password for the account on VoIP.ms. The SIP server is the pop name with the dash removed and .voip.ms appended.
    0_1476641322364_upload-dbe1d28f-1de6-4e8b-b2fd-0acb7ff7751a

    Click to the advanced tab
    0_1476641382336_upload-ca5defef-24ee-46f4-b669-9c2cfb61a7bd

    Scroll to the bottom and change detect fax to enabled if you want to enable inbound faxing on this trunk. VoIP.ms does not support T.38 FoIP but faxing over SIP works for most simple needs.
    0_1476641502737_upload-055e48d8-e122-41ff-b2a2-808da3a6e38e

    You can leave the codecs tab alone unless you have changed default codecs on VoIP.ms side.
    0_1476641654210_upload-4e92834d-1dd8-4286-bcba-2f247175f28b

    Click submit at the bottom of the screen, and then after it finishes, click the red Apply Config button.
    0_1476641702807_upload-5b6306cf-871e-45e9-8758-6efe383600bf

    Go back to the FreePBX dashboard and you should see the trunk online after you click the little circle arrows to refresh.
    0_1476641872530_upload-6d63c9a1-8a9b-4b04-9fb2-4103a46371ee

    Part of the FreePBX 13 Setup Guide


  • Service Provider

    Some people have reported issues using the PJSIP settings with VoIP.ms. I have been using it for months with no problems, but if you are having problems, then you can create a CHAN_SIP based trunk with no problems.

    If you have problems with PJSIP, or jsut need to confirmed support of CHAN_SIP from your provider, setting up a CHAN_SIP trunk is not much more difficult.

    Choose CHAN_SIP
    0_1519669532602_c270fc33-d10b-4038-a595-ba27f603cd53-image.png

    The General tab gets filled out the same as with PJSIP.
    0_1519669635788_4b349bcf-9483-4b76-9566-a1cc468bdb6a-image.png

    Leave the Dialed Number Manipulation Rules empty. I always recommend handling that on the outbound route(s).
    img

    Remove the default information in the Outgoing tab
    0_1519669770315_2df779fe-30fe-4697-a026-c37924e7cbff-image.png

    And populate it with your information. No spaces or characters in the trunk name as that gets used as the Asterisk context.
    0_1519669863014_92f24815-b398-4cd1-8389-880501c89364-image.png

    Here are the settings, you should only need to edit the first 4 lines appropriately.

    host=chicago2.voip.ms
    username=123456_some_sub_acct
    fromuser=123456_some_sub_acct
    secret=some_password
    type=peer
    context=from-trunk
    trustrpid=yes
    sendrpid=yes
    qualify=yes
    nat=yes
    directmedia=no
    insecure=port,invite
    disallow=all
    allow=ulaw
    

    On the Incoming tab , again delete the default data.
    0_1519669984732_7d8ad621-b2a7-41b2-8efd-6a0e826e446d-image.png

    This time leave the USER Context and USER Details blank and only populate the registration string. This is why you want to avoid @ or : in your SIP trunk password.
    0_1519670026551_717bc2cb-0d99-41cb-8380-3da657936978-image.png


  • Service Provider

    Just followed this, worked great.


  • Service Provider

    Following up on this way too many weeks later...

    Sorry about that...

    With VoIP.ms and PJSIP, you also need to go to the advanced tab and change the default expiration time from 3600 to 120.

    I have not tested this with other providers yet as it would be disruptive to a client.
    When I have time I will setup a backup provider and change my extension to use that normally and see how things go. The problem is that with a not very used system, it will still reregister every hour, so to catch it, I have to make a call between the fial time and the reregister time.

    0_1498692886260_28f1a3e4-688d-45bc-8747-11cf87efbca2-image.png


  • Service Provider

    Post 2 updated with the CHAN_SIP instructions.. sorry to be so bad about this.

    https://mangolassi.it/topic/12327/setting-up-a-sip-trunk-in-freepbx-13/2