
Description | Termination Events | Cautions | Example | Errors | See Also
Name: |
int cl_SetUsrAttr(hDevice, pUsrAttr) | |
Inputs: |
long hDevice |
|
void* pUsrAttr |
| |
Returns: |
0 on success | |
Includes: |
cllib.h | |
Mode: |
synchronous | |
The cl_SetUsrAttr( ) function sets the user-defined attribute for a call logging device. When possible, the user-defined attribute for a call logging device should be specified by the pUsrAttr parameter of the cl_Open( ) function.
Parameter |
Description |
hDevice: |
The device handle of the call logging device. |
pUsrAttr: |
The pointer to the user-defined attribute for the specified call logging device. |
None
#include <srllib.h>
#include <cllib.h>
#include <stdio.h>
#include <malloc.h>
#include <memory.h>
/* The Call Logging Device Handle */
extern long g_hDevice;
typedef struct
{
const char* pszProtocol;
const char* pszNetworkDeviceName;
const char* pszUserDeviceName;
} DEVICEUSRATTR;
extern DEVICEUSRATTR* GetDeviceUsrAttr(long hDevice);
void SetDeviceUsrAttr(const char* pszProtocol, const char* pszNetworkDeviceName, const char* pszUserDeviceName)
{
DEVICEUSRATTR* pNewDeviceUsrAttr;
DEVICEUSRATTR* pOldDeviceUsrAttr;
if (g_hDevice != EV_ANYDEV)
{
pNewDeviceUsrAttr = (DEVICEUSRATTR*)malloc(sizeof(DEVICEUSRATTR));
if (pNewDeviceUsrAttr == NULL)
{
printf("SetDeviceUsrAttr - malloc() failed\n");
return;
}
memset(pNewDeviceUsrAttr, 0, sizeof(DEVICEUSRATTR));
pNewDeviceUsrAttr->pszProtocol = pszProtocol;
pNewDeviceUsrAttr->pszNetworkDeviceName = pszNetworkDeviceName;
pNewDeviceUsrAttr->pszUserDeviceName = pszUserDeviceName;
pOldDeviceUsrAttr = GetDeviceUsrAttr(g_hDevice);
if (cl_SetUsrAttr(g_hDevice, pNewDeviceUsrAttr) != 0)
{
printf("SetDeviceUsrAttr - cl_SetUsrAttr() failed\n");
free(pNewDeviceUsrAttr);
return;
}
free(pOldDeviceUsrAttr);
}
}
None.
Click here to contact Dialogic Customer Engineering
Copyright 2001, Dialogic Corporation