# SMS Provider

Use SMS technology for outbound text-message delivery. SMS providers reuse provider identity, status, outbound digit manipulation, additional headers, channel limits, and penalty fields, then expose protocol-specific delivery fields.

## SMS Field Details

<table id="bkmrk-fieldapplies-topurpo"><thead><tr><th>Field</th><th>Applies to</th><th>Purpose</th><th>Fictional example</th></tr></thead><tbody><tr><td>**SMS Protocol**</td><td>SMS only</td><td>Selects delivery method: Web URL, JSON Web URL, SOAP Web URL, SIP MESSAGE, SMSPORTAL, or AGISCRIPT.</td><td>`JSONWEBURL`</td></tr><tr><td>**SIP Provider**</td><td>SMS SIPMESSAGE</td><td>SIP provider used to send outbound SMS with SIP MESSAGE.</td><td>`Docs Telecom SIP Trunk`</td></tr><tr><td>**SMS URL/AGI Script Name**</td><td>WEBURL, JSONWEBURL, SOAPWEBURL, AGISCRIPT</td><td>HTTP endpoint or AGI script name used for delivery.</td><td>`https://sms.example.invalid/v1/messages`</td></tr><tr><td>**SOAP Action**</td><td>SOAPWEBURL</td><td>SOAPAction header value sent with SOAP SMS requests.</td><td>`SendMessage`</td></tr><tr><td>**HTTP Content Type**</td><td>JSONWEBURL, SOAPWEBURL</td><td>Content-Type header. Leave blank to use the protocol default when acceptable.</td><td>`application/json` or `text/xml`</td></tr><tr><td>**User / Password**</td><td>WEBURL, JSONWEBURL, SOAPWEBURL</td><td>HTTP authentication credentials when required by the SMS provider.</td><td>`docs-json-user` and a fictional secret</td></tr><tr><td>**Client ID / API Secret**</td><td>SMSPORTAL</td><td>SMSPortal credentials. MiRTA PBX uses them to request a bearer token before sending messages.</td><td>`fictional-client-id`</td></tr><tr><td>**Post data**</td><td>WEBURL</td><td>POST body in `param=value&param2=value` format. Values are not automatically URL encoded.</td><td>`to=${SMSDESTNUM}&text=${URIENCODE(${SMSTEXT})}`</td></tr><tr><td>**JSON data**</td><td>JSONWEBURL</td><td>One `field.path:value[:type]` line per JSON field. Dot notation creates nested objects; numeric parts can create JSON arrays.</td><td>`messages.0.content:${SMSTEXT}`</td></tr><tr><td>**SOAP data**</td><td>SOAPWEBURL</td><td>SOAP or XML body sent to the SMS provider.</td><td>`<Text>${SMSTEXT}</Text>`</td></tr><tr><td>**Additional Header 1-6**</td><td>SMS HTTP protocols</td><td>Extra HTTP headers for SMS requests.</td><td>`Authorization: Bearer fictional-token`</td></tr></tbody></table>

## JSON Web URL

<figure id="bkmrk-sms-json-web-url-pro">![SMS JSON Web URL provider with nested JSON fields and fictional values.](https://manual.mirtapbx.com/uploads/images/gallery/2026-06/provider-sms-json.png)<figcaption>SMS JSON Web URL provider with nested JSON fields and fictional values.</figcaption></figure>JSON Web URL post data uses one line per JSON field in `field.path:value[:type]` format. Dot notation creates nested objects. Numeric path parts create numeric object keys which encode as JSON array indexes when sequential. Use `:array` to force a single-value array.

```
sender.number:${SMSSOURCENUM}
sender.name:${SMSNAME}
messages.0.destination:${SMSDESTNUM}
messages.0.content:${SMSTEXT}
message.metadata.tenant:${TENANTNAME}
recipients:${SMSDESTNUM}:array
```

## Web URL

<figure id="bkmrk-sms-web-url-provider">![SMS Web URL provider with fictional POST data.](https://manual.mirtapbx.com/uploads/images/gallery/2026-06/provider-sms-weburl.png)<figcaption>SMS Web URL provider with fictional POST data.</figcaption></figure>Web URL post data is sent as a raw form-style body. The script does not automatically URL encode values, so encode values explicitly when the provider requires it.

## SOAP Web URL

<figure id="bkmrk-sms-soap-web-url-pro">![SMS SOAP Web URL provider with fictional SOAP action and XML data.](https://manual.mirtapbx.com/uploads/images/gallery/2026-06/provider-sms-soap.png)<figcaption>SMS SOAP Web URL provider with fictional SOAP action and XML data.</figcaption></figure>SOAP Web URL sends the configured SOAP/XML body and optional SOAPAction header. Set HTTP Content Type to `text/xml` unless the provider documents a different value.

## SMSPortal

<figure id="bkmrk-smsportal-provider-w">![SMSPortal provider with fictional client credentials.](https://manual.mirtapbx.com/uploads/images/gallery/2026-06/provider-smsportal.png)<figcaption>SMSPortal provider with fictional client credentials.</figcaption></figure>SMSPortal uses the Client ID and API Secret to request a bearer token from the SMSPortal REST API before sending the message payload.

## SIP MESSAGE

<figure id="bkmrk-sms-sip-message-prov">![SMS SIP MESSAGE provider with a fictional SIP provider selection.](https://manual.mirtapbx.com/uploads/images/gallery/2026-06/provider-sms-sipmessage.png)<figcaption>SMS SIP MESSAGE provider with a fictional SIP provider selection.</figcaption></figure>SIP MESSAGE sends the SMS through a selected SIP provider. Choose a SIP provider that is trusted and configured for message delivery.

## AGI Script

AGISCRIPT runs the named AGI script for SMS delivery. Use this only for custom integrations maintained by the PBX administrator. The SMS URL/AGI Script Name field stores the script name.

## Available SMS Variables

<table id="bkmrk-variablemeaning%24%7Bsms"><thead><tr><th>Variable</th><th>Meaning</th></tr></thead><tbody><tr><td>`${SMSDESTNUM}`</td><td>Destination number after SMS routing and digit handling.</td></tr><tr><td>`${SMSSOURCENUM}`</td><td>Source number for the message.</td></tr><tr><td>`${SMSNAME}`</td><td>Peer or sender name available to the SMS script.</td></tr><tr><td>`${SMSTEXT}`</td><td>Message text.</td></tr><tr><td>`${EMERGENCYNOTES}`</td><td>Emergency notes from the extension when available.</td></tr><tr><td>`${TENANTNAME}`</td><td>Tenant name.</td></tr><tr><td>`${BILLINGCODE}`</td><td>Tenant billing code.</td></tr><tr><td>`${EXTRACODE}`</td><td>Tenant extra code.</td></tr><tr><td>`${EXTRAFIELD001}`, `${EXTRAFIELD002}`, `${EXTRAFIELD003}`</td><td>Tenant custom extra fields.</td></tr></tbody></table>