Genesys CTI User Forum

Genesys CTI User Forum => Genesys-related Development => Topic started by: nui on January 11, 2008, 04:41:01 AM

Title: Does anyone know how to set parameter to userData in RequestUpdateUserData ?
Post by: nui on January 11, 2008, 04:41:01 AM
Now, I am trying to make simple softphone using .net sdk with c#.net and I think I also need to attach data from my program but I am did not know how to set parameber into userData(KeyValueCollection ) and does .net sdk support this or not ?

below is some neccessary and source code :

using Genesyslab.Platform.Voice.Protocols.TServer.Requests.Userdata;
using Genesyslab.Platform.Commons.Collections;
^
^
Does reference is enough for coding ?

public static bool UserAttachData(TServerProtocol protocol)
        {
            IMessage response;
            try
            {
                KeyValueCollection userData=null; <<< If I need to set key = "test", values="FirstTime" , Do you know how to set it to userData ?
               
                RequestUpdateUserData reqUpdateuserData = RequestUpdateUserData.Create(
                                                                thisDN,
                                                                connId,
                                                                userData
                                                                );
                response = protocol.Request(reqUpdateuserData);
                Debug.Print(response.ToString());
                return true;
            }
            catch (Exception e)
            {
                return false;
            }
        }

Please give me suggestions, I am very new with genesys, just start learning basic concept.

Nui
Title: Re: Does anyone know how to set parameter to userData in RequestUpdateUserData ?
Post by: René on January 11, 2008, 09:39:28 AM
Hi,

Try this piece of code:

[code]KeyValueCollection userData= new KeyValueCollection();
userData.Add("key","value");
[/code]

The method Add has several overloads. Please check Platform SDK documentation for more information.

René
Title: Re: Does anyone know how to set parameter to userData in RequestUpdateUserData ?
Post by: nui on January 11, 2008, 10:40:38 AM
Thank you , René for your code

I did not realize about it.  ;D