FSPBX
From VoIP.ms Wiki
This guide explains how to configure a VoIP.ms SIP Gateway in FSPBX (FreeSWITCH).
It also covers the recommended Access Control (ACL).
Contents |
Requirements
Before starting, make sure you have:
- An active VoIP.ms account
- A Sub Account (SIP) created in the VoIP.ms portal
- SIP Username (ex: ######_SubAccount)
- SIP Password
- Device Type: Asterisk, IP PBX, Gateway or VoIP Switch
- CallerID Number: I use a system capable of passing its own CallerID
- A selected VoIP.ms PoP for your DID (ex: montreal.voip.ms)
Create or Edit the VoIP.ms Gateway
Access your FusionPBX/FSPBX web interface:
- 1) Go to Accounts
- 2) Select Gateways
Create a new gateway (or edit an existing one) and fill in the fields exactly as shown below.
Gateway Settings
- Username: Enter your Sub-Account username ######_SubAccount
- Password: Enter your Sub-Account password
- From User: Enter your Sub-Account username ######_SubAccount
- Proxy: Enter the your Preferred PoPServer. Eg: montreal1.voip.ms
- Realm: Enter "voip.ms"
- Expire Seconds: 120
- Register: Select True
- Retry Seconds: 30
- Auth Username: Enter your Sub-Account username ######_SubAccount
- Register Transport: udp (or TCP)
- SIP CID Type: Type "rpid"
- Codec Preferences: This must reflect your Sub-account, ensure you have the proper codec selected. 1
- Ping: 20
- Domain: Select your demain
- Context: Enter your context
- Profile: Select your profile
- Enabled: YES
- Description: Enter a description for your note
- Click [Save]
Note: Verify registration status under Status → Gateways / Registrations The gateway should show Registered
Access Control (ACL)
For better security, it is strongly recommended to restrict SIP access to VoIP.ms IP ranges only.
Access the Access Control Menu
- Go to Advanced then Access Controls
Create or Edit the "providers" and configure the ACL as follows:
- Name: providers
- Default: deny
- Add allow rules for VoIP.ms server IP ranges
Example entry:
- Type: allow
- CIDR: 208.100.60.0/24
- Description: Eg: "VoIP.ms POP Servers"
- Click [Save]
Important:
- VoIP.ms uses different IP ranges depending on the PoP.
- Make sure to add all required CIDR blocks for the PoP(s) you are using.
Notes and Troubleshooting
If the gateway does not register:
- Double-check Username / Password / Proxy (PoP)
- Ensure firewall and NAT allow UDP 5060 and RTP traffic
- Confirm your ACL includes the correct VoIP.ms IP ranges
Inbound and outbound call routing is configured separately using:
- Dialplans
- Inbound Routes
- Outbound Routes
FSPBX SMS and MMS configuration
The following steps describe how to use your VoIP.ms account to deliver two-way SMS and MMS through FSPBX, including inbound message handling, outbound delivery, and provider authentication. It assumes you have access to the FSPBX web interface and can edit the application environment on the server.
Required environment variables
On the FSPBX host, add the following variables to your .env file:
Variable description
- VOIPMS_API_USERNAME – Your API username for authenticating to VoIP.ms from FSPBX. This is the same value as the email address associated with your VoIP.ms account.
- VOIPMS_API_PASSWORD – Your API password, used together with the username for secure provider access.
Make sure you allowed your FSPBX IP address too.
Apply configuration changes
After saving your .env file, run the following on the FSPBX server so the application loads the new settings:
php artisan config:cache
Webhook configuration
VoIP.ms delivers inbound SMS and MMS to FSPBX through a webhook. You must set the URL in the VoIP.ms customer portal so messages reach your FSPBX instance.
- 1) Log in to your VoIP.ms account.
- 2) Go to DID Numbers → Manage DIDs, then click Edit (the pencil icon) on the DID number that will receive SMS/MMS.
- 3) Enable SMS/MMS on that DID if it is not already enabled.
- 4) Set the inbound webhook URL to use POST with a JSON body. The path expected by FSPBX is:
-
https://your-domain/webhook/voipms/sms - Replace
your-domainwith the public hostname (or FQDN) of your FSPBX installation.
-
- 5) Save your changes in the portal.
Enable SMS on a DID number in FSPBX
After credentials and the webhook are in place:
- 1) In FSPBX, go to Advanced → Message Settings.
- 2) Add or edit a number that is enabled for SMS.
- 3) Select VoIP.ms as the provider.
- 4) Assign the extension that should receive and send messages for that DID number.
- 5) Optionally set an email address for read-only notifications.
- 6) Save the configuration.
Resulting flow:
- Inbound SMS/MMS → VoIP.ms → FSPBX → assigned extension
- Replies → FSPBX → VoIP.ms → original sender
MMS support
If your DID number supports MMS, FSPBX can process media attachments through the same messaging flow. Storing MMS media in FSPBX typically requires S3-compatible storage to be configured in the system; refer to the FSPBX documentation for message storage and MMS options.
