SMS configuration question

Jose B4 years ago

Anton, I have a question regarding notificator SMS:

Today I use in traccar.xml the configuration bellow and works well:

                     <entry key='notificator.sms.manager.class'>[YOUR CLASS]</entry> 
                     <entry key='sms.http.url'>[YOUR URL]</entry> 
                     <entry key='sms.http.user'>[YOUR ACCOUNT SID]</entry> 
                     <entry key='sms.http.password'>[YOUR AUTH TOKEN]</entry> 
                     <entry key='sms.http.template'>[YOUR TEMPLATE]</entry>

I would like to use it per user, (into user's attributes), seems the email configuration "Use SSL per-use described on https://www.traccar.org/documentation/notifications/".

Is it possible? If yes, what I need to for this work?

Respectfully,

JB

Anton Tananaev4 years ago

Not possible, as far as I know.

Jose B4 years ago

Can I suggest as improvement on gitHub?

JB

Anton Tananaev4 years ago

You can, but I'm not sure we will implement it any time soon. SMS configuration is more complicated than email.

Jose B4 years ago

I opened https://github.com/traccar/traccar/issues/4551.
Thank you for atention.
JB

Cristian4 years ago

JB, there is a solution using each user's chatID in the phone field and creating the notification as sms

Anton Tananaev4 years ago

@Cristian, how is this related to SMS configuration? What chatID are you talking about?

Cristian4 years ago

Anton, I fail to explain that at the moment you can use telegram to send notifications by user instead of sms

Sorry about my English but I use a translator

Jose B4 years ago

@Anton, chatID is ID of you user in telegram program. You can see it using "chat id echo" bot into telegram.

@Cristian, where I put bot token? Traccar.xml? (could you share your telegram configuration on traccar.xml)

Cristian4 years ago

traccar.xml

<entry key='notificator.sms.manager.class'>org.traccar.sms.HttpSmsClient</entry>
<entry key='sms.http.url'>https://api.telegram.org/bot<TOKEN>/sendMessage?</entry>
<entry key='sms.http.user'>[YOUR ACCOUNT SID]</entry>
<entry key='sms.http.password'>[YOUR AUTH TOKEN]</entry>
<entry key='sms.http.template'>
    chat_id={phone}&text={message}
</entry>

I must clarify that the user does not receive an SMS, he receives a Telegram notification

Jose B4 years ago

Thank you , I will test it. Obrigado!
JB

Jose B4 years ago

@Cristian, Did not work.

I put on "user phone field" the chatID of client as you havd indicated and I started the bot on the cell phone that should receive the telegram notificator. But I only received notification of the telegram on my telegram user [which is the bot telegram creator].

What I need to do to works?

JB

Jose B4 years ago

@Cristian,

After very tests I discovered that:

It works well if I use the chatID = directly on the configuration (example: <entry key='sms.http.template'>chat_id=111111111&text={message}</entry>) => it sends to correct person.

It works well if I use the chatID = directly on the configuration (example: <entry key='sms.http.template'>chat_id={phone}&text={message}</entry>) => it sends to for bot telegram creator.

it looks like he can't solve the "phone".

What can I to do?

JB

Cristian4 years ago

On the user's phone, look for the bot you created from Telegram and the user will receive notifications for the devices assigned to him. You must not create another bot on the user's phone.

Cristian4 years ago

For example if on your phone you created the Traccar-Sms_bot and you used the token of that bot in traccar.xml, from Telegram on the other phone look for Traccar-Sms enter the chat and you will see how notifications are received there.

I have it working like this, and it sends me the notifications using the chatid entered in the phone field.