Author Topic: Create an interaction programatically PSDK 7.6  (Read 3465 times)

Offline tamichan

  • Newbie
  • *
  • Posts: 5
  • Karma: 0
Create an interaction programatically PSDK 7.6
« on: October 23, 2013, 12:15:08 PM »
Ok, I'm just not getting it.  Yes, I've read the help files.  I thought I had a solution using the Open Media server sample, but that just gets a record into the interactions table not the Interaction table.  Genesys support pointed me to the eServices documentation, but the dot are just not connecting.  If anyone can give a basic explanation on how to programmatically create an interaction to the Genesys newbie I would be most grateful.

Yes I'm a little frustrated.

Current code:

[code]
public void SubmitInteraction()
        {
            string interactionServerName = "InteractionServer";//"<server name>";
            string interactionServerHost = "Host";//"<host>";
            int interactionServerport = 2020;
            string inboundQueue = "InboundQueue";
            string mediaType = "email";

            interactionServerConfiguration = new InteractionServerConfiguration("InteractionServer");

            interactionServerConfiguration.Uri = new Uri("tcp://"
            + interactionServerHost + ":"
            + interactionServerport);
            interactionServerConfiguration.ClientName = "InteractionServer";
            interactionServerConfiguration.ClientType = InteractionClient.MediaServer;
            InteractionServerProtocol interactionServerProtocol = new InteractionServerProtocol(new Endpoint(interactionServerName, interactionServerConfiguration.Uri));
           
            interactionServerProtocol.ClientName = "InteractionServer";
            interactionServerProtocol.ClientType = InteractionClient.MediaServer;
           
            KeyValueCollection userData = new KeyValueCollection();

            userData.Add("interaction:subject", "Incoming interaction");
            userData.Add("interaction:text", "Test Message");
                     
                     

            try
            {

                interactionServerProtocol.Open();

                Genesyslab.Platform.OpenMedia.Protocols.InteractionServer.Requests.InteractionManagement.RequestSubmit requestSubmit =
                    Genesyslab.Platform.OpenMedia.Protocols.InteractionServer.Requests.InteractionManagement.RequestSubmit.Create(
                    inboundQueue,
                    mediaType,
                    "Inbound");
                requestSubmit.TenantId = 101;
                requestSubmit.InteractionSubtype = "InboundNew";
                requestSubmit.UserData = userData;
             
                IMessage response = interactionServerProtocol.Request(requestSubmit);
                interactionServerProtocol.Send(requestSubmit);

                string boo = response.Name;

                interactionServerProtocol.Close();

            }
            catch (Exception ex)
            {
                throw ex;
            }
        }[/code]

Offline Kubig

  • Hero Member
  • *****
  • Posts: 2752
  • Karma: 44
Re: Create an interaction programatically PSDK 7.6
« Reply #1 on: October 23, 2013, 09:04:49 PM »
I am not at my PC now and cannot check my old-codes, but as I can see from your code, you did not create any object for interaction. In your code you did following:

1. Create configuration object for connection
2. Create protocol object
3. Create KeyValueCollection object with KVP (without interaction are unusable)
4. Open connection
5. ReqestSubmit - but what - interaction object is missing

I think, that the responce from IXN server must contain some error message..?

Offline tamichan

  • Newbie
  • *
  • Posts: 5
  • Karma: 0
Re: Create an interaction programatically PSDK 7.6
« Reply #2 on: November 05, 2013, 07:53:36 PM »
Sorry for the late reply.  I had to step back and take a deep breath.  Found a sample on the Genesys forum that I could walk through and see exactly what you are talking about.  I'm a newbie and needed detailed instructions.  Everything is working now and the pieces are falling into place.

Thanks!