Let say you want to receive a sms message then users request a chat. Or just send chat data to some external service. This is very easy archievable just using extension. For example I suggest to have a look at https://github.com/LiveHelperChat/livehelperchat-extensions/tree/master/sevabot
It uses one live helper chat provided events
This event is fired then user starts a chat from chat widget, standard chat window or from read operator message.
Also chat has antoher even which you can use then chat is closed
This even you can use then chat is closed and you want to pass some information to third party service.