Get help with installing, upgrading and running a PBX such as Asterisk.
100 %
User avatar
By WelshPaul
Posts Signature Likes Avatar Topics
Many people struggle when initially trying to use Sipgate on their Asterisk system - especially when going through a NAT firewall.

The key to getting the system to work reliably without getting one way transmission problems is to allocate ports for each Sipgate trunk. On my PBX I have 4 standard Sipgate numbers, and I use one of them for outgoing calls while the others are purely for incoming.

To avoid NAT problems make sure that your /etc/asterisk/sip_nat.conf contains:
  1. nat=yes
  2. externip=x.x.x.x
Where x.x.x.x = your 'public' IP address.
Lets start by seeing a working incoming and outgoing trunk Freepbx setup :
sipgate_asterisk_config.png (4.86 KiB) Viewed 1837 times
In Outgoing settings, make sure you have fromuser and username set to your Sipgate ID.
Enter context=from-trunk in Outgoing settings if you do not allow anonymous sip calls.
User avatar
By Mrdiy88
Posts Likes Avatar Topics
Hi WelshPaul,

I have followed this advice to setup Sipgate basic as my trunk (I know others have already achieved this). I am using the latest version of freepbx but it doesn't seem to register with the above details. Does anyone have any ideas of what to try to get it to work.

Also when I dial any number I get the dead tone, is this just because my trunk is not setup correctly?

User avatar
By VoipIT
Posts Likes Avatar
@WelshPaul's original post is dated 2013 and so it may now be outdated. Try following this guide:

FreePBX Configuration - sipgate SIP Trunking

The following guide describes the configuration of a sipgate SIP Trunk on a fresh install of FreePBX.

Estimated setup time required: under 20 minutes (excluding download and installation of FreePBX)

FreePBX version used in this guide: FreePBX 13; Linux 6.6; Asterisk 13

FreePBX Documentation, Installation & Configuration Guides:

You'll need your sipgate SIP Trunk's SIP-ID and SIP Password.

To find these:
  • Login to your sipgate account:
  • Under the Trunks menu in the Navigation bar click on the Trunk you wish to configure
  • Scroll down to the SIP Credentials section at the bottom of the main page.
Open your computer's browser and enter FreePBX's IP address into your browser's address bar.
Click on FreePBX Administration:


Submit your changes regularly:

Double check your changes before applying them:

1. Add a SIP Trunk:

Open Connectivity --> Trunks:

Click Add Trunk --> Add SIP (chan_sip) TRUNK:

Add Trunk --> General:

Add Trunk --> sip Settings:

Peer Details:
  • fromuser=SIPID
  • username=SIPID
  • secret=SIP_Password
  • port=5060
  • type=peer
  • context=from-trunk
  • insecure=port,invite
  • canreinvite=no
  • registertimeout=600
  • dtmfmode=rfc2833
  • disallow=all
  • allow=alaw&ulaw&G729&GSM&G726
If your PBX is behind a NAT Firewall add the following to your Peer Details:
  • qualify=yes
  • keepalive=30
  • nat=yes
Edit Trunk --> SIP Settings --> Incoming:

Your SIP Trunk must be registered online to receive incoming calls.
If you only wish to place outbound calls with your sipgate trunk this step can be skipped.
In the Incoming menu, delete any settings already showing/entered and add your Register String in the format:
Click Submit followed by Apply Config to register your trunk online with sipgate.
After your trunk has registered online successfully, the status in your sipgate account will update to online:

Click Submit followed by Apply Config to register your trunk online with sipgate.

Your Trunk's registration status can also be checked in the FreePBX GUI under:
Reports --> Asterisk Info --> Registries

2. Add Outbound Route:

Connectivity --> Outbound Routes --> Route Settings:

Outbound Routes --> Dial Patterns:

Simplest Dial Pattern - using X. will send all dialled digits to sipgate:

If you also add a Dial Pattern in your Trunk settings, the Outbound Route's Dial Pattern will be applied to the dialled number first followed by the Trunk's Dialling Pattern.

Set your Outgoing Caller ID:

** Please Note ** It is only possible to set an outgoing Caller ID from a/the number(s) you have on your sipgate trunking account. It is not possible for you to set "any number" as an outbound caller ID with sipgate trunking.

More than one phone number can be used with a single SIP Trunk.

The phone numbers the Trunk will receive incoming calls with can be chosen in your sipgate account Settings:
- Under the Trunking tab click on the trunk.
- On the right hand side of the trunk's settings click Assign Phone Number to add a single number.
- Choose +Phone Number Block to add a block of three or ten numbers.

To set the Outgoing caller ID in FreePBX:
- Open Admin --> Config Edit
- Click on the extensions_Custom.conf file and add the following text:
exten => s,1,SipAddHeader(P-Preferred-Identity:sip:${CALLERID(number)}
exten => s,n,MacroExit()

- The number you wish to show on outgoing calls can be selected in FreePBXs settings in the the Trunk Settings ('General' --> 'Outbound Caller ID'), the Outbound Route's settings ('Route Settings' -> 'Route CID') or in the Extension settings ('Outbound CID').

The number to be displayed as your outgoing caller ID must be sent to sipgate in the in the E.164 format (i.e. international format without the leading zeros or plus (+) sign) as a new header P-Preferred-Identity: 4420300000000)

2. Asterisk SIP Settings:

Asterisk SIP Settings --> General SIP Settings:
- Allow Anonymous Inbound SIP Calls: Yes/No
- STUN Server
- RTP Port Ranges
- Codec Selection

Asterisk SIP Settings --> Chan SIP Settings:
Registration Timer/Expiry Settings
Bind Port: Standard Value = 5160
Bind Address: Standard value is (Asterisk will listen on all addresses)

Disclaimer: I copied the above guide from the Sipgate website. You can view the original source by clicking here.
WelshPaul liked this
User avatar
By WelshPaul
Posts Signature Likes Avatar Topics
@VoipIT thanks for the detailed guide. :thumbsup:

@Mrdiy88 here is my current working FreePBX trunk configuration:


Andrews & Arnold support clearly isn't as good as I…

Snom setup wizard

Hi all I am having issues with some new Snom D315 and …

R.I.P. Voipfone User Forum

On Monday 3rd August 2020 Voipfone officially retired t…

Hi @Elloe Please contact Voipfone Customer servic…

Sign up for VIP membership