simtrunkDocs

SIP trunks to a PBX

Connect your PBX for dial-in and dial-out on your lines, in register, registrar or peer mode.

A SIP trunk connects simtrunk to your own SIP server or PBX (Asterisk, FreeSWITCH, a hosted SIP platform). It carries a line's traffic both ways:

  • Dial-in: a call to the SIM's number goes to the PBX, addressed to the line's DID. The PBX decides who answers.
  • Dial-out: the PBX calls through simtrunk, and the call leaves on a SIM. Off by default: an open trunk is a toll-fraud risk.
  • SMS and USSD ride the trunk too, as SIP MESSAGE. A USSD code the PBX dials is not a call: see USSD.

A line routed to a trunk sends its incoming calls there instead of ringing the phones registered to it.

Modes

ModeWho signs in whereUse it when
registersimtrunk registers to the PBX with a username and passwordThe PBX is on the internet
registrarThe PBX registers to simtrunk with a username and passwordThe PBX should sign in, as a phone does
peerNobody registers: each side sends to the other's addressTwo servers that can reach each other; calls are taken only from the server's addresses

Settings

  • Server: the PBX's host name or IP (register and peer); the port is optional. The transport is UDP (default), TCP or TLS.
  • Username and password: simtrunk's account at the PBX (register), or the PBX's account at simtrunk (registrar).
  • Allowed IPs (optional): other addresses the PBX calls from, such as an SBC cluster, as single IPs (203.0.113.10) or ranges (198.51.100.0/24).
  • Dial-out: lets the PBX place calls on the lines.
  • Routes, one per line: - DID: the line's number as the PBX knows it. Dial-in calls the PBX at this DID; dial-out from this DID leaves on the line. - Prefix (optional): a dial-out number starting with it leaves on the line, without the prefix (1 + 600100200 dials 600100200). - A dial-out matching neither takes the first idle line.

Example: a hosted PBX

  1. On the PBX, create a SIP account for simtrunk. Send inbound calls from it to your queue, and the outbound calls you want on the SIMs to it.
  2. In the dashboard, open SIP trunks and add one: mode register, server sip.example.com, the account's username and password, dial-out on if the PBX may call out, and a route per line with its DID.
  3. The trunk shows as registered. Call the SIM's number: the PBX rings. Every step is on the SIP traces page, both legs in one ladder.

For Asterisk and FreePBX, step by step: Connect simtrunk to Asterisk or FreePBX.

Audio

simtrunk sends and receives RTP on the same port (symmetric RTP). If calls connect with no audio, turn on symmetric RTP and NAT handling on the PBX (Asterisk rtp_symmetric, force_rport, rewrite_contact; FreeSWITCH's NAT settings).

Limits

SIP trunks per plan: 1 on Solo, 5 on Team, no limit on Business.

How is this guide?

Last updated on

On this page