Genesys CTI User Forum

Genesys CTI User Forum => Genesys CTI Technical Discussion => Topic started by: prb75 on December 03, 2016, 04:04:31 PM

Title: Tserver down check platform SDK
Post by: prb75 on December 03, 2016, 04:04:31 PM
I have been searching through the genesys docs and I can't seem to find an explanation of how to listen for a tserver down event using the platform SDK.  All the events I see are related to a specific user login.

Could someone please suggest the best approach for using platform SDK to listen for a tserver down event?
Title: Re: Tserver down check platform SDK
Post by: PeteHoyle on December 05, 2016, 09:43:50 AM
Hi,

If we take the PSDK Java as an example you add a ChannelListener

[code]               
                channel = new TServerProtocol(new Endpoint("PSDK-Sample-App", "<Not Specified>", 7000, options));
channelListener = new ChannelEventsListener();
channel.addChannelListener(channelListener);[/code]



[code] /**
* Implements ChannelListener. Handles channel Open, Close events and
* Channel Errors.
*/
private class ChannelEventsListener implements ChannelListener {

/**
* Change model state to connected.
*/
public void onChannelOpened(EventObject arg0) {
}

/**
* Change model state to disconnected.
*/
public void onChannelClosed(ChannelClosedEvent arg0) {
setConnected(false);
displayControlMessage("Connection closed! \n" + printThrowable(arg0.getCause()));
}

/**
* Display channel errors on the main panel.
*/
public void onChannelError(ChannelErrorEvent arg0) {
displayControlMessage(printThrowable(arg0.getCause()));
}
}


}[/code]

This will tell you if the TServer is down, there are also EventLinkConnected and EventLinkDisconnected events that indicate if the PABX CTI link has gone down.

Even though the TServer will handle the HA failover itself you will need to implement some logic at startup in the scenario where the Primary TServer is down and you need to connect to the Backup TServer. I would recommend that you use the WarmStandby Application block to handle HA.

Thanks,

Pete.
Title: Re: Tserver down check platform SDK
Post by: prb75 on December 14, 2016, 08:46:51 PM
I did get this to work based on this tip - I appreciate the help.