Send custom SMS command with Traccar 4.14

zgps3 years ago

Dear All,

I'm using now Traccar server 4.11, and the custom SMS command function to a device is working well with SMPP protocol with SMSGLOBAL.
My configuration:

<entry key='notificator.types'>web,mail,sms</entry>

<entry key='sms.enable'>true</entry>
<entry key='sms.smpp.host'>smpp.smsglobal.com</entry>
<entry key='sms.smpp.port'>1775</entry>
<entry key='sms.smpp.username'>my username</entry>
<entry key='sms.smpp.password'>my password</entry>
<entry key='sms.smpp.notificationsCharset'>GSM</entry>
<entry key='sms.smpp.notificationsDataCoding'>0</entry>
<entry key='sms.smpp.sourceAddress'>my sourceaddress</entry>

I'd like to use newer Traccar server versions, but as I know the SMPP protocol missing from newer versions of Traccar.
And with HTTP SMS API not working with custom SMS command to send SMS.

I'm using Teltonika devices and this type of devices not online while not sending data. So while these devices in idle state, we unable to send any command. The only way to send any command immediately is the SMS command.

So the question is: how can I send custom SMS commands with newer versions of Traccar?

Thanks in advance,
zgps

Anton Tananaev3 years ago

And with HTTP SMS API not working with custom SMS command to send SMS.

This statement is incorrect. You can send commands with HTTP SMS API.

zgps3 years ago

Thank you Anton!
Yes, I tried this, and I realized that this is working with twilio. I remembered from some forum topic, but that was false.
Some twilio specific information if need to someone: this configuration is working for me:

<entry key='notificator.sms.manager.class'>org.traccar.sms.HttpSmsClient</entry>
<entry key='sms.http.url'>https://api.twilio.com/2010-04-01/Accounts/[YOUR ACCOUNT SID]/Messages.json</entry>
<entry key='sms.http.user'>[YOUR ACCOUNT SID]</entry>
<entry key='sms.http.password'>[YOUR AUTH TOKEN]</entry>
<entry key='sms.http.template'>From=[YOUR PHONE NUMBER]&amp;To={phone}&amp;Body={message}</entry>

I needed to buy an own twilio phone number (US number: 1$/month), and I can use this number in the above code with + in the begining. Don't need to encode the + with URL encode. This working with URL encoded (%2B) and without URL encoded too.

Thank you Anton for your hard and professional work with Traccar. This is very useful and special.

Anton Tananaev3 years ago

In the past it was not possible to send commands with HTTP SMS API, but it is possible now. Actually we enabled it at the same time as we removed SMPP and it's not a coincidence. I would recommend checking release notes we post on the blog. This is the relevant one in this case:

https://www.traccar.org/blog/traccar-4-12/