We have already talked about dealing with multiple search results coming from entity searches in Unified Service Desk.
Results of CTI Search are just as easy to handle – they are very similar, however, there is one crucial difference. Generated as a result of a phone call (or a chat, or a sip call, etc), CTI search can be invoked at any time. If it was performed in the global session, it could overwrite results of any entity search executed previously (say, by a user). To avoid this accidental overwrites, CTI search results are only available in the new session:
As long as new session is created, identical code can be used:
protected override void DoAction( RequestActionEventArgs args) { if (args.Action.Equals("DealWithMultipleResults", StringComparison.OrdinalIgnoreCase)) { var results = GetDesktopRecord().EntityResults; // results are List<Entity>, deal with it // e.g. bind it to the grid and pop the window // in the FloatingPanel } }
What if you don’t want to process multiple search results, don’t want to create a new session but simply are after CTI replacement parameters like ani or dnis? These parameters are available in the global session but not as documented [[cti.ani]] or [[cti.dnis]]. Simply use [[ani]] or [[dnis]], i.e. drop cti prefix and you’re good to go.