Adding SMS capability to your PBX system enables text-based business communication alongside voice calling. This guide covers integrating SMS with an Asterisk/FreePBX-based system.
Understanding the Integration Approach
Traditional PSTN doesn't natively support SMS the way it supports voice — SMS integration typically involves your SIP trunk provider's SMS API (many modern providers offer this alongside voice trunking) rather than Asterisk handling SMS as a native PBX feature.
Checking Your SIP Trunk Provider's SMS Support
See How to Set Up SIP Trunking for Your PBX — many SIP trunk providers offer SMS capability for the same phone numbers used for voice, accessible via a separate API rather than through SIP signaling itself.
Building an SMS Integration via Provider API
const response = await fetch('https://api.your-provider.com/sms/send', {
method: 'POST',
headers: { 'Authorization': `Bearer ${API_KEY}` },
body: JSON.stringify({ from: '+15551234567', to: '+15559876543', message: 'Your order has shipped' }),
});
Your application (not Asterisk directly) typically handles SMS sending through your provider's dedicated messaging API.
Receiving Inbound SMS via Webhook
app.post('/webhook/sms-received', async (req, res) => {
const { from, to, message } = req.body;
await handleIncomingSms(from, to, message);
res.status(200).send();
});
See How to Design and Secure Webhook Endpoints — most SMS-capable providers deliver inbound messages via webhook to your application, similar architectural pattern to other webhook integrations covered throughout this Knowledge Base.
Integrating SMS Notifications with PBX Events
// After a missed call in Asterisk, trigger via AMI or a custom script
await sendSms(callerNumber, "You missed a call from our office. Please call back at your convenience.");
See PBX-CRM integration patterns in How to Integrate a PBX with a CRM — combine SMS capability with PBX call events (missed calls, voicemail received) for automated customer communication workflows.
Using Asterisk Manager Interface (AMI) to Trigger SMS on Call Events
AMI provides programmatic access to Asterisk call events — a script listening to AMI events can trigger SMS notifications (missed call follow-up, appointment reminders) based on genuine real-time PBX activity.
Building a Unified Communication Interface
Consider whether SMS and voice call history should be presented together in a unified interface for your team — genuinely improves customer service continuity when staff can see the full communication history (calls and texts) with a given customer in one place.
Compliance Considerations for Business SMS
See how compliance frameworks generally apply throughout this Knowledge Base, and specifically research SMS-specific regulations (opt-in/consent requirements, and similar) applicable to business text messaging in your jurisdiction — genuinely important legal consideration distinct from voice calling regulations.
Testing SMS Delivery Reliability
Test actual SMS delivery under realistic conditions — delivery reliability, timing, and formatting can vary by provider and destination carrier; verify your specific integration genuinely works as expected before depending on it for important business communication.
Common Errors
SMS sends successfully via API but customer never receives it — check delivery status callbacks from your provider (most APIs provide delivery confirmation); carrier-level filtering/blocking can sometimes prevent delivery even when your provider reports successful sending.
Continue Reading
- How to Set Up SIP Trunking for Your PBX
- How to Integrate a PBX with a CRM
- How to Design and Secure Webhook Endpoints
Browse more articles in VoIP & Communication Servers.