Regarding ISMS interface | developer.brewmp.com Regarding ISMS interface | developer.brewmp.com

Developer

Regarding ISMS interface

Forums:

Hi
Can anybody guide me how to use ISMS interface to send SMS .

Refer BREW API Reference.
-Karthik

Refer BREW API Reference.
-Karthik

Also, there are many posts regarding ISMS in this forum from where you can get complete example.
Regards,
Shashi Kant

Also, there are many posts regarding ISMS in this forum from where you can get complete example.
Regards,
Shashi Kant

- instantiate AEECLSID_SMS interface.
- instantiate AEECLSID_SMSMSG interface.
just like IWEB interface you need to add set of options like to AEECLSID_SMSMSG
Then initialize callback object by using CALLBACK_Init and then call ISMS_SendMsg with the ISMSMSG, callback object.

- instantiate AEECLSID_SMS interface.
- instantiate AEECLSID_SMSMSG interface.
just like IWEB interface you need to add set of options like to AEECLSID_SMSMSG
Then initialize callback object by using CALLBACK_Init and then call ISMS_SendMsg with the ISMSMSG, callback object.

ruben wrote:- instantiate AEECLSID_SMS interface.
- instantiate AEECLSID_SMSMSG interface.
just like IWEB interface you need to add set of options like to AEECLSID_SMSMSG
Then initialize callback object by using CALLBACK_Init and then call ISMS_SendMsg with the ISMSMSG, callback object.
Hi ruben
I 've copied the following code for sending sms.
void BookMyShow4_SendSMS(BookMyShow4 *pMe)
{
boolean nResult;
//IWebOpts sOpts;
SMSMsgOpt sOpts[2];
TAPIStatus pStatus;
pMe->pISMS = NULL;
pMe->pISMSMsg = NULL;
pMe->pITAPI = NULL;
nResult = ISHELL_CreateInstance(pMe->a.m_pIShell,AEECLSID_SMSMSG,(void**)&(pMe->pISMSMsg));
// Make a new SMS service
nResult = ISHELL_CreateInstance(pMe->a.m_pIShell,AEECLSID_SMS,(void**)&(pMe->pISMS));
// Configure our options buffer. Options will be added
// "one at a time"
sOpts[1].nId = MSGOPT_END;
sOpts[1].pVal = NULL;
// We need to instruct the ISMSMessage to copy options that
// are passed
sOpts[0].nId = MSGOPT_COPYOPTS;
sOpts[0].pVal = (void *)TRUE;
ISMSMSG_AddOpt(pMe->pISMSMsg, (WebOpt *)&sOpts);
// Set the destination address on our outbound sms message
sOpts[0].nId = MSGOPT_TO_DEVICE_SZ;
//This is the phone no.
sOpts[0].pVal = (void *)"+919910152405";
ISMSMSG_AddOpt(pMe->pISMSMsg, (WebOpt *)&sOpts);
// priority
sOpts[0].nId = MSGOPT_PRIORITY;
sOpts[0].pVal = (void *)AEESMS_PRIORITY_NORMAL;
ISMSMSG_AddOpt(pMe->pISMSMsg, (WebOpt *)&sOpts);
// sender address (from). We get the sender's MDN from ITAPI
nResult = ISHELL_CreateInstance(pMe->a.m_pIShell,AEECLSID_TAPI,(void **)&pMe->pITAPI);
ITAPI_GetStatus(pMe->pITAPI,&pStatus);
ITAPI_Release(pMe->pITAPI);
sOpts[0].nId = MSGOPT_FROM_DEVICE_SZ;
sOpts[0].pVal = (void *)&pStatus.szMobileID[5];
ISMSMSG_AddOpt(pMe->pISMSMsg, (WebOpt *)&sOpts);
sOpts[0].nId = MSGOPT_MOSMS_ENCODING;
sOpts[0].pVal = (void *)AEESMS_ENC_ASCII;
ISMSMSG_AddOpt(pMe->pISMSMsg, (WebOpt *)&sOpts);
sOpts[0].nId = MSGOPT_PAYLOAD_SZ;
sOpts[0].pVal = (void *)"Hello World";
ISMSMSG_AddOpt(pMe->pISMSMsg, (WebOpt *)&sOpts);
sOpts[0].nId = MSGOPT_PAYLOAD_ENCODING;
sOpts[0].pVal = (void *)AEE_ENC_ISOLATIN1;
ISMSMSG_AddOpt(pMe->pISMSMsg, (WebOpt *)&sOpts);
CALLBACK_Init(&pMe->m_sSendMessageCallback,SMSSendCB,pMe);
ISMS_SendMsg(pMe->pISMS,pMe->pISMSMsg,&pMe->m_sSendMessageCallback,&pMe->m_dwSMSSendResult);
IDISPLAY_ClearScreen(pMe->a.m_pIDisplay);
IDISPLAY_DrawText(pMe->a.m_pIDisplay,AEE_FONT_NORMAL,L"Message sent",-1,30,30,NULL,IDF_ALIGN_MIDDLE);
IDISPLAY_Update(pMe->a.m_pIDisplay);

The code is displaying "Message sent" . but nothing is sent to the phone in real. What could be the reason?
Edit/Delete Message

ruben wrote:- instantiate AEECLSID_SMS interface.
- instantiate AEECLSID_SMSMSG interface.
just like IWEB interface you need to add set of options like to AEECLSID_SMSMSG
Then initialize callback object by using CALLBACK_Init and then call ISMS_SendMsg with the ISMSMSG, callback object.
Hi ruben
I 've copied the following code for sending sms.
void BookMyShow4_SendSMS(BookMyShow4 *pMe)
{
boolean nResult;
//IWebOpts sOpts;
SMSMsgOpt sOpts[2];
TAPIStatus pStatus;
pMe->pISMS = NULL;
pMe->pISMSMsg = NULL;
pMe->pITAPI = NULL;
nResult = ISHELL_CreateInstance(pMe->a.m_pIShell,AEECLSID_SMSMSG,(void**)&(pMe->pISMSMsg));
// Make a new SMS service
nResult = ISHELL_CreateInstance(pMe->a.m_pIShell,AEECLSID_SMS,(void**)&(pMe->pISMS));
// Configure our options buffer. Options will be added
// "one at a time"
sOpts[1].nId = MSGOPT_END;
sOpts[1].pVal = NULL;
// We need to instruct the ISMSMessage to copy options that
// are passed
sOpts[0].nId = MSGOPT_COPYOPTS;
sOpts[0].pVal = (void *)TRUE;
ISMSMSG_AddOpt(pMe->pISMSMsg, (WebOpt *)&sOpts);
// Set the destination address on our outbound sms message
sOpts[0].nId = MSGOPT_TO_DEVICE_SZ;
//This is the phone no.
sOpts[0].pVal = (void *)"+919910152405";
ISMSMSG_AddOpt(pMe->pISMSMsg, (WebOpt *)&sOpts);
// priority
sOpts[0].nId = MSGOPT_PRIORITY;
sOpts[0].pVal = (void *)AEESMS_PRIORITY_NORMAL;
ISMSMSG_AddOpt(pMe->pISMSMsg, (WebOpt *)&sOpts);
// sender address (from). We get the sender's MDN from ITAPI
nResult = ISHELL_CreateInstance(pMe->a.m_pIShell,AEECLSID_TAPI,(void **)&pMe->pITAPI);
ITAPI_GetStatus(pMe->pITAPI,&pStatus);
ITAPI_Release(pMe->pITAPI);
sOpts[0].nId = MSGOPT_FROM_DEVICE_SZ;
sOpts[0].pVal = (void *)&pStatus.szMobileID[5];
ISMSMSG_AddOpt(pMe->pISMSMsg, (WebOpt *)&sOpts);
sOpts[0].nId = MSGOPT_MOSMS_ENCODING;
sOpts[0].pVal = (void *)AEESMS_ENC_ASCII;
ISMSMSG_AddOpt(pMe->pISMSMsg, (WebOpt *)&sOpts);
sOpts[0].nId = MSGOPT_PAYLOAD_SZ;
sOpts[0].pVal = (void *)"Hello World";
ISMSMSG_AddOpt(pMe->pISMSMsg, (WebOpt *)&sOpts);
sOpts[0].nId = MSGOPT_PAYLOAD_ENCODING;
sOpts[0].pVal = (void *)AEE_ENC_ISOLATIN1;
ISMSMSG_AddOpt(pMe->pISMSMsg, (WebOpt *)&sOpts);
CALLBACK_Init(&pMe->m_sSendMessageCallback,SMSSendCB,pMe);
ISMS_SendMsg(pMe->pISMS,pMe->pISMSMsg,&pMe->m_sSendMessageCallback,&pMe->m_dwSMSSendResult);
IDISPLAY_ClearScreen(pMe->a.m_pIDisplay);
IDISPLAY_DrawText(pMe->a.m_pIDisplay,AEE_FONT_NORMAL,L"Message sent",-1,30,30,NULL,IDF_ALIGN_MIDDLE);
IDISPLAY_Update(pMe->a.m_pIDisplay);

The code is displaying "Message sent" . but nothing is sent to the phone in real. What could be the reason?
Edit/Delete Message

In
ISMSMSG_AddOpt(pMe->pISMSMsg, (WebOpt *)&sOpts);
the second parameter is WebOpt instead of SMSMsgOpt
syntax is:
int ISMSMSG_AddOpt(ISMSMsg *po, SMSMsgOpt *apwoz)
- syed

In
ISMSMSG_AddOpt(pMe->pISMSMsg, (WebOpt *)&sOpts);
the second parameter is WebOpt instead of SMSMsgOpt
syntax is:
int ISMSMSG_AddOpt(ISMSMsg *po, SMSMsgOpt *apwoz)
- syed

syedba wrote:In
ISMSMSG_AddOpt(pMe->pISMSMsg, (WebOpt *)&sOpts);
the second parameter is WebOpt instead of SMSMsgOpt
syntax is:
int ISMSMSG_AddOpt(ISMSMsg *po, SMSMsgOpt *apwoz)
- syed
I 've done the desired modifications in my code but still it is not responding.

syedba wrote:In
ISMSMSG_AddOpt(pMe->pISMSMsg, (WebOpt *)&sOpts);
the second parameter is WebOpt instead of SMSMsgOpt
syntax is:
int ISMSMSG_AddOpt(ISMSMsg *po, SMSMsgOpt *apwoz)
- syed
I 've done the desired modifications in my code but still it is not responding.