Versions Compared

Key

  • This line was added.
  • This line was removed.
  • Formatting was changed.

...

Html
 <div class="lang-box-pdf">
	<div>
		<div class="google-lang">
			<div id="google_translate_element">
			</div>
			<script type="text/javascript">
					function googleTranslateElementInit() {
						new google.translate.TranslateElement({pageLanguage: 'en', includedLanguages: 'de,es,fr,it,nl', autoDisplay: false}, 'google_translate_element');
						}
			</script>
			<script type="text/javascript" src="//translate.google.com/translate_a/element.js?cb=googleTranslateElementInit"></script>
		</div>
		
		<div class="pdf-button">
			<a href="https://confluence.wildix.com/spaces/flyingpdf/pdfpageexport.action?pageId=20711000" alt="Convert to .pdf" title="Convert to .pdf"><img src="https://confluence.wildix.com/download/attachments/14549012/pdf-button-download-wildix-documentation.png"></a>
		</div>
	</div>
</div>


Info

SMS API allows any external software to use Wildix PBX as an SMS Server with the possibility of bulk (mass) SMS sending.

APIs Online Documentation :

WMS

(WMS 5.0X/ 4.0X):

 

use URL https://<pbx-host>/api/v1/doc/ (available only for admin user/ users with admin rights!)

WMS 3.88: https://manuals.wildix.com/pbx-control-apis/

Created: February 2018

Updated: June 2020

Permalink: https://confluence.wildix.com/x/WAY8AQ


Note

Requirements:

  • DaySaver/ W01GSM provisioned to your PBX with SIM card

* Before trying to send SMS from Dialplan, make sure SMS can be sent from WEB Collaboration

How to send SMS

Make an HTTP POST/GET request with basic authorization (username/ password of the user who is the SMS sender) to http(s)://<PBX_IP_Address>/api/v1/orginate/sms.

In case a GSM gateway to be used for SMS sending is not specified in the command, the message is sent to a randomly chosen GSM gateway configured in the system.

The timeout for mass sending is 5 sec for each SMS / gateway.

The POST/GET required parameters are:

  • message: the body SMS messages, length of no more than 300 characters
  • number: the phone number or several numbers separated by a comma. Example: +391234567890 or +391234567890,+391234567891,+391234567892,...

The POST/GET optional parameters are

  • postpone: date of postponed message delivery. Example: 14/07/2014 15:35
  • gsm: GSM gateway MAC address. Example: 9c7514330001

The response of the service is

Success: {"type":"result","result":"Success"}

Warning: {"type":"warning","reason":"Unable to add a SMS to the queue","result":["111"]}

Error: {"type":"error","reason":"Number should not be empty","result":null}

The "reason" part is the description of the warning/error


To try the service, you can use the curl software and run it from the command line.

Here is the working example:

Code Block
languagetext
curl -k -X POST -u 101:sms101api --url "https://127.0.0.1/api/v1/originate/sms"  --data-urlencode 
"number=+39123456789" --data-urlencode "message=This API is awesome, now I can add the sms support to my software" --data-urlencode "gsm=9c7514330001"

...

To send SMS from Dialplan, apply the following configuration:


  1. Set -> CURLOPT(userpwd) ->  101:sms101api (user credentials) - allows  allows sending API request
  2. Custom application -> Set(message=${CURL(http://127.0.0.1/api/v1/originate/sms, message=the message body&number=%2B39333123456)}); - SMS API is applied  

    Note

    Note: You need to specify GSM gateway's MAC address if the option Curl SMS send enabled in WMS Settings -> System -> FAX/ SMS server is activated since it has priority over GSM gateway:

    • Set(message=${CURL(http://127.0.0.1/api/v1/originate/sms, message=the messagebody&number=%2B33611121314&gsm=9c7514330001)});

    By adding MAC address, you can also select a specific GSM gateway if there are > 2 gateways.


Note

Note: "%2B" added to the mobile number is "+" character with URL encoding transformation. The full reference is available on the w3school web site.


Note

Note: the same way you can send SMS using http SMS server. For this purpose, another PBX with a configured GSM trunk can be used.

How to configure:

  1. Go to WMS Settings -> System -> FAX/SMS server
  2. Check off "Curl SMS send enabled" enabled option and configure the sending. For example, curl -k -X POST -u user:password --url "http://PBX IP Address/api/v1/originate/sms" --data-urlencode "number={TO_NUMBER}" --data-urlencode "message={MESSAGE}" 
  3. When making SMS API request http(s)://<PBX_IP_Address>/api/v1/orginate/sms via Custom application, use IP address of the PBX with a configured GSM trunk


Html
<div class="fb-like" data-href="https://confluence.wildix.com/x/WAY8AQ" data-layout="button_count" data-action="recommend" data-size="large" data-show-faces="true" data-share="true"></div>

...