Genesys CTI User Forum

Genesys CTI User Forum => Genesys-related Development => Topic started by: charleslk82 on February 22, 2013, 07:40:07 AM

Title: Outbound - Saving Custom fields through GAD
Post by: charleslk82 on February 22, 2013, 07:40:07 AM
We are customizing GAD for outbound with customized outbound fields. We have set the “send_attribute” and the respective fields are shown in GAD. Below is the code taken from a working GAD where it was customized to save the customized fields for outbound.

    String CCU_CallStatus="asdadasdasdadsdasd";

    com.genesyslab.ail.AilFactory factory = com.genesyslab.ail.AilLoader.getAilFactory();
    String idInteraction=(String)request.getParameter( "idInteraction" ) ;
    com.genesyslab.ail.Interaction interaction = factory.getInteraction( (String)request.getParameter( "idInteraction" ) );
    com.genesyslab.ail.InteractionVoiceOutbound IVO = (com.genesyslab.ail.InteractionVoiceOutbound) factory.getInteraction( (String)request.getParameter( "idInteraction" ) );

    com.genesyslab.ail.OutboundRecord outboundRecord ;
    outboundRecord=IVO.getActiveRecord();

    if (CCU_CallStatus != null) {
    interaction.setAttachedData("CCU_CallStatus",CCU_CallStatus);
            outboundRecord.setCustomField("CCU_CallStatus",CCU_CallStatus);
    }

    interaction.saveAttachedData();

But when i run this code i am getting “com.genesyslab.ail.core.InteractionVoiceImpl cannot be cast to com.genesyslab.ail.InteractionVoiceOutbound” error. I have been breaking my head camparing both the GAD and was not able to find anything.

Am I missing any jar file or missing any setting in OCS?

Title: Re: Outbound - Saving Custom fields through GAD
Post by: imaki on February 22, 2013, 07:51:07 AM
Seems like your call is not an outbound call. You could check that the call you are trying to get the record from is the actual outbound-call having all outbound data in it..

Or what is this [b]request[/b] variable you take the 'idInteraction' from? Maybe it does not give you correct id, or that call has already marked done (and therefore not found from AIL at all)?
Title: Re: Outbound - Saving Custom fields through GAD
Post by: charleslk82 on February 22, 2013, 08:45:10 AM
The call was from an outbound  and also checked this code before disconnecting and clicking markdone. "idInteraction" is the interaction ID attached by GAD, for the respective outbound call.  :'(

I am missing something here. But this code actually works in another GAD, but when i replicate into another GAD it is not working.  :'(
Title: Re: Outbound - Saving Custom fields through GAD
Post by: cavagnaro on February 23, 2013, 01:13:42 PM
If works on another GAD:
1. compare GAD versions
2. Be 100% sure that you are calling the script on the exact same event, 100% copy of the working one