Categories
Blog Design FreePBX Knowledge Base

Voice recognition and Asterisk.

This is primarily about Googles new Cloud Speech API and Asterisk recordings.

Having worked on many Voice rec systems including Mitels attendant system, Oranges Wildfire virtual assistance and Lumenvox’s add on for Digium’s Asterisk system one thing none could do was transcribe speech such as voicemails and this is what people want. There was a startup in the UK called Spinvox  but as anyone knows this wasn’t all it seems and when I questioned them while working on a project they clammed up and withdrew our testing account and the rest is history as they say.

So now we are many years on and Google have their second API for this service. The first API was a little flaky to say the least and came up with some amusing translations. The cloud version is much better and does a good job with most voice and also can be localised.

So what have we done. Well we have mixed together some existing code we use and created a “mini voicemail” that records your message converts it to text saves it as a voicemail and emails the resultant Text and recording to you.  In the process we did find a few “gotchas” with the API for example a pause of more than a couple of seconds will result in the translation stopping there, also a big one is that the translation takes as long as the recording is, and the API has a 60 second limit. Both of these can be overcome by limiting the record time in Asterisk to 60 seconds and using sox to remove silence of more than a second.

exten => s,n,Record(catline/${UNIQUEID}.wav,3,60,kaq)
/usr/bin/sox /var/lib/asterisk/sounds/catline/${origdir}.wav ${PATH}${origmailbox}/INBOX/${FILENAME}.flac  lowpass -2 2500 silence -l 1 0.1 1% -1 0.8 1% 

As you can see from these snippits of code above we have used variables where possible to that it can be incorporated easily with existing asterisk systems using GUIs such as Freepbx, We use the voicemail greetings that the user recorded and also use the email address thats linked with their mailbox for simplicity of management.

Now having Voicemails as text is nice but where it comes into its own is with structured mailboxes or simply put questionnaires where the caller is asked a number of predefined questions and these are recorded as one single voicemail. We already do this for some customers but they still have to have some one transcribe teh voicemail to text to input it. The quality of the Google translation means that soon they will be able to just copy the text over. Other applications are only limited by your imagination, Such as automated voice menus for Takeaways or Taxi firms.

To be Continued…HERE

Categories
Knowledge Base Technical

Changing the root or any other mysql password

MySQL stores username and passwords in the user table inside MySQL database. You can directly update or change the password using the following method:

Login to your server, type the following command at prompt:

$ mysql -u root -p

Use the mysql database;

mysql> use mysql;

Change password for user root, enter:

mysql> update user set password=PASSWORD("NEW-PASSWORD") where User='root';

Finally, you need to reload the privileges:

mysql> flush privileges;


mysql> quit
Categories
Asterisk Support Knowledge Base Security

Catching the IP of anonymous callers on Asterisk servers

Hi just sharing a simple bit of dialplan to catch anon callers ip addresses when using freepbx and Anonymous callers is set to yes, which is needed for some suppliers.

Normally I would say lock your firewall to only known IPs, but in some cases this isn’t possible

Im sure if you have a Asterisk server with a public IP you will have seen calls on the console screen where the call is to a destination but the callers are exten@yourserver . Well this little bit of dialplan at the end of you default sip context should catch them and log them with the ip of the originating server

In extensions_custom.conf add the dialplan below

[catchall]
exten => s,1,Noop(Dead calls rising)
exten => s,n,Set(uri=${SIPCHANINFO(uri)})
exten => s,n,Verbose(3,Unknown call from ${uri} to ${EXTEN})
exten => s,n,System(echo "[${STRFTIME(${EPOCH},,%b %d %H:%M:%S)}] SECURITY[] Unknown Call from ${CALLERIDNUM} to ${FROM_DID} IPdetails ${uri}" >> /var/log/asterisk/sipsec.log)
exten => s,n,Hangup()

Then in Custom Destinations add a destination as  catchall,s,1

so you now get in your logs

[May 1 00:11:06] SECURITY[] Unknown Call from  to 900441516014742 IPdetails sip:101@37.75.209.113:21896

 I hope this is some help to you, It allows other scripts to pick up this address and add it to your firewall.
Categories
Elastix Support Knowledge Base Technical

Setting the server domain in elastix correct for scripted email

We run many scripts on customer servers to email cdrs, backups etc, one problem with some mail servers is the mail gets rejected as it comes from root@elastixserver.yourdomain.com by default to fix this is simple and only takes a few lines.

Postfix MTA offers smtp_generic_maps parameter. You can specify lookup tables that replace local mail addresses by valid Internet addresses when mail leaves the machine via SMTP.

Open your main.cf file

# vi /etc/postfix/main.cf

Append following parameter

smtp_generic_maps = hash:/etc/postfix/generic

Save and close the file. Open /etc/postfix/generic file:

# vi /etc/postfix/generic

Make sure root@elastixserver.yourdomain.com change to elastixserver@yourdomain.com add :

root@elastixserver.yourdomain.com  elastixserver@yourdomain.com

Save and close the file. Create or update generic postfix table:

# postmap /etc/postfix/generic

Restart postfix:

# /etc/init.d/postfix restart

When mail is sent to a remote host via SMTP this replaces root@elastixserver.yourdomain.com by elastixserver@yourdomain.com mail address. You can use this trick to replace address with your ISP address if you are connected via local SMTP.

To set up gmail for delivery look at this

Categories
Knowledge Base

Simple Script to import Asterisk Database entries

This is a very simple script to add entries in bulk to the asterisk internal database.

You colate your entries in a simple csv file as below

family,key1,val99
family,key2,val98

then this simple script needs to be written and then run to update the astdb

#!/bin/sh
input=db.csv
while read line
do
 fam=$(echo $line | cut -d',' -f1)
 key=$(echo $line | cut -d',' -f2)
 value=$(echo $line | cut -d',' -f3)
 asterisk -rx "database put $fam $key $value"
done < "$input"

As can be seen its short and simple, but as it does what its meant to do and can save lots of time when building or migrating Asterisk  servers.

It could be easily changed to remove entries if required.

 

Categories
QueueMetrics Support Software

QueueMetrics,  The Advanced Call Center Software Solution Suite. Measure your targets, conversion rates and agent activities. Create accurate reports and statistics. Set security and privacy on individual queues. Support virtual and multi-tenant production environments.

But above all Improve your business.

 

This slideshow requires JavaScript.

QueueMetrics Features:

  • Live administrator and supervisor call center status panel.
  • Area code breakdowns inclusive of calling and waiting time.
  • Agent billable and payable time with total sales, contacts and conversion statistics.
  • Live agent page with queue statistics and agent controls.
  • Total unanswered calls with disconnection time and position.
  • Complete call distribution statistic, including sales and contacts, by week, day or hour.
  • Administrator message broadcasting and SMS functionality.
  • Full agent availability with session and pauses details and history.
  • Inbound ACD call attempts with metrics available by operator, terminal and queue.
  • Detailed call information including the Asterisk Call ID and recorded call.
  • Total of answered calls including call length and waiting time metrics.
  • Inclusive SLA of answered and unanswered calls and disconnection causes.
  • Extensive Quality Assessment module.
  • Send automated nightly PDF/XLS exports by e-mail.
  • Hundreds of metrics computed.

Operations Managers can:

  • See accurate reports of all call center activities.
  • Run reports by single and by user-created queue groups.
  • Measure agents activities, business targets and conversion rates.
  • Fully configure security and privacy, queue-by-queue.

Team Leaders can:

  • Create real time call and agent reporting.
  • See agent status and real­time activities.
  • Remotely listen to live calls as they are handled.
  • Watch agent screens through a VNC client.

Agents can:

  • See the calls they’re handling and integrate with external CRM.
  • Pass data gathered from IVR menus or Caller­ID.
  • Set call status codes for all inbound and outbound traffic.
  • Log­on, log­off, go on pause and set pause reason codes.

IT Managers can:

  • Support single-server or Asterisk® clusters.
  • Support database and flat-file storage.
  • Tune Asterisk® interaction to minimize the load on the Asterisk® server.
  • Avoid patching or changing an existing Asterisk® installation.

To download a product feature sheet click here or call us for a quote.

Categories
Elastix Support Security

SSLv3 Poodle and Elastix

Google has just disclosed SSL POODLE vulnerability which is a design flaw in SSLv3.  By default SSLv3 is enabled by default in Elastix and many other servers, Since it is a design flaw in the protocol itself and not an implementation bug, there will be no patches. Only way to mitigate this is to disable SSLv3 in your web server or application using SSL.

How to test for SSL POODLE vulnerability?

The following simple script will test, its a re-write of Redhats that would give a false negative if the script fails in anyway giving a false sense of security.

#!/bin/bash
chmod 755 /usr/share/doc/bash-3.2/scripts/timeout
ret=$(echo Q | /usr/share/doc/bash-3.2/scripts/timeout 5 openssl s_client -connect "127.0.0.1:${2-443}" -ssl3)
if echo "${ret}" | grep -q 'Protocol.*SSLv3'; then
 if echo "${ret}" | grep -q 'Cipher.*0000'; then
 echo "SSL 3.0 disabled"
 else
 echo "SSL 3.0 enabled"
 fi
else
 echo "SSL disabled or other error"
fi

The outputs will be similar to below on Elastix

[root@elastix24 ~]# ./sslv3.sh 
depth=0 /C=--/ST=SomeState/L=SomeCity/O=SomeOrganization/OU=SomeOrganizationalUnit/CN=localhost.localdomain/emailAddress=root@localhost.localdomain
verify error:num=18:self signed certificate
verify return:1
depth=0 /C=--/ST=SomeState/L=SomeCity/O=SomeOrganization/OU=SomeOrganizationalUnit/CN=localhost.localdomain/emailAddress=root@localhost.localdomain
verify error:num=10:certificate has expired
notAfter=Jun 15 18:30:20 2014 GMT
verify return:1
depth=0 /C=--/ST=SomeState/L=SomeCity/O=SomeOrganization/OU=SomeOrganizationalUnit/CN=localhost.localdomain/emailAddress=root@localhost.localdomain
notAfter=Jun 15 18:30:20 2014 GMT
verify return:1
DONE
SSL 3.0 enabled

As we can see its enabled.

Now edit the file  /etc/httpd/conf.d/ssl.conf

and change line 100 (in Elastix 2.4)

from SLProtocol all -SSLv2    to  SLProtocol all -SSLv2 -SSLv3

The restart the httpd service.

then test again and you should get

13033:error:14094410:SSL routines:SSL3_READ_BYTES:sslv3 alert handshake failure:s3_pkt.c:1086:SSL alert number 40
13033:error:1409E0E5:SSL routines:SSL3_WRITE_BYTES:ssl handshake failure:s3_pkt.c:530:
SSL disabled or other error

If you want to read the background here is the relevant document

Click to access ssl-poodle.pdf

Categories
Asterisk Support Elastix Support Knowledge Base Security

Elastix 2.4 ARI vulnerability Patch

The recent vulnerability in the Asterisk and Freepbx ARI login.php file is not addressed in an update to ARI in the unembedded freepbx on Elastix 2.4.

This will mean that your systems will still be vulnerable.

We have produced a patch that you can apply to address this. The patch can be downloaded  from https://s3.amazonaws.com/filesandpatches/ari.patch and applied as detailed below.

logon to the server console

cd /var/www/html/recordings/includes
cp login.php /root/login.php.ari
wget https://s3.amazonaws.com/filesandpatches/ari.patch
patch < ari.patch 

Then to check either login to server ARI interface or 

cat login.php |grep json

and you should get the following output

$buf = json_decode($_COOKIE['ari_auth'],true);
$data = json_decode($crypt->decrypt($data,$ARI_CRYPT_PASSWORD),true);
$data = $crypt->encrypt(json_encode($data),$ARI_CRYPT_PASSWORD);
$buf = json_encode(array($data,$chksum));


also check to see if you have the file in the fw_ari directory.

ls -l /var/www/html/admin/modules/fw_ari/htdocs_ari/includes

if there is a login.php there then copy over the patched version.

cp /var/www/html/recordings/includes/login.php  /var/www/html/admin/modules/fw_ari/htdocs_ari/includes/login.php

After these actions check that the file ownership is still correct

if not 

chown asterisk:asterisk /var/www/html/recordings/includes/login.php 

This patch also applies to any older version of ARI out there.

also to be on the lookout for two suspicious files, named “c.sh” or “c2.pl” respectively. If you see these two files remove them immediately!

More details here. http://community.freepbx.org/t/critical-freepbx-rce-vulnerability-all-versions-cve-2014-7235/24536 or here http://support.freepbx.org/node/92822

 

 

 

Categories
Case Studies Knowledge Base QueueMetrics Support

QueueMetrics

We have recently installed and customised a Queuemetrics solution for a customer. Their key reason for choosing Queuemetrics was the ability to use dynamic agents without the need of major Elastix reprogramming and a clear and simple interface.

It was also decided that users needed to be able to log into the system from their handsets as well as from a web interface, as the customer is hoping to roll out an agent portal in the future.

To enable Hotdesk the  following setting has to be set similar to below

# The value is interval time (in seconds) used by the analyzer to look back searching HOTDESK verbs in the queue log
default.hotdesking=86400

This meant some additional dialplans to allow logging in & out and pausing.

These are similar to the dialplans that the web portals use except that they have prompts and they also have to store the extension and agent id in the asterisk database.

;added dialplan for queuemetrics
; Add Member - 422
; User is asked for their loging agent id
exten => _422XXXX,1,Answer
exten => _422XXXX,2,Read(AGENTID,agent-login,4,,1,6)
exten => _422XXXX,3,Gotoif($["${AGENTID}" = ""]?end)
exten => _422XXXX,4,GotoIf($[${LEN(${AGENTID})} != 4]?2)
exten => _422XXXX,5,set(DB(qmagent/${CALLERID(num)})=${AGENTID})
exten => _422XXXX,6,Macro(queuelog,${EPOCH},${UNIQUEID},NONE,Agent/${AGENTID},HOTDESK,SIP/${CALLERID(num)})
exten => _422XXXX,7,AddQueueMember(${EXTEN:3:4},SIP/${CALLERID(num)})
exten => _422XXXX,8,SayDigits(${AGENTID})
exten => _422XXXX,9,Playback(agent-loginok)
exten => _422XXXX,10(end),Hangup
; Remove Member - 423
exten => _423XXXX,1,Answer
exten => _423XXXX,2,set(DEL_AGENT=${DB_DELETE(qmagent/${CALLERID(num)})})
exten => _423XXXX,3,RemoveQueueMember(${EXTEN:3:4},SIP/${CALLERID(num)})
exten => _423XXXX,4,Playback(agent-loggedoff)
exten => _423XXXX,5,Hangup
; extension 32: agent pause with hotdesking (with pause code)
exten => _32XX,1,Answer
exten => _32XX,2,set(AGENTCODE=${DB(qmagent/${CALLERID(num)})})
exten => _32XX,3,NoOp( "QM: Pausing Agent/${AGENTCODE} at extension SIP/${CALLERID(num)} with pause reason '${EXTEN:2:2}' made by '${QM_LOGIN}' " )
exten => _32XX,4,PauseQueueMember(,SIP/${CALLERID(num)})
exten => _32XX,5,System( echo "${EPOCH}|${UNIQUEID}|NONE|Agent/${AGENTCODE}|PAUSEREASON|${EXTEN:2:2}" >> /var/log/asterisk/queue_log )
exten => _32XX,6,Playback(dictate/paused)
exten => _32XX,7,Hangup
; extension 33: agent unpause with hotdesking
exten => 33,1,Answer
exten => 33,2,NoOp( "QM: Unpausing Agent/${AGENTCODE} at extension SIP/${CALLERID(num)} made by '${QM_LOGIN}' " )
exten => 33,3,UnpauseQueueMember(,SIP/${CALLERID(num)})
exten => 33,4,Playback(dictate/pause)
exten => 33,5,Playback(removed)
exten => 33,6,Hangup

These need to be added to your extensions_custom.conf file in a context that’s included in the from-internal  context.

Also a change has to be made to the dialplans in the extensions_queuemetrics.conf to store and delete the database entry as well.

The system has proved to deliver what was expected and will shortly be expanded to track outbound calls and the addition of custom wallboards similar to what we recently produced for another customer.

If you would like to talk about adding QueueMetrics to your Asterisk system or are looking for a complete phone system and queuemetrics platform please contact us.

Categories
Asterisk Support Elastix Support Knowledge Base

Installing DynDns update script on Centos

The following is a simple run-through on installing the dyndns client for updating the ip address on your hosts.

cd /usr/src

wget  http://cdn.dyndns.com/ddclient.tar.gz
tar -xzvf ddclient.tar.gz

cd ddclient-3.7.3/

mkdir /etc/ddclient

mkdir /var/cache/ddclient
cp ddclient /usr/local/sbin

cp sample-etc_ddclient.conf /etc/ddclient/ddclient.conf

cp sample-etc_rc.d_init.d_ddclient /etc/rc.d/init.d/ddclient
chkconfig --add ddclient

cd ..

vi  /etc/ddclient/ddclient.conf

add at the bottom of file

#
use=web
login=USERNAME
password=PASSWORD
server=members.dyndns.org  
protocol=dyndns2
# add your DNS name here as below 
DNSNAME.dyndns.biz
#
/etc/init.d/ddclient start

You will then need to check that your host address has updated on the dyndns site.

If you get perl io ssl errors in the logfile then:

yum install perl-IO-Socket-SSL