FreePBX 17 (PJSIP)

Connect FreePBX 17 (Asterisk, chan_pjsip) to an Edesy SIP trunk for outbound calls to Indian numbers and inbound calls on your Edesy DID, with NAT, codec and dial-pattern settings.

6 min read

To connect FreePBX 17 to Edesy, create a credentials termination trunk in the Edesy portal, then add a chan_pjsip trunk in FreePBX that registers to tk-<id>.trunk.edesy.in on port 5070. Add an outbound route that sends numbers in E.164 and an inbound route for your DID. Use only the ulaw and alaw codecs.

1. Collect your connection details#

From the trunk page in the Edesy portal (create a SIP credentials trunk if you have not yet):

Setting Where to find it Example
SIP server Integration snippets → SIP server tk-1a2b3c4d.trunk.edesy.in
Port Fixed 5070
Transport Fixed UDP (TCP also works)
Username Authentication → Username user-1a2b3c4d
Password Authentication → Reveal (from the portal)
Caller ID Phone Numbers +91XXXXXXXXXX
Edesy signalling IP The FreePBX 17 snippet on the trunk page, Match (Permit) line (from the portal)
Max concurrent calls Trunk page 50

The trunk page's FreePBX 17 (chan_pjsip trunk) snippet has these values filled in for your trunk.

2. Prerequisites#

  • FreePBX 17 with the PJSIP driver (the default with Asterisk 21).
  • Your FreePBX server can reach the Edesy signalling IP on UDP 5070, and your RTP port range is open.
  • If FreePBX is behind NAT, you know your public IP. See step 6.

3. Create the trunk#

Connectivity → Trunks → Add Trunk → Add SIP (chan_pjsip) Trunk

General tab

Field Value
Trunk Name Edesy
Outbound CallerID Your Edesy number, such as +91XXXXXXXXXX
Maximum Channels Same as the trunk's max concurrent calls, such as 50

pjsip Settings → General

Field Value
Username user-1a2b3c4d
Secret The revealed password
Authentication Outbound
Registration Send
SIP Server tk-1a2b3c4d.trunk.edesy.in
SIP Server Port 5070
Context from-pstn
Transport 0.0.0.0-udp

pjsip Settings → Advanced

Field Value
Contact User user-1a2b3c4d
From User user-1a2b3c4d
From Domain tk-1a2b3c4d.trunk.edesy.in
Client URI sip:[email protected]:5070
Server URI sip:tk-1a2b3c4d.trunk.edesy.in:5070
AOR Contact sip:tk-1a2b3c4d.trunk.edesy.in:5070
Match (Permit) The Edesy signalling IP from your trunk snippet
Qualify Frequency 60
DTMF Mode RFC 4733

Match (Permit) tells FreePBX to trust INVITEs from Edesy and send them into from-pstn. It is needed for inbound calls.

pjsip Settings → Codecs: enable ulaw and alaw only. Disable g722, g729, opus and the rest.

Click Submit, then Apply Config.

4. Outbound route#

Connectivity → Outbound Routes → Add Outbound Route

Field Value
Route Name Edesy-Out
Trunk Sequence for Matched Routes Edesy

Dial patterns: send numbers in E.164 (country code, no +). For India:

prepend prefix match pattern Meaning
91 XXXXXXXXXX 10-digit mobile: add 91
91XXXXXXXXXX Already has the country code: pass through

Apply the config and dial a mobile number from an extension.

Caller ID: The caller ID must be your Edesy number. If FreePBX sends the SIP username as the caller ID, Edesy rejects the call with 403 Caller ID Not Authorized. Set Outbound CallerID on the trunk or route.

5. Inbound route (optional)#

Inbound has two halves:

  1. On Edesy: route your number to this trunk (Phone Numbers → your number → Inbound routing → Termination Trunk). Because the trunk registers, Edesy delivers calls to your FreePBX once it shows Registered.
  2. On FreePBX: Connectivity → Inbound Routes → Add Inbound Route. Set DID Number to 91XXXXXXXXXX (try with and without a leading +) and pick a destination: an IVR, ring group or extension.

6. NAT and firewall#

An on-premises FreePBX is almost always behind NAT. In Settings → Asterisk SIP Settings → chan_pjsip:

  • External Address: your site's public IP or dynamic-DNS name.
  • Local Networks: your LAN subnets, such as 192.168.0.0/24.

On your firewall or router:

  • Allow outbound UDP to the Edesy signalling IP on port 5070, and your RTP range.
  • Allow inbound UDP from the Edesy signalling IP for SIP and RTP.
  • Forward the RTP range (Asterisk default 10000-20000/udp) to FreePBX if it is not the edge device.
  • Turn off SIP ALG on the router. See SIP ALG.

A correct External Address is the usual fix for one-way or no audio.

7. Verify#

  • Registration: Reports → Asterisk Info → Registrations shows the Edesy trunk as Registered, and the trunk page in the Edesy portal shows Registered.
  • Outbound: dial a mobile from an extension.
  • Edesy side on its own: use the outbound test on the trunk page. See Test Calls.

Troubleshooting#

Symptom Likely cause and fix
Not registered Wrong password (reveal or rotate it again); port 5070 blocked; Server URI missing :5070
Outbound 401 / 403 Authentication not set to Outbound; username or secret mismatch; From User and From Domain not set
403 Caller ID Not Authorized Caller ID is not your Edesy number
Outbound 404 or not routed Number not in E.164; fix the dial-pattern prepend (91 for India)
One-way or no audio NAT: set External Address and Local Networks; open RTP; ulaw/alaw only; disable SIP ALG
Inbound never rings Number not routed to the trunk on Edesy; missing Match (Permit); DID format in the inbound route

Have your trunk name and trunk ID ready when you contact support.

FAQ#

Does this work with plain Asterisk or other Asterisk-based PBXs?#

Yes. The same settings apply to any chan_pjsip setup: registration to the trunk host on port 5070, outbound auth, G.711 codecs and an identify/permit for the Edesy IP.

Can I use IP authentication instead of registration?#

Yes, if your PBX has a static public IP. Create an IP allowlist trunk, set Registration to None, and route your number to the trunk with a trunk-level inbound SIP URI pointing at your PBX.

Which codecs should I enable?#

ulaw and alaw only. Other codecs can cause negotiation failures.

How do I move from a PRI line to SIP?#

Keep your FreePBX dialplan, add the Edesy trunk as above, and change the outbound route's trunk sequence. Buy Edesy numbers for inbound calls.

Was this page helpful?