Welcome to DirectSmile

How to configure SMS.XML

link this post written on 07/04/2014
  • To top

Today, I'd like to share all my knowledge about the configuration of sms.xml.

 

This is exactly how sms.xml looks like right after the installation of DSMX.

 

sms.xml default configuration

 

 

1. SMS parameter: HTTP GET Request

First of all, sms sending feature only support HTTP GET requesting. So SMS provider you'd like to use for your DSMX have to support it in their API. If they support, please replace the Url parameter's value to what with your provider's one. Usually, you need to give a user name and a password in the request url string.

[PHONE] would be replaced to the mobile phone number.

[TEXT] would be replaced the pre-defined text.

*Make it sure that URL value has been url encoded. So "&"(ampersand) letter have to be replaced to "&". If you forget it, it will throw error when you send sms via DSMX Designer interface.

 

Option:

UseGsmEncoding="True" [True/False]

TextEncoding="utf-8" [iso-8859-1/utf-8/unicode/etc...]

HexEncode="True" [True/False]

 

2. ReturnCode parameter

ReturnCode parameter is the part where you can set the action to query and/or catch exactly code by using Regular Expression, and the each return code and its description.

 

2-1. Action

There are two possible actions :

Query_            :Query_ followed by the url (please make sure it is correct url encoding!) to query. 

ReturnCode_   :ReturnCode_ followed by the return code to return.

 

Query to specific ID:

For example, Clickatell doesn't return status code by initial sms sending request. So we need to confirm the resutl by requesting query method. To do so, you can query specific record's status by using Query_ action.

 

<ReturnCode Value="rx_^ID: ([0-9a-f]{32})$" Action="Query_http://api.clickatell.com/http/querymsg?api_id=&amp;user=&amp;password=&amp;apimsgid=[1]" />

This request would request the result of sms sending from first catch of apimsgid.

*Of course, you need to give value to 'user' & 'password' attribute in this string.

 

Regular Expression:

<ReturnCode Value="rx_^([0-9]+)|" Action="ReturnCode_[1]" />  is the line they need to return the correct code.

 

"rx_ " as prefix within the value followed by the regex(Regular Expression) to use it. You can use the regex catches in these actions. They just need to be placed in square brackets with the correct number. The first regex catch has the number one. So it will evaluate the result by value which caught at first.

 

2-1. ReturnCode record

As for ReturnCode, you can set the all possible ReturnCode value with its independent description.
To recoginze it as "Succeed" of sending sms, you need to add Success="yes" as addition attribute in that record.

 

Usually, if your SMS provider simply send back status of your sms sending as Return Code, then you can just need to have RegEx and each returncode records in it. In the case it requer to query each single sms try's status, please configure it as same as default one for Clickatell.

 

Of course, DirectSmile offer you a Professional Service to configure sms.xml for you. Please ask DirectSmile Service team whenever you need a help.

 

I hope it will help you!

 

Best regards,

NOG

 

The author has edited this post (on 07/04/2014)
link this post written on 19/11/2014
  • To top

Hi.

If an sms api says that they are using ISO8859-1 or ISO8859-15 for xml special characters encoding and it doesnt work, what could the problem be?
What different encodings are allowed from the dsmx software?


I have changed the:
<?xml version="1.0" encoding="UTF-8"?> 

to

<?xml version="1.0" encoding="ISO8859-1"?>

but without any luck.

 

regards,
Håkan 

link this post written on 19/11/2014
  • To top

Hi Håkan,

You should not use encoding of XML, it should be utf-8.

In the case you use different encoding for the sending text, as you can see in the instraction above, you need to give additional parameter in the first line.

 

So it should be something like below.

<SMS Delay="10000" Url="http://xxxx.xxxx.xxx/http/sendmsg?api_id=xxxxx&amp;user=xxxxx&amp;password=xxxx&amp;to=[PHONE]&amp;text=[TEXT]" TextEncoding="iso-8859-1">

 

Please try this

 

NOG


link this post written on 16/12/2014
  • To top

Worked like a charm!

Cheers!

  • Statistics: 4 Posts | 48 Visits
created by mixxt
  • v1.1.1
  • (highfive)