Custom Commands

khushbugarg3 years ago

I've added config of HTTP SMS API. Wanted to know what is to be added in device's PHONE attribute which is being used in api payload.

Anton Tananaev3 years ago

Your device phone number?

khushbugarg3 years ago

oh okay. But I am getting error-connection failed.

Anton Tananaev3 years ago

And how is that related to the phone number?

khushbugarg3 years ago

I thought phone number might be the reason for the error. What else could go wrong?

 <entry key='notificator.types'>web,firebase,sms</entry>
 <entry key='notificator.sms.manager.class'>org.traccar.sms.HttpSmsClient</entry>
<entry key='sms.http.url'>http://100.82.206.233:8082/</entry>
<entry key='sms.http.authorization'>0c847578</entry>
        <entry key='sms.http.template'>
    {
        "to": "{phone}",
        "message": "{message}"
    }
    </entry>

This is what the configuration looks. Am i missing something?

Anton Tananaev3 years ago

The IP address and port are not accessible.

khushbugarg3 years ago

Changed it.

 <entry key='notificator.types'>web,firebase,sms</entry>
 <entry key='notificator.sms.manager.class'>org.traccar.sms.HttpSmsClient</entry>
<entry key='sms.http.url'>http://192.168.29.90:8082/</entry>
<entry key='sms.http.authorization'>bbede379</entry>
        <entry key='sms.http.template'>
    {
        "to": "{phone}",
        "message": "{message}"
    }
    </entry>
Anton Tananaev3 years ago

That's your local IP, so I have no idea if it's correct or not. You should really test the connection.

khushbugarg3 years ago

Send SMS using following API:

POST /
{
    "to": "+10000000000",
    "message": "Your message"
}

I get this by opening the url.

Anton Tananaev3 years ago

Are you connecting from your server or from your local machine?

khushbugarg3 years ago

From server

Anton Tananaev3 years ago

Then I don't really understand why you would be getting connection error. No ideas.