Does anyone know how to set parameter to userData in RequestUpdateUserData ?

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

Hi,

Try this piece of code:

KeyValueCollection userData= new KeyValueCollection();
userData.Add("key","value");

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

René

2 Likes

Thank you , René for your code

I did not realize about it. ;D