/** * simple_netcallerid2orator.bsh * * This script sends a speech message when a caller id message is * received. It simply sends the caller name that was sent with * the caller id message. * */ // All xPL4Java beanshell scripts must have an init() method. void init() { // Set the default source... SetDefaultSource("cdp1802-xpl4java.micklaptop"); // Set the listener... ListenFor("xpl-trig.*.*.*.cid.netcall"); } void handleXPLMessage(theMessage) { // Get the caller name from the caller id message... callerName = theMessage.getNamedValue("cln"); // Create the speech message... speechMessage = CreateMessage("xpl-cmnd", "*", "tts.basic"); speechMessage.addNamedValue("speech", "Incoming call from " + callerName); // Send the speech message... SendMessage(speechMessage); }