ICALLHISTORY queries | developer.brewmp.com ICALLHISTORY queries | developer.brewmp.com

Developer

ICALLHISTORY queries

Forums:

I have few queries regarding ICALLHISTORY:

1.Can you post an example on how to use ICALLHISTORY. While using ICALLHISTORY_AddEntry() its crashing. How do i use it?

2.Also inside "Shared" folder , i can see a file named "callhist". What is the use of this file?

3.Will this file get updated automatically if a call is simulated on the emulator?

Thanks in advance.

Could you post out your part codes here? So that we can help you.

Could you post out your part codes here? So that we can help you.

posting the code: The application crashes at Icallhistory_addentry():
ICallHistory* pICallHistory = NULL;
AEECallHistoryEntry *pche=(AEECallHistoryEntry*)MALLOC(sizeof(AEECallHistoryEntry));
AEECallHistoryField *temp;
int pnErr = AEE_SUCCESS;
char arr[] = {'1','2','3','4','5','6','\0'};
pche->wNumFields = 2;
pche->pFields = (AEECallHistoryField*) MALLOC(sizeof(AEECallHistoryField)*2);
pche->pFields->ClsId = 0;
pche->pFields->wID = AEECALLHISTORY_FIELD_CALL_TYPE;
pche->pFields->pData = (uint16*)MALLOC(sizeof(uint16));
MEMSET((uint16*)pche->pFields->pData,(uint16)AEECALLHISTORY_CALL_TYPE_FROM,sizeof(uint16));
pche->pFields->wDataLen = sizeof(uint16);
temp = pche->pFields + sizeof(AEECallHistoryField);
temp->ClsId = 0;
temp->wID = AEECALLHISTORY_FIELD_NUMBER;
temp->pData = (char*)MALLOC(6);
temp->wDataLen = sizeof(arr);
ISHELL_CreateInstance(pMe->pIShell,AEECLSID_CALLHISTORY,(void **)&pICallHistory);
pnErr = ICALLHISTORY_AddEntry(pICallHistory, pche);

posting the code: The application crashes at Icallhistory_addentry():
ICallHistory* pICallHistory = NULL;
AEECallHistoryEntry *pche=(AEECallHistoryEntry*)MALLOC(sizeof(AEECallHistoryEntry));
AEECallHistoryField *temp;
int pnErr = AEE_SUCCESS;
char arr[] = {'1','2','3','4','5','6','\0'};
pche->wNumFields = 2;
pche->pFields = (AEECallHistoryField*) MALLOC(sizeof(AEECallHistoryField)*2);
pche->pFields->ClsId = 0;
pche->pFields->wID = AEECALLHISTORY_FIELD_CALL_TYPE;
pche->pFields->pData = (uint16*)MALLOC(sizeof(uint16));
MEMSET((uint16*)pche->pFields->pData,(uint16)AEECALLHISTORY_CALL_TYPE_FROM,sizeof(uint16));
pche->pFields->wDataLen = sizeof(uint16);
temp = pche->pFields + sizeof(AEECallHistoryField);
temp->ClsId = 0;
temp->wID = AEECALLHISTORY_FIELD_NUMBER;
temp->pData = (char*)MALLOC(6);
temp->wDataLen = sizeof(arr);
ISHELL_CreateInstance(pMe->pIShell,AEECLSID_CALLHISTORY,(void **)&pICallHistory);
pnErr = ICALLHISTORY_AddEntry(pICallHistory, pche);

I checked the pICallHistory is NULL. So it got crashed.

I checked the pICallHistory is NULL. So it got crashed.

Hi Soyo,
I have checked and for me pICallHistory object is getting created properly and is not NULL. While iterating through the code, i can see that pICallHistory is not NULL, but still it crashes. :(

Hi Soyo,
I have checked and for me pICallHistory object is getting created properly and is not NULL. While iterating through the code, i can see that pICallHistory is not NULL, but still it crashes. :(

Try this:
ICallHistory* pICallHistory = NULL;
AEECallHistoryEntry *pche=(AEECallHistoryEntry*)MALLOC(sizeof(AEECallHistoryEntry));
AEECallHistoryField *temp;
int pnErr = AEE_SUCCESS;
char arr[] = {'1','2','3','4','5','6','\0'};
pche->wNumFields = 2;
pche->pFields = (AEECallHistoryField*) MALLOC(sizeof(AEECallHistoryField)*2);
pche->pFields->ClsId = 0;
pche->pFields->wID = AEECALLHISTORY_FIELD_CALL_TYPE;
pche->pFields->pData = (uint16*)MALLOC(sizeof(uint16));
MEMSET((uint16*)pche->pFields->pData,(uint16)AEECALLHISTORY_CALL_TYPE_FROM,sizeof(uint16));
pche->pFields->wDataLen = sizeof(uint16);
temp = pche->pFields + sizeof(AEECallHistoryField);
temp->ClsId = 0;
temp->wID = AEECALLHISTORY_FIELD_NUMBER;
temp->pData = (char*)MALLOC(STRLEN(arr)+1);
STRCPY(temp->pData, arr);
temp->wDataLen = sizeof(arr);
ISHELL_CreateInstance(pMe->pIShell,AEECLSID_CALLHISTORY,(void **)&pICallHistory);
pnErr = ICALLHISTORY_AddEntry(pICallHistory, pche);

Try this:
ICallHistory* pICallHistory = NULL;
AEECallHistoryEntry *pche=(AEECallHistoryEntry*)MALLOC(sizeof(AEECallHistoryEntry));
AEECallHistoryField *temp;
int pnErr = AEE_SUCCESS;
char arr[] = {'1','2','3','4','5','6','\0'};
pche->wNumFields = 2;
pche->pFields = (AEECallHistoryField*) MALLOC(sizeof(AEECallHistoryField)*2);
pche->pFields->ClsId = 0;
pche->pFields->wID = AEECALLHISTORY_FIELD_CALL_TYPE;
pche->pFields->pData = (uint16*)MALLOC(sizeof(uint16));
MEMSET((uint16*)pche->pFields->pData,(uint16)AEECALLHISTORY_CALL_TYPE_FROM,sizeof(uint16));
pche->pFields->wDataLen = sizeof(uint16);
temp = pche->pFields + sizeof(AEECallHistoryField);
temp->ClsId = 0;
temp->wID = AEECALLHISTORY_FIELD_NUMBER;
temp->pData = (char*)MALLOC(STRLEN(arr)+1);
STRCPY(temp->pData, arr);
temp->wDataLen = sizeof(arr);
ISHELL_CreateInstance(pMe->pIShell,AEECLSID_CALLHISTORY,(void **)&pICallHistory);
pnErr = ICALLHISTORY_AddEntry(pICallHistory, pche);

Hi Soyo,
Thanks for your reply,
I created a new project and tried the same code, now its not crashing, but the problem is
ICALLHISTORY_AddEntry() returns an error code of 14 and we can't see any entry in callhist file.
Any idea why this is so?
Is there any mandatory field to be included?
Is the code you pasted working for you?
I mean with that is any entry getting entered to callhist file??

Hi Soyo,
Thanks for your reply,
I created a new project and tried the same code, now its not crashing, but the problem is
ICALLHISTORY_AddEntry() returns an error code of 14 and we can't see any entry in callhist file.
Any idea why this is so?
Is there any mandatory field to be included?
Is the code you pasted working for you?
I mean with that is any entry getting entered to callhist file??