
Description | Termination Events | Cautions | Example | Errors | See Also
Name: |
int cl_SetTransactionUsrAttr(hDevice, idTransaction, pUsrAttr) | |
Inputs: |
long hDevice |
|
long idTransaction |
| |
void* pUsrAttr |
| |
Returns: |
0 on success -2 if call logging transaction already released | |
Includes: |
cllib.h | |
Mode: |
synchronous | |
The cl_SetTransactionUsrAttr( ) function sets the user-defined transaction attribute for a specified call logging transaction.
Parameter |
Description |
hDevice: |
The device handle of the call logging device. |
idTransaction: |
The call logging transaction ID. |
pUsrAttr: |
The pointer to the user-defined attribute for the specified call logging transaction. |
None
#include <cllib.h>
#include <stdio.h>
#include <malloc.h>
#include <memory.h>
typedef struct
{
time_t timeConnect;
time_t timeDisconnect;
} TRANSACTIONUSRATTR;
TRANSACTIONUSRATTR* SetTransactionUsrAttr(long hDevice, long idTransaction)
{
TRANSACTIONUSRATTR* pTransactionUsrAttr;
int iRet;
pTransactionUsrAttr = (TRANSACTIONUSRATTR*)malloc(sizeof(TRANSACTIONUSRATTR));
if (pTransactionUsrAttr == NULL)
{
printf("SetTransactionUsrAttr - malloc() failed\n");
return NULL;
}
memset(pTransactionUsrAttr, 0, sizeof(TRANSACTIONUSRATTR));
iRet = cl_SetTransactionUsrAttr(hDevice, idTransaction, pTransactionUsrAttr);
if (iRet != 0)
{
if (iRet == -2)
{
printf("SetTransactionUsrAttr - Transaction already released\n");
}
else
{
printf("SetTransactionUsrAttr - cl_SetTransactionUsrAttr() failed\n");
}
free(pTransactionUsrAttr);
return NULL;
}
return pTransactionUsrAttr;
}
If the function returns a value < 0, use the SRL Standard Attribute function ATDV_LASTERR( ) to obtain the error code or use ATDV_ERRMSGP( ) to obtain a descriptive error message. The error codes that can be returned by ATDV_LASTERR( ) are:
Error Code Value |
Returned When |
ECL_TRANSACTIONRELEASED |
transaction already released |
ECL_INTERNAL |
internal Call Logging error; cause unknown |
See 2.2 Error Handling for more information about what kinds of errors can cause these codes to be returned
Click here to contact Dialogic Customer Engineering
Copyright 2001, Dialogic Corporation