
Description | Termination Events | Cautions | Example | Errors | See Also
Name: |
int cl_PeekVariable(hDevice, idTransaction, pszVariableName, pszVariable, iVariableSize) | |
Inputs: |
long hDevice |
|
long idTransaction |
| |
const char* pszVariableName |
| |
char* pszVariable |
| |
int iVariableSize |
| |
Returns: |
0 on success -2 if call logging transaction already released | |
Includes: |
cllib.h | |
Mode: |
synchronous | |
The cl_PeekVariable( ) function gets the value of a semantics-defined variable as it was observed at the time the function was called. The current list of semantics variables common to all protocols is (case-sensitive) CALLED, CALLING, CHANNEL Additional protocol-specific variable names can be defined by the semantics.
Parameter |
Description |
hDevice: |
The device handle of the call logging device. |
idTransaction: |
The call logging transaction ID. |
pszVariableName: |
The pointer to the ASCIIZ string that specifies the name of the semantics-defined variable. |
pszVariable: |
The pointer to the buffer into which the value of the semantics-defined variable is returned. The variable is returned as an ASCIIZ string. |
iVariableSize: |
The size of the buffer into which the value of the semantics-defined variable is returned, where maximum size includes the terminating NUL of the ASCIIZ string. |
None
The Call Logging API is not multi-thread safe. Call logging functions must be called within the same thread.
#include <srllib.h>
#include <cllib.h>
#include <stdio.h>
/* The Call Logging Device Handle */
extern long g_hDevice;
void PeekVariable(long idTransaction)
{
int iRet;
char szCalled[32];
char szCalling[32];
char szChannel[8];
if (g_hDevice != EV_ANYDEV)
{
iRet = cl_PeekVariable(g_hDevice, idTransaction, "CALLED", szCalled, sizeof(szCalled));
if (iRet != 0)
{
if (iRet == -2)
{
printf("PeekVariable - Transaction already released\n");
}
else
{
printf("PeekVariable - cl_PeekVariable() failed\n");
}
}
else
{
printf("Called party number is: \"%s\"\n", szCalled);
}
iRet = cl_PeekVariable(g_hDevice, idTransaction, "CALLING", szCalling, sizeof(szCalling));
if (iRet != 0)
{
if (iRet == -2)
{
printf("PeekVariable - Transaction already released\n");
}
else
{
printf("PeekVariable - cl_PeekVariable() failed\n");
}
}
else
{
printf("Calling party number is: \"%s\"\n", szCalling);
}
iRet = cl_PeekVariable(g_hDevice, idTransaction, "CHANNEL", szChannel, sizeof(szChannel));
if (iRet != 0)
{
if (iRet == -2)
{
printf("PeekVariable - Transaction already released\n");
}
else
{
printf("PeekVariable - cl_PeekVariable() failed\n");
}
}
else
{
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_INVALIDPARAMETER |
invalid parameter |
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