You are here: SwitchKit Programmer’s Guide > 3 Channel Management > sk_setGroupHandler()
Description
Use the sk_setGroupHandler() function to complement the function sk_watchChannelGroup(). When a message arrives on a channel that does not have an explicitly-assigned handler function, the handler function of its group is notified.
Syntax
int sk_setGroupHandler(char *aChannelGroupName, void *aTag, HandlerFunc* aHandlerFunc);
Threadsafe Syntax
int skts_setGroupHandler(char *aChannelGroupName, void *aTag, HandlerFunc* aHandlerFunc);
Parameters
The function parameters are shown in the table below.
Argument |
Description |
---|---|
aChannelGroupName |
The name of a specified channel group. |
aTag |
An application defined pointer which will be returned to the application when a handler is invoked. |
aHandlerFunc |
A pointer to a function that is designed to handle messages. |
How sk_setGroupHandler works
Send the following function calls, with respect to your naming convention, to the LLC:
sk_watchChannelGroup("inbound");
sk_setGroupHandler("inbound", NULL, handleInboundCall);
After this function call is sent and if your application uses sk_rcvAndDispatch() or sk_rcvAndDispatchAutoStorage(), every time a message is received for a channel in the specified group, the message will be sent to this handler function.
Always returns OK.