Using a callwithus DID with FreePBX/Asterisk

Using a callwithus DID with FreePBX/Asterisk is very straight forward.

First you need to purchase the DID through your callwithus account. I am buying a number located in the UK.

buying a DID from callwithus

Once you have purchased the DID you can click on the DID menu option again to check where the DID is being forwarded to. To make things easier on the FreePBX side we want to change this from the default.

Change the destination to “SIP/[email protected]

If you do not do this it will be your account number passed to Asterisk as the DID rather than your actual DID number. This will mean that your Inbound Route will not work correctly.

setting callwithus DID destination

If you have configured your callwithus trunk as described here calls to your DID should now go through to your Asterisk server.

We can test this by setting up an inbound route. Click on “Inbound Routes” in FreePBX and enter the details. For “DID Number” enter the number as it is shown in your callwithus account.

incoming route in freepbx for callwithus

Scroll down and enter the destination for the Inbound Route. I like to set the destination to “Put caller on hold for ever” as, with music on hold setup, you should be able to hear music when you dial the number.

incoming route in freepbx for callwithus 2

Once you’ve done that you can click on Submit and Apply Changes.

Now try ringing your number!

If you have problems getting this to work it might be worth checking that you have “Allow Anonymous Inbound SIP Calls?” set to yes in the “General Settings” page of FreePBX. This can be required depending on how your trunk is registered and where the call comes from to your Asterisk server.

Setting “Allow Anonymous Inbound SIP Calls” to Yes is potentially unsafe. It gives attacks a chance to connect to your server via SIP in an attempt to compromise it. Please see here for more information – http://sysadminman.net/blog/2011/sip-scanning-attacks-freepbx-allow-anonymous-3276

Also, I had poor audio quality on my DID initially but that turned out to be because the audio was being routed via the US. After opening a ticket with callwithus the voice for the call was routed in the UK only and sounded great.