Siebel CTI Administration Guide > Configuring Advanced Communications Features > Integrating with Siebel Scripting Languages >
Integrating Scripting Using Server Scripts
Here are some examples of using business services and Siebel scripting with your communications configurations. These examples are for server-side scripting using Siebel eScript. Event Response Example
Table 43 shows an example event response that invokes the server-layer scripting business service method CTI_Test.EvtBSGotoView. This event response retrieves work item data and generates a screen pop to the view Contact List View, with all contacts whose last name starts with the letter S.
Table 43. Event Response: OnInboundCallReceived
|
|
ServiceMethod |
CTI_Test.EvtBSGotoView |
ServiceParam.myWorkItemID |
{SiebelWorkItemID} |
ServiceParam.ANI |
{ANI} |
Command Example
Table 44 and Table 45 show an example communications command and associated command data that invokes the server-layer scripting business service method CTI_Test.CmdBSGotoView. This command makes an outbound phone call to the number the user specified in the communications toolbar's text input field.
Table 44. Command: MakeCallToPhone
|
|
ServiceMethod |
CTI_Test.CmdBSGotoView |
CmdData |
MakeCallToPhone |
OnEditControl |
True |
Table 45 shows a command data definition for this command definition.
Table 45. Command Data: MakeCallToPhone
|
|
ServiceParam.PhoneNumber |
{@Phone:PhoneTypeLookup} |
RequiredField.@Phone |
?* |
Param.CallNotifyText |
Call from {@UserName}... |
Server Script Examples
Define the following server scripts in the CTI_Test business service. These scripts are invoked by the event response and command described in Event Response Example and Command Example: function Service_PreCanInvokeMethod (MethodName, &CanInvoke) { var ReturnVal = ContinueOperation; switch (MethodName) { case "EvtBSGotoView": case "CmdBSGotoView": CanInvoke = "True"; ReturnVal = CancelOperation; } return (ReturnVal); }
function Service_PreInvokeMethod (MethodName, Inputs, Outputs) { var ReturnVal = ContinueOperation; switch (MethodName) { case "EvtBSGotoView": EvtBSGotoView(Inputs, Outputs); ReturnVal = CancelOperation; break;
case "CmdBSGotoView": CmdBSGotoView(Inputs, Outputs); ReturnVal = CancelOperation; break; } return (ReturnVal); }
function EvtBSGotoView(Inputs, Outputs) { // Getting input arguments from Event Response parameters var itemID = Inputs.GetProperty("myWorkItemID"); var ANI = Inputs.GetProperty("ANI");
// Invoking Business Service "Communications Session Manager" method var ctibs = TheApplication().GetService("Communications Session Manager"); var ip = TheApplication().NewPropertySet(); var op = TheApplication().NewPropertySet(); ip.SetProperty("WorkItemID", itemID); ctibs.InvokeMethod("GetWorkItemInfo", ip, op);
// Generate a screen pop to "Contact List View" with // all the contacts whose last name start with letter "S" var boGlobal = TheApplication().GetBusObject("Contact"); var bcContact = boGlobal.GetBusComp("Contact"); bcContact.SetViewMode(AllView); bcContact.ClearToQuery(); bcContact.SetSearchSpec("Last Name", "S*"); bcContact.ExecuteQuery(ForwardBackward); TheApplication().GotoView("Contact List View", boGlobal); }
function CmdBSGotoView(Inputs, Outputs) { // Getting input arguments from Command Data parameters var number = Inputs.GetProperty("PhoneNumber");
// Invoking Business Service "Communications Client" method var ctibs = TheApplication().GetService("Communications Client"); var ip = TheApplication().NewPropertySet(); var op = TheApplication().NewPropertySet(); ip.SetProperty("PhoneNumber", number); ip.SetProperty("ProfileName", "Siebel CTI"); ctibs.InvokeMethod("MakeCall", ip, op); }
|