Genesys CTI User Forum

Genesys CTI User Forum => Genesys-related Development => Topic started by: TOM on May 08, 2007, 10:43:31 AM

Title: How to set parameter in reasonCode
Post by: TOM on May 08, 2007, 10:43:31 AM
:)
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.
Title: Re: How to set parameter in reasonCode
Post by: cavagnaro on May 08, 2007, 05:23:20 PM
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
Title: Re: How to set parameter in reasonCode
Post by: René on May 08, 2007, 06:59:10 PM
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):
----------------------------------------
[font=Courier]Genesyslab.Platform.Commons.Collections.KeyValueCollection reasons;

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

request = RequestAgentReady.create([i]thisDN[/i], [i]workMode[/i], [i]thisQueue[/i], reasons, [i]extensions[/i]);[/font]
----------------------------------------

René
Title: Re: How to set parameter in reasonCode
Post by: cavagnaro on May 08, 2007, 09:18:03 PM
Ok,
Seems i posted a total different thing, what language is that?
Title: Re: How to set parameter in reasonCode
Post by: TOM on May 09, 2007, 01:58:18 AM
I am using JAVA language.

Now I did crear my problem.
Thank you very mutch.
;)