How to set parameter in reasonCode

:slight_smile:
request = RequestAgentReady.create(thisDN, workMode, thisQueue, reason_kvc, ext_kvc);

reason_kvc is String or int or structure ??
Please teach me, How to set parameter in reasonCode.

Dim ReasonPair As New CTKVPair
Dim ReasonList As New CTKVList

    'Create the NotReady ReasonCode KVPair
    ReasonPair.Type = CKVTypeNum
    ReasonPair.Key = "ReasonCode"
    ReasonPair.NumValue = 3 'Where 3 is what you created on CME for example as Action Codes

    'Add the NotReady ReasonCode to the KVList
    ReasonList.AddHead ReasonPair

    'Attach the KVList to the AttributeReason List
    TExtension1.TSetReason ReasonList

    'Change Agent's state to AuxWork mode, and go NotReady.
    TExtension1.TAgentWorkMode = AuxWork
    TExtension1.TNotReady

    'Clear the NotReady ReasonCode Extension, and Reason list.
    ReasonList.Clear
    TExtension1.TSetReason ReasonList
    TExtension1.TSetExtensions ReasonList

Hi Tom,

the parameter “reasons” is an object of type “KeyValueCollection”. You have to create an instance of this object, add some key-value pair and pass it as a parameter to “create” method. The standard KV for reason code is “ReasonCode” (surprise ;)) but I would suggest you to check TServer documentation for your PBX for correct name of key-value pair.

Here is an example code (unfortunately not tested):

Genesyslab.Platform.Commons.Collections.KeyValueCollection reasons;

reasons = new Genesyslab.Platform.Commons.Collections.KeyValueCollection();
reasons.Add(“ReasonCode”,“1”);

request = RequestAgentReady.create(thisDN, workMode, thisQueue, reasons, extensions);

René

1 Like

Ok,
Seems i posted a total different thing, what language is that?

2 Likes

I am using JAVA language.

Now I did crear my problem.
Thank you very mutch.
:wink: