This section shows how to use CM module, Cally Square and Motion Phonebar Popup together.
Just follow the next steps:
Step1: Add contacts information in the Contacts Manager
Please refer to the Contact Manager guide for contacts and lists creation.
Step 2: Set up the Cally Square project:
- Add variables: Open a new Cally Square project, go to the menu file→variable and add the two variables:
DBRESULT: where we’ll save the query result array
CALLERID(name): to replace the default caller name with the contact name
like in the following example:
![](https://helpdesk.xcallyusa.com/wp-content/uploads/2022/03/Schermata-2018-03-28-alle-10.11.40-1024x451.png)
- Design the IVR
like in the following example:
![](https://helpdesk.xcallyusa.com/wp-content/uploads/2022/03/image2016-8-29-16_21_54.png)
- Configure the Blocks:
- Edit DATABASE
![](https://helpdesk.xcallyusa.com/wp-content/uploads/2022/03/Schermata-2018-03-28-alle-10.25.22-1024x603.png)
and insert in the Query the following code block:
SELECT firstname,lastname from cm_contacts WHERE phone=”{CALLERID(num)}” OR mobile=”{CALLERID(num)}” order by id desc LIMIT 1
The query will search the Caller Number into the cm_contacts table in both fields “phone” and “mobile”. If multiple records are found, the query returns the last inserted contact.
- GOTOIF
![](https://helpdesk.xcallyusa.com/wp-content/uploads/2022/03/Schermata-2018-03-28-alle-10.32.05-1024x566.png)
Using the database block built-in variable, we check the query result. If no contact is found, the Caller Name is sent to Motion Phonebar as the default.
- SET
![](https://helpdesk.xcallyusa.com/wp-content/uploads/2022/03/Schermata-2018-03-28-alle-10.37.19-1024x521.png)
If the contact name is found, the Caller Name variable is replaced with the value “FirstName LastName”
Step 3: Configure the Motion Phonebar Popup and the trigger
MotionBar CTI Please refer to the Motion Phonebar Popup guide to properly setup the html template and the trigger
- Popup template
The following screenshot shows an example of a template used to show information about the call and the caller:
![](https://helpdesk.xcallyusa.com/wp-content/uploads/2022/03/Schermata-2018-03-28-alle-11.04.53-1024x1022.png)
(see here for more information about Popup creation)
- Trigger
The following example is a trigger used to show information template:
![](https://helpdesk.xcallyusa.com/wp-content/uploads/2022/03/Schermata-2018-03-28-alle-11.03.06-1024x362.png)