traccar / traccar

Traccar GPS Tracking System
https://www.traccar.org
Apache License 2.0
5.26k stars 2.59k forks source link

New Http Sms API #4171

Closed gdrako closed 2 years ago

gdrako commented 5 years ago

Hello

If there is time available from the developers I would like to implement a new API interface for sending sms. Here is the information from the official site. https://www.smsapi.com/docs/#1-introduction

Regards

tananaev commented 5 years ago

Can't you already use it with HTTP API option?

gdrako commented 5 years ago

Yes, I tried with all three examples but without success. See below the log...

WARN: Unable to connect to SMPP server:  - Unable to connect to host [localhost] and port [2775]: Connection refused: localhost/127.0.0.1:2775 - SmppChannelConnectException (... < SmppClient:171 < ReconnectionTask:29 < ...)

Also see an example that works well with the API in php.. https://drive.google.com/open?id=1jvSFpcElf9tE9OcwC11-83qL7ffpeXbJ

Regards

tananaev commented 5 years ago

Why have you enabled SMPP? You clearly misconfigured something.

gdrako commented 5 years ago

The error stopped appearing when I made false the "sms.enable" parameter However, it still does not send sms alerts Probably something I be wrong ..Here is the current config..

<entry key='notificator.types'>web,mail,sms</entry>
<entry key='sms.enable'>false</entry>
<entry key='notificator.sms.manager.class'>org.traccar.sms.HttpSmsClient</entry>
<entry key='sms.http.url'>https://api2.smsapi.com/sms.do</entry>
<entry key='sms.http.authorization'>XXXXXXXXXXXXXXXXXXXzGO4CIxXKxCpbIg</entry>
<entry key='sms.http.template'>
    [{
        "from" : "info",
        "to": "{phone}",
        "message": "{message}",
    }]
</entry>