Download the source code
Unstructured Supplementary Service Data (USSD) is GSM technology used to send short message from mobile device to GSM network. It uses the signaling channel of GSM connection and can have up to 182 bytes in length. The messages received on the device are not saved. It has different set of applications and most common use of USSD message is balance enquiry. For example “*123#” used for balance enquiry in India. For a more detailed explanation of USSD messages refer to the Wikipedia.
The TAPI API lineSendUSSD is used to send the USSD command. The syntax is defined as:
LONG WINAPI lineSendUSSD(HLINE hLine,const BYTE * const lpbUSSD,DWORD dwUSSDSize,DWORD dwFlags);
The hLine parameter is the handle to the line and lpbUSSD is a pointer to USSD command. The dwUSSDSize parameter is the length of th USSD command and dwFlags flags to the USSD command which will be 0 in most cases.
The function returns a positive request identifier and is completed asynchronously. A negative integer will returned if an error occurs. The sample application presented here uses a database to store USSD commands. The application lists all the commands in the database in a list control. You can add, edit or delete the entries. Upon double clicking an entry the application sends corresponding USSD command using the Cellular Line.