How to monitor using sk_monitorChannel( )
Introduction:
An application using the Dialogic® Switchkit Application Programmers Interface (Switchkit API) may need to monitor a channel without taking ownership of it and having to send call control messages to it.
To do this, the Switchkit API provides a function called sk_monitorChannel( )
This article describes how start and stop monitoring channels and how these functions work within the Switchkit API framework.
Details:
Monitoring works by sending a copy of each outgoing and incoming message in the specified channel group to the application that issued the sk_monitorChannel( ) call.
These messages are routed to the Default handler specified in the call to the sk_setDefaultHandler( ).
Once in the Default handler, the application can process and parse out messages using the SKC_MSG_SWITCH( ) and CASEC_ macro functions in a similar way to a non-monitoring application.
Calling sk_unMonitorChannel( ) after monitoring a channel with sk_monitorChannel( ) will stop the LLC routing calls for the specified channel group to the application.
The code snippet below is a default handler that will print messages that the channel group receives after the connection to the LLC is created (and the ack is routed to it) to standard output .
int DefaultHandler(SK_Event *evt, void *Tag)
{
SKC_Message *msg = evt->IncomingCMsg;
string MessageName = msg->getMsgName();
SKC_MSG_SWITCH(msg)
{
CASEC_ConnectionStatusMsg(connectionStatus)
{
if (!Connected)
{
Connected = true;
int startSpan = 100;
int stopSpan = 108;
int startChannel = 0;
int stopChannel = 23;
printf('Ready to monitor span/channels %d:%d to %d:%d for messaging\n',startSpan,startChannel,stopSpan,stopChannel);
sk_monitorChannel(startSpan,startChannel,stopSpan,stopChannel);
}
return OK;
break;
}
} SKC_END_SWITCH;
printf('************************************\n');
printf('Received:%s\n',msg->getMsgName());
printf('************************************\n');
return OK;
}
Product List:
Dialogic® CSP Converged Services Platforms
Dialogic® MSP Mulit-services Platforms
Dialogic® Switchkit Application Programmers Interface
First published: 18-Nov-2010
Open access: Product rule: ; Page rule: Auto