An application can audit the status of all in-progress connections maintained by the SCCP layer by calling SCCPConnAuditRqst. SCCPConnAuditRqst can be invoked to either the primary or the backup SCCP layer in a redundant configuration. Use connection auditing to:
Resynchronize a backup application that has failed and restarted
Ensure that the application and the SCCP layer have consistent connection data
Troubleshoot an application
Each call to SCCPConnAuditRqst generates a SCCPCONNAUDCFM event to the application containing connection data (connection ID, calling and called addresses, connection state) for one connection. On the first call, the application specifies a connection ID (the spInstId attribute of the connection ID) of zero. On all subsequent calls, the application specifies the connection ID returned in the previous SCCPCONNAUDCFM event that returned a connection. When all active connections are exhausted, the SCCP layer responds to a call to SCCPConnAuditRqst with a SCCPCONNAUDCFM event with an event type of SCCP_CONNAUDEOF, indicating there are no more active connections. The following example demonstrates the initiation of the connection audit:
SccpConnId connId;
DWORD ret;
...
/* populate connection ID to kick off audit */
connId.suId = mySuid;
connId.spId = mySpid;
connId.suConnId = 0; /* not used */
connId.spConnId = 0; /* start at first connection */
/* issue the command to the SCCP service API */
ret = SCCPConnAuditRqst( myCtaHd, &connId );
...
Connection audit requests return data on all active connections for all SCCP user SAPs, not just those associated with the calling application. If more than one user application uses connection-oriented services, the application associated with a connection returned in a SCCPCONNAUDCFM event can be determined from the service provider ID (SCCP user SAP number) attribute of the connection ID or from the subsystem number field in the calling or called address parameter.
The following example demonstrates the handling of a connection audit confirmation:
SccpAllMsgs sccpMsg;
SccpRcvInfoBlk infoBlk;
...
/* get SCCP message from API */
if( (retval = SCCPRetrieveMessage( myCtaHd, &sccpMsg, &infoBlk, 0 )) != SCCP_SUCCESS )
{
...
}
switch (infoBlk.indType)
{
...
case SCCPCONNAUDCFM:
{
/* check if connection info returned or end of connections */
if( infoBlk.evntType == SCCP_CONNAUDOK )
{
/* display returned connection info */
printf( ... );
/* request next connection audit info, using connection ID
just returned */
ret = SCCPConnAuditRqst( myCtaHd, &infoBlk.connId );
}
else if( infoBlk.evntType == SCCP_CONNAUDEOF )
{
printf( "Connection audit complete\n" );
}
...
break;
}
...