SMS Server Tools 3
 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. The forum is currently read-only, but will open soon. Thu Nov 21, 2024 17:32
SMSTools3 Community » Help and support Bottom

[answered] Error in sending USSD codes

Login and Post Reply

Page:  1

Author Post
Member
Registered:
Aug 2017
Location: Iran, Iran
Operating system name and version: Ubuntu 16.04
Version of smsd: 3.1.21
Smsd installed from: sources
Name and model of a modem / phone: D-link
Interface: serial / USB



When I send the ussd code to retrieve the balance of my credit, I get the following error:



Administrator
Registered:
May 2009
Location: Jyväskylä, Finland
Is there other port than ttyUSB0 provided by the modem? If there is, try to use another port. Some modems provide multiple ports, and USSD does not work with all ports.

Member
Registered:
Aug 2017
Location: Iran, Iran
Topic owner
Here's the output of wvdialconf:



It seems there are two ports ttyUSB0 and ttyUSB1.

I checked both ports with miniterm.py. The output of port ttyUSB0 is as follows:


and there is no correct output!! And for port ttyUSB1 I cannot send any AT commands and I get error.

Member
Registered:
Aug 2017
Location: Iran, Iran
Topic owner
I did some more tests. I think I should send the USSD code via /dev/ttyUSB0 and receive the result from /dev/ttyUSB1!! The problem is that how can I make use of this behavior in smstools?? I mean how can I use both ports in smstools3 to send and receive the result of the USSD codes?

Member
Registered:
Sep 2017
Location: Munich, Germany
All,

I have a language problem and a provider problem and your help solving them will be much appreciated.

My modem is a ZTE MF112, my provider is the German e-plus. When querying the prepaid balance using
AT+CUSD=1,"*100#"
I get error 258 (device busy). This is true for both smsd via GSM1.sh and a direct AT-command based conversation with the modem.

However, I can get an answer by requesting the German character set in a third argument (15) to CUSD:


This can be decoded to "Ihr Guthaben beträgt: 9,77 ."


Questions:

1.) what is a good way of splicing the extra argument in? The proposed GSM1.sh does not appear to support this. Maybe there is a general AT command I could use for setting the character set in all modem responses?

2.) the answer is funny in that it contains '00' as every second byte, potentially making decoding fail. Any thoughts on this?

3.) the response does not yield the remaining time for using the SIM card. For this I need to use *102#. A sample answer would then be (after removing zeroes and decoding): "Das aktuelle Aktivitätszeitfenster Ihrer SIM-Karte endet am 24.08.2018 und kann durch weitere Aufladungen verlängert werden." Nice and clean.

I could configure a first script for balance (say GSM1.sh) and a second one (GSM2.sh) for time. Can anybody think of a more elegant way to check both figures in one go?

Kind regards

birnbacs

Administrator
Registered:
May 2009
Location: Jyväskylä, Finland
birnbacs,

The response is hexadecimal representation of UCS2 encoding. Use a modem setting ussd_convert = 1 to decode it.

You could just handle the expiration manually, as it does not change all the time.

Member
Registered:
Aug 2017
Location: Iran, Iran
Topic owner
Quote
I did some more tests. I think I should send the USSD code via /dev/ttyUSB0 and receive the result from /dev/ttyUSB1!! The problem is that how can I make use of this behavior in smstools?? I mean how can I use both ports in smstools3 to send and receive the result of the USSD codes?

Dear Keke, Do you have any idea for the above issue?
Thanks.

Member
Registered:
Sep 2017
Location: Munich, Germany
keke wrote
birnbacs,

The response is hexadecimal representation of UCS2 encoding. Use a modem setting ussd_convert = 1 to decode it.

You could just handle the expiration manually, as it does not change all the time.

Thanks a ton but this did not make much differende. GSM1.balance still reads:


Member
Registered:
Sep 2017
Location: Munich, Germany
keke wrote
birnbacs,

The response is hexadecimal representation of UCS2 encoding. Use a modem setting ussd_convert = 1 to decode it.

You could just handle the expiration manually, as it does not change all the time.

Thanks Keke,

I will work on problems 2 and 3 as soon as I get there, I am sure I will find a solution.
I am still blocked by problem #1 though. Do you have any idea on fixing the problems issuing the USSD command?

Administrator
Registered:
May 2009
Location: Jyväskylä, Finland
birnbacs wrote
I am still blocked by problem #1 though. Do you have any idea on fixing the problems issuing the USSD command?

Did you try this:

ussd_command="AT+CUSD=1,\"*100#\",15"

Member
Registered:
Sep 2017
Location: Munich, Germany
keke wrote
birnbacs,

The response is hexadecimal representation of UCS2 encoding. Use a modem setting ussd_convert = 1 to decode it.

You could just handle the expiration manually, as it does not change all the time.

I found a solution to problem 1 and it is embarrassingly straightforward:
GSM1.sh now contains the line


Administrator
Registered:
May 2009
Location: Jyväskylä, Finland
sinai wrote
Quote
I did some more tests. I think I should send the USSD code via /dev/ttyUSB0 and receive the result from /dev/ttyUSB1!! The problem is that how can I make use of this behavior in smstools?? I mean how can I use both ports in smstools3 to send and receive the result of the USSD codes?

Dear Keke, Do you have any idea for the above issue?
Thanks.

Smstools3 cannot use dual ports for single modem. As this issue is rare, and you likely will have problems with delivery reports too, I'm not willing to create dual-port facility to this software. I recommend to buy a better modem.

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.