comgt: add new script to send ussd request and get the answer
authorKirill Lukonin <klukonin@gmail.com>
Fri, 20 Mar 2020 09:08:52 +0000 (14:08 +0500)
committerPetr Štetiar <ynezz@true.cz>
Wed, 8 Jul 2020 14:07:05 +0000 (16:07 +0200)
New script for comgt. Should help to fetch balance or any additional information with USSD.
This script uses the standard AT command which should be supported by all modems.

Run-tested on: Mikrotik wAP LTE KIT

Signed-off-by: Kirill Lukonin <klukonin@gmail.com>
[fixed from/sob]
Signed-off-by: Petr Štetiar <ynezz@true.cz>
package/network/utils/comgt/files/ussd.gcom [new file with mode: 0644]

diff --git a/package/network/utils/comgt/files/ussd.gcom b/package/network/utils/comgt/files/ussd.gcom
new file mode 100644 (file)
index 0000000..c5be80b
--- /dev/null
@@ -0,0 +1,21 @@
+opengt
+ set com 115200n81
+ set comecho off
+ set senddelay 0.02
+ waitquiet 0.2 0.2
+ flash 0.1
+
+:start
+ send "AT+CUSD=1,"
+ send $env("ussd")
+ send ",15"
+ send "^m"
+ waitfor 120 "+CUSD:"
+ if % = -1 goto timeout
+ get 1 "^m" $s
+ print $s
+ exit 0
+
+:timeout
+ print "ERROR: no USSD response, timeout.\n"
+ exit 1