📜 ⬆️ ⬇️

Installing SuiteCRM 7.5. Integration with Asterisk via Callinize - community Edition

I had the need to install a bundle: Asterisk + CRM + Integration. There were no problems installing Asterisk and FreePBX on Ubuntu. Excellent article with step by step instructions and pictures, even a beginner can handle it.

But when it came to installing CRM and trying to make friends with Aster, my hair began to fall out in shreds. At first I thought this task was as simple as installing Ubuntu + Asteris + FreePBX. But after a few days, I realized that there are simply no normal manuals, and especially normal free models. So our company is not big and there is no desire to buy anything. I had to buy pieces of different manuals, posts, articles and install and integrate CRM with Aster by trial and error.

I chose from 3 (Sugar, Tiger and Suite) and chose SuiteCRM (the rest did not pass the test for strength and compatibility with Aster's integration modules).
')
In this article, I actually want to share the experience of installing and integrating SuiteCRM with Asterisk. Anyone who has already installed SuiteCRM, and it is successfully working, we can safely flip through the part with the installation and move on to the integration .

SuiteCRM installation


Open the terminal and connect to our Ubuntu Server as root.

1. First, go to the html directory (for me, for example / var / www / html, and you may have another one):

cd /var/www/html 

2. Download the archive with the latest version of CRM (at the time of writing this article it was 7.5):

 wget https://github.com/salesagility/SuiteCRM/archive/v7.5.tar.gz 

3. Unpack the archive:

 tar zxvf v7.5.tar.gz 

4. Rename the directory (for convenience, that would not then write a long address in the browser line):

 mv SuiteCRM-7.5 crm 

5. Assign the rights of the new directory:

 chmod -R 775 crm chmod -R a+wr crm 

6. Open our_server / crm page in the browser and proceed to setup.

7. We read and agree with the license agreement, click Next:

image

8. Make a couple of sips of tea and eat one cookie while the system checks the “soil” on which it will grow.

image

9. CRM checked everything and everything suits her. Click Next:

image

If swears on IMAP Module, then just install it:

Installation
 sudo apt-get install php5-imap sudo php5enmod imap sudo service apache2 restart 


10. Fill in all required fields:

image

If you want to immediately have demo data in CRM, then Choose Demo Data -> Populate Database with Demo Data? -> Yes.

11. We go to finish drinking tea and finish the cookies until the system installs and adjusts everything:

image

12. The system is installed and ready to go. Enter the logs and password of the main administrator and log in:

image

13. Cheers. The system is working. Further we smoke guides how to use it.

Let's move on to the stage that took down my brain for several days.

Integration with Asterisk via Callinize - community Edition


I will say right away that there is no free solution of this problem out of the box. I spent a few days trying all CRM in combination with all the available free integration modules: all variations are non-working. Some I tried to finish my hands, some I deleted immediately after installation. In general, I, in fact, intended to write this article in order to save time and nerves for someone.

I had the following tasks: It is necessary that from CRM it was possible to call directly from the browser window with one click of the mouse. So that when you call (incoming / outgoing) immediately in the browser window, CRM shows the client card with the necessary information. All this had to be done to facilitate the work of the sales of my company.

I stopped my choice (or rather did not stop the choice, but by trial and error I found out that this is the most working version) on “Callinize - community Edition”. I don’t know if I can download the free version from their website , I haven’t found it. Somewhere in the wilds of the web, I came across yaai-callinize OpenSourse and downloaded it. I don’t remember where I downloaded, and in order for the package to stand on SuiteCRM, I had to finish its insides a little.

So: "scalpel, sister, let's start":

Module installation


1. Download the module from here ;

2. Go to our CRM and go to the Administrator -> Admin -> Module Loader;

3. Select the file of the module that was downloaded and click Upload;

4. When the file is downloaded and displayed in the lower window, click Install on our module:

image

5. We read and accept the agreement and click Commit:

image

6. We wait until the module is installed and click Back to Module Loader:

image

This was all a saying, but now the very juice begins - we need to make friends with Asterisk, CRM and Yaai all at once. Thanks to Habra for the ban on using profanity in articles, otherwise I would write now what I think about all the developers of the module!

Setting up our module


1. Let's create a manager Astara, under which our module will work, for this we rule manager.conf:

 nano /etc/asterisk/manager.conf         [yaai] secret = __yaai deny=0.0.0.0/0.0.0.0 permit=127.0.0.1/255.255.255.0 read = all ; ^--- on some systems you can get away with just "call,hud" write = originate,system,call 

After that, restart Asterisk so that it reads the new settings:

 asterisk -rx "module reload manager" 

2. Next, configure our module. Go to the browser window with our CRM and open Administratir -> Admin -> scroll to the bottom, find the item section “Callinize - Asterisk SugarCRM Integration” and click on “Module Configuration”:

image

3. Enter the manager's login and password:

Asterisk Manager Login - yaai
Asterisk Manager Secret - the password you specified in manager.conf

And SOAP:

SugarCRM Soap-User - admin
SugarCRM Soap-Pass - the password that you specified for the super admin when installing SugarCRM

We don’t touch the remaining values, click Save:

image

4. Go to Administratir -> Admin -> Studio.

Section Modules scroll down. Find the “User” folder, expand it, expand the “Layouts” folder, click “EditView”. In the right window, we will open the user settings template, in which we will have to add something:

To begin with, we drag “New Panel”, we throw “New Row” on it. Then we drag 3 values ​​onto the fields (filler): Personal Extension, Magic Dial Buttons, Call Notification. Click Save & Deploy. It should look like this:

image

5. Go to Administratir -> Admin -> User Manager.

Click on the user (I will configure the Administrator), in the window that opens, click Edit. We will see that the panel that we added in paragraph 4, now appeared here and you can fill in the fields. In the Personal Extension (s) field, we register the user's internal number (I hope that you have already created an Extension in FreePBX that you want to assign to the user in SuitCRM, for example, I already have an internal number 1001, which I will assign to Administrator). Put the Magic Dial Buttons checkboxes, Call Notification and click Save:

image

And here is the first joint. I do not know why, but the first time you save the settings, the CRM menu disappears. We will treat this by editing the CSS code.

 nano /var/www/html/crm/custom/modules/Asterisk/include/css/asterisk.css   ".dropdown-menu LI"   "display: none; " 

The menu was treated.

6. Open the terminal and run the script:

 cd /var/www/html/crm/custom/modules/Asterisk php asteriskLogger.php 

If your script at the end displayed the following “Waiting for call events ...”:

 [Asterisk Manager Interface (AMI) Connection] Successfully opened socket connection to 127.0.0.1:5038 AMI Version Info: ``` Asterisk Call Manager/2.8.0 ``` AMI Login action raw response: ``` Response: Success Message: Authentication accepted ``` AMI Login was a *success!* Waiting for call events... 

Zanachach you did everything right.

If errors come up, then you have somewhere not carefully read / followed the instructions!

7. Let's check. In our CRM we will create a contact, for example, Markenig -> Contacts -> Create. Fill in the First Name, Last Name, and most importantly Office Phone - here we write the phone number to which we will now call to test outgoing calls from CRM. Click Save:

image

8. And this is what we see:

image

Click on the green tube and - lo and behold! - our internal phone rings, after we pick up the phone, the Asterisk will call the number that was near the green handset and connect us. Hooray. Outgoing work.

BUT! We do not have a pop-up client card when calling. It should appear in the CRM window for outgoing / incoming calls and display information about the counterparty. We will treat it. Because we really need this "trick".

So, first we need to download handlebars.runtime.js:

  cd /var/www/html/crm/custom/modules/Asterisk/include/javascript/ wget http://builds.handlebarsjs.com.s3.amazonaws.com/handlebars.min-latest.js mv handlebars.min-latest.js handlebars.runtime.js 

Now we will rule callPopups.js:

 nano callPopups.js   template = Handlebars.templates['call-template.html'];     var source = '<div id="{{callbox_id}}" class="callbox"><div class="callboxhead"><div class="callboxtitle">{{title}}</div><div class="callboxoptions"><a href="#" class="callbox_close">X</a></div></div><div class="control_panel"><button class="transfer_panel"></button><button class="operator_panel"></button><!--<button class="callbox_action" data-dropdown="#dropdown-1_{{callbox_id}}"></button>--><button class="callbox_action"></button></div><div id="dropdown-1_{{callbox_id}}" class="dropdown-menu has-tip dropdown-hidden"> <!-- left: 746px; top: 631px; display: block; --><ul><li class="ul_relate_to_contact"><a href="#" class="relate_to_contact">{{relate_to_contact_label}}</a></li><li class="ul_relate_to_account"><a href="#" class="relate_to_account">{{relate_to_account_label}}</a></li><li class="ul_create_contact"><a href="#" class="create_contact">{{create_new_contact_label}}</a></li></ul></div><div class="callboxcontent"><div class="asterisk_info"><h4 class="call_type">{{call_type}}</h4><div><table class="asterisk_data"><tr class="multiplematchingcontacts"><td colspan="2"><b>{{select_contact_label}}</b>{{#each beans}}<p class="select_contact" id="contact_{{bean_id}}"><input type="radio" name="contactSelect" class={{bean_module}} value={{bean_id}} /><a class="multiplecontacts" title="{{parent_name}}" href={{bean_link}}>{{bean_name}}</a></p>{{/each}}</td></tr><tr class="singlematchingcontact"><td>{{name_label}}</td><td><a class="contact_id" href="{{bean_link}}"><span class="call_contacts">{{bean_name}}</span></a><!-- <button class="unrelate_contact"></button> --></td></tr><tr class="parent_name_box"><td>{{company_label}}</td><td><a class="company" href="{{parent_link}}">{{parent_name}}</a></td></tr><tr class="caller_id_box"><td class="caller_id_label">{{caller_id_label}}:</td><td class="caller_id">{{caller_id}}</td></tr><tr class="phone_number_box"><td class="phone_number_label">{{phone_number_label}}:</td><td class="phone_number">{{phone_number}}</td></tr><tr class="call_duration_box"><td class="call_duration_label">{{duration_label}}:</td><td><span class="call_duration">{{duration}}</span></td></tr><!--<tr class="call_time_box">--><!--<td class="call_time_label">{{call_time_label}}:</td>--><!--<td>--><!--<span class="call_duration">{{call_time}}</span>--><!--</td>--><!--</tr>--></table></div></div></div><div class="callboxinput"><textarea rows="4" cols="30" class="callboxtextarea callboxtextareaselected"></textarea><div class="callboxbuttons"><table width="100%"><tbody><tr><td valign="bottom"><button class="save_memo">{{save_label}}</button></td></tr></tbody></table></div></div><form class="call_record_id" name="{{call_record_id}}"><input type="hidden" name="relateContactId"/><input type="hidden" name="relateContactFirstName"/><input type="hidden" name="relateContactLastName"/><input type="hidden" name="relateAccountId"/><input type="hidden" name="relateAccountName"/></form></div>'; var template = Handlebars.compile(source); 

All is ready. Windows appear, calls go. Now configure the asteriskLogger.php autoload:

 wget https://raw.github.com/blak3r/yaai/master/misc/asterisk_logger mv asterisk_logger /etc/init.d/ chmod 755 /etc/init.d/asterisk_logger chmod 755 /etc/init.d/functions 

Edit asterisk_logger:

 nano +34 /etc/init.d/asterisk_logger   . /lib/lsb/init-functions     /etc/init.d/functions 

Check:

 /etc/init.d/asterisk_logger start 

If everything is good and there are no errors, we enable autoloading:

 chkconfig --add asterisk_logger chkconfig asterisk_logger on 

Source: https://habr.com/ru/post/276413/


All Articles