If you have a Yeastar MyPBX embeded machine for your telephony solution, you can still use Asternic Call Center Stats to have good reporting on your queue activity. The only catch is that you must install Asternic on a separate Linux server as the little box does not have a robust and large enough permanent storage for the data.
So, first of all, you must have a Linux box ready with Apache, PHP and MySQL installed. You can use a virtual machine with at least 512Mb of RAM for that purpose. That should be enough for small/medium size contact centers. If you have a large contact center and have thousands of calls per day, then you need at least 2Gb or RAM.
In this guide we will asume that the Linux box has the IP address 192.168.1.1 and the Yeastar box has the IP address 192.168.1.100
Follow the same procedures as on a regular installation. Basically download, extract and run "make".
cd /usr/src wget http://download.asternic.net/asternic-stats-pro-2.1.1.tgz tar zxvf asternic-stats-pro-2.1.1.tgz cd asternic-stats-pro-2.1.1 make
Be sure to change owner of html directory to the same user your web server is running as. That user might change depending on your linux distribution of choice, for example it could be the user 'www-data'
chown www-data.www-data /var/www/html/stats/ -R
As this is a standalone Linux box with no Asterisk installation in it, you will have to create the asterisk log directory by hand like this:
That's it. You completed the Asternic server side of things. Now you will have to work on the MyPBX box setup:
You will have to perform some configuration on the Yeastar box, some directly via command line, login into it via SSH, and some via the web interface:
Log via ssh to the Yeastar Box and enable queue_log by creating a new file:
cd /persistent/custom-cfg vi logger_custom.conf
Write this content on the logger_custom.conf file. be sure to get into insert mode first (i):
Save the file and exit the vi text editor (:wq)
Apply Changes in GUI
We will use a neat trick to replicate the queue_log from the Yeastar box into our Linux server. For that we will use passwordless ssh. So again, inside the Yeastar box run this commands to create an ssh key:
mkdir /persistent/.ssh chmod 0700 /persistent/.ssh dropbearkey -t rsa -f /persistent/.ssh/id_rsa chmod 0600 /persistent/.ssh/id_rsa
Now we must retrieve the public identity just created, use this command to print it out on screen:
dropbearkey -y -f /persistent/.ssh/id_rsa | grep "^ssh-rsa"
You will have to copy the output and then paste it inside the file /root/.ssh/authorized_keys on your Linux server. So be sure to open that file in the Linux box and paste the contents produced by the above command into it.
Once that's done, you can test if the connection works by running this command inside the Yeastar box (change 192.168.1.1 with the IP address of the Linux box):
ssh -y -i /persistent/.ssh/id_rsa firstname.lastname@example.org
That should connect you to the Linux box with no password prompts. If that is ok be sure to close that session by typing "exit" to return to the Yeastar CLI.
We will use the extensibility options the Yeastar box provides via custom scripts. First we create a script to startup a new command when the box boots up, named /persistent/add.sh:
Write this content in that file, via vi insertion mode (i)
#!/bin/sh chmod +x /persistent/asterniclog /persistent/asterniclog &
Save the file and exit (:wq)
Now we will create a script to actually feed log updates on the remote server by creating a script /persistent/asterniclog:
With this content, be sure to set vi in insert mode (i)
#!/bin/sh sleep 60 tail -f /var/log/yslog/queue_log | ssh -y -i /persistent/.ssh/id_rsa email@example.com "cat >>/var/log/asterisk/queue_log" &
Save the file and exit (:wq)
In order for Asternic realtime view to work, you will have to log into the Yeastar Web GUI and allow remote connections to AMI by adding the IP address of your linux box as a "permit" line.
Finally you will have to reboot the Yeastar Box for all the changes to take effect.
Also, do not forget to edit /var/www/html/stats/config.php and set the correct manager user, secret and host .