Custom Commands

khushbugarg 4 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 Tananaev 4 years ago

Your device phone number?

khushbugarg 4 years ago

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

Anton Tananaev 4 years ago

And how is that related to the phone number?

khushbugarg 4 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 Tananaev 4 years ago

The IP address and port are not accessible.

khushbugarg 4 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 Tananaev 4 years ago

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

khushbugarg 4 years ago

Send SMS using following API:

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

I get this by opening the url.

Anton Tananaev 4 years ago

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

khushbugarg 4 years ago

From server

Anton Tananaev 4 years ago

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