" /> Current Agent State - Genesys CTI User Forum

Author Topic: Current Agent State  (Read 8358 times)

Offline Elango

  • Newbie
  • *
  • Posts: 13
  • Karma: 0
Re: Current Agent State
« Reply #15 on: June 26, 2015, 03:24:42 PM »
Advertisement
No Change, result is same as it

Offline cavagnaro

  • Administrator
  • Hero Member
  • *****
  • Posts: 7641
  • Karma: 56330
Re: Current Agent State
« Reply #16 on: June 26, 2015, 03:26:44 PM »
Add ~LoggedOut

Enviado de meu C6602 usando Tapatalk


Adam G

  • Guest
Re: Current Agent State
« Reply #17 on: June 26, 2015, 03:33:10 PM »
Hope this helps:

The "Time" you are referring to [i]IS [/i]the UNIX EPOCH:

1435376204 = GMT: Sat, 27 Jun 2015 03:36:44 GMT

Conversion utilities exist on the web and other Posts on the Forum explain how to convert this to a standard time format.  Basically, add 1435376204 [i]seconds [/i]to 00:00:00 01/01/1970...

Offline Elango

  • Newbie
  • *
  • Posts: 13
  • Karma: 0
Re: Current Agent State
« Reply #18 on: June 26, 2015, 03:38:41 PM »
[b]cavagnaro[/b], still the result is same....
[b]adamgill[/b], I can understand what it was, bt how it wil help in getting the time value for current agent state ?

Adam G

  • Guest
Re: Current Agent State
« Reply #19 on: June 26, 2015, 03:58:46 PM »
I think you are building a real-time interface, yes?

The TIME you can see allocated is the [i]exact [/i]time/date that the STATUS of the Agent Object was reported by the StatServer.  If you are building an App (and this is [i]not [/i]CCP+), then you need to apply a local calculation within the App which counts the amount of time that has past, since the last STATUS update TIME from the StatServer.  You will also need to send a regular request to the StatServer, to get regular STATUS updates.  Or, if your App is 3rd party registered (as an Application in CIM), then that should be easy enough to set up as a regular (poll) request to a StatServer.

CCP+ does all of these things by design and I think you will need to find a way to emulate;

The TIME conversion to your local time zone.
The time that has elapsed since the last TIME update of the STATUS from the StatServer.
Regular polling of Updates from the StatServer to your App - or register the App with the StatServer to enable you to specify a polling interval.

Offline Elango

  • Newbie
  • *
  • Posts: 13
  • Karma: 0
Re: Current Agent State
« Reply #20 on: June 29, 2015, 10:51:50 AM »
Hi all...
  Very much thanks to everyone, I got the solution by the following calculation


[b]DateTime origin = new DateTime(1970, 1, 1, 0, 0, 0, 0);
DateTime istdate = TimeZoneInfo.ConvertTimeFromUtc(origin.AddSeconds(Convert.ToDouble(1435376204)),TimeZoneInfo.FindSystemTimeZoneById("India Standard Time")); [/b]  -----> This will convert the starting time for the agent's current status to GMT+5.30.

[b]DateTime curetime=TimeZoneInfo.ConvertTimeFromUtc(DateTime.UtcNow, TimeZoneInfo.FindSystemTimeZoneById("India Standard Time"));[/b]  -----> This will convert the current time to GMT+5.30

[b]TimeSpan diff = curetime - istdate;[/b] ------> This will get the exact duration of the agent's current state(in seconds).

Offline Kubig

  • Hero Member
  • *****
  • Posts: 2755
  • Karma: 44
Re: Current Agent State
« Reply #21 on: June 29, 2015, 11:02:33 AM »
I said you that the time is in Unix format :) :D ;D
« Last Edit: June 29, 2015, 12:10:50 PM by Kubig »

Offline Elango

  • Newbie
  • *
  • Posts: 13
  • Karma: 0
Re: Current Agent State
« Reply #22 on: June 29, 2015, 11:03:43 AM »
Yeah Thanks Kubig...
:D :D :D

Adam G

  • Guest
Re: Current Agent State
« Reply #23 on: June 29, 2015, 03:44:13 PM »
::)