Using ICall Interface | developer.brewmp.com Using ICall Interface | developer.brewmp.com

Developer

Using ICall Interface

Forums:

hello Everybody,
I am new to brew and want to write an application 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 anybody 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

What exactly is the error code that you get?

What exactly is the error code that you get?

you can not create ICall directly like this.
Following are the steps to get ICall:
- Create ITelephone using ISHELL_CreateInstance
- Use ITELEPHONE_GetCalls to get Call Descriptors for active calls
- Create ICallMgr using ISHELL_CreateInstance
- use ICALLMGR_GetCall to get ICall (Note: pass the Call Descriptor you got from step 2. You need to pass only one descriptor. "the first one" to get ICall for first call. there could be multiple calls active at the same time.)
- Finally you can use ICall to answer the call

you can not create ICall directly like this.
Following are the steps to get ICall:
- Create ITelephone using ISHELL_CreateInstance
- Use ITELEPHONE_GetCalls to get Call Descriptors for active calls
- Create ICallMgr using ISHELL_CreateInstance
- use ICALLMGR_GetCall to get ICall (Note: pass the Call Descriptor you got from step 2. You need to pass only one descriptor. "the first one" to get ICall for first call. there could be multiple calls active at the same time.)
- Finally you can use ICall to answer the call