SparkTG
Cloud Telephony

Configuring SIP trunk credentials in your PBX

Set up SparkTG SIP trunking in Asterisk, FreePBX, or 3CX. Includes configuration examples, codec settings, NAT handling, and steps to verify two-way audio.

8 min readLast updated 03 May, 2026By SparkTG Support Team

SIP trunking connects your on-premises PBX to SparkTG's cloud telephony network, enabling inbound and outbound calls through your existing phone system. Here's how to configure it.

Getting your SIP credentials

  1. 1

    Go to Settings → SIP Trunks

    Dashboard → Settings → SIP Trunks → click Create New Trunk.

  2. 2

    Copy your credentials

    You'll see: SIP Server (sip.sparktg.com), SIP Port (5060 for UDP, 5061 for TLS), Username, Password, and your Outbound Caller ID. Keep these secure.

FreePBX / Asterisk configuration

ini
; /etc/asterisk/sip.conf — SparkTG trunk
[sparktg-trunk]
type=peer
host=sip.sparktg.com
port=5060
username=YOUR_SIP_USERNAME
secret=YOUR_SIP_PASSWORD
fromuser=YOUR_SIP_USERNAME
fromdomain=sip.sparktg.com
insecure=port,invite
qualify=yes
dtmfmode=rfc2833
context=from-sparktg
disallow=all
allow=ulaw
allow=alaw

3CX configuration

  1. 1

    Add a new SIP trunk

    In 3CX Admin Console → SIP Trunks → Add SIP Trunk → Generic SIP Trunk.

  2. 2

    Enter credentials

    Registrar/Server: sip.sparktg.com | Port: 5060 | Authentication ID: your SIP username | Password: your SIP password.

  3. 3

    Set codec priority

    Add G.711 (ulaw/alaw) as the first codec. Remove any video codecs. SparkTG supports G.711, G.729, and G.722.

If your PBX is behind NAT, you must set the External IP and Local Networks fields in your SIP settings. Without this, audio is one-way or calls drop after 30 seconds.

Testing the trunk

  • After saving, the trunk should show Registered status within 30 seconds.
  • Place a test outbound call from an extension through the trunk.
  • Receive a test inbound call to your virtual number and verify it reaches the PBX.
  • Check two-way audio — speak and listen both directions for at least 30 seconds.

Frequently asked questions

Where do I find my SparkTG SIP trunk credentials?
Go to SparkTG Dashboard → Settings → SIP Trunks → Create New Trunk (or select an existing one). Your SIP Server (sip.sparktg.com), SIP Port, Username, Password, and Outbound Caller ID are all shown on that page. Keep these credentials secure.
My SIP trunk shows 'Unregistered' in FreePBX — what should I check?
Check four things: (1) SIP credentials match exactly — username and password are case-sensitive. (2) SIP server is sip.sparktg.com on port 5060 UDP. (3) Your firewall allows outbound UDP on port 5060 and UDP 10000–20000 for RTP. (4) If behind NAT, your External IP and Local Networks are correctly set in Asterisk SIP settings.
Why is audio one-way after my SIP trunk connects?
One-way audio is almost always a NAT issue. Your PBX is sending RTP audio to the wrong IP address. In Asterisk/FreePBX, go to SIP Settings → NAT and set your External IP to your public IP address and add your local subnet to Local Networks. In 3CX, set the External IP under Advanced → Network.
Why do calls drop exactly after 30 seconds on my SIP trunk?
Calls dropping at exactly 30 seconds is a classic NAT signalling problem — the SIP re-INVITE after the initial 30-second timer is being blocked. Enable 'insecure=port,invite' in Asterisk or set 'Reregister' in 3CX, and ensure your firewall doesn't block SIP re-INVITEs.
Which audio codecs should I configure for SparkTG SIP trunking?
Configure G.711 ulaw and G.711 alaw as the first priority codecs. SparkTG also supports G.729 and G.722. Remove all video codecs from your trunk configuration. Always set dtmfmode=rfc2833 for reliable keypress detection through the trunk.

Was this article helpful?

Still stuck? Contact our support team →