diff options
author | Kirill Lukonin <klukonin@gmail.com> | 2020-03-20 14:08:52 +0500 |
---|---|---|
committer | Petr Štetiar <ynezz@true.cz> | 2020-07-08 16:07:05 +0200 |
commit | 667fbb8151c7348283985f28c43aeb848f948350 (patch) | |
tree | b1c970c03e53728505f9c5198aeba70b64456a22 /package/network/utils/comgt | |
parent | 645b1ec3e2857769d7e4adb3bc4c2261af795115 (diff) | |
download | upstream-667fbb8151c7348283985f28c43aeb848f948350.tar.gz upstream-667fbb8151c7348283985f28c43aeb848f948350.tar.bz2 upstream-667fbb8151c7348283985f28c43aeb848f948350.zip |
comgt: add new script to send ussd request and get the answer
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>
Diffstat (limited to 'package/network/utils/comgt')
-rw-r--r-- | package/network/utils/comgt/files/ussd.gcom | 21 |
1 files changed, 21 insertions, 0 deletions
diff --git a/package/network/utils/comgt/files/ussd.gcom b/package/network/utils/comgt/files/ussd.gcom new file mode 100644 index 0000000000..c5be80b2d7 --- /dev/null +++ b/package/network/utils/comgt/files/ussd.gcom @@ -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 |