prefixkit RU

VoIP & telephony

SIP trunk config generator

A ready SIP trunk setup: pjsip.conf and dialplan for Asterisk, gateway and dialplan for FreeSWITCH, a Kamailio fragment. Registration or IP authentication, codecs, DTMF, NAT, TLS and SRTP.

Provider

Numbers and routing

Media and NAT

The config is built in your browser; the password is not sent anywhere.

How to connect the trunk

  1. Get the server address, username and password from the provider (or agree on IP authentication and give them the PBX public address).
  2. Asterisk: add the blocks to /etc/asterisk/pjsip.conf and extensions.conf, run pjsip reload and dialplan reload, check pjsip show registrations.
  3. FreeSWITCH: put the gateway into sip_profiles/external, run sofia profile external rescan and sofia status gateway provider.
  4. Check the provider server with our SIP check, and if something fails paste the log into the SIP log analyzer.

Common problems

  • 401/403 on registration: wrong auth username or From domain. Many providers need From user to match the number.
  • No audio or one-way audio: the PBX is behind NAT without external_media_address, or the router runs SIP ALG. Turn ALG off (on MikroTik use our generator) and open the RTP ports.
  • Inbound calls do not arrive: the call came from an IP missing in identify, or the number in the Request-URI has another format (with “+”, without the country code).
  • 488 Not Acceptable: no common codec. Providers usually accept G.711 A-law (PCMA).

How many channels you need

The number of lines for a given load comes from the Erlang calculator, bandwidth per call from the bandwidth calculator.