SMS Notification not working, Got Error!!

Zuo Bruno6 years ago

Thanks Guys, I get this error in my Logs : WARN: SMS sending error - com.cloudhopper.smpp.type.SmppChannelException: SMPP session is not connected - MessageException (SmppClient:254 < *:264 < ...)

I have followed the tutorials here: https://www.traccar.org/http-sms-api/ and used the code below"

<entry key='notificator.types'>web,mail,sms</entry>
<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>

NB: I encoded the + sign with %2B as required (I Hope)

Anton Tananaev6 years ago

It looks like you have enabled SMPP. You need to disable it.

Zuo Bruno6 years ago

Please let me know how to disable SMPP.

Anton Tananaev6 years ago

In your config fragment you don't have it, so I guess you omitted the most relevant part of the configuration. Just revert any other changes that you did.

Zuo Bruno6 years ago

@Anton I am sorry for asking, is there a line of code I need to add to turn off SMPP? because at the moment I can't find it and i added nothing else apart from what is posted above which came from the official source

Anton Tananaev6 years ago

Upload somewhere your configs, so we can check.

Zuo Bruno6 years ago

My Traccar.cml files looks like this

<?xml version='1.0' encoding='UTF-8'?>

<!DOCTYPE properties SYSTEM 'http://java.sun.com/dtd/properties.dtd'>

<properties>

    <entry key='config.default'>./conf/default.xml</entry>

    <!--

    This is the main configuration file. All your configuration parameters should be placed in this file.

    Default configuration parameters are located in the "default.xml" file. You should not modify it to avoid issues
    with upgrading to a new version. Parameters in the main config file override values in the default file. Do not
    remove "config.default" parameter from this file unless you know what you are doing.

    For list of available parameters see following page: https://www.traccar.org/configuration-file/

    -->

    <entry key='database.driver'>org.h2.Driver</entry>
    <entry key='database.url'>jdbc:h2:./data/database</entry>
    <entry key='database.user'>sa</entry>
    <entry key='database.password'></entry>

<!-- Working with SMS for Twilio, Added 16th Jan 2018 at 9:27AM -->

    <entry key='notificator.types'>web,mail,sms</entry>
<entry key='notificator.sms.manager.class'>org.traccar.sms.HttpSmsClient</entry>
<entry key='sms.http.url'>https://api.twilio.com/2010-04-01/Accounts/A**************************/Messages.json</entry>
<entry key='sms.http.user'>A***************************</entry>
<entry key='sms.http.password'>c*********************************</entry>
<entry key='sms.http.template'>
    From=%2B17135615254&amp;To={phone}&amp;Body={message}
</entry>


<!-- Added These Lines on January 12 2019 Because of connection issues to DB 
<entry key='database.url'>jdbc:h2:/home/user/Documents/yourDataBaseName/target/database</entry>-->


</properties>

That is what I have, I have replaced the some Twilio credentials with asterisks (******)

Anton Tananaev6 years ago

What about default xml? Please upload it somewhere instead of posting directly into the forum comment.

Zuo Bruno6 years ago

Thanks @Anton, Here are the pasted details:

Traccar.xml: https://pastebin.com/PYNah6Wh
Default.cml: https://pastebin.com/gBhXcvAB

Thanks

Anton Tananaev6 years ago

Where did you get following line?

<entry key='sms.enable'>true</entry>

It's not part of the default configuration and you said you haven't changed anything other than what you showed originally, so how did it get there?

Zuo Bruno6 years ago

Hello, @Anton Like I said at the time of posting, I did nothing else, But as you know I was reading other official posts and this was recommended too. So I did add that line of code and also the ones at traccar.xml which I have shared. Please let me know how to turn off SMPP. Please!!

Anton Tananaev6 years ago

I would recommend you to re-install everything clean and do only what official documentation says.

From your original error message I know that the line was there when you first asked, so please don't lie.

Zuo Bruno6 years ago

@Anton why would I lie? I added this based on the official recommendations, will taking it off solve the issue? because I actually had to pay someone to upgrade from 4.0 to 4.2 as myself did it once as lost everything.

Zuo Bruno6 years ago

@Anton, I think I did everything correctly, I just restarted Traccar server and now the SMS works. Thanks for your support. Will be sending you a cup of coffee. Thank you so much. Will let you know when I make my donations