Sunday 4 October 2015

Vtiger + Asteris Connector

Asterisk can be integrated with Vtiger, so crm users can make direct calls using the phones. It saves the call history, call recording in the PBXManager of the specific user. It also display the incoming popup

Requirements:

Asterisk 1.8 or Asterisk 11
sox
a running version of vtiger

How it works.


Asterisk Vtiger Connector consist of following

1. web server

It listen on a specific port which is defined into the propertise file. It servers the call commands and also server call recording files. When a call is made using vtiger , it is sent to the this web server where it connects internally with asterisk

2. Asterisk controller

It send commands to asterisk to make calls, when a call is sent , it write down the commands info into its db which is "VtigerAsteriskWebapp.db"

3. agi socket listener script

It listen for asterisk commands, inbound calls are handle with this and also when a call is ended it send the request back to vtiger to write its information into the database


You can use following urls to get help in installation.

https://wiki.vtiger.com/vtiger6/index.php/PBX_Manager
https://wiki.vtiger.com/vtiger6/index.php/Asterisk_Integration






Thursday 13 June 2013

Failed to install CPAN Perl module(s) LWP::UserAgent

Today I stuck in this error when recompiling php using easyapache. It was giving error to fail to install the given perl module.

-- Begin opt 'CurlSSL' --
!! Failed to install CPAN Perl module(s) LWP::UserAgent !!

Failed to install CPAN Perl module(s) LWP::UserAgent
When i check it using cpan , It says that this module is already installed and up to date. 

I tried different solutions to check why it is not getting installed.

Some on them was using cpan


root@server [~]# cpancpan>cpan> install  LWP::UserAgent
CPAN: Storable loaded ok (v2.20)
Reading '/home/.cpan/Metadata'
  Database was generated on Thu, 13 Jun 2013 21:53:03 GMT
CPAN: Module::CoreList loaded ok (v2.18)
LWP::UserAgent is up to date (6.05).
I even tried opening a support ticket but could not process free cpanel ticket due to some error .

Solution:

Then i tried to uninstall the given perl module so i can re-install it. Inorder to un-install the perl module I downloaded cpanminus.


curl -L http://cpanmin.us | sudo perl - App::cpanminus
sudo cpanm LWP::UserAgent
Then I run the command to uninstall the perl module using


 cpanm -U LWP::UserAgent
and then installed the module again using
 root@server [~]# cpan
cpan>
cpan> install LWP::UserAgent

And then run easyapache again and it all went successfully.. So writing this so some one might get benefit of it.

Thanks
Asif

Friday 25 May 2012

sum of one key/column of multi dimentional array

Some time we need to get sum of one key/column of a multdimentional array and need unique output similary to aggregated and grup by functions of mysql functions, here i have written a php function, this is my first post , so please tell me about this and if you can give a better algo for this, please share. I tried searching online but could not find one.

thanks

------------------------------------------------------------------------------------------------------------------------


function sumArraykey($array,$key){
 foreach($array as $first){
                $first[$key]="";
                $distinct[]=$first;
        }

        $unique = array_map("unserialize", array_unique(array_map("serialize", $distinct)));
        foreach($unique as $first){
                $sum=0;
                foreach($array as $second){
                        $val=$second[$key];
                        $second[$key]="";
                        $matchcounter=1;
                        if($second == $first){
                                $matchcounter++;
                                $sum+=$val;
                        }
                }
                $first[$key]=$sum;

                $return[]=$first;
        }
        return $return;
}
------------------------------------------------------------------------------------------------------------------------
Example use!!!


$test[]=array(0=>1,1=>2,2=>3,3=>4,4=>5,5=>6,6=>10);
$test[]=array(0=>1,1=>2,2=>3,3=>4,4=>5,5=>6,6=>10);
$test[]=array(0=>1,1=>2,2=>3,3=>4,4=>5,5=>6,6=>10);
$test[]=array(0=>3,1=>2,2=>3,3=>4,4=>5,5=>6,6=>10);
$test[]=array(0=>3,1=>2,2=>3,3=>4,4=>5,5=>6,6=>10);

$output=sumArraykey($test,6);
print_r($output);