Howto:ACD with Voicemail XML Script and external Database or Application
This article describes how to setup a simple automated call distribution by using custom voicemail XML script and an external database or a CRM application.
This information applies to
- innovaphone PBX, V7
A frequently asked feature for incoming call centers is ability to connect incoming customer calls to their respective personal point of contact(an agent or agent group). The relationship of customer calling number and responsible agent is stored in the external database or CRM application. For this purpose a custom XML voicemail script can be used to perform a query from innovaphone PBX to an external application via HTTP.
The voicemail command
exec url executes an HTTP GET CGI-request. The URL is supposed to contain arbitrary script variables. The remote CGI script shall return a short voicemail script comprising
The call distribution is intentional designed so that the first free agent gets the most calls.
Please note, that the scripts are exemplary and free and can be modified to fulfil your special requirements.
The outline for the following configuration scenario shall be as follows:
- Create a file with XML script listed below and named "acd.xml".
- Additionally place the text files with numbers of agents and voicemail box in this folder.
- Create a new voicemail object in the PBX with URL
Contents of acd.xml:
<?xml version="1.0" encoding="utf-8" ?> <voicemail xmlns="http://www.innovaphone.com/xsd/voicemail6.xsd"> <function define="Main"> <!-- get call data --> <pbx-getcallinfo out-cgpn="$cgpn" out-cdpn="$cdpn" out-leg2="$leg2" /> <!-- default number for call froward, in case URL not available --> <assign out="$forward" value="999"/> <!-- external database query --> <exec url="http://172.16.0.17/query.php?cgpn=$cgpn"/> <!-- forward the call to the number returned by the URL --> <pbx-fwd e164="$forward" out-cause="$cause" barge-in="false" /> <!-- Play Prompt and Disc - In order to call be disconnected from ACD Script--> <store-get root="" name="silence.$coder" out-url="$ctrl" /> <pbx-prompt url="$ctrl" sec="1" repeat="true"/> <pbx-disc/> </function> </voicemail>
A very simple server side code example based on PHP:
<?php //just for test: if CGPN is 235, forward to 103 //implement your db query etc. here instead if ($_GET['cgpn'] == "235") $forward = "103"; echo "<?xml version=\"1.0\" encoding=\"utf-8\"?>\r\n"; echo "<voicemail xmlns=\"http://www.innovaphone.com/xsd/voicemail6.xsd\">\r\n"; echo " <assign out=\"\$forward\" value=\"$forward\"/>\r\n"; echo "</voicemail>\r\n"; ?>
The response of the PHP script should be as follows(if CGPN is 235):
<?xml version="1.0" encoding="utf-8"?> <voicemail xmlns="http://www.innovaphone.com/xsd/voicemail6.xsd"> <assign out="$forward" value="103"/> </voicemail>
- Don't forget to provide additional option to the script URL, since it is required for the executing of call forwards: