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

From innovaphone wiki
Jump to navigation Jump to search
Line 53: Line 53:


<!-- Place call. IN $number=e164, OUT $call-result=away(CFU),busy,unreachable(unregistered),timeout(no answer) -->
<!-- Place call. IN $number=e164, OUT $call-result=away(CFU),busy,unreachable(unregistered),timeout(no answer) -->
<function define="call">
<function define="call">
   <!-- Assign 'happy end' as default  -->
   <!-- Assign 'happy end' as default  -->
Line 69: Line 68:
     </if>
     </if>


     <!-- forward the call with no response timeout of 15 sec. adjust it according your needs -->
     <!-- 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" />
     <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">
     <switch var="$cause">
       <case equal="17">
       <case equal="17">
Line 86: Line 87:
   </if>
   </if>
</function>
</function>


<function define="Main">
<function define="Main">
Line 92: Line 95:
   <lib-strcat out-string="$file" string="$prefix"  string2=".txt" />
   <lib-strcat out-string="$file" string="$prefix"  string2=".txt" />
   <store-cookie root="" name="$file" out="$number" />
   <store-cookie root="" name="$file" out="$number" />
   <while cond="$number">
   <while cond="$number">
   
   
Line 109: Line 113:
     <assign out="$number"  value=""  />
     <assign out="$number"  value=""  />
     <store-cookie root="" name="$file" out="$number" />
     <store-cookie root="" name="$file" out="$number" />
   </while>
   </while>


   <!-- Silence (just a workaround to be able to disconnect with busy cause)  -->
   <!-- if any agents were busy -->
  <store-get root="" name="silence.g711a"  out-url="$ctrl" />
  <pbx-prompt url="$ctrl"  sec="1"  barge-in="false" />
 
   <if cond="$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" />
     <pbx-disc cause="17" />
   </if>
   </if>
   <else>
   <else>
    <!-- otherwise read voicemail number from vm.txt -->
     <store-cookie root="" name="vm.txt" out="$vmdummy"  />
     <store-cookie root="" name="vm.txt" out="$vmdummy"  />
    <!-- and forward the call to voicemail -->
     <pbx-fwd e164="$vmdummy"  />
     <pbx-fwd e164="$vmdummy"  />
   </else>
   </else>

Revision as of 17:36, 23 December 2008

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.


Call Distribution Diagramm.png


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 .


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 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/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>


Contents of acd.xml: <?xml version="1.0" encoding="utf-8" ?> <voicemail xmlns="http://www.innovaphone.com/xsd/voicemail6.xsd">

<function define="call">

  <assign out="$call-result"  value="ok"  />
  <if cond="$number">
    <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>
    <pbx-fwd e164="$number"  out-cause="$cause" barge-in="false" sec="15" />
    <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" />
   
   <switch var="$call-result">
     <case equal="ok">
       <pbx-disc />
     </case>
   </switch>
   <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 cond="$busy">
   <store-get root="" name="silence.g711a"  out-url="$ctrl" />
   <pbx-prompt url="$ctrl"  sec="1"  barge-in="false" />
   
   <pbx-disc cause="17" />
 </if>
 <else>
   <store-cookie root="" name="vm.txt" out="$vmdummy"  />
   <pbx-fwd e164="$vmdummy"  />
 </else>

</function>

</voicemail>

Known Problems

Related Articles

How to Configure the innovaphone Voicemail