Take the 2-minute tour ×
Ask Ubuntu is a question and answer site for Ubuntu users and developers. It's 100% free, no registration required.

Basically what I want to do is to check my balance of my prepaid SIM-Card, which is located in a 3G-Modem (USB).

Some background information:

  1. The provider of my 3G-Internet (called Beeline) is also offering cell phone services. To check the balance on any SIM-Card I can just type *102# on any mobile phone and will receive back a notice of my balance. So what always works is to take out the SIM-Card out of the modem into a cell-phone and check the balance by "calling" *102#
  2. The modem came with a windows-program which has a button "check balance". I don't want to try to emulate this program with wine for various reasons. And I don't have to because --Thank Ubuntu-- the modem is running without any problems out of the box.

My thought would be: Is there a possibility of doing these USSD-requests (which don't seem to be a problem with any random phone) via the 3G-Modem through Ubuntu?

share|improve this question

1 Answer 1

up vote 0 down vote accepted

These "hash-tag-request" are called USSD. Searching this keyword you'll find different solutions:

  1. Gammu can send USSD request and receive it back via the command gammu getussd *102#. As pointed out here some GSM modems might require a quite complicated transformation of the USSD-code. Make sure you have the rights to read the device /dev/ttyUSB0 (or similar). An example can be found here.

  2. Gsm-ussd seems to be easier to use than gammu for ussd but has less features overall. It is not in the official repositories, download from here and configure it similar to this.

  3. Prepaid-manager-applet has nice graphical interface and is in the official repositories. This is probably the easiest and definitely the nicest solution. Chances are that your provider is already listed so you don't have to do anything. If it is not add the USSD-number to '/usr/share/mobile-broadband-provider-info/serviceproviders.xml'. Find the section of your country and provider and add

    <balance-check>
        <ussd>*102#</ussd>
    </balance-check>
    

    whereas *102# has to be replaced by your providers USSD-code. It looks as sophisticated as this:

Screenshot of the Prepaid-Manager-Applet

share|improve this answer

Your Answer

 
discard

By posting your answer, you agree to the privacy policy and terms of service.

Not the answer you're looking for? Browse other questions tagged or ask your own question.