Hi folks,

I have been writing a GSM<->IRC gateway using SMSlib and pircbotx. One 
thing that arose while testing, is that SMSlib appears not to handle 
multi-line USSD responses very well. These are quite common with my current 
service provider (Vodacom South Africa), with their general self service 
number *111#.

SMS lib was only returning the first line, and ignoring the rest. I 
discovered that I could update the terminators defined in the ATHandler, 
and managed to get it to work with the following code:

String[] terminators = gateway.getATHandler().getTerminators();
if (terminators[9].equals("\\+CUSD:\\s.*\\s"))
    terminators[9] = "(?s)^\\+CUSD:\\s[012],\".*\",\\d+\\s*$";
else
    System.err.println("Couldn't replace the USSD terminator!");

The "(?s)" tells the code that carriage return/line feeds should also match 
various wild cards, allowing the pattern to match a multi-line string.

The overall pattern seems to be a bit more precise, according to the 
WaveCom manuals. Anyway, it works for me, using a Sierra Wireless/WaveCom 
MV8792V on a MiniPCIe to USB carrier board.

Regards,

Rogan

-- 
You received this message because you are subscribed to the Google Groups 
"SMSLib Discussion Group" group.
To view this discussion on the web visit 
https://groups.google.com/d/msgid/smslib/6e8ff364-8c94-4325-856d-a3e84909e7f3%40googlegroups.com.
  • [smslib] Update for handlin... Rogan Dawes via SMSLib Discussion Group

Reply via email to