Difference between revisions of "Mod cidlookup"

From FusionPBX
Jump to: navigation, search
(unixODBC: Clarify unixODBC install)
 
(20 intermediate revisions by 3 users not shown)
Line 1: Line 1:
 
==Overview==
 
==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.
+
The scope of this is to allow the use of FusionPBX's Contacts module to populate phones with Caller ID Name.
  
 
==Preface==
 
==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.
+
*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.
 +
*The CIDlookup module provides more functionality than described here. See the FreeSwitch wiki page for more details.
 +
* If you also configure to lookup using a URL and/or citystate Sql, then it is the first service that finds a result that wins. The Sql lookup in Contacts described here is second in the list.
  
 
==Requirements==
 
==Requirements==
unixODBC
+
*unixODBC for linux users, appropriate ODBC driver for Windows users
 +
*mod_cidlookup
  
mod_cidlookup
+
==Additional Info==
 +
*http://wiki.freeswitch.org/wiki/Mod_cidlookup for more details on cidlookup configuration
 +
*http://www.ch-werner.de/sqliteodbc/ for Windows Sqlite ODBC driver
  
 +
==Optional==
 
memcached
 
memcached
 
at least mod_cidlookup installed with unixodbc support.
 
  
 
==unixODBC==
 
==unixODBC==
For CentOS:
+
To install and configure ODBC on Linux, see http://wiki.freeswitch.org/wiki/Using_ODBC_in_the_core, Section 1 for details. The FusionPBX linux install scripts include installation of unixODBC.
yum install unixodbc unixodbc-dev
 
cd /usr/src/freeswitch
 
./configure && make mod_cidlookup-install
 
  
For Ubuntu
+
==Windows ODBC==
apt-get install unixodbc
+
Install an appropriate ODBC driver for the database you are using. For Sqlite use this http://www.ch-werner.de/sqliteodbc/. You then need to create a DSN using Control Panel/Administrative Tools/Data Sources.
apt-get install unixodbc-dev
 
  
 
==cidlookup.conf.xml==
 
==cidlookup.conf.xml==
PostgreSQL:
+
The default configuration file contains 3 main sections. The first is lookup using a URL, second is via a Sql Select, and third is the fallback to city-state Sql lookup. Comment out the sections that you will not be using.
 +
 
 +
For the example on this page, insert the Sql statement into the first sql section.
 +
 
 +
Sqlite or 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
 +
 
 +
 
 +
Sqlite or 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 33: Line 44:
  
  
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}'
  
 +
==DialPlan Configuration==
 +
See the FreeSwtich CIDlookup module page for several choices to add the lookup call to your dialplan
  
 
==TODO==
 
==TODO==
 
if CID Name = Fname Lname (fax) send to fax extension.
 
if CID Name = Fname Lname (fax) send to fax extension.

Latest revision as of 21:30, 29 October 2012

Overview

The scope of this is to allow the use of FusionPBX's Contacts module to populate phones with Caller ID Name.

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.
  • The CIDlookup module provides more functionality than described here. See the FreeSwitch wiki page for more details.
  • If you also configure to lookup using a URL and/or citystate Sql, then it is the first service that finds a result that wins. The Sql lookup in Contacts described here is second in the list.

Requirements

  • unixODBC for linux users, appropriate ODBC driver for Windows users
  • mod_cidlookup

Additional Info

Optional

memcached

unixODBC

To install and configure ODBC on Linux, see http://wiki.freeswitch.org/wiki/Using_ODBC_in_the_core, Section 1 for details. The FusionPBX linux install scripts include installation of unixODBC.

Windows ODBC

Install an appropriate ODBC driver for the database you are using. For Sqlite use this http://www.ch-werner.de/sqliteodbc/. You then need to create a DSN using Control Panel/Administrative Tools/Data Sources.

cidlookup.conf.xml

The default configuration file contains 3 main sections. The first is lookup using a URL, second is via a Sql Select, and third is the fallback to city-state Sql lookup. Comment out the sections that you will not be using.

For the example on this page, insert the Sql statement into the first sql section.

Sqlite or 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


Sqlite or 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}'

DialPlan Configuration

See the FreeSwtich CIDlookup module page for several choices to add the lookup call to your dialplan

TODO

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