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
| Mode | Who signs in where | Use it when |
|---|---|---|
register | simtrunk registers to the PBX with a username and password | The PBX is on the internet |
registrar | The PBX registers to simtrunk with a username and password | The PBX should sign in, as a phone does |
peer | Nobody registers: each side sends to the other's address | Two servers that can reach each other; calls are taken only from the server's addresses |
Settings
- Server: the PBX's host name or IP (
registerandpeer); 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+600100200dials600100200). - A dial-out matching neither takes the first idle line.
Example: a hosted PBX
- 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.
- In the dashboard, open SIP trunks and add one: mode
register, serversip.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. - 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