arnaudcoquelet / fusionpbx

Automatically exported from code.google.com/p/fusionpbx
0 stars 0 forks source link

SQL #806

Closed GoogleCodeExporter closed 9 years ago

GoogleCodeExporter commented 9 years ago
 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

Original issue reported on code.google.com by blessen...@gmail.com on 8 Jan 2015 at 9:50

GoogleCodeExporter commented 9 years ago
Sorry, can't delete this issue, but try to describe a problem with new comment.

On the Wiki Page I found this example of sqlite request for fusionpbx.
The problem is "Contact Number Edit" page in FusionPBX GUI does not allow set 
v_contact_phones.phone_type field, but allow set v_contact_phones.phone_label.

If v_contact_phones.phone_type is not set cidlookup will not return contact 
name.
So, you should change a Wiki page examples, or allow set phone type on the 
contact edit page. 

Another bug on "Contact Number Edit" - when you open contact phone edit page 
after saving number which started from zero, 0XXXXXXXXX, you will see this 
number without zero (XXXXXXXXX). But in the database, and contact summary info 
page - number still correct - with zero.

My FusionPBX System status

Version:    3.7.1
Operating System:   Linux fusionpbx 2.6.32-31-pve #1 SMP Thu Jul 24 06:44:16 
CEST 2014 x86_64 GNU/Linux
Uptime:     12:03:52 up 56 days, 16:07, 1 user, load average: 0.12, 0.13, 0.14
Date:   Thu, 08 Jan 2015 12:03:52 +0200

Original comment by blessen...@gmail.com on 8 Jan 2015 at 10:04

GoogleCodeExporter commented 9 years ago
http://wiki.fusionpbx.com/index.php?title=Mod_cidlookup

Original comment by blessen...@gmail.com on 8 Jan 2015 at 10:04

GoogleCodeExporter commented 9 years ago
I think usefull info for beginners, like me, on the wiki page will be info 
about sqlite db connection settings in the cidlookup.conf.xml.

<!--    <param name="odbc-dsn" value="$${dsn_system}"/> -->
<param name="odbc-dsn" value="/var/www/fusionpbx/secure/fusionpbx.db"/>

Original comment by blessen...@gmail.com on 8 Jan 2015 at 10:07

GoogleCodeExporter commented 9 years ago
Added as requested.

Original comment by markjcrane@gmail.com on 11 Jan 2015 at 8:12