Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • SEARCH
  • Home
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 8846445
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 14, 20262026-06-14T11:59:12+00:00 2026-06-14T11:59:12+00:00

I have a USSD application that provides an interactive session for users, for example:

  • 0

I have a USSD application that provides an interactive session for users, for example:

User> Dial USSD Shortcode
Serv> Return Main Menu
User> Select Option 1, e.g. "View Movie Times"
Serv> Return List of Cities
User> Select Option 3, e.g. Mumbai
Serv> Return List of Cinemas
User> etc ...

I would like to test the USSD Server by using SMSLib to simulate the user.

Are there any example SMSLib code snippets that show how to perform an interactive USSD session with a USSD server?

  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-06-14T11:59:15+00:00Added an answer on June 14, 2026 at 11:59 am

    The code at this link gives an example of sending and receiving USSD data using smslib:

    // SendUSSD.java - Sample application.
    //
    // This application shows you the basic procedure for sending messages.
    // You will find how to send synchronous and asynchronous messages.
    //
    // For asynchronous dispatch, the example application sets a callback
    // notification, to see what's happened with messages.
    
    package examples.modem;
    
    import org.smslib.AGateway;
    import org.smslib.AGateway.Protocols;
    import org.smslib.IUSSDNotification;
    import org.smslib.Library;
    import org.smslib.Service;
    import org.smslib.USSDResponse;
    import org.smslib.modem.SerialModemGateway;
    
    public class SendUSSD
    {
            public void doIt() throws Exception
            {
                    Service srv;
          USSDNotification ussdNotification = new USSDNotification();
                    System.out.println("Example: Send USSD Command from a serial gsm modem.");
                    System.out.println(Library.getLibraryDescription());
                    System.out.println("Version: " + Library.getLibraryVersion());
                    srv = new Service();
                    SerialModemGateway gateway = new SerialModemGateway("modem.com1", "COM4", 19200, "Huawei", "E220");
                    gateway.setProtocol(Protocols.PDU);
          gateway.setInbound(true);
                    gateway.setOutbound(true);
                    gateway.setSimPin("0000");
          srv.setUSSDNotification(ussdNotification);
                    srv.addGateway(gateway);
                    srv.startService();
                    System.out.println();
                    System.out.println("Modem Information:");
                    System.out.println("  Manufacturer: " + gateway.getManufacturer());
                    System.out.println("  Model: " + gateway.getModel());
                    System.out.println("  Serial No: " + gateway.getSerialNo());
                    System.out.println("  SIM IMSI: " + gateway.getImsi());
                    System.out.println("  Signal Level: " + gateway.getSignalLevel() + "%");
                    System.out.println("  Battery Level: " + gateway.getBatteryLevel() + "%");
                    System.out.println();
    
          String resp = gateway.sendUSSDCommand("*888#"); // not working
    //      String resp = gateway.sendCustomATCommand("AT+CUSD=1,\"*888#\",15\r"); // working
          System.out.println(resp);
    
          System.out.println("Now Sleeping - Hit <enter> to terminate.");
                    System.in.read();
                    srv.stopService();
            }
    
       public class USSDNotification implements IUSSDNotification
       {
          public void process(AGateway gateway, USSDResponse response) {
                            System.out.println("USSD handler called from Gateway: " + gateway.getGatewayId());
                            System.out.println(response);
          }
       }
    
            public static void main(String args[])
            {
                    SendUSSD app = new SendUSSD();
                    try
                    {
                            app.doIt();
                    }
                    catch (Exception e)
                    {
                            e.printStackTrace();
                    }
            }
    }
    
    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I have an app that make USSD calls, but after all USSD calls i
need help regarding USSD Gateway. I have to develop an app, which will directly
Have a look at one of my websites: moskah.com The problem is that it
I have seen this question so many times and has the answer of USSD
I have android test project that i've integrated into the Hudson. I have created
Have a network location that shows paths in the 8.3 short format. I need
Have data that has this kind of structure. Will be in ascending order by
Have data that has this kind of structure: $input = [ { animal: 'cat',
Have converted devise new session from erb to Haml but doens't work, this is
Have a bunch of WCF REST services hosted on Azure that access a SQL

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.