Issue with http sms api

Loic 4 years ago

Dear Anton

I am trying to configure the http sms api in my traccar server (last version).

This is my traccar config file :

<!--HTTP SMS API -->
<entry key='notificator.types'>web,mail,sms</entry>
<entry key='sms.smpp.enable'>true</entry>
<entry key='sms.enable'>true</entry>
<entry key='notificator.sms.manager.class'>org.traccar.sms.HttpSmsClient</entry>
<entry key='sms.http.url'>http://10.36.XXX.33:8082</entry>
<entry key='sms.http.authorization'>0dddXXX2</entry>
<entry key='sms.http.template'>
    {
        "to": "{phone}",
        "message": "{message}"
    }
</entry>

When i try to send a sms to my tracker the server reply :

"SMPP session is not connected - SmppChannelException (SmppClient:254 < BaseProtocol:112 < CommandsManager:66 < ...)"

I have installed the traccar sms gateway app and my phone have a public ip the same i set in traccar.xml

https://www.lekaptek.fr/index.php/f/133050

What's the problem ? Would you please help me ?

Merry christmas

Loic 4 years ago
Anton Tananaev4 years ago

Can you please explain each line you have added to your config. Specifically, I don't really understand why you are enabling SMPP.

Loic 4 years ago

thank you for your reply.

I have enable smpp following a previous post on the forum but effectively it's a nonsense because i just want to use http sms api and not smpp.

So i removed it but i still have this error when i am trying to send sms to a device :

"SMPP session is not connected - SmppChannelException (SmppClient:254 < BaseProtocol:112 < CommandsManager:66 < ...)"

I added those lines to my traccar.xml file following the documentation :

<entry key='notificator.types'>web,mail,sms</entry>
<entry key='sms.enable'>true</entry>
<entry key='notificator.sms.manager.class'>org.traccar.sms.HttpSmsClient</entry>
<entry key='sms.http.url'>http://10.56.89.XXX:8082</entry> #  this is the url i can find on the traccar sms gateway app
<entry key='sms.http.authorization'>0dddXXX2</entry> #API KEY on the traccar sms gateway app
<entry key='sms.http.template'>
    {
        "to": "{phone}",
        "message": "{message}"
    }
</entry>

My server works on the VPS. The public ip address is 46.105.31.XXX

I probably missed something but i don't know what . I tried to search on the forum without success ...

Anton Tananaev4 years ago

You can't use HTTP API for commands. It can only be used for notifications.

Henrique3 years ago

Hi, did you find the solution? I am in the same need!