How to automatically route calls to contact owners
This document explains how to assign contacts to account managers to automatically route calls to assigned owners.
Created: January 2019
Permalink:Â https://wildix.atlassian.net/wiki/x/LRHOAQ
Assign contacts to account managers
Note: For detailed information about contacts import, please consult Import of Contacts and Users Guide.
Import of contacts from Infusionsoft: if the contacts imported from Infusionsoft have "Owner" (specified in Infusionsoft) and owner's email address is present both in Infusionsoft and local LDAP, then the owner is automatically assigned to the imported contacts in Collaboration.Â
For each contact you can assign an account manager:
- Go to Collaboration → Phonebook
- Select the phonebook and click Edit
- Select the contact in Contact owner field
Automatically route calls from known callers to account managersÂ
To configure automatic routing of calls, you need to set up the Dialplan to perform a lookup (Lookupphonebook) using the function MYVAR=${LOOKUPPHONEBOOK(valuetolookup, fieldswelookup, fieldwewant)}). The function searches for a specified parameter of a contact and, according to results, routes a call to its owner.
Where:
- MYVAR - the variable to which the result of performing LOOKUPPHONEBOOK function is saved
- valuetolookup - the value to be looked up. Can be a channel variable
- fieldswelookup - the list of fields to search by. Multiple values, separated by commas, are allowed (in this case use single quotes)
- fieldwewant - the field whose value to return
Lookupphonebook is performed in such a way: SELECT fieldwewant FROM all_shared_phonebooks WHERE (fieldwelookup_1=valuetolookup OR fieldwelookup_2=valuetolookup OR ...)
For example: OWNER ->Â ${LOOKUPPHONEBOOK('CALLER_NUMBER', 'office, mobile', 'owner_id')}Â
Important: the search is performed in shared phonebooks!
Here you can find the example of Dialplan configuration:
- Set ->Â OWNER ->Â ${LOOKUPPHONEBOOK('${CALLERID(num)}' , 'office,home,mobile', 'owner_id')} - looks up for owner ID
- Set ->Â INFUSIONSOFT ->Â ${LOOKUPPHONEBOOK('${OWNER}', 'source_id', 'extension')} - looks up for a contact owner according to the found ID (PBX user) in shared phonebooksÂ
- Jump to if ->Â "${INFUSIONSOFT}"!="" -> Procedure with a modified number ${INFUSIONSOFT} - if the previous execution is successful, routes a call to a contact owner
- Call group - the application is executed in case no contact owner is found
Note: Refer to Dialplan applications Admin Guide for the detailed information about Dialplan applications.