Description:
This method is used to send SMS messages from the handset.This function can
be used to send text messages to either a specific BREW application on another handset
or a general text message to the handset. It sends messages to a destination mobile
number or an email ID. When this function is called, it is likely that it will result
in a SUSPEND/RESUME sequence to the BREW application. This is initiated by the handset
when it sends the SMS message out.~
The sequential flow of control is as follows:
~
1. The application invokes ITAPI_SendSMS()
2. The handset begins the process of sending the SMS message out
3. The notification function specified by pfn is invoked with the status of
the message delivery
*
Associated with this process, the application may receive EVT_APP_SUSPEND and
EVT_APP_RESUME events sometime after step 1.
Parameters:
pITapi : Pointer to the ITAPI Interface object
pszDst : Number or email ID of the destination where message must be sent to.
If this is set to NULL and if clsDst is non-zero, this function sends the EVT_APP_MESSAGE
event to the application (clsDst) on the local handset and the dwParam of that event
shall contain pszMsg. In this case, the return value of the function is the same
as the return value of ISHELL_SendEvent(). The notification function will not be
called since this is a local delivery of the message.
pszMsg : Text message to be sent to the destination mobile.
ITAPI_SendSMS() expects text message to be in device encoding and uses byte,
double byte for device encoding UNICODE, set to 0 as message delimiter.
If pszMsg is set to NULL, the function returns EBADPARM
clsID : If non-zero, it specifies the class ID of the BREW application on the
destination mobile to which this message must be sent
pfn : Notification function that is invoked to inform the status of the SMS
message sent
pUser : User data to be sent to the notification function
Examples:
===pre>
if (nDeviceEncoding == AEE_ENC_UNICODE)
{
ITAPI_SendSMS (pITapi, "8581112222", (char*)STRTOWSTR("Hello World", pBuffer, nBufSize), 0, MyMOSMSNotify, pMe );
ITAPI_SendSMS ( pITapi, "foo@sample.com", (char*)STRTOWSTR("Hello World", pBuffer, nBufSize), 0, MyMOSMSNotify, pMe );
}
else
{
ITAPI_SendSMS (pITapi, "8581112222", "Hello World", 0, MyMOSMSNotify, pMe );
ITAPI_SendSMS ( pITapi, "foo@sample.com", "Hello World", 0, MyMOSMSNotify, pMe );
}
===/pre>
Return Value:
SUCCESS, if message is accepted for delivery by ITAPI. This success doesn't indicate
the successful submission of the message to SMSC for delivery.
EITEMBUSY, if ITAPI determines that the device is busy and cannot send this SMS.
Generally, a SMS message cannot be sent if the notification function has not yet been
called for a previously sent SMS message.
EBADPARM, if pszMsg is NULL or pszDst and clsDst are both set to NULL.
EBADCLASS, if TAPI is not enabled on this handset.
EFAILED, if there is a general failure in sending the SMS.
Comments:
NOTE: This function may cause some devices to experience difficulties when attempting
to send long messages.
NOTE: The status passed to the notification function will be success if message was
successfully submitted to SMSC for delivery. The status passed to the notification
function can be EITEMBUSY or EFAILED to indicate problem in submitting the message
to SMSC for delivery.