Difference between revisions of "Mod cidlookup"

From FusionPBX
Jump to: navigation, search
(Requirements)
(cidlookup.conf.xml)
Line 23: Line 23:
  
 
==cidlookup.conf.xml==
 
==cidlookup.conf.xml==
PostgreSQL:
+
PostgreSQL (fusionpbx version 3 or higher)
 +
SELECT v_contacts.contact_name_given || ' ' || v_contacts.contact_name_family ||' ('||v_contact_phones.phone_type||')' AS name, v_contact_phones.phone_number AS number
 +
FROM v_contacts, v_contact_phones
 +
WHERE v_contact_phones.contact_uuid = v_contacts.contact_uuid AND v_contact_phones.phone_number = '${caller_id_number}'
 +
LIMIT 1
 +
 
 +
 
 +
PostgreSQL (fusionpbx version 2):
 
  SELECT v_contacts.n_given || ' ' || v_contacts.n_family ||' ('||v_contacts_tel.tel_type||')' AS name, v_contacts_tel.tel_number AS number
 
  SELECT v_contacts.n_given || ' ' || v_contacts.n_family ||' ('||v_contacts_tel.tel_type||')' AS name, v_contacts_tel.tel_number AS number
 
  FROM v_contacts, v_contacts_tel
 
  FROM v_contacts, v_contacts_tel
Line 31: Line 38:
  
  
MySQL:
+
MySQL: (fusionpbx version 2)
 
  SELECT CONCAT(v_contacts.n_given, ' ', v_contacts.n_family) AS name, v_contacts_tel.tel_number AS number
 
  SELECT CONCAT(v_contacts.n_given, ' ', v_contacts.n_family) AS name, v_contacts_tel.tel_number AS number
 
  FROM v_contacts, v_contacts_tel
 
  FROM v_contacts, v_contacts_tel
 
  WHERE v_contacts_tel.contact_id = v_contacts.contact_id AND v_contacts_tel.tel_number = '${caller_id_number}'
 
  WHERE v_contacts_tel.contact_id = v_contacts.contact_id AND v_contacts_tel.tel_number = '${caller_id_number}'
 
  
 
==TODO==
 
==TODO==
 
if CID Name = Fname Lname (fax) send to fax extension.
 
if CID Name = Fname Lname (fax) send to fax extension.

Revision as of 23:13, 15 June 2012

Overview

The scope of this is to allow the use of FusionPBX's Contacts module to populate phones with Caller ID Name. This is aimed towards a linux user.

Preface

There's one major drawback of using this - you cannot assign multiple people the same number as it will only return the first result. A workaround is to create separate contacts for the company and users within the company.

Requirements

  • unixODBC
  • mod_cidlookup

Optional

memcached

unixODBC

For CentOS:

yum install unixodbc unixodbc-dev
cd /usr/src/freeswitch
./configure && make mod_cidlookup-install

For Ubuntu

apt-get install unixodbc
apt-get install unixodbc-dev

cidlookup.conf.xml

PostgreSQL (fusionpbx version 3 or higher)

SELECT v_contacts.contact_name_given || ' ' || v_contacts.contact_name_family ||' ('||v_contact_phones.phone_type||')' AS name, v_contact_phones.phone_number AS number
FROM v_contacts, v_contact_phones
WHERE v_contact_phones.contact_uuid = v_contacts.contact_uuid AND v_contact_phones.phone_number = '${caller_id_number}'
LIMIT 1


PostgreSQL (fusionpbx version 2):

SELECT v_contacts.n_given || ' ' || v_contacts.n_family ||' ('||v_contacts_tel.tel_type||')' AS name, v_contacts_tel.tel_number AS number
FROM v_contacts, v_contacts_tel
WHERE v_contacts_tel.contact_id = v_contacts.contact_id AND v_contacts_tel.tel_number = '${caller_id_number}'
LIMIT 1


MySQL: (fusionpbx version 2)

SELECT CONCAT(v_contacts.n_given, ' ', v_contacts.n_family) AS name, v_contacts_tel.tel_number AS number
FROM v_contacts, v_contacts_tel
WHERE v_contacts_tel.contact_id = v_contacts.contact_id AND v_contacts_tel.tel_number = '${caller_id_number}'

TODO

if CID Name = Fname Lname (fax) send to fax extension.