To connect FreePBX 17 to an Indian SIP trunk, add a PJSIP trunk with your trunk host on port 5070, outbound authentication and registration set to Send, enable only ulaw and alaw, then add an outbound route that prepends 91 to 10-digit numbers. Set External Address and Local Networks if FreePBX is behind NAT.
Get the trunk details first: Create a termination trunk — the trunk page shows the host, username and password you'll paste below.
This guide uses an Edesy termination trunk, but the FreePBX side works the same for most SIP providers. The full reference, with screenshots, lives in the FreePBX setup guide.
Before you start
You need:
- FreePBX 17 with PJSIP (the default).
- An Edesy account with KYC done and a number bought (mobile, landline, toll-free or 92-series).
- A termination trunk in credentials (registration) mode.
- Firewall access to allow UDP 5070 for SIP and your RTP range for audio.
- Your site's public IP, if FreePBX is on a local server behind a router.
Step 1: Collect your trunk details
Open Trunks in the Edesy portal and click your trunk.
| Setting | Where on the trunk page | Example |
|---|---|---|
| SIP server (host) | Integration snippets | tk-xxxxxxxx.trunk.edesy.in |
| Port | Fixed | 5070 |
| Transport | Fixed | UDP (TCP also supported) |
| Username | Connectivity | user-xxxxxxxx |
| Password | Click Reveal, or Rotate | shown in the portal |
| Caller ID | Numbers | your Edesy number in E.164 |
| Edesy signalling IP | Shown on the trunk page | used for your firewall and the Match field |
| Max concurrent calls | Trunk detail | match this in FreePBX |
Reveal is rate-limited and audit-logged. If an older trunk won't reveal its password, click Rotate once.
Step 2: Create the trunk in FreePBX
Go to Connectivity > Trunks > Add Trunk > Add SIP (chan_pjsip) Trunk.
General tab: Trunk Name Edesy, Outbound CallerID your Edesy number, Maximum Channels equal to the
trunk's max concurrent calls.
pjsip Settings > General:
| Field | Value |
|---|---|
| Username / Secret | from Step 1 |
| Authentication | Outbound |
| Registration | Send |
| SIP Server | your trunk host |
| SIP Server Port | 5070 |
| Context | from-pstn |
| Transport | 0.0.0.0-udp |
pjsip Settings > Advanced:
| Field | Value |
|---|---|
| Contact User / From User | your trunk username |
| From Domain | your trunk host |
| Client URI | sip:<username>@<trunk host>:5070 |
| Server URI / AOR Contact | sip:<trunk host>:5070 |
| Match (Permit) | the Edesy signalling IP |
| Qualify Frequency | 60 |
| DTMF Mode | RFC 4733 |
The Match (Permit) entry tells FreePBX to trust INVITEs from Edesy and send them into from-pstn. Without
it, inbound calls never reach your routes.
pjsip Settings > Codecs: tick ulaw and alaw only. Untick g722, g729 and opus.
Click Submit, then Apply Config.
Step 3: Outbound route with Indian dial patterns
Go to Connectivity > Outbound Routes > Add Outbound Route. Name it Edesy-Out and put Edesy first in
the trunk sequence. If you still have a PRI, put it second as a fallback.
| Prepend | Match pattern | What it does |
|---|---|---|
| 91 | XXXXXXXXXX |
10-digit mobile or landline number, adds the country code |
| (none) | 91XXXXXXXXXX |
already has 91, passed through |
Numbers must leave FreePBX in E.164 without the plus sign. A 404 or "not routed" on every call almost always means the 91 is missing. If your users dial a leading 0 for landlines, add a pattern that strips the 0 and prepends 91.
Step 4: Inbound route
Inbound has two halves:
- Edesy side: your number's inbound routing must point at the trunk ("Your SIP trunk" is one of the inbound routing targets; support can also set it). With Registration set to Send, Edesy then delivers calls to wherever FreePBX is registered from.
- FreePBX side: Connectivity > Inbound Routes > Add Inbound Route. Set DID Number to your number
with country code (try
91XXXXXXXXXX, with and without a leading plus, if it doesn't match), then pick a destination: an IVR, ring group, queue or extension.
Step 5: NAT settings for an on-site server
Most on-site FreePBX boxes sit behind a router. In Settings > Asterisk SIP Settings > chan_pjsip:
- External Address: your public IP or dynamic DNS name.
- Local Networks: your LAN subnets, for example
192.168.0.0/24.
On the router or firewall:
- Allow outbound UDP to the Edesy signalling IP on 5070, and the RTP range.
- Allow inbound UDP from the Edesy signalling IP for SIP and RTP.
- Forward the RTP range (Asterisk default 10000 to 20000 UDP) to FreePBX if it isn't the edge device.
- Turn off SIP ALG on the router. Port forwarding does not fix what SIP ALG breaks.
If calls connect but one side hears nothing, or every call drops at about 30 seconds, read fixing one-way audio, SIP ALG and NAT.
Step 6: Verify
- Registration: Reports > Asterisk Info > Registrations shows the trunk as Registered, and the trunk's Connectivity badge in the Edesy portal flips to Registered.
- Outbound: dial a mobile from an extension.
- Inbound: call your Edesy number from a mobile.
- Isolate problems: the trunk page has a Call me test that rings a number through the trunk without FreePBX. If that works and FreePBX doesn't, the issue is on the PBX side.
Troubleshooting
| Symptom | Likely cause | Fix |
|---|---|---|
| Not registered | Wrong password, 5070 blocked, Server URI missing port | Reveal or rotate; open UDP 5070; add :5070 |
| Outbound 401 / 403 | Auth not Outbound, or From User/Domain unset | Set as in Step 2 |
| Outbound 404 | Number not E.164 | Fix the 91 prepend |
| One-way or no audio | NAT, RTP blocked, codec mismatch | External Address, Local Networks, RTP range, ulaw/alaw only |
| Calls drop at ~30 s | SIP ALG rewriting ports | Disable SIP ALG on the router |
| Inbound never rings | Missing Match permit, DID format | Add Match; try DID with and without plus |
Costs
Calls are Rs 0.50/min with a 60-second pulse, unanswered calls free, plus number rental. Everything is deducted from a prepaid INR wallet topped up with Razorpay, with GST invoices. Prices exclude 18% GST. Sizing the Maximum Channels value? See how many SIP channels do I need.
Moving off a PRI line? Read SIP trunk vs PRI line in India. More on the SIP trunking page and in the FreePBX 17 guide in the SIP docs.
Create your trunk and have FreePBX registered in one sitting.