Gateways Module Documentation
Table of Contents
- Module Overview (Technical)
- Module Overview (Commercial/Business)
- Module Overview (End User/Administrator)
- Configuration Fields Reference
- Gateway SIP Profiles
- Common Scenarios & Examples
- Limitations & Important Notes
- Troubleshooting Tips
- Glossary
---
1. Module Overview (Technical)
What Are Gateways?
Gateways define SIP trunk connections to external carriers, ITSPs, or other PBX systems. Each gateway represents a configured connection with authentication, registration, and routing settings.
Architecture
Key Tables
| Table | Purpose | |
|---|---|---|
public.sip_gateways | Gateway definitions | |
public.gateway_sip_profiles | Shared profile settings | |
public.gateway_settings | Per-gateway settings |
Key Files
| File | Description | |
|---|---|---|
admin/apps/web/src/modules/gateways/ | Gateway frontend | |
admin/apps/web/src/modules/gatewaySipProfiles/ | SIP Profiles frontend | |
admin/apps/web/src/i18n/en/gateways.json | Gateway translations | |
admin/apps/web/src/i18n/en/gatewaySipProfiles.json | Profile translations |
Integration with FreeSWITCH
Gateways are translated into FreeSWITCH XML configuration:
---
2. Module Overview (Commercial/Business)
Business Value
Gateways enable external telephony connectivity:
| Without Gateways | With Gateways | |
|---|---|---|
| Internal calls only | External PSTN/SIP calls | |
| No carrier integration | Multiple carrier support | |
| No failover | Automatic failover | |
| Single path | Load balancing |
Use Cases
- PSTN Connectivity
- Terminate calls to phone numbers
- SIP Trunking
- Cost-effective calling
- Multi-Carrier Routing
- Least-cost routing
- PBX Interconnection
- Legacy system integration
Feature Highlights
| Feature | Benefit | |
|---|---|---|
| Gateway SIP Profiles | Reusable carrier settings | |
| Registration | Dynamic registration with carriers | |
| Authentication | Username/password, realm support | |
| NAT Traversal | Works behind firewalls | |
| Failover | Automatic backup gateway | |
| Channel Limits | Concurrent call control | |
| Codec Selection | Audio/video codec preference | |
| TLS/SRTP | Secure signaling and media |
3. Module Overview (End User/Administrator)
What Can You Do?
Gateways:- Create SIP trunk connections
- Configure authentication
- Set registration parameters
- Define channel limits
- Configure failover cascades
- Create reusable settings templates
- Configure transport and codecs
- Set NAT/security options
- Apply to multiple gateways
Administrator Workflow
Quick Tips
TIP
Use SIP Profiles: Create profiles for common carrier types to reuse settings.TIP
Set Failover: Always configure a backup gateway for reliability.CAUTION
Channel Limits: Set realistic limits to prevent carrier billing surprises.---
4. Configuration Fields Reference
Gateway Fields
Basic Information
| Field | Description | Example | |
|---|---|---|---|
| Gateway Name | Unique identifier | carrier_main | |
| Description | Optional description | Primary VoIP Carrier | |
| Gateway SIP Profile | Inherited settings | Standard Carrier | |
| Dial Profile | Reusable template to apply call variables and behaviors | Office Default | |
| Enabled | Gateway active status | On/Off |
Authentication & Connection
| Field | Description | Example | |
|---|---|---|---|
| Proxy | Carrier SIP address | sip.carrier.com | |
| Username | SIP authentication user | account123 | |
| Password | SIP password | ●●●●●●●● | |
| Auth Username | Alternative auth user | (optional) | |
| Realm | Authentication realm | carrier.com | |
| Outbound Proxy | Separate signaling path | (optional) | |
| Register Proxy | Separate registration | (optional) | |
| Register Transport | UDP/TCP/TLS | UDP |
Registration & Keepalive
| Field | Description | Default | |
|---|---|---|---|
| Register | Enable registration | On | |
| Expire Seconds | Registration period | 3600 | |
| Retry Seconds | Retry on failure | 30 | |
| Ping Interval | OPTIONS ping interval | 25 | |
| Ping Min/Max | Up/down thresholds | 1/5 | |
| Contact in Ping | Include Contact header | Off |
Media & Overrides
| Field | Description | |
|---|---|---|
| Audio Codecs | Preferred codec list | |
| Video Codecs | Video codec list | |
| Allow Video | Enable video calls | |
| Packetization Time | RTP packet size | |
| T.38 Support | Fax relay support |
Routing & Limits
| Field | Description | Default | |
|---|---|---|---|
| Context | Inbound dialplan context | public | |
| Extension | Default inbound extension | - | |
| Max Channels | Concurrent call limit | 0 (unlimited) | |
| Failover Gateway | Backup gateway | None |
5. Gateway SIP Profiles
Purpose
Gateway SIP Profiles are reusable configuration templates that define:
- Transport settings (UDP/TCP/TLS)
- DTMF mode
- Codec preferences
- NAT handling
- TLS/SRTP security
Profile Sections
Signaling & Transport
| Field | Options | Description | |
|---|---|---|---|
| Transport | UDP, TCP, TLS | SIP transport | |
| DTMF Mode | RFC2833, INFO, Inband | DTMF signaling | |
| INVITE Format | user@domain, E.164 | URI format | |
| Caller ID Policy | From, PAI, RPID | CID header | |
| NAT Mapping | On/Off | Contact rewrite | |
| Register Transport | UDP, TCP, TLS | Registration transport |
Media & Codecs
| Field | Description | |
|---|---|---|
| Audio Codecs | PCMU, PCMA, G729, G722, OPUS | |
| Video Codecs | VP8, H264, H263, AV1 | |
| Allow Video | Enable video negotiation | |
| RTP Proxy | Force media through PBX | |
| Packetization Time | 10, 20, 30, 40 ms | |
| T.38 Support | Fax relay |
Security / TLS
| Field | Description | |
|---|---|---|
| TLS Enabled | Enable TLS signaling | |
| TLS Verify Policy | Certificate verification | |
| TLS Version | Minimum TLS version | |
| SRTP Mode | Always, Optional, Never | |
| Require Secure Media | Reject non-SRTP |
6. Common Scenarios & Examples
Scenario 1: Basic ITSP Connection
Gateway: "voip_carrier"| Setting | Value | |
|---|---|---|
| Proxy | sip.voip-carrier.com | |
| Username | 12345678 | |
| Password | ●●●●●●●● | |
| Register | Yes | |
| Transport | UDP | |
| Codecs | PCMU, PCMA, G729 |
Scenario 2: Primary + Backup Carriers
Gateway: "carrier_primary"| Setting | Value | |
|---|---|---|
| Proxy | sip.carrier-a.com | |
| Max Channels | 30 | |
| Failover | carrier_backup |
| Setting | Value | |
|---|---|---|
| Proxy | sip.carrier-b.com | |
| Max Channels | 20 | |
| Failover | None |
Scenario 3: Secure TLS Trunk
Gateway SIP Profile: "Secure Carrier"| Setting | Value | |
|---|---|---|
| Transport | TLS | |
| TLS Version | 1.2 | |
| TLS Verify | Peer | |
| SRTP Mode | Always |
| Setting | Value | |
|---|---|---|
| Gateway SIP Profile | Secure Carrier | |
| Proxy | sips.carrier.com:5061 |
7. Limitations & Important Notes
Technical Notes
NOTE
Configuration Module: Gateways are configuration entities. Settings are translated to FreeSWITCH XML by the configuration generator.WARNING
Reload Required: Gateway changes require FreeSWITCH sofia profile reload.WARNING
NAT Considerations: Enable NAT mapping when PBX is behind firewall.Best Practices
- Use Profiles: Create profiles for common carrier types
- Set Channel Limits: Prevent unexpected charges
- Configure Failover: Always have a backup
- Test Registration: Verify gateway registers successfully
- Monitor Status: Check gateway status regularly
- Secure Credentials: Use strong passwords
---
8. Troubleshooting Tips
Common Issues
| Symptom | Possible Cause | Solution | |
|---|---|---|---|
| Not registered | Wrong credentials | Verify username/password | |
| Registration timeout | Firewall blocking | Check ports 5060/5061 | |
| Calls fail | Wrong proxy | Verify proxy address | |
| One-way audio | NAT issue | Enable NAT mapping | |
| No audio | Codec mismatch | Check codec preferences | |
| TLS errors | Certificate issue | Verify TLS settings |
FreeSWITCH Commands
Diagnostic SQL
List gateways: Check gateway settings:---
9. Glossary
| Term | Definition | |
|---|---|---|
| Gateway | SIP trunk connection to external carrier | |
| SIP Profile | Reusable configuration template | |
| Registration | Process of registering with carrier | |
| Proxy | Carrier's SIP server address | |
| Realm | Authentication domain | |
| Failover | Automatic switch to backup gateway | |
| ITSP | Internet Telephony Service Provider | |
| NAT | Network Address Translation | |
| SRTP | Secure Real-time Transport Protocol |
Lua Handler Status
⚡ No Dedicated Handler Required
Gateways are configuration entities:
- Stored in
public.sip_gateways,public.gateway_sip_profiles - Translated to FreeSWITCH XML by configuration generator
- Used by outbound/inbound routes for call routing
---
Documentation last updated: January 2026