Howto:Simple Linear ACD with Voicemail XML Script: Difference between revisions

From innovaphone wiki
Jump to navigation Jump to search
m →‎Configuration: Source code moved to Download Page
Line 40: Line 40:
The outline for the following configuration scenario shall be as follows:
The outline for the following configuration scenario shall be as follows:
*Create a new folder on the compact flash card e.g. "acd".
*Create a new folder on the compact flash card e.g. "acd".
*Place a file with XML script listed below and named "acd.xml".
*Place a files provided in the download section in this folder.
*Additionally place the text files with numbers of agents and voicemail box in this folder.
*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 <code>http://127.0.0.1/drive/CF0/acd/acd.xml?$_pbxfwd=true</code>.
*Create a new voicemail object in the PBX with URL <code>http://127.0.0.1/drive/CF0/acd/acd.xml?$_pbxfwd=true</code>.
*In case an innovaphone voicemail is used instead of an external voicemail box:
*In case an innovaphone voicemail is used instead of an external voicemail box:
**Create a dummy user with a CFU to <VM-Number>+<Box-Number>
**Create a dummy user with a CFU to <VM-Number>+<Box-Number>
Contents of acd.xml:
<code xml>
<?xml  version="1.0" encoding="utf-8" ?>
<voicemail xmlns="http://www.innovaphone.com/xsd/voicemail6.xsd">
<!-- Place call. IN $number=e164, OUT $call-result=away(CFU),busy,unreachable(unregistered),timeout(no answer) -->
<function define="call">
  <!-- Assign 'happy end' as default  -->
  <assign out="$call-result"  value="ok"  />
  <if cond="$number">
    <!-- check, whether a CFU is active  -->
    <pbx-finduser-e164 e164="$number" out-cn="$cn" />
    <if cond="$cn">
      <pbx-query-obj name="$cn" type="cfu" out="$cfu" />
        <if cond="$cfu">
          <assign out="$call-result"  value="away" />
          <return />
        </if>
    </if>
    <!-- try to forward the call with no response timeout of 15 sec. adjust it according your needs -->
    <pbx-fwd e164="$number"  out-cause="$cause" barge-in="false" sec="15" />
    <!-- validate the cause code and assign the result to $call-result -->
    <switch var="$cause">
      <case equal="17">
        <assign out="$call-result"  value="busy" />
        <assign out="$busy"  value="true" />
      </case>
      <case equal="18">
        <assign out="$call-result"  value="unreachable" />
      </case>
      <case equal="128">
        <assign out="$call-result"  value="timeout" />
      </case>
    </switch>
  </if>
</function>
<function define="Main">
  <assign out="$prefix"  value="1"  />
  <lib-strcat out-string="$file" string="$prefix"  string2=".txt" />
  <store-cookie root="" name="$file" out="$number" />
  <while cond="$number">
  <call name="call" />
   
    <!-- call current $number  -->
    <switch var="$call-result">
      <case equal="ok">
        <pbx-disc />
        <!-- happy end  -->
      </case>
    </switch>
    <!-- next round  -->
    <add value="$prefix"  value2="1"  out="$prefix" />
    <lib-strcat out-string="$file" string="$prefix"  string2=".txt" />
    <assign out="$number"  value=""  />
    <store-cookie root="" name="$file" out="$number" />
  </while>
  <!-- if any agents were busy -->
  <if cond="$busy">
    <!-- Silence (just a workaround to be able to disconnect with busy cause)  -->
    <store-get root="" name="silence.g711a"  out-url="$ctrl" />
    <pbx-prompt url="$ctrl"  sec="1"  barge-in="false" />
   
    <!-- disconnect call with cause code 17 (busy)-->
    <pbx-disc cause="17" />
  </if>
  <else>
    <!-- otherwise read voicemail number from vm.txt -->
    <store-cookie root="" name="vm.txt" out="$vmdummy"  />
    <!-- and forward the call to voicemail -->
    <pbx-fwd e164="$vmdummy"  />
  </else>
</function>
</voicemail>
</code>


===Known Problems===
===Known Problems===

Revision as of 14:33, 2 August 2010

This article describes how to setup a simple automated call distribution by using custom voicemail XML script.

Applies To

This information applies to

  • innovaphone PBX, V7 hotfix 1


More Information

In most cases it is possible to distribute incoming calls on innovaphone PBX as desired by using PBX features like a broadcast call, waiting queue and user groups. But some scenarios require more complex call routing between user objects. For this purpose a custom XML voicemail script can be used to implement a desired call distribution scenario.


This script is based on an example for a simple call flow:

  • route incoming call to agents one by one
  • try next agent if
    • agent is away(CFU is enabled) or not registered
    • agent is busy
    • agent is not responding after 15 sec.
  • at the end, when all agents have been tried
    • route call to VM if no busy agents
    • disconnect with cause code "busy", if busy agents available

The call distribution is intentional designed so that the first free agent gets the most calls.



To make the script somewhat generic the numbers of agents and mailbox number are stored in separate files:

1.txt
101
2.txt
102
3.txt
103
vm.txt
300

Please note, that this script is exemplary and free and can be modified to fulfill your special requirements.


Configuration

The outline for the following configuration scenario shall be as follows:

  • Create a new folder on the compact flash card e.g. "acd".
  • Place a files provided in the download section in this folder.
  • 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/acd.xml?$_pbxfwd=true.
  • In case an innovaphone voicemail is used instead of an external voicemail box:
    • Create a dummy user with a CFU to <VM-Number>+<Box-Number>

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
  • Make sure there no administrative CFUs (using boolean, "only not for" etc.) configured on the PBX users/agents.
  • Make sure the CFNR Timeout is longer than timeout difined in the ACD XML Script. CFNR defined on User Objects with no registered device are executed immediately.
  • If "No Answer" on Trunk Object is configured, configure a CFNR on the ACD VoiceMail Object with "-" (minus sign) as number (see Reference7:Administration/PBX/Objects/Edit CFs for more information).

Download

Related Articles

How to Configure the innovaphone Voicemail