Genesys CTI User Forum

Genesys CTI User Forum => Genesys CTI Technical Discussion => Topic started by: n2201 on February 17, 2010, 01:38:56 PM

Title: Attaching data to a email interaction
Post by: n2201 on February 17, 2010, 01:38:56 PM
Friends,

What I am trying to do: I have an email interaction and from the function below I am trying to attach data to the email interaction.
Good thing: I do not get any syntax error
Problem: When I check the attached data after this statement is executed I do not see new attached data with the interaction.

I very much appreciate your advise and suggestions!

Thank you!

[code]        protected void MyFunction(string emailInteractionID)
        {
            try
            {
                AttachedData[] allAttachedData = new AttachedData[4];

                AttachedData attachedData0 = new AttachedData();
                attachedData0.key = "voiceCallLengthSufficient";
                attachedData0.value = "true";
                allAttachedData[0] = attachedData0;

                KeyValue[] keyValue = new KeyValue[2];
                keyValue[0] = new KeyValue();
                keyValue[0].key = "interaction:addAttachedData";
                keyValue[0].value = allAttachedData;

                keyValue[1] = new KeyValue();
                keyValue[1].key = "interaction:modifiedAttachedData";
                keyValue[1].value = allAttachedData;

                    com.genesyslab.ail.ws.interaction.InteractionDTO[] ixnDTOs = new InteractionDTO[1];
                    ixnDTOs[0] = new InteractionDTO();
                    ixnDTOs[0].interactionId = emailInteractionID;

                    ixnDTOs[0].data = keyValue;
                    ConnectionLink.InteractionService.setInteractionsDTO(ixnDTOs);
                }
            } catch (Exception ex)
            {
                string errString = string.Format("Interaction.onEmailCallLengthSuficient interactionId({0}). {1}", emailInteractionID, ex);
                CMILogging.Singleton.logger.Write(LogTypes.Error, errString);
                throw (ex);
            }
        }[/code]
Title: Re: Attaching data to a email interaction
Post by: René on February 17, 2010, 03:46:14 PM
Hi,

[quote]Problem: When I check the attached data after this statement is executed I do not see new attached data with the interaction.[/quote]
Could you please explain how you check the attached data?

R.
Title: Re: Attaching data to a email interaction
Post by: n2201 on February 17, 2010, 06:09:10 PM
I check it 2 ways:

1. Looked in the tserver log files
2. In other part of my code I hit a Done button on the email, there I checked the local variables and the "Attached data" for the interaction did not contain the newly attached data

Is this right?

Thanks
Title: Re: Attaching data to a email interaction
Post by: n2201 on February 19, 2010, 09:41:41 AM
Thanks all problem resolved, Just in case any one is interested, here are the details I got from a friend, my copy-paste error.

***************
Hi

I think the method "InteractionService.setInteractionsDTO(ixnDTOs)" returns an attribute error (error. common.RequestFailed) because allAttachedData table size is wrong.

change
TheAttachedData[] allAttachedData =  new AttachedData[4]; by TheAttachedData[] allAttachedData =  new AttachedData[1];

Also the attribute "interaction:modifiedAttachedData" is not taken into account because it is used only with InteractionEvent. So you don't have to send it.

The TServer handles only Voice Interaction. Email interaction are handled by InteractionServer.


Christian Foricher
***************