SugarCRM and Superfecta!

Discussion in 'General' started by DjBac, Jun 3, 2009.

  1. DjBac

    Joined:
    May 20, 2009
    Messages:
    137
    Likes Received:
    0
    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?
     
  2. Patrick_elx

    Joined:
    Dec 14, 2008
    Messages:
    1,120
    Likes Received:
    0
    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>
     
  3. Patrick_elx

    Joined:
    Dec 14, 2008
    Messages:
    1,120
    Likes Received:
    0
    try the following:

    DB Host: localhost
    DB Name: sugarcrm
    DB user: sugarcrm
    DB password: sugarcrm
     
  4. DjBac

    Joined:
    May 20, 2009
    Messages:
    137
    Likes Received:
    0
    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?
     
  5. Patrick_elx

    Joined:
    Dec 14, 2008
    Messages:
    1,120
    Likes Received:
    0
    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).
     
  6. Patrick_elx

    Joined:
    Dec 14, 2008
    Messages:
    1,120
    Likes Received:
    0
    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.
     
  7. DjBac

    Joined:
    May 20, 2009
    Messages:
    137
    Likes Received:
    0
    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?
     
  8. DjBac

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

    Joined:
    Dec 14, 2008
    Messages:
    1,120
    Likes Received:
    0
    did you select in the correct inbound route CID lookup source as superfecta?
     
  10. DjBac

    Joined:
    May 20, 2009
    Messages:
    137
    Likes Received:
    0
    Yeap, sorry my mistake!!

    But still, cannot get it work with sugarCRM!
     
  11. Patrick_elx

    Joined:
    Dec 14, 2008
    Messages:
    1,120
    Likes Received:
    0
    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.
     
  12. DjBac

    Joined:
    May 20, 2009
    Messages:
    137
    Likes Received:
    0
    So, there is nothing right now I can do to fix it, right? :(
     
  13. Patrick_elx

    Joined:
    Dec 14, 2008
    Messages:
    1,120
    Likes Received:
    0
    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.
     
  14. DjBac

    Joined:
    May 20, 2009
    Messages:
    137
    Likes Received:
    0
    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??
     
  15. Patrick_elx

    Joined:
    Dec 14, 2008
    Messages:
    1,120
    Likes Received:
    0
    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]
     
  16. DjBac

    Joined:
    May 20, 2009
    Messages:
    137
    Likes Received:
    0
    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
     
  17. Patrick_elx

    Joined:
    Dec 14, 2008
    Messages:
    1,120
    Likes Received:
    0
    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...
     
  18. Patrick_elx

    Joined:
    Dec 14, 2008
    Messages:
    1,120
    Likes Received:
    0
    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.
     
  19. DjBac

    Joined:
    May 20, 2009
    Messages:
    137
    Likes Received:
    0
    PERFECT!!!

    Thanx!!! :D:D

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

    Joined:
    Dec 14, 2008
    Messages:
    1,120
    Likes Received:
    0
    Not really.
    Except using phpMyAdmin to import your file in the asterisk phonebook mySQL database directly.
     

Share This Page