SugarCRM and Superfecta!

DjBac

Joined
May 20, 2009
Messages
137
Likes
0
Points
0
#1
Has anyone managed to make superfecta lookup on sugarcrm's contacts?

Do you know the database name of cugarcrm in order to put it into superfecta's configuration?
 

Patrick_elx

Joined
Dec 14, 2008
Messages
1,120
Likes
0
Points
0
#2
I'm not using sugarcrm, however the latest version of superfecta seems to be working well with sugarcrm on PiaF per the different user's reports I've read.

Are you using the latest version of Superfecta?

http://projects.colsolgrp.net/projects/list_files/superfecta

also did you add the rewriteCond in
/etc/httpd/conf.d/elastix.conf


<Directory "/var/www/html">
# Redirect administration interface to https
RewriteEngine on
RewriteCond %{HTTPS} off
RewriteCond %{REQUEST_URI} !(/admin/modules/superfecta/*)
RewriteRule (.*) %{HTTP_HOST}%{REQUEST_URI}
</Directory>
 

Patrick_elx

Joined
Dec 14, 2008
Messages
1,120
Likes
0
Points
0
#3
try the following:

DB Host: localhost
DB Name: sugarcrm
DB user: sugarcrm
DB password: sugarcrm
 

DjBac

Joined
May 20, 2009
Messages
137
Likes
0
Points
0
#4
I still get "SugarCRM connection failed" when trying to search for a phone number!

What is the best way to have CID that can search through a phonebook. Is this the one?
 

Patrick_elx

Joined
Dec 14, 2008
Messages
1,120
Likes
0
Points
0
#5
you have the asterisk phonebook.

You can add number from the unembedded freepbx interface (Tools / Asterisk phonebook).

You can have a lookup at this sources either from superfecta or directly by asterisk (just select internal as CID lookup source in your inbound route instead of superfecta).
 

Patrick_elx

Joined
Dec 14, 2008
Messages
1,120
Likes
0
Points
0
#6
I just installed sugarcrm on my server, and superfecta achieved to connect to the database.


Look in the file /var/www/html/crm/config.php

in mine I have:

Code:
'db_host_name' => 'localhost',
    'db_host_instance' => '',
    'db_user_name' => 'sugarcrm',
    'db_password' => 'sugarcrm',
    'db_name' => 'sugarcrm',
    'db_type' => 'mysql',
Look in yours if the user name and password are different.
 

DjBac

Joined
May 20, 2009
Messages
137
Likes
0
Points
0
#7
Now it seems to connect but I get no result.

For instance, let's say I create a contact in sugarcrm and then test is on the superfecta module it says not found!

I chose sugarcrm instead of asterisk phonebook, since it is easier to import contacts from outlook!!

Is there a way to import or even sync contacts from my exchange server?
 

DjBac

Joined
May 20, 2009
Messages
137
Likes
0
Points
0
#8
It works with asterisk phonebook on the test page, but on my extensions I get no name! Isn't this strange?
 

Patrick_elx

Joined
Dec 14, 2008
Messages
1,120
Likes
0
Points
0
#9
did you select in the correct inbound route CID lookup source as superfecta?
 

DjBac

Joined
May 20, 2009
Messages
137
Likes
0
Points
0
#10
Yeap, sorry my mistake!!

But still, cannot get it work with sugarCRM!
 

Patrick_elx

Joined
Dec 14, 2008
Messages
1,120
Likes
0
Points
0
#11
You're right I have the same problem.

Looking in the source I've found that (removed full code for clarity):
Code:
if($param['SugarCRM']['Search_Type'] >= 0)
		$wquery_string = accounts.phone_office OR accounts.phone_alternate OR accounts.phone_fax
// search also users, if no result from accounts
if($wsearch_type >= 1 && strlen($wresult_caller_name) == 0)
		$wquery_string = users.phone_work OR users.phone_mobile OR users.phone_home OR users.phone_other OR users.phone_fax
// search also contacts, if no results from previous searches
if($wsearch_type >= 2 && strlen($wresult_caller_name) == 0)
		$wquery_string = contacts.phone_work OR contacts.phone_mobile OR contacts.phone_home OR contacts.phone_other OR contacts.phone_fax
If you put a phone number in an account, superfecta will find it.
If you put it in users or contact it will not be found.
Either the search type is not properly sent, or there is another small bug.

I will report it to the developer. Let's hope it will be corrected soon.
 

DjBac

Joined
May 20, 2009
Messages
137
Likes
0
Points
0
#12
So, there is nothing right now I can do to fix it, right? :(
 

Patrick_elx

Joined
Dec 14, 2008
Messages
1,120
Likes
0
Points
0
#13
yes you can enter your phone numbers in account instead of users and it will work.

Or you can wait a few days for a new bug fix release as the superfecta team seems to be really reactive.
 

DjBac

Joined
May 20, 2009
Messages
137
Likes
0
Points
0
#14
HHhmmm, but in accounts there is only one field for phone number, so this won't do!

Is there a better way to import or sync contacts from outlook/exchange server/csv file??
 

Patrick_elx

Joined
Dec 14, 2008
Messages
1,120
Likes
0
Points
0
#15
you can do a temporary fix until the bug is corrected by putting in

/var/www/html/admin/modules/superfecta/bin/source-SugarCRM.php


$wsearch_type= '2';

somewhere in the beginning of the file.


It does the trick for me.

[Edited: No need for this fix, check my next post with the full fix]
 

DjBac

Joined
May 20, 2009
Messages
137
Likes
0
Points
0
#16
That seems to work, but it doesn't search in all the fields (i.e. home phone, business phone etc.). Is there a way too, to change this? :D
 

Patrick_elx

Joined
Dec 14, 2008
Messages
1,120
Likes
0
Points
0
#17
Ok I should have found the bug earlier.

No need for the temporary fix in my previous post.


Just edit the /var/www/html/admin/modules/superfecta/bin/source-SugarCRM.php

replace the two:

if($wsearch_type >=

by

if($param['SugarCRM']['Search_Type'] >=

and it works flawlessly...
 

Patrick_elx

Joined
Dec 14, 2008
Messages
1,120
Likes
0
Points
0
#18
DjBac said:
That seems to work, but it doesn't search in all the fields (i.e. home phone, business phone etc.). Is there a way too, to change this? :D
so far it's looking at the following fields in the sugarcrm mySQL database:

search type>=0
accounts.phone_office
accounts.phone_alternate
accounts.phone_fax

search type >=1
users.phone_work
users.phone_mobile
users.phone_home
users.phone_other
users.phone_fax

search type>=2
contacts.phone_work
contacts.phone_mobile
contacts.phone_home
contacts.phone_other
contacts.phone_fax


I don't see any other field to look for.

i created contacts with different number in the different field and it's working ok.
 

DjBac

Joined
May 20, 2009
Messages
137
Likes
0
Points
0
#19
PERFECT!!!

Thanx!!! :D:D

Do you might know a better way to import or sync contacts?
 

Patrick_elx

Joined
Dec 14, 2008
Messages
1,120
Likes
0
Points
0
#20
DjBac said:
PERFECT!!!

Thanx!!! :D:D

Do you might know a better way to import or sync contacts?
Not really.
Except using phpMyAdmin to import your file in the asterisk phonebook mySQL database directly.
 

Members online

No members online now.

Latest posts

Forum statistics

Threads
30,900
Messages
130,884
Members
17,561
Latest member
marouen
Top