Genesys CTI User Forum
Genesys CTI User Forum => Genesys CTI Technical Discussion => Topic started by: Nathzn on April 21, 2015, 10:33:22 AM
-
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.
-
Would InteractionVoice.singleStepTransfer work?
-
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
-
Conference or Transfer?
What does not work? Check TServer logs to see if anything happens there
-
[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
-
Didnt see anything noticable from the T Server logs :(
Anyone had experiance trying to acheive the above?
-
Managed to finally get it working! wooo
-
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 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!