
Description | Termination Events | Cautions | Example | Errors | See Also
Name: |
int cl_GetChannel(hDevice, pclEventData, pszChannel, iChannelSize) | |
Inputs: |
long hDevice |
|
CL_EVENTDATA* pclEventData |
| |
char* pszChannel |
| |
int iChannelSize |
| |
Returns: |
0 on success -2 if call logging transaction already released | |
Includes: |
cllib.h | |
Mode: |
synchronous | |
The cl_GetChannel( ) function gets the channel number, at event time. The value returned is that of the semantics-defined CHANNEL variable. The function returns the channel number as the number would have appeared at the time the CLEV_MESSAGE event was generated.
Parameter |
Description |
hDevice: |
The device handle of the call logging device. |
pclEventData: |
A pointer to the call logging event data block obtained from sr_getevtdatap( ) while the function was processing a CLEV_MESSAGE event. See Section 1.5.2. Retrieving Event Datafor more information. |
pszChannel: |
The pointer to the buffer into which the channel number is returned as an ASCIIZ string. |
iChannelSize: |
The size of the buffer into which the channel number is returned, where the maximum size includes the terminating NUL of the ASCIIZ string. |
None
#include <cllib.h>
#include <stdio.h>
void GetChannel_WithinEventHandler(long hDevice, CL_EVENTDATA* pclEventData)
{
int iRet;
char szChannel[8];
iRet = cl_GetChannel(hDevice, pclEventData, szChannel, sizeof(szChannel));
if (iRet != 0)
{
if (iRet == -2)
{
printf("GetChannel_WithinEventHandler - Transaction already released\n");
}
else
{
printf("GetChannel_WithinEventHandler - cl_GetChannel() failed\n");
}
return;
}
printf("Bearer channel number is: \"%s\"\n", szChannel);
}
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_NULLPARAMETER |
invalid NULL parameter |
ECL_INVALIDCONTEXT |
invalid event context |
ECL_TRANSACTIONRELEASED |
transaction already released |
ECL_NOMEM |
out of memory |
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