Asterisk: How Do I Configure Asterisk for sipgate trunking?

These are the settings for the basic configuration of Asterisk for sipgate trunking. 

For general Asterisk configuration instructions with sipgate team accounts please click here instead.

Note: Please replace your SIPID to SIP-ID and PASSWD to SIP Password respectively.

Please enter the following in sip.conf:

  • []
  • type=peer
  • port=5060
  • username=SIP-ID
  • fromuser=SIP-ID
  • secret=SIP Password
  • dtmfmode=rfc2833
  • insecure=port,invite
  • canreinvite=no
  • registertimeout=600
  • disallow=all
  • allow=alaw
  • allow=ulaw

The information under "outboundproxy" is particularly important as it ensures your PBX is connected with the correct server. Your Asterisk must be registered with our server in order to receive incoming calls.

Equally important is that the peer is:

  • register => SIP-ID:SIP

If you now run the debug command on your Asterisk console, the REGISTER packets should be sent to the IP address

For outgoing calls, please enter the sender number in E.164 format (i.e. international format without the leading zeros or plus (+) sign) as a new header P-Preferred-Identity:

  • SIPAddHeader(P-Preferred-Identity: <>)

Important CLIP/Outgoing Caller ID information: At this time, only sipgate-provided phone numbers can be set as the outgoing identity (Caller ID).

Should you wish to block your telephone number, you can do so by using:

  • SipAddHeader(P-Preferred-Identity: <>)
  • SipAddHeader(Privacy: id)

Incoming calls are signalled to you with the fully selected E.164 number in the Request URI. This way you can work with the the variable $ {EXTEN} without issues. It is not necessary to remove the number for the To-URI.

It is also possible to enable call forwarding on your PBX. To do this, please use the Diversion-Header and enter the originally dialled number. 

Note: The following example was written in ORIGEXTEN:

  • SipAddHeader(Diversion: <${ORIGEXTEN}>)



Was this article helpful?