PureConnect

 View Only

Discussion Thread View
  • 1.  Convert "1m 30.0s" string value to number of seconds

    Posted 06-29-2017 21:57
    Need some creative thinking here. I set up a handler with the StatAlertServer initiator, alert goes off based on the "Longest Hold Time" statistic in ICBM and the handler checks some info on the call and sends email alert to managers (out of the box alerts are horrible and doesn't give any usefull info like agent or Interaction ID). The way I'm thinking of doing it is via the Query Queue step and looping thru all calls in queue checking for Eic_State = "H" and then the handler compares $Now with Eic_StateTimestamp and checks if the difference is greater than the value of sStatLowerBound which is the value that was used in ICBM to trigger the alert (value of Longest Hold Time is greater than 1:30 minutes). My problem is that the value of sStatLowerBound (string) comes in as "1m 30.0s", if I convert this value to integer it'll get me a value of 15 - not 90, converting to DateTime value is even worse. The question is how to convert "1m 30.0s" in string to an integer value which will equal the amount of seconds in 1:30 minutes - 90? Thanks


  • 2.  RE: Convert "1m 30.0s" string value to number of seconds

    Posted 06-30-2017 13:24
    I would just write a helper subroutine that parses through the string and then converts it. I would do a strmid and then find the m and take everything to the left which would be your minutes. For the seconds grab the strmid between " " and ".". From here just multiple the minutes by 60 and add it to the seconds. There may be a better way to do this but sometimes with things like this I find it easier to just whip up a quick subroutine and chunk through the data as you can do it with minimal steps and it will execute in like no time.


  • 3.  RE: Convert "1m 30.0s" string value to number of seconds

    Posted 06-30-2017 14:16
    I did just that, see the handler attached. Was fun btw :)


Need Help finding something?

Check out the Genesys Knowledge Network - your all-in-one access point for Genesys resources