Author Topic: [SOLVED] Can't attach ReasonCode to AttributeExtensions on AgentNotReady Event  (Read 6564 times)

Offline luchosrock

  • Newbie
  • *
  • Posts: 43
  • Karma: 0
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,
« Last Edit: January 22, 2016, 02:09:09 PM by luchosrock »

Offline Kubig

  • Hero Member
  • *****
  • Posts: 2752
  • Karma: 44
Re: Can't attach ReasonCode to AttributeExtensions on AgentNotReady Event
« Reply #1 on: December 30, 2015, 01:24:49 PM »
Post your code fragment where you post the attach data together with logs covering the behaviour.

Offline luchosrock

  • Newbie
  • *
  • Posts: 43
  • Karma: 0
Re: Can't attach ReasonCode to AttributeExtensions on AgentNotReady Event
« Reply #2 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  ??? :-\

Offline Kubig

  • Hero Member
  • *****
  • Posts: 2752
  • Karma: 44
Re: Can't attach ReasonCode to AttributeExtensions on AgentNotReady Event
« Reply #3 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

Offline luchosrock

  • Newbie
  • *
  • Posts: 43
  • Karma: 0
Re: Can't attach ReasonCode to AttributeExtensions on AgentNotReady Event
« Reply #4 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

Offline mduran22

  • Full Member
  • ***
  • Posts: 108
  • Karma: 5
Re: Can't attach ReasonCode to AttributeExtensions on AgentNotReady Event
« Reply #5 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.

Offline luchosrock

  • Newbie
  • *
  • Posts: 43
  • Karma: 0
Re: Can't attach ReasonCode to AttributeExtensions on AgentNotReady Event
« Reply #6 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]

Offline mduran22

  • Full Member
  • ***
  • Posts: 108
  • Karma: 5
Re: Can't attach ReasonCode to AttributeExtensions on AgentNotReady Event
« Reply #7 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.

Offline luchosrock

  • Newbie
  • *
  • Posts: 43
  • Karma: 0
Re: Can't attach ReasonCode to AttributeExtensions on AgentNotReady Event
« Reply #8 on: January 07, 2016, 07:13:19 PM »
Yeah but how do I set that ReasonCode at the switch level that you mentioned before?

Offline mduran22

  • Full Member
  • ***
  • Posts: 108
  • Karma: 5
Re: Can't attach ReasonCode to AttributeExtensions on AgentNotReady Event
« Reply #9 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.

Offline gstkein

  • Jr. Member
  • **
  • Posts: 56
  • Karma: 4
Re: Can't attach ReasonCode to AttributeExtensions on AgentNotReady Event
« Reply #10 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.


Offline luchosrock

  • Newbie
  • *
  • Posts: 43
  • Karma: 0
Re: Can't attach ReasonCode to AttributeExtensions on AgentNotReady Event
« Reply #11 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?

Offline gstkein

  • Jr. Member
  • **
  • Posts: 56
  • Karma: 4
Re: Can't attach ReasonCode to AttributeExtensions on AgentNotReady Event
« Reply #12 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.

Offline luchosrock

  • Newbie
  • *
  • Posts: 43
  • Karma: 0
Re: Can't attach ReasonCode to AttributeExtensions on AgentNotReady Event
« Reply #13 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.
« Last Edit: January 22, 2016, 02:08:54 PM by luchosrock »

Offline gstkein

  • Jr. Member
  • **
  • Posts: 56
  • Karma: 4
I´m glad I could help :)