The Unstructured Supplementary Service Data (USSD) service provided by GSM/ WCDMA networks transmits information over the network's signalling channels.
USSD has been placed within the messaging functionality because of its potential use as a bearer for WAP or other overlying protocol. The USSD protocol is therefore suitable for implementation within a Sockets protocol (.PRT) module.
RMobileUssdMessaging allows clients to:
- open a USSD messaging sub-session using RMobileUssdMessaging::Open()
- get capabilities using RMobileUssdMessaging::GetCaps(). Capabilities are encapsulated in a packaged RMobileUssdMessaging::TMobileUssdCapsV1 object.
- wait for the next incoming USSD message using RMobileUssdMessaging::ReceiveMessage()
- send a UUSD message using RMobileUssdMessaging::SendMessage()
Example
The following code gets in aMessageData the contents, and in aUssdAtts the attributes, of the next USSD message received.
Code:
void CClientApp::ReceiveUssdMessageL(   RMobileUssdMessaging::TGsmUssdMessageData& aMessageData,   RMobileUssdMessaging::TMobileUssdAttributesV1& aUssdAtts)   {   // Open session   RMobileUssdMessaging ussdSession;   User::LeaveIfError(ussdSession.Open(iMobilePhone));   CleanupClosePushL(ussdSession);
  // Get ussd capabilities   RMobileUssdMessaging::TMobileUssdCapsV1 ussdCaps;   RMobileUssdMessaging::TMobileUssdCapsV1Pckg ussdCapsPckg(ussdCaps);   User::LeaveIfError(ussdSession.GetCaps(ussdCapsPckg));
  // Test if USSD messages can be received   if (ussdCaps.iUssdTypes & RMobileUssdMessaging::KCapsMTUssd)     {     // Get the next received Ussd message     RMobileUssdMessaging::TMobileUssdAttributesV1Pckg ussdAttsPckg(aUssdAtts);     TRequestStatus status;     ussdSession.ReceiveMessage(status, aMessageData, ussdAttsPckg);     User::WaitForRequest(status);     User::LeaveIfError(status.Int());     }      // Clean up   CleanupStack::PopAndDestroy(); // calls ussdSession.Close()   }
I am not sure what the attributes should be set to and I get the Error Etel Client Fault 8. Do I need to open the RMobilePhone before calling Open in the RMobileUssdMessaging class ? Please Help
I have tried SSUU code for receiving USSD messages and it works. I have made a similar code for sending USSD messages but I get a -6 (Bad Request) error in the status variable after sending the message. Do I have to use special Ussd attributes?? Any idea??
Forum posts: 52
The Unstructured Supplementary Service Data (USSD) service provided by GSM/ WCDMA networks transmits information over the network's signalling channels.
USSD has been placed within the messaging functionality because of its potential use as a bearer for WAP or other overlying protocol. The USSD protocol is therefore suitable for implementation within a Sockets protocol (.PRT) module.
RMobileUssdMessaging allows clients to:
- open a USSD messaging sub-session using RMobileUssdMessaging::Open()
- get capabilities using RMobileUssdMessaging::GetCaps(). Capabilities are encapsulated in a packaged RMobileUssdMessaging::TMobileUssdCapsV1 object.
- wait for the next incoming USSD message using RMobileUssdMessaging::ReceiveMessage()
- send a UUSD message using RMobileUssdMessaging::SendMessage()
Example
The following code gets in aMessageData the contents, and in aUssdAtts the attributes, of the next USSD message received.
  RMobileUssdMessaging::TGsmUssdMessageData& aMessageData,
  RMobileUssdMessaging::TMobileUssdAttributesV1& aUssdAtts)
  {
  // Open session
  RMobileUssdMessaging ussdSession;
  User::LeaveIfError(ussdSession.Open(iMobilePhone));
  CleanupClosePushL(ussdSession);
  // Get ussd capabilities
  RMobileUssdMessaging::TMobileUssdCapsV1 ussdCaps;
  RMobileUssdMessaging::TMobileUssdCapsV1Pckg ussdCapsPckg(ussdCaps);
  User::LeaveIfError(ussdSession.GetCaps(ussdCapsPckg));
  // Test if USSD messages can be received
  if (ussdCaps.iUssdTypes & RMobileUssdMessaging::KCapsMTUssd)
    {
    // Get the next received Ussd message
    RMobileUssdMessaging::TMobileUssdAttributesV1Pckg ussdAttsPckg(aUssdAtts);
    TRequestStatus status;
    ussdSession.ReceiveMessage(status, aMessageData, ussdAttsPckg);
    User::WaitForRequest(status);
    User::LeaveIfError(status.Int());
    }
  Â
  // Clean up
  CleanupStack::PopAndDestroy(); // calls ussdSession.Close()
  }
NewLC #2150
Forum posts: 14
i could send ussd codes using AT commands, despite i would like to know how can i access to the description of this library, because it's not public.
thanks,
bye.
Forum posts: 63
CleanupClosePushL(ussdSession);
RMobileUssdMessaging::TGsmUssdMessageData aMessageData;
RMobileUssdMessaging::TMobileUssdAttributesV1 aUssdAtts;
// fill in message and attributes
aMessageData.Copy(_L8("#999#"));
aUssdAtts.iFlags = 0;
aUssdAtts.iFormat = 0;
aUssdAtts.iType = 0;
aUssdAtts.iDcs = 0;
RMobileUssdMessaging::TMobileUssdAttributesV1Pckg ussdAttsPckg(aUssdAtts);
TRequestStatus status;
ussdSession.SendMessage(status, aMessageData, ussdAttsPckg);
User::WaitForRequest(status);
User::LeaveIfError(status.Int());
CleanupStack::PopAndDestroy(); // calls ussdSession.Close()
I am not sure what the attributes should be set to and I get the Error Etel Client Fault 8. Do I need to open the RMobilePhone before calling Open in the RMobileUssdMessaging class ?
Forum posts: 14
i use AT commands to send USSD codes and it works, if you prefer to use this way post me.
Bye.
Benji.
Forum posts: 63
Forum posts: 14
i can get the AT command response but it's the code sent if successful.
The message received from the operator is shown directly by the OS and the application cannot capture it.
bye.
Forum posts: 63
Thanks.
Forum posts: 63
Forum posts: 14
here you are:
User::LeaveIfError(StartC32()); //Arrancamos el servidor de comm
RCommServ commServer;
CleanupClosePushL( commServer );
User::LeaveIfError(commServer.Connect());
_LIT(KCsyName, "dataport");
User::LeaveIfError(commServer.LoadCommModule(KCsyName));
_LIT(KDataPort, "DATAPORT::1");
TBuf<20> port(KDataPort);
RComm commW;
CleanupClosePushL( commW );
User::LeaveIfError(commW.Open(commServer, port, ECommShared));
TBuf8<128> atCommand;
atCommand.Append(_L8("AT+CUSD=1,\""));
atCommand.Append(aUssdCode);
atCommand.Append(_L8("\",15\r\n"));
TRequestStatus callStatus;
commW.Write(callStatus, atCommand);
User::WaitForRequest(callStatus);
User::After(1000);
if(callStatus.Int() == KErrNone)
{
TBuf8<128> replyBuf;
commW.Read(callStatus, TTimeIntervalMicroSeconds32(1000000), replyBuf);
HBufC* msg = HBufC::NewL(replyBuf.Length()*2);
(msg->Des()).Copy(replyBuf);
User::LeaveIfError(replyBuf.Compare(atCommand)==0);
}else
{
User::Leave(callStatus.Int());
}
CleanupStack::PopAndDestroy( &commW );
CleanupStack::PopAndDestroy( &commServer );
Forum posts: 63
Forum posts: 63
Forum posts: 14
bye.
Forum posts: 12
I have tried SSUU code for receiving USSD messages and it works. I have made a similar code for sending USSD messages but I get a -6 (Bad Request) error in the status variable after sending the message. Do I have to use special Ussd attributes?? Any idea??
Thanks
Forum posts: 1
comipler report many errors when I am trying ssuu's code,anybody can tell me how to get it ?