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. Tue Apr 13, 2021 13:18
SMSTools3 Community » Help and support Bottom

USSD log-file ?

Login and Post Reply

Page:  1

Author Post
Member
Registered:
Feb 2013
Location: Belarus
Operating system name and version: OpenWrt Tp-Link
Version of smsd: 3.1.15
Smsd installed from:
Name and model of a modem / phone: ZTE mf190
Interface: USB

Hi all.
I apologize for bad English, modem ZTE MF 190.
Logs from three different SIM cards MTS, Velcom, Life.
Belarus.
Settings are not changed.

MTS


Velkom


Life
???? :'(


What's the problem I can not understand the operator "Life" ?

Member
Registered:
Feb 2013
Location: Belarus
Topic owner
Hi keke.
I can not understand what the problem with receiving ussd-messages ...
It comes in the form of torn. This is only one operator "life".
Maybe it is too long on the text?
Logs and configuration, see below ...

config


run.log


smsd.log


complete text


Member
Registered:
Feb 2013
Location: Belarus
Topic owner
ussd
#!/bin/sh

touch /var/run/spool/ussd/ussd.file
echo "AT+CUSD=1,"*100#",15" >> /var/run/spool/ussd/ussd.file
'bash' Syntax Highlight powered by GeSHi


Administrator
Registered:
May 2009
Location: Jyväskylä, Finland
It seems that you need to modify the sources.

In the file smsd.c locate this:

/* =======================================================================
   Device-Spooler (one for each modem)
   ======================================================================= */


int cmd_to_modem(
  //
  //
  //
  char *command,
  int cmd_number
)
{
  int result = 1;
  char *cmd;
  char *p;
  char answer[500];
  char buffer[600];
  int fd;
  int log_retry = 3;
  int i;
  FILE *fp;
  int is_ussd = 0;  // 3.1.7
 
'c' Syntax Highlight powered by GeSHi


Change those numbers:
char answer[1024];
char buffer[1024];


Then save, recompile and try again.

It's also a good idea to set "echo OFF", with the modem setting:
init = ATE0

Member
Registered:
Feb 2013
Location: Belarus
Topic owner
Thank you for your help.
Good luck.

Member
Registered:
Feb 2013
Location: Belarus
Topic owner
Hi keke.
All work properly.
Thank you for your help.
Maybe someone will come in handy.
Small patch.

001-smsd.patch


Member
Registered:
Feb 2013
Location: Belarus
Topic owner
Hi keke.

I have another problem.
After sending a USSD-request session is not closed.
To close the USSD-session need to send another request.
Can I duplicate a USSD-request for one minute?
In the log file, it shows, I have attached it before.

Administrator
Registered:
May 2009
Location: Jyväskylä, Finland
Probably the answer is reveiced too slowly, and therefore smsd cuts it. Can you try with a global setting log_read_from_modem = yes and show the results?

Member
Registered:
Feb 2013
Location: Belarus
Topic owner
I will make and post the result.
But this problem is a particular provider ...
Can I change my SIM card? :D

Member
Registered:
Feb 2013
Location: Belarus
Topic owner
Log file is 100k
Where to send the package?
Messages can be translated into English ...
Sorry, the log file does not want to cut into pieces.
How to package and to attach - the forum can not find ..

Good luck....

Administrator
Registered:
May 2009
Location: Jyväskylä, Finland
Instructions in the private block:

Hidden private text.



Member
Registered:
Feb 2013
Location: Belarus
Topic owner
Well, I'll try ...
Sorry for my bad english ;)

Member
Registered:
Feb 2013
Location: Belarus
Topic owner
check all posted

Administrator
Registered:
May 2009
Location: Jyväskylä, Finland
It seems that while handling the USSD response, your script should detect if the response was +CUSD: 1, and in that case the script should create a new command which is AT+CUSD=2.

Later version of smsd could do this automatically, but right now I'm too busy to make any changes to it.

USSD session also expires, but I do not know what is the timeout in your service provider. And if you really need to ask the saldo every minute, waiting is not a solution.

Administrator
Registered:
May 2009
Location: Jyväskylä, Finland
Can you test this highlighted addition in smsd.c:

        if ((cmd = malloc(strlen(command) + 2)))
        {
                sprintf(cmd, "%s\r", command);
                // 3.1.5: Special case: AT+CUSD, wait USSD message:
                //put_command(*modem, device, cmd, answer, sizeof(answer), 1, EXPECT_OK_ERROR);
                if (!strncasecmp(command, "AT+CUSD", 7) && strlen(command) > 9)
                {
                        is_ussd++;
                        put_command(cmd, answer, sizeof(answer), 3, "(\\+CUSD:)|(ERROR)");

                        if ((p = strstr(answer, "+CUSD:")))
                        {
                                if (atoi(p + 6) == 1)
                                {
                                        char answer[500];

                                        put_command("AT+CUSD=2\r", answer, sizeof(answer), 1, EXPECT_OK_ERROR);
                                }
                        }

                }
                else
                // 3.1.12:
                if (*cmd == '[' && strchr(cmd, ']'))
                {
 
'c' Syntax Highlight powered by GeSHi


The code is not tested. I would like to see what is the response for AT+CUSD=2 command.

Member
Registered:
Feb 2013
Location: Belarus
Topic owner
Hi keke.

I sent you the log file.
My fix.



« Last edit by z-wer on Fri Mar 15, 2013 08:05, 98 months ago. »
Administrator
Registered:
May 2009
Location: Jyväskylä, Finland
Thank you very much!

It is working. Large buffer is not required because the anwser is always short.

This feature will be included in the future releases. I think that there should be a configuration setting for this, like ussd_session_close = yes (default: no), because some users may handle answer in external script, and session needs to kept open. Generally taken smsd acts as before, when it's upgraded.

Member
Registered:
Feb 2013
Location: Belarus
Topic owner
Thank you for your help. ;)
I will test more tomorrow.
I sometimes get an error.
Cause I can not install.

Member
Registered:
Feb 2013
Location: Belarus
Topic owner
Sometimes I get this error.



Administrator
Registered:
May 2009
Location: Jyväskylä, Finland
CME ERROR: 258 Phone is busy (???)

Nothing can be done. Just ignore it.

Member
Registered:
Feb 2013
Location: Belarus
Topic owner
Ok.
Good luck.

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.