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.
const char * pszDst,
const char * pszMsg,
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() interprets the text message to be in encoding specified by device item AEE_DEVICEITEM_TAPI_SMS_ENCODING.
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
Following examples demonstrate the use of ITAPI_SendSMS() on a device where
device item AEE_DEVICEITEM_TAPI_SMS_ENCODING value is AEE_ENC_ISOLATIN1.
ITAPI_SendSMS (pITapi, "8581112222", "Hello World", 0, MyMOSMSNotify, pMe );
ITAPI_SendSMS ( pITapi, "firstname.lastname@example.org", "Hello World", 0, MyMOSMSNotify, pMe );
Likewise, following examples demonstrate the use of ITAPI_SendSMS() on a device where
device item AEE_DEVICEITEM_TAPI_SMS_ENCODING value is AEE_ENC_UNICODE.
ITAPI_SendSMS (pITapi, "8581112222", (char*)STRTOWSTR("Hello World", pBuffer, nBufSize), 0, MyMOSMSNotify, pMe );
ITAPI_SendSMS ( pITapi, "email@example.com", (char*)STRTOWSTR("Hello World", pBuffer, nBufSize), 0, MyMOSMSNotify, pMe );
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.
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.
Introduced BREW Client 2.0
typedef void (*PFNSMSSTATUS)(void * pUser, int status);
pUser: User-specific data that will be passed back to the notification function when invoked by BREW
status: Status of the msg delivery. This will be set to AEEMOSMS_ERR_*
AEEMOSMS_ERR_NO_ERR : SUCCESSfully sent. Indicates the message has been sent to network.
AEEMOSMS_ERR_OUTOF_RESOURCES : Device is temporarily out of resources.
AEEMOSMS_ERR_NETWORK_NOT_READY : Network is not reachable or ready for device to communicate.
AEEMOSMS_ERR_TRANSPORT_TEMP : Network temporarily refused message. Application may retry.
AEEMOSMS_ERR_TRANSPORT_PERM : Network rejected the message.
AEEMOSMS_ERR_INTERNAL : An internal error occured.
here I am trying to get the value of pUser which is given by the user depending on the value of status.