" /> GAD Customisation, transfer simple call - Genesys CTI User Forum

Author Topic: GAD Customisation, transfer simple call  (Read 4986 times)

Offline Nathzn

  • Newbie
  • *
  • Posts: 31
  • Karma: 0
GAD Customisation, transfer simple call
« on: April 21, 2015, 10:33:22 AM »
Advertisement
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
[code]- <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>[/code]

releaseInteraction.jsp
[code]<%@ 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>
[/code]

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.

Offline Nathzn

  • Newbie
  • *
  • Posts: 31
  • Karma: 0
Re: GAD Customisation, transfer simple call
« Reply #1 on: April 21, 2015, 01:02:01 PM »
Would InteractionVoice.singleStepTransfer work?

Offline Nathzn

  • Newbie
  • *
  • Posts: 31
  • Karma: 0
Re: GAD Customisation, transfer simple call
« Reply #2 on: April 22, 2015, 03:01:01 PM »
Update, think i'm getting closer but cant make it work :(((

current jsp.code
[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>[/code]

any help would be great  ;D ;D
« Last Edit: April 22, 2015, 03:08:37 PM by Nathzn »

Offline cavagnaro

  • Administrator
  • Hero Member
  • *****
  • Posts: 7641
  • Karma: 56330
Re: GAD Customisation, transfer simple call
« Reply #3 on: April 22, 2015, 03:15:32 PM »
Conference or Transfer?
What does not work? Check TServer logs to see if anything happens there

Offline Nathzn

  • Newbie
  • *
  • Posts: 31
  • Karma: 0
Re: GAD Customisation, transfer simple call
« Reply #4 on: April 22, 2015, 03:51:20 PM »
[quote author=cavagnaro link=topic=8806.msg39227#msg39227 date=1429715732]
Conference or Transfer?
What does not work? Check TServer logs to see if anything happens there
[/quote]

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
[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>[/code]

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

Offline Nathzn

  • Newbie
  • *
  • Posts: 31
  • Karma: 0
Re: GAD Customisation, transfer simple call
« Reply #5 on: April 28, 2015, 11:39:03 AM »
Didnt see anything noticable from the T Server logs :(

Anyone had experiance trying to acheive the above?

Offline Nathzn

  • Newbie
  • *
  • Posts: 31
  • Karma: 0
Re: GAD Customisation, transfer simple call
« Reply #6 on: April 29, 2015, 03:45:58 PM »
Managed to finally get it working! wooo

Offline cavagnaro

  • Administrator
  • Hero Member
  • *****
  • Posts: 7641
  • Karma: 56330
Re: GAD Customisation, transfer simple call
« Reply #7 on: April 29, 2015, 04:04:33 PM »
Yay! and share knowledge is for fools! Yay! :D
Would be good if you share the how to as someone else may need it someday and need help as you did.

Offline Nathzn

  • Newbie
  • *
  • Posts: 31
  • Karma: 0
Re: GAD Customisation, transfer simple call
« Reply #8 on: April 30, 2015, 11:20:43 AM »
[quote author=cavagnaro link=topic=8806.msg39273#msg39273 date=1430323473]
Yay! and share knowledge is for fools! Yay! :D
Would be good if you share the how to as someone else may need it someday and need help as you did.
[/quote]

Definitely  :)

[code]


    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);

[/code]

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