Howto:ACD with Voicemail XML Script and external Database or Application: Difference between revisions
m (fixed syntaxhighlight) |
|||
(4 intermediate revisions by 3 users not shown) | |||
Line 16: | Line 16: | ||
Please note, that the scripts are exemplary and free and can be modified to | Please note, that the scripts are exemplary and free and can be modified to fulfil your special requirements. | ||
Line 27: | Line 27: | ||
Contents of acd.xml: | Contents of acd.xml: | ||
< | <syntaxhighlight lang="html5"> | ||
<?xml version="1.0" encoding="utf-8" ?> | <?xml version="1.0" encoding="utf-8" ?> | ||
<voicemail xmlns="http://www.innovaphone.com/xsd/voicemail6.xsd"> | <voicemail xmlns="http://www.innovaphone.com/xsd/voicemail6.xsd"> | ||
Line 43: | Line 43: | ||
<pbx-fwd e164="$forward" out-cause="$cause" barge-in="false" /> | <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> | </function> | ||
</voicemail> | </voicemail> | ||
</ | </syntaxhighlight> | ||
A very simple server side code example based on PHP: | A very simple server side code example based on PHP: | ||
< | <syntaxhighlight lang="php"> | ||
<?php | <?php | ||
//just for test: if CGPN is 235, forward to 103 | //just for test: if CGPN is 235, forward to 103 | ||
//implement your db query etc. here instead | //implement your db query etc. here instead | ||
if ($_GET['cgpn'] == "235") $forward = "103"; | if ($_GET['cgpn'] == "235") $forward = "103"; | ||
echo "<?xml version=\"1.0\" encoding=\"utf-8\"?>\r\n"; | echo "<?xml version=\"1.0\" encoding=\"utf-8\"?>\r\n"; | ||
echo "<voicemail xmlns=\"http://www.innovaphone.com/xsd/voicemail6.xsd\">\r\n"; | echo "<voicemail xmlns=\"http://www.innovaphone.com/xsd/voicemail6.xsd\">\r\n"; | ||
echo " <assign out=\"\$forward\" value=\"$forward\"/>\r\n"; | echo " <assign out=\"\$forward\" value=\"$forward\"/>\r\n"; | ||
echo "</voicemail>\r\n"; | echo "</voicemail>\r\n"; | ||
?> | ?> | ||
</ | </syntaxhighlight> | ||
The response of the PHP script should be as follows(if CGPN is 235): | The response of the PHP script should be as follows(if CGPN is 235): | ||
< | <syntaxhighlight lang="html5"> | ||
<?xml version="1.0" encoding="utf-8"?> | <?xml version="1.0" encoding="utf-8"?> | ||
<voicemail xmlns="http://www.innovaphone.com/xsd/voicemail6.xsd"> | |||
<assign out="$forward" value="103"/> | |||
</voicemail> | |||
</syntaxhighlight> | |||
</ | |||
===Known Problems=== | ===Known Problems=== |
Latest revision as of 11:41, 3 November 2023
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.
Applies To
This information applies to
- innovaphone PBX, V7
More Information
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 assign
elements.
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.
Configuration
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
http://127.0.0.1/drive/CF0/acd.xml?$_pbxfwd=true
.
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>
Known Problems
- Don't forget to provide additional option to the script URL, since it is required for the executing of call forwards:
?$_pbxfwd=true