Making it easy for customers to connect is one of the benefits of deploying SAP Business Communications Management (BCM) in the contact center. One valuable convenience offered by BCM is the “Callback” functionality that can be enabled for any voice queue.
This functionality allows callers to have the option of requesting a call back in the event there is no agent to assist them immediately, and to eliminate the need for them to wait in queue. Agents are logged into this “Callback Queue” and handle these requests as outbound interactions. Extending this convenience to a website or a kiosk can further improve the customer experience.
How can this be achieved with SAP BCM? Read on to find out how we can enable call back requests programmatically.
Step 1 – Create Callback Queue using SAP BCM System Configurator
We’re going to assume you know your way around BCM System Configurator (SC) and get right to the details. You can find more information on the SC, at the SAP Library Online Documentation site.
This queue is just like any other queue, except we are going to designate it for use as a call back queue. Adjust the settings for your specific use case, including a callback script* to be displayed to the agent when the call is connected. *Edit: The callback script is currently mandatory for callbacks to work.
Step 2 – Associate the Callback Queue with a Primary Queue
We now open our primary queue and associate the call back queue by entering the number in the “Callback Queue Number” field under “Contact Management” settings.
Step 3 – Create Stored Procedure using Microsoft SQL Management Studio
We’re going to leverage the fact that SAP BCM has Microsoft SQL Server as its foundation data layer. Call back requests at their core are simply entries in a database table. In the steps below, we will walk you through the specifics on what table holds this data and create a generic stored procedure to insert a Call back request programmatically. The nice benefit of a stored procedure is it can be called by a variety of languages and leveraged by many platforms e.g. .NET Web Services, ASP.NET, ODBC on any platform, JDBC from Java, PHP, etc. Really, any environment that can execute SQL Server Stored Procedures can benefit without knowing specifics about, or directly modifying, the underlying BCM tables.
It’s outside our scope to step you through using SQL Management Studio or any other tools that can be leveraged to create SQL stored procedures. There are lot’s of examples available through a web search.
The following sql script can be leveraged/modified to create your stored procedure:
-- ================================================ -- PROC x_SetCallBack -- -- Sets a CallBack request into BCM so a caller -- can be called back by submitting a web form, -- from a web service call, etc -- (anything that can execute this PROC) -- -- Return Value: -- 1 = Success -- 0 = Failure -- (Occurs when a Queue with the specified -- name does not exist or a CallBack -- Queue is not configured for the Queue -- Specified) -- ================================================ -- SET this variable to the name of your BCM Operative DB :setvar bcmConfigDB "BCMTest" USE [$(bcmConfigDB)] GO SET ANSI_NULLS ON GO SET QUOTED_IDENTIFIER ON GO CREATE PROCEDURE x_SetCallBack -- Proc Params @QueueName AS varchar(64), @CallBackNumber AS varchar(32) AS BEGIN SET NOCOUNT ON; -- SET Return Values DECLARE @result INT; SET @result = 0; -- default return value is failure -- Declare variables DECLARE @OrigCalledNbr VARCHAR(32), @QueueGUID UNIQUEIDENTIFIER, @CBQNbr VARCHAR(32), @IVRQNbr VARCHAR(32), @ExtraData NVARCHAR(MAX); -- Get Extentension & CallBack Queue for the "orginally called number" /* Sets @OrigCalledNbr, * @CBQNbr * * If the Queue specified by @QueueName does not have a configured * CallBack Queue, this PROC throws an error. */ SELECT @OrigCalledNbr = e.Address, @QueueGUID = qa.QueueGUID, @CBQNbr = qp.Value FROM [$(bcmConfigDB)].[dbo].[Extension] e JOIN [$(bcmConfigDB)].[dbo].[QueueAttr] qa ON e.OwnerGUID = qa.QueueGUID JOIN [$(bcmConfigDB)].[dbo].[QueueParameter] qp ON qp.QueueGUID = qa.QueueGUID WHERE e.Type = 21 AND qa.Name = 'Name' AND qa.Value = @QueueName AND qp.Name = 'QCBQueueNumber' ORDER BY e.Address; IF (@OrigCalledNbr IS NULL OR @CBQNbr IS NULL) BEGIN SET @result = 0; -- Error result RAISERROR('Queue not found or CallBack Queue not found for Queue with name: "%s"', 10, 1, @QueueName); RETURN @result; END -- Get Callback IVR Extension SELECT @IVRQNbr = e.Address FROM [$(bcmConfigDB)].[dbo].[Extension] e, [$(bcmConfigDB)].[dbo].[Application] a WHERE e.OwnerGUID = a.GUID AND a.Type = 'CallBackIvr'; -- Set Call Attached Data (CAD) for IVR Callback -- Set Callback Number (Caller A-Number) and Queue Name SET @ExtraData = '<?xml version="1.0" encoding="UTF-8"?><XML><CustomerName></CustomerName><CustomerCompany></CustomerCompany><CustomerEMail></CustomerEMail><CustomerTitle></CustomerTitle><CustomerMobile></CustomerMobile><RealANumber>' + CONVERT(nvarchar(32),@CallBackNumber) + '</RealANumber><CustomerNumber></CustomerNumber><FirstBName>' + CONVERT(nvarchar(36),@QueueGUID) + '</FirstBName></XML>'; -- Insert CallBack Request into DB -- We are setting the NextCallTime to NOW, so CallBack is moved to top of the Queue INSERT INTO [$(bcmConfigDB)_Operative].[dbo].[CallBackQueue] (GUID, CreationTime, NextCallTime, OrigCallerNbr, OrigCalledNbr, CBQNbr, IVRQNbr, Failures, MaxCalls, LastResult, ExtraData, Notes) VALUES (NewID(), GetDate(), GetDate(), @CallBackNumber, @OrigCalledNbr, @CBQNbr, @IVRQNbr, '0', '3', 'ADDED', @ExtraData, ''); SET @result = 1; -- return success RETURN @result; END GO
There are a number of ways this procedure could be enhanced. For instance, you could pass in the NextCallTime parameter and provide your customers the ability to request a specific time for the call back. You could improve performance by passing the GUID and extension of the callback queue, and thus avoid the expense of the lookup code.
Step 4 – Test the Stored Procedure from Microsoft SQL Management Studio
Now, let’s test our procedure to ensure it works as expected. The following SQL code can be modified with your specific queue name and called directly from SQL Management Studio.
-- SET this variable to the name of your BCM Operative DB :setvar bcmConfigDB "BCMTest" USE [$(bcmConfigDB)] GO DECLARE @return_value int -- Replace 'Sales' and '12223334444' with your specifics EXEC @return_value = [dbo].[x_SetCallBack] @QueueName = N'Sales', @CallBackNumber = N'12223334444' SELECT 'Return Value' = @return_value GO
Executing this script should result in your number going to the front of the callback queue and being called by the next available agent. If the script doesn’t seem to work, don’t forget… you do need to assign agents to the Sales and Sales Callback Queue, log them in and make available!
Step 5 – Call Stored Procedure from your Code
Now that we have it working, we can use this as the pattern for calling this stored procedure from your own code.
Leverage for Maximum Benefit
Hopefully this article has sparked some ideas to help you develop compelling customer solutions, and improve the customer experience. Here are a few ideas to get you started:
- Web call back form: Allow customers to enter their phone number from your website to request a call back. The queue is determined based on the “context” of the requesting web page. For instance, if the customer is at the “checkout” page vs. the “returns” page.
- Front end the stored procedure call with a secure web service in your DMZ and enable “Call me” functionality from any mobile app
- Scheduling customer calls based on triggering criteria within a 3rd party application (for scenarios where outbound campaigns are not necessary)
P.S. Special thanks to SAP’s Jason Rosen for his contribution to this post!