Community discussions

MikroTik App
 
VendiaNet
just joined
Topic Author
Posts: 3
Joined: Fri Nov 01, 2024 10:38 am

Teltonika SMS gateway for notifikations

Fri Nov 01, 2024 10:45 am

Hi,
I have some success using a Teltonika TRB140 as a SMS gateway for Dude notifikations.
I do have an issue.
I have this notification: /tool fetch url="http://IP/cgi-bin/sms_send?username=use ... r&text=The Dude is happy again"
My problem is, that ROS is not happy about the text, unless all spaces are removed and _ is used.
testing all inside the "" sends an SMS, but the entire string fails with fetch error 400
Notepad++ regards the text inside the "" as a URL until the first space after =The
I tried to double up on "" or ''.
Anyone got an idea ?
Thx
 
jaclaz
Forum Guru
Forum Guru
Posts: 1882
Joined: Tue Oct 03, 2023 4:21 pm

Re: Teltonika SMS gateway for notifikations

Fri Nov 01, 2024 11:50 am

No idea about the actual issue, but also the board parser seems to behave just like you describe, it "interrupts" the hyperlink on the first space (after the "The").

So it could be something similar.

Try replacing the spaces with %20, a http URL must contain no spaces:
viewtopic.php?t=164815#p810546
 
User avatar
Amm0
Forum Guru
Forum Guru
Posts: 4234
Joined: Sun May 01, 2016 7:12 pm
Location: California
Contact:

Re: Teltonika SMS gateway for notifikations

Fri Nov 01, 2024 11:57 am

The URL needs to use "urlencoding", which means things like space need to be escaped for HTTP. So your "....text=The Dude is happy again" part is likely the problem.
In recent V7, you can use :convert to do the encoding.
/tool fetch url="http://IP/cgi-bin/sms_send?username=use ... r&text=$[:convert to=url "The Dude is happy again"]"

Alternatively, you can just replace any space with + or %20 (which both are urlencodings for a space), so without :convert, you can just add %20 instead of space, so "...text=The%20Dude%20is%20happy%20again" should work.
 
VendiaNet
just joined
Topic Author
Posts: 3
Joined: Fri Nov 01, 2024 10:38 am

Re: Teltonika SMS gateway for notifikations

Fri Nov 01, 2024 2:57 pm

Thx guys,
Both solutions works nicely.

Who is online

Users browsing this forum: No registered users and 3 guests