GAD Customisation, transfer simple call

Hi Guys,

Looking for a little nudge of assistance here, recently.. I’ve been looking at customizing GAD by adding a new button. I’ve followed the example/sample provided by Genesys and successfully added a button that will release the call; However, i need it to transfer to another route point.

Here is my current configuration

Custom.xml

- <gcn-resources>
- <desktop>
  <dictionary-class>custom</dictionary-class> 
- <interaction-action>
- <buttons>
- <button name="releaseButton">
  <image-up-name>custom/btnrelease_up.png</image-up-name> 
  <image-disable-name>custom/btnrelease_disable.png</image-disable-name> 
  <image-focus-name>custom/btnrelease_focus.png</image-focus-name> 
  <tooltip-dictionary-key>interaction.release</tooltip-dictionary-key> 
- <javascript-oninteractionstatuschange>
- <![CDATA[                             if( interactionStatus == STATUS_TALKING )
                                enableButton("releaseButton");
                            else
                                disableButton("releaseButton");
                        
  ]]> 
  </javascript-oninteractionstatuschange>
- <javascript-onload>
- <![CDATA[                             if( interactionStatus == STATUS_TALKING )
                                enableButton("releaseButton");
                            else
                                disableButton("releaseButton");
                        
  ]]> 
  </javascript-onload>
- <javascript-onselect>
- <![CDATA[                             document.forms.releaseForm.elements.idInteraction.value =
                                                                        idInteraction;
                            document.forms.releaseForm.submit();
                        
  ]]> 
  </javascript-onselect>
- <html-body>
- <![CDATA[                             <form name="releaseForm" method="get" target="releaseActionFrame"
                                               action="custom/releaseInteraction.jsp">
                                <input type="hidden" name="idInteraction">
                            </form>
                            <iframe name="releaseActionFrame" style="visibility:hidden" frameborder="no" width="0" height="0" src="custom/empty.htm"></iframe>
                        
  ]]> 
  </html-body>
  </button>
  </buttons>
  </interaction-action>
  </desktop>
  </gcn-resources>

releaseInteraction.jsp

<%@ page language="java" buffer="none" contentType="text/html; charset=utf-8"%>
<html>
  <head>
    <meta http-equiv="Content-Type" content="text/html; charset=utf-8">
    <script language="javascript">
      window.parent.includeGDFunctionalities(window);

      function custom_load() {
        activateGDFunctionalities();
      }

      function custom_unload() {
        unactivateGDFunctionalities();
      }
    </script>
  </head>
  <body height="0" leftmargin="0" topmargin="0" marginwidth="0" marginheight="0" onload="custom_load()" onunload="custom_unload()">
    <script language="javascript">
<%
    com.genesyslab.ail.AilFactory factory =
                                        com.genesyslab.ail.AilLoader.getAilFactory();
    com.genesyslab.ail.Interaction interaction =
           factory.getInteraction( (String)request.getParameter( "idInteraction" ) );

    try {
        if( com.genesyslab.ail.Interaction.Type.PHONE_CALL.equals(
                                                          interaction.getType() ) ) {
            interaction.releaseCall( null );
        }
    } catch( com.genesyslab.ail.exception.RequestFailedException
                                                           requestFailedException ) {
%>

    showWarningMessage("Release interaction failed!");

<%
    }
%>
    </script>
  </body>
</html>

My java knowledge is pretty limited at the moment and I’m only starting to learn. Any help to get this to forward/1step transfer to another destination would be great.

Thanks folks.

Would InteractionVoice.singleStepTransfer work?

Update, think i’m getting closer but cant make it work :(((

current jsp.code

<%@ page language="java" buffer="none" contentType="text/html; charset=utf-8"%>





<script language="javascript">
<%
com.genesyslab.ail.AilFactory factory = com.genesyslab.ail.AilLoader.getAilFactory();
com.genesyslab.ail.Interaction interaction = factory.getInteraction( (String)request.getParameter( "idInteraction" ) );
com.genesyslab.ail.InteractionVoice call = (InteractionVoice)factory.getInteraction(idInteraction);
try {
var transfer = "00123456789";
call.singleStepConference(transfer, null, null, null, null);}
catch( com.genesyslab.ail.exception.RequestFailedException
                                                           requestFailedException ) {
%>

showWarningMessage("Release interaction failed!");

<%
}

%>
</script>

any help would be great ;D ;D

Conference or Transfer?
What does not work? Check TServer logs to see if anything happens there

The transfer doesnt work, sorry with that code above I had conference as I was testing to see if it worked. Here is the updated code

<%@ page language="java" buffer="none" contentType="text/html; charset=utf-8"%>






<script language="javascript">
var transfer = "001234567892";
var location = "SIP";
<%
com.genesyslab.ail.AilFactory factory = com.genesyslab.ail.AilLoader.getAilFactory();
com.genesyslab.ail.Interaction interaction = factory.getInteraction( (String)request.getParameter( "idInteraction" ) );
com.genesyslab.ail.InteractionVoice call = (InteractionVoice)factory.getInteraction(idInteraction);
try {
call.singleStepTransfer(transfer, location, null, null, null, null);}
catch( com.genesyslab.ail.exception.RequestFailedException
                                                           requestFailedException ) {
%>

showWarningMessage("Release interaction failed!");

<%
}

%>
</script>

I’ll update you after I check the T Server Logs

Didnt see anything noticable from the T Server logs :frowning:

Anyone had experiance trying to acheive the above?

Managed to finally get it working! wooo

Yay! and share knowledge is for fools! Yay! :smiley:
Would be good if you share the how to as someone else may need it someday and need help as you did.

Definitely :slight_smile:




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

    
		transfer = "077XXXXXXXX";
		location = "SIP";
		InteractionVoice call = (InteractionVoice)factory.getInteraction(idInteraction);


			call.singleStepTransfer(transfer, location, null, null, null, null);


Hope this helps! Took me while to figure it out!