" /> PositionInQueue - Genesys CTI User Forum

Author Topic: PositionInQueue  (Read 5368 times)

Offline tyeaman

  • Newbie
  • *
  • Posts: 4
  • Karma: 0
PositionInQueue
« on: December 28, 2010, 09:24:05 PM »
Advertisement
I am attempting to determine the number of calls in queue for playback in a VTO script.  Does anybody have any experience using the PositionInQueue function?  In my testing, I am hard coding the agent group that I am targeting but the initial call (and all subsequent calls) return zero.  I can understand this for the first call, since it hasn't actually queued yet but I would expect the subsequent calls to return the proper value.  Any help would be appreciated!

Tyler

Offline cavagnaro

  • Administrator
  • Hero Member
  • *****
  • Posts: 7641
  • Karma: 56330
Re: PositionInQueue
« Reply #1 on: December 28, 2010, 09:38:14 PM »
Maybe some logs and more detailed info on what and how you are doing it will be helpful...

Offline tyeaman

  • Newbie
  • *
  • Posts: 4
  • Karma: 0
Re: PositionInQueue
« Reply #2 on: December 28, 2010, 09:53:49 PM »
Sure, sorry if I didn't post enough detail.

My test strategy is fairly simple.  I have a multifunction block that assigns the target name, target name minus the .ga and then utilizes the 'PositionInQueue' function to assign the position value to a variable.  The position value is then incremented by 1, since the call hasn't actually queued yet.  I then attach the value of that variable as UserData.  The call is then sent to VTO to play a script that has a digit set that keys off of the UserData value to play the caller's position in queue.

Here is a small snippet of logs:

15:20:30.004_M_I_ [10:1d] virtual queues allocation pattern: static=(13 256 128) dynamic=(136 111/1024)
received from 65216(Avaya_01)JBVCCSD03A:3010(fd=) message EventQueued
AttributeCallState 0
AttributeThisQueue '51566'
AttributeNetworkCallID 1293571230
AttributeCallType 1
AttributePropagatedCallType 1
AttributeCallID 2576
AttributeConnID 00cc01e016f0309b
AttributeCallUUID 'EEIT6KVF1D6N10HV45R7GI3IMS0000P2'
AttributeDNIS '51566'
AttributeThisDN '51566'
AttributeThisDNRole 2
AttributeOtherDN '51574'
AttributeOtherDNRole 1
AttributeExtensions [19] 00 01 02 00..
'UCID' bin: 9E 54 1A 4D.. (len=8)
AttributeTimeinSecs 1293571231 (15:20:31)
AttributeTimeinuSecs 145000
AttributeEventSequenceNumber 0000000000000fb9
15:20:31.145_T_I_0000000000000000 [14:0c] EventQueued is received for tserver Avaya_01[Avaya] (this dn=51566)
    _T_I_00cc01e016f0309b [01:11] connid 00cc01e016f0309b is bound to the call 361-01e46890
15:20:31.145_I_I_00cc01e016f0309b [01:01] call (361-01e46890) for Resources created (del 0)
    _T_I_00cc01e016f0309b [14:09] add DN Avaya_01 51566 <51566@Avaya> (CDN 57 00cc01e016f0309b) to the call 361-01e46890 truly:22
received from 65216(Avaya_01)JBVCCSD03A:3010(fd=) message EventRouteRequest
AttributeCallState 0
AttributeThisQueue '51566'
AttributeNetworkCallID 1293571230
AttributeCallType 1
AttributePropagatedCallType 1
AttributeCallID 2576
AttributeConnID 00cc01e016f0309b
AttributeCallUUID 'EEIT6KVF1D6N10HV45R7GI3IMS0000P2'
AttributeDNIS '51566'
AttributeThisDN '51566'
AttributeThisDNRole 2
AttributeOtherDN '51574'
AttributeOtherDNRole 1
AttributeExtensions [19] 00 01 02 00..
'UCID' bin: 9E 54 1A 4D.. (len=8)
AttributeTimeinSecs 1293571231 (15:20:31)
AttributeTimeinuSecs 145000
AttributeEventSequenceNumber 0000000000000fba
15:20:31.145_T_I_00cc01e016f0309b [14:0c] EventRouteRequest is received for tserver Avaya_01[Avaya] (this dn=51566)
    _T_I_00cc01e016f0309b [14:09] add DN Avaya_01 51566 <51566@Avaya> (CDN 71 00cc01e016f0309b) to the call 361-01e46890 truly:11
    _T_I_00cc01e016f0309b [14:08] check delayed proc
    _I_I_00cc01e016f0309b [14:33] strategy: *0x65*v8_PositionInQueueTesting_v1 (3470972261) is attached to the call
15:20:31.145 Int 20001 interaction 00cc01e016f0309b is started
    _I_I_00cc01e016f0309b [01:14] current call classification: media=voice(100), service=default(200), segment=default(300)
15:20:31.145_I_I_00cc01e016f0309b [09:06] >>>>>>>>>>>>start interpretator()
    _I_I_00cc01e016f0309b [09:04] ASSIGN: __Return(SCRIPT) <- STRING:
    _I_I_00cc01e016f0309b [07:46] no error mode for this call
    _I_I_00cc01e016f0309b [09:04] ASSIGN: __Return(SCRIPT) <- STRING:
    _I_I_00cc01e016f0309b [09:04] ASSIGN: __DBReturn(SCRIPT) <- STRING:
    _I_I_00cc01e016f0309b [09:04] ASSIGN: __DBStrReturn(SCRIPT) <- STRING:
    _I_I_00cc01e016f0309b [09:04] ASSIGN: __TargetVar(SCRIPT) <- STRING:
    _I_I_00cc01e016f0309b [09:04] ASSIGN: s_T1(LOCAL) <- STRING: PositionTest.GA
    _I_I_00cc01e016f0309b [09:04] ASSIGN: s_T1_NoGA(LOCAL) <- STRING: PositionTest
    _I_I_00cc01e016f0309b [09:04] ASSIGN: var_position_target(LOCAL) <- STRING: PositionTest@StatServer.Q
15:20:31.145_M_I_ [10:06] STATOBJECT(022ce720 -1 2) tenant=Resources name=PositionTest@StatServer.Q: statistic <##true> asked
    _I_I_00cc01e016f0309b [09:04] ASSIGN: var_position(LOCAL) <- STRING: 0
    _I_I_00cc01e016f0309b [09:04] ASSIGN: var_position(LOCAL) <- STRING: 1

A value of 0 is returned, regardless of the number of calls already targeting this agent group.  This example is actually the second call that was routed through this strategy while the first call was still queued to the agent group.

Offline René

  • Administrator
  • Hero Member
  • *****
  • Posts: 1832
  • Karma: 62
Re: PositionInQueue
« Reply #3 on: December 29, 2010, 11:46:34 AM »
Hi,

PositionInQueue function works only in case the interaction is waiting for specified target. Otherwise it returns zero.

I would suggest you using some statistic (SData) to get number of calls waiting in particular queue.

R.

Offline tyeaman

  • Newbie
  • *
  • Posts: 4
  • Karma: 0
Re: PositionInQueue
« Reply #4 on: December 29, 2010, 02:30:43 PM »
[quote author=René link=topic=6082.msg26424#msg26424 date=1293623194]
Hi,

PositionInQueue function works only in case the interaction is waiting for specified target. Otherwise it returns zero.

I would suggest you using some statistic (SData) to get number of calls waiting in particular queue.

R.
[/quote]

Interesting.  I guess I don't fully understand how to implement the PositionInQueue function.  It is my understanding that the interaction "sits" at the target block until the timeout expires.  How would one hit the PIQ function while queued?  Thanks for all the help!

Offline catanirex

  • Sr. Member
  • ****
  • Posts: 272
  • Karma: 11
Re: PositionInQueue
« Reply #5 on: December 30, 2010, 10:15:48 AM »
PositionInQueue requires that the agentgroup targeted have the Virtual queues configured as origination DNs - otherwise it will return zero.

Offline tyeaman

  • Newbie
  • *
  • Posts: 4
  • Karma: 0
Re: PositionInQueue
« Reply #6 on: December 30, 2010, 04:39:27 PM »
Ok, we are doing that but queuing to the VQ in the same target block as the agent group.  I guess we should queue to the VQ, hit the PIQ function and then target the agent group?

Offline kubikle

  • Full Member
  • ***
  • Posts: 140
  • Karma: 7
Re: PositionInQueue
« Reply #7 on: January 07, 2011, 07:06:51 PM »
If calls targets soem agent group (in target selection object) then PositionInQueue can be asked for such group (this group with its qualifier .GA ned to used as this function parameter).
It will return 0 if call is not waiting this agent group so no use to place it before the target selection object but only after. There is closely realetd function CallsWaiting which just return number of calls waiting in router for specifed target. Basically PositionInQueue return value of CallsWaiting scaled by current call position among all calls wating for this target (and if call is not waiting the scaling factor is 0).