Genesys CTI User Forum

Genesys CTI User Forum => Genesys-related Development => Topic started by: luchosrock on December 30, 2015, 01:14:06 PM

Title: [SOLVED] Can't attach ReasonCode to AttributeExtensions on AgentNotReady Event
Post by: luchosrock on December 30, 2015, 01:14:06 PM
Hi guys,

I'm trying to attach the ReasonCode to the AttributeExtensions on the NotReady Event. I've added the Extensions KeyValueCollection with the ReasonCode to the request but when I informed the event the response doesn't show the KVList i sent, instead it responds AgentSessionID

Please any help on this will be really appreciated. I'm using Genesys 8 SDK for .NET by the way.

Regards,
Title: Re: Can't attach ReasonCode to AttributeExtensions on AgentNotReady Event
Post by: Kubig on December 30, 2015, 01:24:49 PM
Post your code fragment where you post the attach data together with logs covering the behaviour.
Title: Re: Can't attach ReasonCode to AttributeExtensions on AgentNotReady Event
Post by: luchosrock on December 30, 2015, 01:47:17 PM
Thanks for your quick reply Kubig.

I'm trying to send it as a KeyValueCollection attached to the Extensions attribute

[code]
Dim reqAgentNotReady As RequestAgentNotReady
...
reqAgentNotReady.Extensions = New KeyValueCollection
reqAgentNotReady.Extensions.Add("ReasonCode", reasonCode)
...
Dim response As IMessage
response = Me.protocolManagementService(TServerString).Request(reqAgentNotReady, TimeSpan.FromSeconds(15))
[/code]

But the response received is

[code]
...
Extensions:
      (Str) AgentSessionID        XXXXXXXXXXXXXXXXXXXXXXXXXX
...
[/code]

As you can see, the Extensions attribute is overriden by another KeyValueCollection  ??? :-\
Title: Re: Can't attach ReasonCode to AttributeExtensions on AgentNotReady Event
Post by: Kubig on December 30, 2015, 03:50:12 PM
And what say logs of T-Server? I suppose you tried to change the status on voice channel
Title: Re: Can't attach ReasonCode to AttributeExtensions on AgentNotReady Event
Post by: luchosrock on December 30, 2015, 08:27:32 PM
What do you mean by changing the status on voice channel? Mi big issue is that on Interaction Workspace this is notified as 'ReasonCode' 'specificreason' just after the AttributeExtensions entry, I'm trying to get to the same output but through the .NET Platform SDK

Is there a caveat that I don't know? I used to inform this by attaching the reason on the the Reasons attribute to the NotReady request sent but now I need to inform it the same way IWS does
Title: Re: Can't attach ReasonCode to AttributeExtensions on AgentNotReady Event
Post by: mduran22 on December 30, 2015, 09:14:55 PM
The AttributeExtensions are used for hardware reason codes based on the swtich will only accept integers only. If you are sending a string in this attribute it won't attach. If you want to send a software reason code as a string you should sent it under AttributeReason. You can test this by putting a integer (i.e. 1) in your test. What you should see, even if you are sending a string, is that the response will comeback with an integer.
Title: Re: Can't attach ReasonCode to AttributeExtensions on AgentNotReady Event
Post by: luchosrock on January 07, 2016, 02:39:37 PM
mduran22 How can I send a hardware reason code through the Platform SDK? What key-value pair should I use?
Let me show you what I receive in response to the RequestAgentNotReady:

[code]

{'EventAgentNotReady' ('76')
message attributes:
AttributeThisDN [str] = "55555"
AttributeReasons [bstr] = KVList:
'Backoffice' [str] = "backoffice"
CallHistory    = ComplexClass(CallHistoryInfo):
LastParty      = ComplexClass(LastRemoteParty):
FirstParty      = ComplexClass(FirstRemoteParty):
AttributeExtensions [bstr] = KVList:
'AgentSessionID' [str] = "XXXXXXXXXXXXXXXXXXX"
AttributeEventSequenceNumber [long] = 1534419427
AttributeAgentID [str] = "112008"
AttributeReferenceID [int] = 6
Time            = ComplexClass(TimeStamp):
AttributeTimeinuSecs [int] = 165000
AttributeTimeinSecs [int] = 1452177312
AttributeCustomerID [str] = "Resources"
AttributeAgentWorkMode [int] = 0 [Unknown]
}
[/code]
Title: Re: Can't attach ReasonCode to AttributeExtensions on AgentNotReady Event
Post by: mduran22 on January 07, 2016, 05:54:08 PM
Change the key to "ReasonCode". With software reason codes you can have any string you would like so "backoffice" would be fine.
Title: Re: Can't attach ReasonCode to AttributeExtensions on AgentNotReady Event
Post by: luchosrock on January 07, 2016, 07:13:19 PM
Yeah but how do I set that ReasonCode at the switch level that you mentioned before?
Title: Re: Can't attach ReasonCode to AttributeExtensions on AgentNotReady Event
Post by: mduran22 on January 07, 2016, 09:11:49 PM
If you are trying to change the actual switch aux code in most cases you will need to get this from the whoever administers and sets the not ready reason codes on the switch. You will have to then use this integer in the attributeextensions section with the KVP ReasonCode:[int] that matches the value of the switch code you want to change to. For example on Avaya you could have not ready reason codes 1-9 where 1 is lunch as administered on the Avaya switch. You would then send a requestagentnotready request with the KVP "ReasonCode:1" under attributeextensions to set the agent to Lunch on Avaya.
Title: Re: Can't attach ReasonCode to AttributeExtensions on AgentNotReady Event
Post by: gstkein on January 18, 2016, 03:26:49 PM
There are switch specific guides for this, for example the One for Avaya specifies to add a keyvaluepair ReasonCode -> integer

to a KeyValueCollection and set it as the extensions of the request, so in theory an integer value should work.

Title: Re: Can't attach ReasonCode to AttributeExtensions on AgentNotReady Event
Post by: luchosrock on January 21, 2016, 01:24:19 PM
Thank you for your responses  :)

But how can a desktop application using the .NET Platform SDK inform the ReasonCode as an Extension attribute. I tried sending the integer on my RequestAgentNotReady with no results (at least from my debugger):

[code]
reqAgentNotReady.Extensions = New KeyValueCollection
reqAgentNotReady.Extensions.Add("ReasonCode", reasonCode)

response = Me.protocolManagementService(TServerString).Request(reqAgentNotReady, TimeSpan.FromSeconds(15))
[/code]

My guess is that the ReasonCode should be informed on the response. Is that correct?
Title: Re: Can't attach ReasonCode to AttributeExtensions on AgentNotReady Event
Post by: gstkein on January 21, 2016, 05:02:42 PM
Your code seems fine, I think that shares the code with the switch, not sure if it should show in the response.

To show the code in the response, you could try adding the "ReasonCode", code pair to the reqAgentNotReady.Reasons as well
you can add to the reqAgentNotReady.Reasons the key "Reason" with the description.
Title: Re: Can't attach ReasonCode to AttributeExtensions on AgentNotReady Event
Post by: luchosrock on January 21, 2016, 05:24:40 PM
Thanks @gstkein, You are right!

I can see now the ReasonCode sent by the desktop application on the SIPServer logs (at least is received by the SIPServer)

If everything works well, I will mark this thread as solved (by changing the topic name to [SOLVED] ..... ahahaha)

Regards,
---
EDIT: I'll mark this as solved since the integration I was looking for worked fine. Thanks to all for your kind help.
Title: Re: [SOLVED] Can't attach ReasonCode to AttributeExtensions on AgentNotReady Event
Post by: gstkein on January 26, 2016, 01:02:18 PM
I´m glad I could help :)