API Reference | developer.brewmp.com API Reference | developer.brewmp.com

Developer

API Reference

ITAPI_SENDSMS()

Brew Release
Brew MP 1.0.2
See Also
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. (See the AEEEvent topic for specific information about events.)
Params
pITapi
[]:
Pointer to the ITAPI interface object.
pszDst
[]:
Number or email ID of the destination where the message must be sent. If this is set to NULL and 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 because 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. (See the AEEDeviceItem topic.)
clsID
[]:
If non-zero, it specifies the class ID of the Brew MP application on the destination mobile device 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.

Interface
Prototype
  •     int ITAPI_SendSMS(ITAPI *pITapi, const char * pszDst, const char * pszMsg, AEECLSID clsDst, 
        PFNSMSSTATUS pfn, void *pUser);
    
Return
  • AEE_SUCCESS : The message is accepted for delivery by ITAPI. This success doesn't indicate the successful submission of the message to SMSC for delivery. AEE_EITEMBUSY : 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. AEE_EBADPARM : pszMsg is NULL or pszDst and clsDst are both set to NULL. AEE_EUNSUPPORTED : SMS is not enabled on this handset. AEE_EFAILED : a general failure in sending the SMS.
Side Effect
  • Depending on the state of the device, a traffic call may be set up to send the SMS message.
Comments
This function may cause some devices to experience difficulties when attempting to send long messages. 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.