Author Topic: How to set parameter in reasonCode  (Read 9213 times)

TOM

  • Guest
How to set parameter in reasonCode
« 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.

Offline cavagnaro

  • Administrator
  • Hero Member
  • *****
  • Posts: 7639
  • Karma: 56330
Re: How to set parameter in reasonCode
« Reply #1 on: May 08, 2007, 05:23:20 PM »
  • Best Answer
  • 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

    Offline René

    • Administrator
    • Hero Member
    • *****
    • Posts: 1832
    • Karma: 62
    Re: How to set parameter in reasonCode
    « Reply #2 on: May 08, 2007, 06:59:10 PM »
  • Best Answer
  • 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é

    Offline cavagnaro

    • Administrator
    • Hero Member
    • *****
    • Posts: 7639
    • Karma: 56330
    Re: How to set parameter in reasonCode
    « Reply #3 on: May 08, 2007, 09:18:03 PM »
  • Best Answer
  • Ok,
    Seems i posted a total different thing, what language is that?

    TOM

    • Guest
    Re: How to set parameter in reasonCode
    « Reply #4 on: May 09, 2007, 01:58:18 AM »
  • Best Answer
  • I am using JAVA language.

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