Tip #679: Multiple CTI matches in Unified Service Desk

Too many search resultsWe 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:
Multiple CTI search results

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.

3 thoughts on “Tip #679: Multiple CTI matches in Unified Service Desk

  1. Scott Hoff says:

    To be clear, [[cti.parameters]] are available inside of Sessions that have been created using these CTI-Decision-type Window Navigation Rules. If you want to “drop the CTI” and access these same parameters “from the global session,” then it is vital that the CTI Event be taking place in the present, not the past. This is because [[ani]] and [[dnis]] are Event parameters, and they use Replacement Syntax specific to USD Events. The general USD Replacement syntax structure of [[application.parameter]] does not pertain to USD Events. Like all USD Events, CTI Events use of simpler [[parameter]] syntax rather than [[application.parameter]] syntax, because while the Event is taking place, “the Event is the Application,” so to speak. This means that the Global Session never “contains” the CTI Event parameters that are accessible as [[ani]] or [[dnis]]. Only the Event contains them, and when the Event is over, they’re gone… so pass them while you have them! Real global parameters typically utilize the “g” switch between the closing brackets in their standard-format replacement syntax, for example: [[application.parameter]g]

    • You’re quite right, Scott, I shouldn’t have referred to the event parameters being available in the global session. What I meant to say is that you could use something like

      yourparam=[[ani]]

      as your action parameter (in response to the event) and then parse and consume that inside your hosted control without creating a new session.

  2. Raheem says:

    Need help on this topic

Leave a Reply

Your email address will not be published. Required fields are marked *