Previous PageTable Of Contents../index.htmlIndexNext Page


2.2 Error Handling

Call Logging functions return a negative value (test for <0) for failure and in most cases you use the SRL Standard Attribute function ATDV_LASTERR( ) to obtain the error code. The cl_Open( ) function cannot use this error handling method, however, because if it fails it does not return a device handle, which is a required parameter for ATDV_LASTERR( ). Instead, cl_Open( ) error codes are returned in the errno global variable.

Table 11 shows the list of possible error codes that can be returned. The Error section of each function description lists the error codes that apply to that particular function.


Table 11. Call Logging Function Errors

Error Code Value

Description

ECL_NOMEM

out of memory

ECL_NULLPARAMETER

invalid NULL parameter

ECL_INVALIDPARAMETER

invalid parameter

ECL_INVALIDCONTEXT

invalid event context

ECL_TRANSACTIONRELEASED

transaction already released

ECL_UNSUPPORTED

function not supported

ECL_FILEOPEN

fopen failed

ECL_FILEREAD

fread failed

ECL_INTERNAL

internal Call Logging error; cause unknown

ECL_GCOPENEX_NETWORK *

gc_OpenEx( ) failed on the network side

ECL_GCOPENEX_USER *

gc_OpenEx( ) failed on the user side

*The following additional flag is set in these error code values to indicate that the error occurred while the Call Logging API was calling a GlobalCall function:

ECL_FLAG_INSIDE_GC

use gc_ErrorValue( ) for an additional error description

The error codes returned by the Call Logging API may be explicit enough, but for more information about the GlobalCall gc_ functions and error code values they return, see the GlobalCall API Software Reference.

Some Call Logging functions will return -2 if they fail because the transaction was already released. ATDV_LASTERR( ) returns ECL_TRANSACTIONRELEASED in these cases.

ECL_INVALIDPARAMETER is returned when a parameter is fully or partially invalid. Examples of when this error code could be returned are:

ECL_INVALIDCONTEXT is returned if the Call Logging function can only be called while processing a CLEV_MESSAGE event and the function is called at another time or with a different device than the one for which the event was posted.

ECL_UNSUPPORTED is returned if the Call Logging function is not supported under the current conditions. For example, cl_DecodeTrace( ) can only be called when the FILE method was specified in the pszDeviceName parameter of cl_Open( ).

ECL_FILEOPEN and ECL_FILEREAD are returned when fopen and fread fail. This can happen when cl_DecodeTrace( ) is called if the pszFileName parameter specifies a file that does not exist or a file that does not have the required format.


Previous PageTable Of ContentsTop Of PageIndexNext Page

Click here to contact Dialogic Customer Engineering

Copyright 2001, Dialogic Corporation
All rights reserved
This page generated February, 2002