using ITAPI Interface | developer.brewmp.com using ITAPI Interface | developer.brewmp.com

Developer

using ITAPI Interface

Forums:

Hello Everybody,
I am totally new to brew and this is my first effort and i am trying to make a voice call using ITAPI interface. But when i create a instance of ITAPI interface using ISHELL_CreateInstance the function always returns me null object . I cannot understand where i am going wrong. This is the code what i wrote, the struct is generated by brew wizard

typedef struct _CallHook {
AEEApplet a ;
AEEDeviceInfo DeviceInfo;
IDisplay *pIDisplay;
IShell *pIShell;
CallHook;

boolean MakeVoiceCall(CallHook* pMe , const char * number)
{
ITAPI *pITAPI;
ISHELL_CreateInstance(pMe->pIShell, AEECLSID_TAPI,(void **)&pITAPI);

if(pITAPI == NULL)
{
return FALSE;
}
ITAPI_MakeVoiceCall(pITAPI, number, 0);
return true

After ISHELL_CreateInstance call pITAPI is still null. Can anybody please tell me what is wrong in this code.
Thanks a lot in advance.

Did you verified the retun type of the it must return SUCCESS else if it is ECLASSNOTSUPPORT then you must not have req. privilages.

Did you verified the retun type of the it must return SUCCESS else if it is ECLASSNOTSUPPORT then you must not have req. privilages.

I checked the return type and i get EPRIVLEVEL i.e 21 instead of success. It is security violation. Can you please let me know what to do in this case?

I checked the return type and i get EPRIVLEVEL i.e 21 instead of success. It is security violation. Can you please let me know what to do in this case?

I think you not given the TAPI privilage to your application by using mif editor->privilage tab

I think you not given the TAPI privilage to your application by using mif editor->privilage tab

Hello sunil,
Thanx a lot for the last suggestion. I am now able to make voice call.But i am having a problem with ICALL interface.
Actually After making a call using ITAPI i am writing another function which can receive an outside call , answer the call and after say few seconds end it. I am simulating the incomming call use the ITAPI Interface from the simulator and i call my procedure of receiving the call in the EVT_APP_SUSPEND event. this is the code i wrote to receive the call
boolean ReceiveVoiceCall(CallHook* pMe)
{
ICall * pICall;
AECHAR szText[] = {'C','A','L','L','E','N','D','E', 'D','\0'};
int nret;
if (ISHELL_CreateInstance(pMe->pIShell, AEECLSID_CALL,(void **)&pICall) == SUCCESS)
{
nret = ICALL_Answer(pICall);
if (nret == 0)
{
nret = ICALL_End(pICall);
if (nret==0)
{
IDISPLAY_DrawText(pMe->pIDisplay, AEE_FONT_BOLD, szText, -1,
0,
0,
NULL,
IDF_ALIGN_CENTER | IDF_ALIGN_MIDDLE);
IDISPLAY_Update (pMe->pIDisplay);
}
}
.
But i am not able to create the Icall instance using ISHELL_CreateInstance it returns failure. first i got out of memory error then i added the icall dependency in the mif file of the project. I created icall.bid and added it to the mif of the project then i get now failure return . i dont know if there is some privelage to be given in mif but i looked at it and could not fine any option.
Can u please let me know what i am wrong or any steps i have forgotten? or how can i receive a call and end it ?
thanx a lot in advance

Hello sunil,
Thanx a lot for the last suggestion. I am now able to make voice call.But i am having a problem with ICALL interface.
Actually After making a call using ITAPI i am writing another function which can receive an outside call , answer the call and after say few seconds end it. I am simulating the incomming call use the ITAPI Interface from the simulator and i call my procedure of receiving the call in the EVT_APP_SUSPEND event. this is the code i wrote to receive the call
boolean ReceiveVoiceCall(CallHook* pMe)
{
ICall * pICall;
AECHAR szText[] = {'C','A','L','L','E','N','D','E', 'D','\0'};
int nret;
if (ISHELL_CreateInstance(pMe->pIShell, AEECLSID_CALL,(void **)&pICall) == SUCCESS)
{
nret = ICALL_Answer(pICall);
if (nret == 0)
{
nret = ICALL_End(pICall);
if (nret==0)
{
IDISPLAY_DrawText(pMe->pIDisplay, AEE_FONT_BOLD, szText, -1,
0,
0,
NULL,
IDF_ALIGN_CENTER | IDF_ALIGN_MIDDLE);
IDISPLAY_Update (pMe->pIDisplay);
}
}
.
But i am not able to create the Icall instance using ISHELL_CreateInstance it returns failure. first i got out of memory error then i added the icall dependency in the mif file of the project. I created icall.bid and added it to the mif of the project then i get now failure return . i dont know if there is some privelage to be given in mif but i looked at it and could not fine any option.
Can u please let me know what i am wrong or any steps i have forgotten? or how can i receive a call and end it ?
thanx a lot in advance

You must use ICALLMGR_GetCall() to get a pointer to ICall not creat directly.

You must use ICALLMGR_GetCall() to get a pointer to ICall not creat directly.

thanx sunil
i will have a look at this. I also looked at the doc and found intresting about itelephone which i think is also another way of doing it i want to give try to both of them which ever works.

thanx sunil
i will have a look at this. I also looked at the doc and found intresting about itelephone which i think is also another way of doing it i want to give try to both of them which ever works.