Hemal Mehta | Just to add. If you need more details, the CallEnd Action is very well described in Chapter 5. http://www.cisco.com/en/US/docs/voice_ip_comm/cust_contact/contact_center/customer_voice_portal/cvp8_0/programming/guide/cvp_801_prog.pdf
Hemal
From: Cisco Developer Community Forums [mailto:cdicuser@developer.cisco.com] Sent: Wednesday, April 11, 2012 2:50 PM To: cdicuser@developer.cisco.com Subject: New Message from Janine Graves in Customer Voice Portal (CVP) - General Discussion - All Versions: RE: Indentify HANGUP and write on Report where happens.
Janine Graves has created a new message in the forum "General Discussion - All Versions":
-------------------------------------------------------------- The only valid way to do catch the hangup in Studio/VxmlServer is using an End Of Call java class that checks how the call ended, and if it was a hangup, simulates what the CVP_Subdialog_Return does. The Java code below does this. It looks for session variables return0, return1, return2, return3 and returns them to ICM. In ICM, they'll show up in the Termination Variable table in the FromExtVXML array entries if you've configured these variable as Persistent.
You will have to compile this java and then configure the Studio app (Project / Properties / Call Studio / End Point Settings / End of Call - Class: EndClassSubRet And you'll have to have the info in Session variables return0,1,2,3 (or modify the java to grab the session variables that you care about).
//These classes are used by on call end classes
import com.audium.core.vfc.VException; import com.audium.core.vfc.VPreference; import com.audium.core.vfc.form.VBlock; import com.audium.core.vfc.form.VForm; import com.audium.core.vfc.util.VAction; import com.audium.core.vfc.util.VMain; import com.audium.server.AudiumException; import com.audium.server.proxy.EndCallInterface; import com.audium.server.session.CallEndAPI;
/** * If caller hung up, send data * from the Session variables return0, return1, return2, return3 * to ICM into ECC variables FromExtVxml[0], [1], [2], [3] */
public class EndClassSubRet implements EndCallInterface { /** * All On End Call classes must implement this method. Use the passed * CallEndAPI class to get useful information. Making changes here will * do nothing as the call has already ended. */
public void onEndCall(CallEndAPI data) throws AudiumException { if (data.getHowCallEnded().equals("hangup")) { try {
//get data to return to ICM from these Session variables: //and return 'hangup' in the caller_input ECC variable of ICM //return0, return1, return2, return3 String return0 = (String) data.getSessionData("return0"); String return1 = (String) data.getSessionData("return1"); String return2 = (String) data.getSessionData("return2"); String return3 = (String) data.getSessionData("return3");
VPreference pref = data.getPreference(); VMain vxml = VMain.getNew(pref); VForm form = VForm.getNew(pref); VBlock block = VBlock.getNew(pref);
VAction var = VAction.getNew(pref, VAction.VARIABLE, "caller_input", "hangup", VForm.WITH_QUOTES); block.add(var); VAction returnTag = null; if(return0 != null){ VAction var0=VAction.getNew(pref, VAction.VARIABLE, "FromExtVXML0", return0, VForm.WITH_QUOTES); block.add(var0); if(return1 != null){ VAction var1=VAction.getNew(pref, VAction.VARIABLE, "FromExtVXML1", return1, VForm.WITH_QUOTES); block.add(var1); if(return2 != null){ VAction var2=VAction.getNew(pref, VAction.VARIABLE, "FromExtVXML2", return2, VForm.WITH_QUOTES); block.add(var2); if(return3 != null){ VAction var3=VAction.getNew(pref, VAction.VARIABLE, "FromExtVXML3", return3, VForm.WITH_QUOTES); block.add(var3); returnTag = VAction.getNew(pref, VAction.RETURN, "caller_input FromExtVXML0 FromExtVXML1 FromExtVXML2 FromExtVXML3"); } else{ returnTag = VAction.getNew(pref, VAction.RETURN, "caller_input FromExtVXML0 FromExtVXML1 FromExtVXML2"); } }else { returnTag = VAction.getNew(pref, VAction.RETURN, "caller_input FromExtVXML0 FromExtVXML1"); } }else { returnTag = VAction.getNew(pref, VAction.RETURN, "caller_input FromExtVXML0"); } }else { returnTag = VAction.getNew(pref, VAction.RETURN, "caller_input"); }
block.add(returnTag);
form.add(block); vxml.add(form);
data.setCustomVxmlResponse(vxml);
} catch (VException ex) { ex.printStackTrace(); } } } } -- To respond to this post, please click the following link:
<http://developer.cisco.com/web/cvp/forums/-/message_boards/view_message/5437194>
or simply reply to this email. |