SMS Server Tools 3
This site is hosted by Kekekasvi.com
 Menu
Basic information:
Additional information:
Support:
Get SMS Server Tools 3:
Additional Options

 Sponsored links

 Search
Custom Search

 Visitor locations
 
 SMS Server Tools 3 Community
Welcome, Guest. Please login or register. Fri Mar 29, 2024 13:34
SMSTools3 Community » Help and support Bottom

[answered] Read Network Message

Login and Post Reply

Page:  1

Author Post
Member
Registered:
May 2009
Location: Italy
Operating system name and version: Debian 8.7
Version of smsd: 3-3.1.15
Smsd installed from: sources
Name and model of a modem / phone: huawei usb stick
Interface: USB

Hi,
i have a request and I hope is possible to do this. My carrier is a low cost Italy carrier and do not have a web page to check money on my prepaid SIM.
Only way to check my credit is to make a voicecall to hear the credit or other way is to dial *123# and receive a Network fast message on Mobile Phone Display.
I tried to dial *123# with sms3 but nothing was received. My question is if its possible to receive this kind of messages eith sms3.

Many thanks

Marco


« Last edit by marcolino7 on Wed Feb 08, 2017 22:05, 86 months ago. »
Administrator
Registered:
May 2009
Location: Jyväskylä, Finland
You need to use USSD command, and with regular_run feature it can be done.

For a modem, define the following settings, or something like this:
regular_run_cmdfile = /var/spool/sms/GSM1.cmdfile
regular_run_statfile = /var/spool/sms/GSM1.statfile

When you need to know the saldo, create that GSM1.cmdfile with the content:
AT+CUSD=1,"*123#"

After a while smsd sends this command to modem, and the answer will be in the GSM1.statfile.

After the GSM1.cmdfile is processed, it is removed. When you next time need to know the saldo, just create that file again.

There is also little bit more complex solution available, presented in this topic:
Sample config and script for regular_run and balance of prepaid SIM using USSD.

With that solution you can get the saldo for example every 24 hours, and also when more than pre-defined number of messages are sent, and you can get an alert SMS when the saldo is going low or SIM is going to expire.

Member
Registered:
May 2009
Location: Italy
Topic owner
Hi Keke,
thanks for quick answer.
I tried 1st method. I can see file GSM1.cmdfile removed after a while, but I cannot see file GSM1.statfile created. sms3 daemon run as root, and user is owner on the folder.

Is there something I can check in logs?

Many thanks

Marco

Administrator
Registered:
May 2009
Location: Jyväskylä, Finland
Set loglevel = 7.

Check how AT+CUSD is sent in the log, and what is the answer from the modem.

Member
Registered:
May 2009
Location: Italy
Topic owner
I keke,
I grep logfile for AT+CUSD and for my 2 tries I got this





Administrator
Registered:
May 2009
Location: Jyväskylä, Finland
You could try with a command AT+CUSD=1,"*123#",0; or AT+CUSD=1,"*123#",15; if it makes a difference.

Member
Registered:
May 2009
Location: Italy
Topic owner
Hi keke,
also last command you sent me raise an error. Only difference is that in this case GSM1.statfile was srote, but inside there is the same log line with error.

Marco

Administrator
Registered:
May 2009
Location: Jyväskylä, Finland
Okay, it seems that your Huawei device needs USSD parameter in GSM 7bit packed format.

First ensure that *123# is surely the correct number. If it is, the parameter is AA986C3602.

If something else is required, smsd can do the conversion. For example:
# smsd -E *100#
AA180C3602

With *123# your command is:
AT+CUSD=1,"AA986C3602",15

As the answer will be in GSM 7bit packed format too, you need to use a modem setting:
ussd_convert = 2

Member
Registered:
May 2009
Location: Italy
Topic owner
Hi keke,
in this way it is not raised an error but inside statfile, i have the log line and not the credit on my SIM:



Administrator
Registered:
May 2009
Location: Jyväskylä, Finland
Make some more tests:

Stop the smsd if it's running.

Start smsd in communication mode:
smsd -C GSM1

Enter the command:
AT+CUSD=1,"AA986C3602",15

Within a seconds there should be and answer after OK string. If you do not get the answer, try a command without the ending ,15:
AT+CUSD=1,"AA986C3602"

If you still do not get the credit, I do not know what to do next.

With my Huawei E353 both commands are working, and the answer is received quickly.

Member
Registered:
May 2009
Location: Italy
Topic owner
Hi keke,
it reply OK at both command but without credit
Thanks for help.

Marco

Administrator
Registered:
May 2009
Location: Jyväskylä, Finland
One more thing...

Those devices usually provides more than one USB interface. You could stop the smsd, disconnect the modem, and plug it in again. Then using dmesg see what USB ports are provided.

Then use smsd in communication mode, and try the command with each port provided. It may be possible that some other port than your current gives the answer properly.

Member
Registered:
May 2009
Location: Italy
Topic owner
Hi keke,
i change my carrier, and this Carrier have the command *120#
Can you give me the command in GSM 7bit format?

Many Thanks

Member
Registered:
May 2009
Location: Italy
Topic owner
Hi Keke,
I found converter on your site.
If I am not wrong, *120# converted to GSM 7bit format is AA980C3602.
I followed your suggestion and using another of the modem created, and running command AT+CUSD=1,"AA980C3602",15
I got as result:



Is this correct? How can I convert to current balance?

Many thanks

Administrator
Registered:
May 2009
Location: Jyväskylä, Finland
While PDU Converter is a popular and useful tool, smsd can also be used to create 7bit Packet format string:

# smsd -E *120#
AA980C3602

If can also decode string with -D when testing issues.

A modem setting ussd_convert = 2 makes the answer readable when smsd is receiving USSD answer.

Member
Registered:
May 2009
Location: Italy
Topic owner
Hi Keke,
it works like a charm. Many thanks for support.

Marco

Login and Post Reply

Page:  1

SMSTools3 Community » Help and support Top

 
Time in this board is UTC.  

Privacy Policy   SMS Server Tools 3 Copyright © Keijo Kasvi.