Categories
Blog FreePBX Products and services Software

FreeStats

FreeStats is a re-write and expansion of the original call center stats package from Asternic giving it a fresh look and some additional features requested by our users including CDRs, Search, Compare which is a quick one glance page to see queue statuses, realtime display that can either view all queues or just one and the Administrator login is synced with freepbx. But most importantly it now has been rewritten to work with FreePBX 17 and Debian with uptodate PHP and mysql.

The statistics are ‘live’ as the system uses mysql storage of queue records and not the parsing of the logfile that in the case of the original package had to be “Cron’d” or a separate parser had to run in the background

The screenshots of the package here show the refreshed user interface and additional pages.

The Search function lets you search the DB for the call uniqueID or callerID number then displaying all items in the queue logs and the realtime page is rewritten to work with modern Asterisk versions and the updated versions of AMI and Ajam for control of agents.

The package for downloading includes full installation instructions and sql file for creating the mysql DB. An additional option is to limit access to the application by changing the config.php so that the Administrator logins can be used for allowing access to the system.

The code is opensource and your free to make changes or if you like it consider buying me a coffee.

Download the Source here

Categories
Blog FreePBX Knowledge Base

Running Subroutines on answer for Queues

Some years ago we wrote a post on running macros on queue answer here. this was very useful for integration with backends, At the time we raised a feature request to get it added to Freepbx, But this never happened.

Now the variable QGOSUB is in the dialplan for freepbx queues, But still there is no way of setting this in a default freepbx installation and it requires a snip-it of custom dialplan that is called from freepbx by a ‘custom destination’ . For example at its simplest the dialplan to set it could be :-

[qmacro-set]
exten => .,1,Noop(ians test) 
exten => .,n,Set(_QGOSUB=ians_routine) 
exten => .,n,Goto(app-daynight,1,1)  

and this sets the variable for all channels in this call, and when the Queue command is run in the default freepbx dialplan

Queue(9471,${QOPTIONS},,${QAANNOUNCE},${QMAXWAIT},${QAGI},,${QGOSUB},${QRULE},${QPOSITION})  

This allows simple or more complicated routines to be run. For example sending an email on answer which was a request we had that caused us to revisit this.

[ians_routine]
exten = s,1,Set(origtime=${EPOCH})
exten = s,n,Noop(${CHANNEL})
exten = s,n,Set(Agent11=${CUT(CHANNEL,@,1)})
exten = s,n,Set(Agent12=${CUT(Agent11,/,2)})
exten = s,n,Noop(${Agent11} , ${Agent12} )
exten = s,n,Set(fulltime=${STRFTIME(${EPOCH},,%d%m%Y-%H:%M:%S)})
exten = s,n,system(echo "There has been a call , Callers Details: ${CALLERID(number)} ,  ${CRM_SOURCE} , Date and Time: ${fulltime} ,  Agent: ${Agent12} ,Timestamp: ${origtime} , Queue Number: ${QUEUENUM} " | mail -s "failed recall at ${fulltime}" email@address.com)
same = n,Return()

If you think that you would like to be able to set this variable in the freepbx gui give it a vote https://issues.freepbx.org/browse/FREEPBX-22274