Project

General

Profile

Caller Data Retrieval from DB

In order to integrate PBX server to your CRM, the following information is necessary:

  • DB Hostname - database IP address
  • DB Username - username for database access
  • DB Password - password for database access
  • DB Name - database name
  • DB Query - query used to retrieve information

DB Query example

CAST) USING utf8) AS BINARY) AS name,

SELECT customers.id,
    CAST(CONVERT(TRIM(CONCAT(customers.firstname, ' ', customers.lastname)) USING utf8) AS BINARY) AS name,
    IFNULL(current_op.pabx_alias, dedicated_op.pabx_alias) AS direct_line,
    IF(customers.group_id IS NULL AND COUNT(orders.id) > 0, 1, NULL) AS queue_position,
    CONCAT('http://app.while1.ro/admin/customers/edit?customer=', customers.id) AS backend_link,
    CASE
        WHEN customers.source = 'emag_marketplace' THEN 'emag'
    ELSE 
        NULL
    END AS route_identifier
FROM customers
LEFT JOIN orders ON orders.customer = customers.id AND orders.status NOT IN ('pending', 'completed', 'cancelled', 'refused')
LEFT JOIN employees AS dedicated_op ON dedicated_op.customer_id = customers.dedicated_operator
LEFT JOIN employees AS current_op ON current_op.customer_id = orders.owner
WHERE customers.telephone1 = '%s'
GROUP BY customers.id
ORDER BY orders.id DESC, customers.id
LIMIT 1
The query will return the following columns:
  • id => Internal customer ID*+mandatory+
  • name => name, first name*+mandatory+
  • backend_link => Popup link for Incoming Call Answer
  • direct_line => used for Inbound Calls with direct transfer to the agent (e.g.: SIP/ion-popescu), optional
  • queue_position => queue position, 0-100 / NULL, optional
  • route_identifier => Special Routes Identifier, used to override the Outbound Number in PBX- Inbound routes (e.g.: call to eMAG MKTP customers)
  • outbound_number => used for Outbound Calls. The Outbound number can be obtained from the Dial Plan supplied by the telephone provider. (optional)

Database Access Details will be provided in the available form from Settings>Projects>Edit project.

The route_identifier parameter is used together with the unique ID External identifier, configured in the GUI section Inbound routes for outbound calls.

Connecting to MySQL is allowed from PBX's dedicated IP address, so please make sure that you have notified While1 Voice Support team in order for PBX's dedicated IP address to be whitelisted.

In order to display the Caller ID Pop-up to the agent, continue to follow the steps from item 2, page Caller ID Pop-up.

Configuration mySQL example

Configuration MSSQL example


Available in other languages: RO

Go to top