Set up Quarantine Management process¶
Introduction¶
We offer a possibility to set up live cycles for IOVOX Numbers in the accounts. The normal cycle for IOVOX Numbers is as described below
- VoxNumber is purchased.
- VoxNumber is assign to a link.
- VoxNumber remind active for a period of time.
- VoxNumber is put quarantine.
- VoxNumber is deleted from the account.
In some cases, The VoxNumber cycle is static. In these cases, we provide the functionality to do this automatically.
Main Concepts¶
Quarantine Period is the period when the VoxNumbers remains inactive to let the callers know that these numbers are no longer in used for the purpose they used to be.
Quarantine Date is the date when the VoxNumber is put in Quarantine.
Deletion Date is the date when this VoxNumber will be deleted from the account.
Detach Date is the date when this VoxNumber will be detached from the link and put back to the pool account.
How to set up the quarantine management process¶
In order to set up the quarantine management process you will need to follow the steps below
- Create the Quarantine and Deletion dates
- Create Quarantine Template.
- Create the Node, link, attach the Quarantine and Deletion dates and apply a VoxNumber
These dates can be changed or removed if it is required.
Create the Quarantine and Deletion dates¶
We will use the method createCategoryConfigurations in order to create the Quarantine and Deletion Dates categories
Quarantine Date E.G:
<?xml version="1.0" encoding="utf-8"?>
<request>
<category>
<label>Quarantine Date</label>
<category_id>Quarantine Date</category_id>
<type>Quarantine_Date</type>
<value_type>STATIC</value_type>
</category>
</request>
Deletion Date E.G:
<?xml version="1.0" encoding="utf-8"?>
<request>
<category>
<label>Deletion Date</label>
<category_id>Deletion Date</category_id>
<type>Deletion_Date</type>
<value_type>STATIC</value_type>
</category>
</request>
Detach Date E.G:
<?xml version="1.0" encoding="utf-8"?>
<request>
<category>
<label>Detach Date</label>
<category_id>Detach Date</category_id>
<type>Detach_Date</type>
<value_type>STATIC</value_type>
</category>
</request>
Create Quarantine Template¶
We will use the method createCallFlow. we will add the property isQuarantine="TRUE". It is only allowed to have one Quarantine template in the account. The Quarantine template can have fixed whispers and a phoneNumber whisper which will play back the phone number of the contact applied. E.G:
<?xml version="1.0" encoding="UTF-8"?>
<callFlow name="QuarantineTemplate" isQuarantine="TRUE">
<play id="play_1" label="Play Message">
<soundFile soundLabel="Destination number not available" soundGroup="English"/>
<phoneNumber format="INTERNATIONAL" locale="en_GB" destinationPhoneNumber="?" destinationContactId="?"/>
</play>
</callFlow>
The way the automatic script will work is that once a link reaches the Quarantine Date, we will find the first variable contact from the first call rule and apply it to the quarantine template if it contains a phoneNumber element.
Create the Node, link, attach the Quarantine and Deletion dates and apply a VoxNumber¶
We will use the method createNodeFull for setting up the Node, link and apply the Quarantine and Deletion Dates. These dates must have a format YYYY-MM-DD otherwise a message will be displayed with an error. Furthermore, the category ID will be unique. If the category does not exist, it will be created and appended to to the link. E.G:
<?xml version="1.0" encoding="utf-8"?>
<request>
<node>
<node_id>ABCD-Client</node_id>
<node_name>Bob Plumbing</node_name>
<node_type>Business</node_type>
<node_date>2017-01-19 14:10:46</node_date>
<links>
<link>
<link_id>ABCD-Directory</link_id>
<link_name>Bob in directory</link_name>
<link_type>Newspaper</link_type>
<link_date>2017-01-19 14:10:46</link_date>
<rule_template_name>call</rule_template_name>
<assign_voxnumber>
<method>BY AREA</method>
<voxnumber_idd>44</voxnumber_idd>
<area_code>20</area_code>
</assign_voxnumber>
<rules_variable>
<rule>
<rule_id>call_1</rule_id>
<rule_type>call</rule_type>
<rule_label>Call</rule_label>
<contact>
<contact_id>23113123</contact_id>
<display_name>Bob Plumbing</display_name>
<email>bob.plumber@iovox.com</email>
<business_phone>449789122233</business_phone>
<company>IOVOX</company>
</contact>
</rule>
</rules_variable>
<categories>
<category>
<category_id>Quarantine Date:2017-04-07</category_id>
<label>Quarantine Date</label>
<value>2017-04-07</value>
</category>
<category>
<category_id>Deletion Date:2017-05-07</category_id>
<label>Deletion Date</label>
<value>2017-05-07</value>
</category>
</categories>
</link>
</links>
</node>
</request>
If a link contains only a Quarantine Date, then the link will be only put in Quarantine. If the Link has only the Deletion Date, the VoxNumber will be removed from the account only.
Update and delete Quarantine Date and Deletion Date¶
In order to update the Quarantine Date, the current Quarantine Date will be replaced for the new category. In this case, the method removeCategoryFromLink will be used first and afterwards will be use the method updateLinks.
<?xml version="1.0" encoding="utf-8"?>
<request>
<link>
<link_id>ABCD-Directory</link_id>
<category_id>Quarantine Date:2017-08-20</category_id>
<label>Quarantine Date</label>
</link>
</request>
E.G: updateLinks