All the following commands must be run on your voip server.
1.Installation
- First install perl dependencies with cpan :
cpan
install LWP::UserAgent
install Asterisk::AGI
install Time::Piece::MySQL
install DBI
install Params::Classify
- Copy script to /var/lib/asterisk/agi-bin
cp *.agi /var/lib/asterisk/agi-bin
chown asterisk sugarlookup.agi
chgrp asterisk sugarlookup.agi
chmod +x sugarlookup.agi
- Edit /etc/asterisk/extensions_custom.conf
In [from-sip-external] context add this lines
exten => _.,n,Goto(s,1)
.....
exten => s,1,NoOp(Sugarlookup started)
exten => s,2,AGI(sugarlookup.agi)
exten => s,3,Ringing
...
- Add a new user in your mysql database (crm server)
Go into yousugarcrm.server.com/phpmyadmin
->Privileges ->Add new user
Name : voip
Pwd : ulaval
HOST : youroip.server.com
2.Configuration
Edit the script and change the following variables :
vim /var/lib/asterisk/agi-bin/SugarlookupCID.agi
$database_hostname = "yoursugarcrm.server.com";
$database_name = "sugarcrm";
$database_user = "voip";
$database_password = "password";
This database user must be authorized to access to you crm database with this ip (the host filed of this user must be the ip of your voip server).