Home

QueueMetrics - Advanced Configuration Manual

image

Contents

1. JkMount jsp workerl JkMount do workerl JkMount tpf workerl JkMount manager workerl Serving QueueMetrics through Apache lt VirtualHost gt You can include or exclude the manager path in order to access Tomcat s manager 3 4 2 Model 2 Using Apache as a proxy to Tomcat Using this model you forward requests to a Tomcat server that may or may not be on the same host All requests for this domain are forwarded QWaliaevielllogie 8190 ServerName queuemetrics example com ServerAlias queuemetrics test example com CustomLog var log httpd queuemetrics example com access log common ErrorLog var log httpd queuemetrics example com error log AddDefaultCharset UTF 8 ProxyPreserveHost On ProxyPass ajp localhost 8009 ProxyPassReverse ajp localhost 8009 VirtualHost As the AJP request contains the full virtual host information you still have to set up a virtual host in Tomcat for the hosts you need to proxy Of course you could have Tomcat reside on a separate server on the same subnet so you would offload all computation intensive activities from your internet facing server to a separate server that runs QueueMetrics 3 5 Creating Virtualhosts in Tomcat 3 5 1 Turning off unnecessary connectors Within Tomcat s server xml file within the section marked by SERVICE NAME Catalina remove all connector entries but the one here e Detime a Coyote JX2 AIP 1 3 GComweciter om po
2. 4 2 Configure the Name Based SSL Virtual Hosts Note Apache will allow you to configure name based SSL virtual hosts but it will always use the configuration from the first listed virtual host on the selected IP address and port to setup the encryption layer In certain specific circumstances it is acceptable to use a single SSL configuration for several virtual hosts In particular this will work if the SSL certificate applies to all of the virtual hosts For example this will work if 1 All the virtual hosts are within the same domain e g one example com and two example com 2 You have a wildcard SSL certificate for that domain one where the Common Name begins with an asterisk e g example com Remember that the SSL directives from all virtual hosts except the first listed one will be ignored when setting up the initial SSL connection 4 3 Install the Apache HTTP Server and its SSL TLS Module f yum install httpd Installed httpd x86 64 0 2 2 3 31 e15 centos f yum install mod ssl J menEeudilkels moc ssl x99 94 1892522253 3 5119 CENTOS Dependency Installed distcache x86 64 0 1 4 5 14 1 4 4 Configure the global Apache Settings mkdir etc httpd vhosts d cp etc httpd conf httpd conf etc httpd conf httpd conf orig vi etc httpd conf httpd conf Add the following lines to the end of Section 3 Virtual Hosts HE Use name based virtual hosting NameVirtualHost 80 Use name based SSL virtual ho
3. Chapter 5 Installing QM as a ROOT webapp QueueMetrics is usually deployed as a webapp whose path stems from the root of the webserver for example as http queuemetrics example com 8080 queuemetrics It is possible to deploy Queuemetrics as a ROOT webapp so that the complete address ends up being simply http queuemetrics example com 5 1 Prerequisites A working QueueMetrics instance 5 2 Model 1 using a ROOT webapp 5 2 1 Changes to Tomcat Copy the current version of QueueMetrics to a webapp named ROOT all capital letters cd usr local queuemetrics tomcat webapps cp R usr local queuemetrics webapps queuemetrics 1 6 0 ROOT Restart QueueMetrics 5 2 2 Set the access port If you want QueueMetrics to be available on a port that is different from the default one 8080 edit the server xml file and look for a line that looks like lt l pekine a moa SSL Coyote BITE 1 1 Connector om oore 9S0 gt Connector port 8080 maxThreads 150 minSpareThreads 25 maxSpareThreads 75 enableLookups false redirectPort 8443 acceptCount 100 debug 0 connectionTimeout 20000 and change that to lt Connector port 80 maxThreads 150 minSpareThreads 25 maxSpareThreads 75 enableLookups false redirectPort 8443 acceptCount 100 debug 0 connectionTimeout 20000 CAUTION Make sure you have no Apache running on port 80 in case turn it off Restart QueueMetrics 5 3 Model 2 defining a
4. Loway suggested that set the Xms and Xmx values the same Thus used Xms4096M Xmx4096M You also want to make sure to add server as this changes the compiler in Java Read more here http stackoverflow com questions 198577 real differences between java server and java client Note Be sure that your memory settings are within the limits of your physical RAM bearing in mind that your OS and other applications like MySQL also need resources have 12GB of RAM in my 400 Agent server of which 8GB is in use mostly Tomcat and MySQL 41 Tuning QueueMetrics memory settings 18 3 2 Memory Settings PermGen Next thing to look at is PermGen Often the OutOfMemory events are in fact not from Heap but PermGen You might see this in the catalina out log Exception in thread RMI TCP Connection idle java lang OutOfMemoryError PermGen space hadn t realised that just like the Heap you can also set the PermGen size By default this seems to be about 80Mb experimented with 256Mb and eventually settled on 512Mb So add these settings to your config for tomcat XX PermSize 512M XX MaxPermSize 512M This change made a significant difference to the stability of QM You can read more about PermGen here https blogs oracle com jonthecollector entry presenting the permanent generation 18 3 3 Garbage Collection Next up is Garbage Collection When you start reading about Garbage Collection there is a lot of information a
5. Satisfy Any situation SSLOptions StrictRequire List the SSL protocol flavors with which clients can connect SSILPuoEOsOl all sTLbSwl 9913 11 Serving QueueMetrics over Apache SSL List the cipher suites that clients are permitted to negotiate SSLCipherSuite HIGH MEDIUM aNULL SHA1 MD5 HIGH MEDIUM Point to the PEM encoded certificate private key and CA certificate j mea ciles for whis walle Nost SSLCertificateFile var www https testl example com conf ssl crt wildcard exampl SSLCertificateKeyFile var www https testl example com conf ssl key wildcard exal SSLCertificateChainFile var www https testl example com conf ssl crt gd bundle Handle problems with broken clients such as older versions of Internet Explorer Seten SE r AGEA MS TEN nokeepalive ssl unclean shutdown downgrade 1 0 force respo Log information about the SSL pa nse 1 0 rameters that are negotiated for requests CustomLog var www https testl exa f sla Sole S ox St eed IE VirtualHost END 000 https testl xample com co mple com logs ssl request log NOWOCOIR S 4S9 Civ ox 59S Cie lel Lt ER USI K EYSI nf CONTENTS Do the same for the second virtual host setting the names as appropriate s CON s CONE f vi etc httpd vhosts d 001 https test2 4 10 Verify the Configuration httpd S VirtualHost configurat
6. data3 data4 FROM queue log WHERE partition P001 AND time id gt 1243980000 AND time id 15 AND queue IN NONE none EAT OPES ORDER BY timeni GM AS GP nT ONEIS WIR S TOS AS C7 18 seconds for what is essentially a simple query Compare the rows sent versus rows examined There are 2 4m rows in the database 2 4m rows is not a lot of data have worked on tables with 100m rows in them That can only mean our query is not using an index or our indexes are not working So I did an explain and saw that you do have a multiple column index and that it is being considered and in fact used But the mysql query is still slow mysql explain SELECT time id call id queue agent verb datal data2 data3 F id select type table type possible keys key key len ref ri t IES TM ENE queue_log ref idx sel partizione b partizione b 22 ae F 1 row in set 0 10 sec 9 1 Prerequisites A working QueueMetrics instance 9 2 Changes to QueueMetrics None required 24 Chapter 10 Moving QueueMetrics to a different server This chapter explains the required steps in order to move a working QueueMetrics to a different server 10 1 Prerequisites Stop qloader on the Asterisk server Make a backup of the current QM database Make sure the clocks of all servers involved are aligned to a sub second differe
7. so that data from one is automatically replicated to the other within a minimun delay In case the WAN goes down data from the local PBXs is still available in real time when the WAN comes back online the two databses sync automatically and make all data available to all users again How it works Each PBX has a local qloaderd that uploads data to the local MySQL database each PBX uploads data to a partition that has its own name in it e g PBX A1 uploads data to partition PA1 A2 to PA2 B1 to PB1 B2 to PB2 Each MySQL server is configured to insert rows with a unique id that is always odd for server A and always even for server B this way the same table can be shared on insert with no issues Each MySQL server holds all the data some coming from local Qloaderds and some from the replica of the other database Each QM server is able to monitor all four PBXs at once using a cluster of all partitions so it does not need to know what is where 12 1 Prerequisites Two clustered QueueMetrics licenses All server clocks aligned to a sub second difference via NTP MySQL server version 5 or later When doing this tutorial we assume that we have a working QueueMetrics database on MySQL A while we have nothing on server B During the replication we will clone the database on server A to the new server B a 10 10 1 10 10 10 2 10 10 10 1 11 10 10 2 11 10 10 1 12 10 10 2 12 10 10 1 13 10 10 2 13 28 Using Mast
8. 2 What you need is to download the sources and unpack in a suitable folder werens Imes Srt pr cource ror GI o mec sic dL ed oZ ice eae movi gur d 4 52 Then configure compile and install the library Col gue autoconf configure make make install ep usiz local ilile ililsrep a Lis cd PJSIP was introduced in Asterisk 12 in order to replace the SIP channel Even if we don t use this new channel in this tutorial PUSIP is needed by WebRTC in order to properly handle STUN ICE transactions Follows these steps to download configure and install the latest PJSIP version available on GitHub git clone https github com asterisk pjproject pjproject 56 Using the WebRTC softphone on the Icon agent page ea jJeiseJex a COME aL grise prefix usr nable shared disable sound disable resample disable video disable opencore amr with external speex with external srtp with external gsm make dep make make install Celo o Jansson is a JSON library needed by Asterisk 12 We focus on the 2 5 version of this library wget http www digip org jansson releases jansson 2 5 tar gz tai NAL JSIMASSOM Z 5 eue sop ec Jaimssoim Z NES configure prefix usr make make install cd All required dependencies are now satisfied and it s time to download Asterisk 12 3 0 and compile it wget http downloads asterisk org pub telephony asterisk asterisk 12 3 0 tar gz tar xvf asterisk 1
9. ON cjewewasicics TO waeicial 1 25366 l1iDmENITIEJGED BY cwp p ViciDial will also need special indexing on the queue_log table to work efficiently CREATE INDEX vici time id on queue log time id CREATE INDEX vici call id on queue log call id 2 3 Changes to ViciDial The system configuration can easily be set from the ViciDial Admin System Settings page ViciDial integration VICI di HOME Timeslesk Loacut Friday January 8 2010 13 08 13 PM o M System Settinas ADMINISTRATION MODIFY VICIDIAL SYSTEM SETTINGS Version 2 2 0b0 5 DB Schema Version 1191 DB Schema Update Date 2010 01 07 13 34 20 Auto User add Value 101 Install Date 2009 12 23 Use Non Lati 0 w 2 Webroot Wrtable 1 v 2 VICIDIAL Agent Disable Display ALL w Allow SIPSAK Messages oly Admin Home URL vicidielwelcome php Templates Enable Agent Transfer Logle 0 v 2 Carriers Timeclock End OfDay 0000 2 Servers Timeclock Last Auto Logout 2010 01 08 Conferences Agent Screen Header Date Format MS_DASH_24HR 2008 06 24235959 w 2 System Settings Agent Screen Customer Date Format AL_TEXT_AMPM OCT 24 2008 115959 PM v 2 System Statuses Agent Screen Customer Phone Format US_PARN 000 000 0000 2 oicemail Agent API Active 1 v Audio Store Agent Only Callback Campaign Lock 1 v Music On Bold Central Sound Control Active 1 v 2 Sounds Web Server 1
10. a database will be created 57 Using the WebRTC softphone on the Icon agent page Google Chrome currently limits microphone and speaker sharing to well known SSL certified connections If no HTTPS protocol is used Chrome asks to the user to allow microphone and speaker usages on each call For this reason you need to configure your servlet container to serve QueueMetrics through SSL connections Details are reported in this manual see Chapter 20 Securing QueueMetrics Tomcat With A SSL Certificate 25 4 Configuring Asterisk Asterisk configuration files are located at etc asterisk folder cd etc asterisk The first operation we want to do is to enable the websocket transport This must be done by editing the http conf file and changing the following keys enabled yes bindport 8088 bindaddr 0 0 0 0 then Save and exit Our target is to have a softphone for the agent and a regular SIP phone for the caller We need to configure them by editing the sip conf file With a text editor change the key transport udp ws This enables the websocket transport then change the realm key to something valid for your site like for example realm LowayResearch The new peers will be added though the help of templates The first template is targeted to softphones the second is targeted to regular SIP phones Add these lines to your sip conf file WebRTC iE VOSS OSS ie host dynamic nat force_rport comedia context from int
11. anything A set of cron jobs is expected to run to keep the logs updated check that they are present by issuing a crontab e fix the vicidial agent log once every hour and the full day run at night 33 usr share astguiclient AST cleanup agent log pl 50 0 usr share astguiclient AST cleanup agent log pl last 24hours 5 usr share astguiclient AST cleanup agent log pl only qm live call check JL dL 99 usc mines esta lake Welceie _opciim we eli talolesjoll cunec Also you will need to install the PHP XML RPC library in order to have audio data accessible from the QueueMetrics server pear install XML_RPC 1 5 1 2 4 Changes to QueueMetrics Edit the configuration properties file in order to set the following properties ViciDial integration This is the default queue log file default queue log file sq1 P01 By default ViciDial logs all data to partition PO1 audio server it loway app queuemetrics callListen listeners ClassicXmlRpcRecordings audio liveserver it loway app queuemetrics callListen RTlisteners ClassicXmlRpcListenerR default audioRpcServer http 1 2 3 6 vicidial xml rpc audio server vicidial php Change 1 2 3 6 to your ViciDial server address After this you need to define each ViciDial campaign as a QueueMetrics queue and set it properly as an inbound or outbound one After that you can freely create composite queues to report on all or some activity at once The l
12. blended call handling It can also be easily integrated with QueueMetrics For more information see http www vicidial com ViciDial is a registered trademark 2 1 Prerequisites A working ViciDial instance version 2 0 4 or later It is very important that all servers involved be they for QueueMetrics or ViciDial or general Asterisk usage are on the same time zone and time aligned with sub second precision by an NTP daemon If this is not so the setting may lead to data corruption and inaccurate reports In order to translate ViciDial data to QueueMetrics the following conventions are used The campaign id in ViciDial is seen as the queue in QueueMetrics The user ID in ViciDial is prepended by agent and translated to the agent code in QueueMetrics e g user 123 appears as agent 123 The UniquelD for the call appears as Asterisk s unique id prepended with server id field e g 1 1170345123 1234 In this example we imagine that The QueueMetrics server has IP 1 2 3 4 The QueueMetrics database server has IP 1 2 3 5 and the QM database is called queuemetrics The ViciDial server has IP 1 2 3 6 2 2 Changes to QueueMetrics database ViciDial and QueueMetrics work together by sharing the database You must log on to the QueueMetrics database and create a user for ViciDial to connect to it We use a different username from the one QM uses so it is easy to monitor who is doing what GIRVANIE AL RRIWILECERS
13. catalina out notifempty copytruncate dateext daily rotate 10 compress missingok JOE IE OC Gb bin nice usr bin find usr local queuemetrics tomcat temp endscript 17 3 Misc changes You can also look into the CentOS logrotation settings and implement some of the following changes depending on your needs Even if you set the rotation to daily in qm tomcat6 logrotate conf overrides it to weekly vi etc logrotate conf Set weekly to daily rotate log files daily 39 typ ic mtim 10 Enabling log rotation in Tomcat daily Change the backlogs from 4 week to 14 days keep 14 days worth of backlogs rotate 14 Compressed logs uncomment this if you want your log files compressed compress By default logrotation runs at 4am You can change this by editing etc crontab Set it to 02 02 02 2 roor run parts etc cicom caily 17 4 Changes to QueueMetrics None required 17 5 For further reading http articles slicehost com 2010 6 30 understanding logrotate on centos part 1 http articles slicehost com 2010 6 30 understanding logrotate on centos part 2 40 Chapter 18 Tuning QueueMetrics memory settings This article was contribuited by Emile Coetzee of Clarotech Consulting South Africa who spent a significant time working with Loway to tune the JVM memory and garbage collection policies This article is a summary of his findings and explains how to tune the JV
14. ck ck ck ck ck ck ck kc k ck ck k k kk di COW KKEKKKKKKKKKKKKKKKKKKKKKKKKK Slave_IO_State Waiting for master to send event DISHES 1927 iis 0 5 LO Master_User slaveuser_for_s3 Master_Port 3306 Connect_Retry 60 Master Log File mysql bin 000010 Read Master Log Pos 1067 Relay Log File slave relay 000002 Relay Log Pos 235 Relay Master Log File mysql bin 000010 Slave IO Running Yes Slave SQL Running Yes Replicate Do DB exampledb Replicate Ignore DB Replicate Do Table Replicate Ignore Table Replicate Wild Do Table Replicate Wild Ignore Table LSC JEucseiwo s 0 Lest Terors Skip_Counter 0 Exec_Master_Log_Pos 1067 Relay_Log_Space 235 Until Condition None ime i Log Jai lbeve Unies bog Loss 0 Master_SSL_Allowed No Master_SSL_CA_File Master SSL CA Path IMieusneesx Sel costae Master SSL Cipher Mester SIL Ie S 30 Using Master master database replication for strong high availability Seconds_Behind_Master 0 1 row in set 0 00 sec 12 2 3 Configure replica from B master to A slave GRANT REPLICATION SLAVE ON queuemetrics TO slave a Q IDENTIFIED BY slave a pass FLUSH PRIVILEGES 12 3 Changes to QueueMetrics Just point each QM instance to its copy of the database as you would for two distinct instances Make sure that the changes you make on one server are immediately available on the other one Also make sure that each qloaderd
15. claircaS S SEVEn EAA This query might take a while to run Data will reappear in the correct partition and is still available in the tenmporary o partition as well Now check with QueueMetrics that you have no more duplicate rows If you still have run a database restore 22 4 Cleaning up First we remove the temporary table DROP TABLE queue log backup Then we remove data from temporary partitions DELETE FROM queue log WENN parecieron LUKE go wV After large inserts and deletes it is better to resort the table and optimize it so that QueueMetrics can access it efficiently ALTER TABLE queue_log ORDERED YERO OAS C e ASC E EC OC OU INSCp OPTIMIZE TABLE queue_log Do not forget to restart the qloaderd when done 53 Chapter 23 Printing all QueueMetrics users and agents in one go It is sometimes useful to get a tabular output of all users in a QueueMetrics instance that are currently enabled and not holding the masterkey as no users should hold the msterkey in prod uction their current class and extra keys their configured agent aliases if any their current location supervisor and agent group the set of queues they are supposed to work on So that you can see at a glance the current state and whether there are any misconfigurations The following query does just that S a cu q f Jbexe
16. each key expires you can install a different one you invoice your client for actual usage 16 1 Terminology used A pre purchased key PPK is an activation key that you purchase from Loway and specifies an activation period for a given license of QueueMetrics for example a PPK that looks like this XQI LOWAY 74KKMREX6TOH1 QM 50 1 90 Will eventually convert into a 90 day QueueMetrics key for 50 agents and 1 Asterisk server You can purchase PPK for most common time lengths one month three months one year four years A license key is the actual key that has to be installed in QueueMetrics in order to activate it It can be installed manually within the web xml file or can be installed over QM itself on the License page It looks like the following example SZ SHEET 52 3240 Olas o 6 6 0 soe SOE It is important to note that it must written all on one line 16 2 Converting a PPK into a License key In order to convert a PPK into a License key you call a web service on a key server that you will be given when you purchase it For the license to be converted from a blank PPK to a full license you need to pass a few parameters The end user name will be used to create the key name that appears on the License page of the QM instance It should match the end user firm name The email address that you specify in the web service will receive a note containing all the information of the newly created license this is for y
17. for instance trigger a restart of Tomcat In my case just used them to send me email This is javaerrormailgen sh bin sh echo date mail s SITENAME Java Error General me domain com An this is javaerrormailmem sh bin sh echo date mail s SITENAME Java Error OutOfMemory me domain com You can read more about GC here http java sun com performance reference whitepapers 6_performance html and here http techfeast hiranya blogspot com 2010 1 1 taming java garbage collector html 18 4 Troubleshooting taking thread and memory dumps Once you have these things in place you can now start monitoring JavaVM and Tomcat logs and capture details for feedback to Loway Capturing jstack and jmap is detailed in the same document and the JVM setup but will list some changes to these commands which found worked better jscack sr 2472 Parameters are F Forces the thread dump often found that in a hung state was unable to get a thread dump without this 42 Tuning QueueMetrics memory settings Prints a long listing with more info 21472 Is the Java Tomcat PID jmap F dump live format b file heap bin 21472 Parameters are F Forces the thread dump dump Dumps into a binary format file called heap bin Make sure you have disk space available as this file can get very large It does compress reasonably well using bz2 if you need to upload i
18. idl victer thread will never run lt parameter gt lt name gt timeBetweenEvictionRunsMillis lt name gt 21 Database connection pooling lt value gt 10000 lt value gt lt parameter gt I Donte ello Connections CO lues ourc roile Too lug never longer than what wait_timeout is set to on the server A few minutes or even fraction of a minute is sometimes okay here it depends on your application and how much spikey load it will see gt lt parameter gt lt name gt minEvictableIdleTimeMillis lt name gt lt value gt 60000 lt value gt lt parameter gt Maximum time to wait for a dB connection to become available in ms in this example 10 seconds An Exception is thrown if this timeout is exceeded Set to 1 to wait indefinitely lt parameter gt lt name gt maxWait lt name gt lt value gt 30000 lt value gt lt parameter gt MySQL dB username and password for dB connections gt lt parameter gt lt name gt username lt name gt lt value gt queuemetrics lt value gt lt parameter gt lt parameter gt lt name gt password lt name gt lt value gt javadude lt value gt lt parameter gt lt l Class neme ror MESO JDC cheiyer gt lt parameter gt lt name gt driverClassName lt name gt lt value gt com mysql jdbc Driver lt value gt lt parameter gt lt i Iie JDBC Commecciom well em CoOnmeCciciime co your lS
19. on your system as well will not be told that the certificate is invalid 20 3 Removing obsolete Diffie Hellman ciphers On modern browsers the default Tomcat SSL configuration will show an error like Server has a weak ephemeral Diffie Hellman public key In order to overcome this error you have to disable the weak Diffle Hellman ciphers in your server xml file This is how the Connector stanza should look like Connector port 8443 maxHttpHeaderSize 8192 maxThreads 150 minSpareThreads 25 maxSpareThreads 75 enableLookups false disableUploadTimeout true acceptCount 100 SeCume true SSLEnabled true clientAuth false keyAlias lt yourdomain com gt ciphers IS laiCiD isla INSVA_ViVIlWal Aye LUZ CIC sp 6 WIS JCiDie g _IGVA TITEL ume dL29 CIC Slav TLS ECDHE RSA WITH AES 256 CBC SHA384 TLS ECDHE RSA WITH AES 256 CBC SHA IERS RSA WB ADS 128 Cec SIUNZ GL TS IRSA WIL ses 126 CIC SKA DS ROA WR ASS 256 _ Cec SSmUN256 TL5 IRSA Wr NaS 256 IC SKAN sslProtocol TLS keystoreFile lt your keystorefile gt scheme https keypass lt your keystore password gt gt Es Thanks to Julian Franke for the suggestion 49 Chapter 21 Offlining a part of the queue_log table You may want to put offline a part of the queue log table in order to reduce disk consumption on the server This s
20. redirecting to the SugarCRM page The logic is not already implemented because we don t know how agent codes and SugarCRM username and passwords are defined in your organization but we can provide some hints on how to retrieve the needed information from QueueMetrics In order to propagate the agent code to the script you need to change the URL you defined in the configuration properties file adding the dynamic agentcode parameter You should have something like 45 CRM Integration with QueueMetrics http 10 10 1 1 QueueMetrics SugarCRM php callid C amp agentcode A Don t forget to restart QueueMetrics and logoff and logon again to the agent page As soon as the script will be called the variable Sagent in the script will be populated with the calling agent code What you have to do is to implement some logic that starting from this code retrieves the username and the password used by that specific agent to authenticate on SugarCRM if Sageme lo V Insert here your code for agent SugarCRM username and password retrieval The default behavior is to use a single account for all agents Using default behavior requires agent authentication on SugarCRM pages Susername Sugar CRM username for this agent Spassword Sugar CRM password for this agent Sautologon TRUE You need to properly set the username and password variables then comment out the autologon flag row The script will generate a SugarCRM
21. session that will be inserted in the URL used to open the contact page 19 3 Integration with VTigerCRM Integration with VTigerCRM could be done in two different mutually exclusive ways 19 3 1 Integrate with QueueMetrics live page Integration with VTigerCRM is implemented through an external script to be copied on the Apache webroot folder The script is available on the addon library available at https github com Loway OpenQueueMetricsAddOns When properly configured the QueueMetrics agent call history page opens an external URL for each call taken by the agent This URL triggers the provided PHP script The script searches among contacts in the CRM database using the current caller id and opens either the caller s record if present on the CRM database or preloads a new contact page filling in the calling party number The steps for installing and configuring the script are reported below We suppose to use the same Apache webserver where the VTigerCRM is running We install the script on the Apache webserver main document root Download the Php Zen json libraries from http framework zend com releases ZendFramework 1 6 1 ZendFramework 1 6 1 minimal zip and uncompress them Update the PHP shared library search path add the Zen Json folder to the include path key in the php ini file Install the PHP Pear framework and type pear install HTTP Client from a command line shell Copy the QueueMetrics VTigerCRM php script to the web
22. var lib mysql slave relay log index expire logs days e JL 500M max binlog size After this we create a dump of the database on A and SHOW MASTER STATUS as in mysql SHOW MASTER STATUS File RPOSiiciem Binilo Do DS Binloc lenore De 29 Using Master master database replication for strong high availability mysql bin 000010 1067 queuemetrics 1 row in set 0 00 sec Then unlock the tables mysql gt UNLOCK TABLES and run the following command to make server3 a slave of server it is important that you replace the values in the following command with the values you got from the SHOW MASTER STATUS command that we ran on server2 mysql gt CHANGE MASTER TO MASTER_HOST 192 168 0 101 MASTER USER slaveuser for s3 MASTER PASSWORD slave user for server3 password MASTER LOG FILE mysql bin 000010 MASTER LOG POS 1067 You see that the values for MASTER LOG FILE and MASTER LOG POS come from the MASTER STATUS query Finally start the slave START SLAVE Ex Then check the slave status It is important that both S ave O Running and Slave SQL Running have the value Yes in the output otherwise something went wrong and you should check your setup again and take a look at var log syslog or the MySQL logs to find out about any errors mysql SHOW SLAVE STATUS VG Ck CKkCkCkCck ck k ck ck ck
23. 11 2 1 Bonus checking your InnoDB execution plan If you are unsure whether your new table is working correctly you can Log slow queries from QueueMetrics Run the following commands SET optimizer trace enabled on SYBASE OH E your slow query SELECT FROM INFORMATION SCHEMA OPTIMIZER TRACE At this point you can find the detailed execution plan in a field called TRACE This is especially useful to diagnose why an index may not be used 11 3 Changes to QueueMetrics None required 27 Chapter 12 Using Master master database replication for strong high availability It is possible to obtain strong resilient high availability over a wide area network with automated replication using master master replication Imagine this scenario you have 4 Asterisk servers that are physically in two locations connected over a WAN you want the cluster monitoring to be available from any location and you want to have a usable local system even in a case where the WAN should become unavailable SIC fA Sp 15 WPS LO 3 0 3L ox IPs 359 5350 2 5 OM A qeu S A gt B gt MySQL A MySQL B lt B gt A PBX A1 PBX A2 PBX BI al PBX B2 What we do is this we connect the two MySQL servers in a master master fashion
24. 2 3 0 tar gz cd asterisk 12 3 0 configure make menuselect If building on a KVM box it s better to uncheck BUILD NATIVE under Compiler Flags press x to save Disable all res pjsip modules exceptres pjsip log forwarder Disable chan pjsip make make install make samples Asterisk provides a set of init scripts you can copy and use in your distribution Centos 6 4 requires to copy the file rc redhat asterisk in your init d folder cp contrib init d rc redhat asterisk etc init d asterisk then edit the copied file by changing the line AST SBIN usr sbin and assigning the root and execution privileges chown root root etc init d asterisk chmod 544 etc init d asterisk You should now have Asterisk 12 installed and ready to be configured 25 3 Install QueueMetrics QueueMetrics must be installed following the regular procedures We will do an automated yum installation For more detailed information please refer to the QueueMetrics user manual Type the follwing commands wget P etc yum repos d http yum loway ch loway repo yum install queuemetrics The yum command will download QueueMetrics and all of its dependencies and install it on your system This may take a while depending on your internet connection speed When asked to confirm the installation type y to proceed To test that everything is fine you ll have to point your browser to the address http yourserverip 8080 queuemetrics on the first access
25. 92 168 198 112 o Sounds Web Directory nl zx7dcpmtq2yc85vpizzwp50vvz h Active Voicemail Server 192 168 198 112 vl Auto Dial Limit 4 x Outbound Auto Dial Active 1 x Max FILL Calls per Second 40 Allow Custom Dialplan Entnes 1 v User Ternitories Active 1 v Enable Second Webform Enable TTS Integration 1 v QC Features Active 0 v QC Last Pull Time 2009 12 23 11 30 53 Enable QueueMetrics Logging 0 v QueueMetrics Server IP QueueMetncs DB Name QueueMetrics DB Login QueueMetrics DB Password QueueMetrics URL QueueMetrics Log ID VIC QueueMetrics EnterQueue Prepend None v Text To Speech Reports ISI ASIA S e Enable QueueMetrics logging set to 1 QueueMetrics server IP this is the IP for the MySQL DB server in our example 1 2 3 5 QueueMetrics DB name the database name in our example queuemetrics QueueMetrics DB login the database login in our example vicidial QueueMetrics DB password the database password in our example qm e QueueMetrics URL the login URL for QM e g http 1 2 3 4 8080 queuemetrics e QueueMetrics LogID leave it to VIC this in an ID for the server QueueMetrics EnterQueue Prepend This field is used to allow for prepending of one of the vicidial list data fields in front of the phone number of the customer for customized QueueMetrics reports Default is NONE to avoid populating
26. AR2 chown R asterisk asterisk recordings cd var spool asterisk I SIE TOILE OIE ln s recordings SVAR1 SVAR2 monitor chown R asterisk asterisk monitor Make the script executable RN All data you should have in var spool asterisk monitor will be deleted on the first run of this script so make a copy first 33 Separating audio recordings in a daily folder The script should run every day at midnight by using a cron job 14 3 Changes to QueueMetrics Edit the configuration properties file as follows This is the name of the class that finds recordings See documentation audio server it loway app queuemetrics callListen listeners LocalFilesByDay The top level directory where monitored calls are held Do NOT forget to add the ending slash default monitored_calls recordings YY MM DD Log off and on again You should see the file search being much quicker now 14 4 Making older files accessible If you have older files they will not be accessible unless you separate and save them by day as newer files This can be more or less easy based on the format of your file names If you need it Loway offers a file separation service that can be performed remotely in order to obtain the desired result 34 Chapter 15 Show ringing phones in the realtime page With Asterisk 1 4 and QueueMetrics 1 7 1 is possible to have ringing phones information on the realtime page This information should be provid
27. Cle The autoReconnect true argument to the url makes sure that the mm mysql JDBC Driver will automatically reconnect if mysqld closed the connection mysqld by default closes idle connections after 8 hours gt lt parameter gt lt name gt url lt name gt value jdbc mysql localhost queuemetrics zeroDateTimeBehavior convertToNull amp amp lt parameter gt lt ResourceParams gt lt Context gt In the file above you need to change the following elements lt Context docBase MYQMAPP path MYQMAPP reloadable true gt Change MYQMAPP to the name of the webapp as deployed on your system usually queuemetrics Then change the url parameter and the username and password elements setting your JDBC URL 22 Database connection pooling You may also fine tune the maximum number of allowed connections in the pool and the eviction policies but this goes beyond the scope of this tutorial Now copy the connector driver such as mysql xxxx jar to the common lib directory of your Tomcat installation and remove it from WEB INF lib of your QueueMetrics instance Restart QueueMetrics 23 Chapter 9 Monitoring and fixing slow queries in MySQL 5 Tames 090603 295507529 4 User Host queuemetrics queuemetrics localhost 127 0 0 1 Query time 18 Lock time 0 Rows sent 3260 Rows examined 2474525 SELECT time id call id queue agent verb datal data2
28. M in your own environment I ve spent a good few months working with the Loway team trying to track down a performance problem in QueueMetrics and it looks like we have finally made a breakthrough I m currently testing a beta version which is looking to be very promising thought would post some of the history and some of the useful information I ve gathered over time Even though I believe the improvements Loway have made mostly contribute to the overall solution your Java performance settings play a key role as well 18 1 Prerequisites In order to understand this article fully it is advisable to have a basic knowledge of JVM monitoring and tuning it would be advisable to read Advanced JVM monitoring Chapter 7 Advanced QueueMetrics monitoring This article applies to recent version of QueueMetrics running on Java 6 or 7 JVMs QueueMetrics 12 09 includes significant performance increases so it is highly recommended that you upgrade to this version in addition to following the steps detailed below 18 2 Usage scenario For simplicity will be referring to QM as the application Obviously it is served by Tomcat which uses Java Between Tomcat and Java is where most of the troubleshooting and setting changes need to happen but the action of running QM is what causes Tomcat and Java to become unstable Typical symptoms was experiencing were either all or a combination of the following QueueMetrics GUI becomes terribly slo
29. QueueMetrics Advanced Configuration Manual Loway QueueMetrics Advanced Configuration Manual Loway Table of Contents 1 Acknowledgements 2 i oir tree ots ince gets rertensbtenedebstertetspremedetprerteesbtenedatepertotsbnemegetpterteerbrenedebetentessns 1 2 ViciDial TCI eT 2 ARE 2 2 2 Changes to QueueMetrics database 0 cece cece cee nnn ee e me hee trun e ess e esses s e e sense enne 2 2 3 Changes to ViciDial dearen mp vaia ide OR ER ences LER BOUE EERER Oda LE dp Ono PERRA Seager devine nea Edu teen Tora aada pep Beet REPRE es 2 2 4 Changes to Q eueMSelfics 1 251 eee ore equ deba REPE UR DR esd snara iode ea dauana epe aves sunata iver tay dane iod 3 3 Serving QueueMetrics through Apache ssssssssssssssssee eI I emen emen eese he se ee e tente ens e n nnn nnns 5 SAUCE 5 3 2 Installing Mod jK PET H 5 3 3 Configuration of Apache and mod jK is soseri nesin tont dpt opis depu DR RR RE Rdip t dx dp AA DRE DER IRR ERR dR PR UR 5 3 4 Virtual host configuration iret estaia tened eR aan aeiia a A ene iapa ea eaa aa taeda aria eged aaea eaa inedi 6 3 5 Creating Virtualhosts in Tomcat s str cnaciiiebe ee est cored seek E AA e EA EE EA AA IR RR REX E ex AEE D aA 7 3 6 Troubleshooting re 1 1 eet enr teer he da
30. T NULO ipxgevUnbT UU call uo yenc 200 NOI WOL queue varchar 50 NOT NULL agent varchar 30 NOT NULL DEFAULT verb varchar 30 NOT NULL DEFAULT datal varchar 2 NOT N SYTHE D glenem2 varene 2 data3 varchar 2 data4 varchar 2 U D NOT NU DS EPANUTRST YY DIRETTO SERSINTTRTERTR MNT J ES ES TRU NOT NU DEFAULT U 1 data5 varchar 2 NOT NULL DEFAULT serverid varchar 10 NOT NULL DEFAULT unique row count int 10 unsigned NOT NULL Kim okk Sell parci tion p iunge sel 2 emen 2 5 Mim partizione Io qpeuctibsbindo p cime acl unicue ow Cownt y Wm low Iaoieclesic weielo emea ENGINE InnoDB DEFAULT CHARSET utf8 0 0 0 0 0 Copy data from the old table to the new one We will insert it in the correct order to make reading quicker Eri INSERT INTO queue log i SELECT FROM queue log ORDER BY partition ASC time id ASC unique row count ASC Stop gloaderd Rename the new table to queue log and the previous one to queue log old This can be done atomically as in RENAME TABLE queue log TO queue log old queue log i TO queue log Restart QueueueMetrics 26 Moving the queue_log table to InnoDB Restart qloaderd e Optionally delete the old queue log table
31. You need to locate the file jk2 properties and add edit the following line request registerRequests fals CAUTION This change must be made when Tomcat is stopped or it will overwrite it when it terminates Chapter 4 Serving QueueMetrics over Apache SSL Thanks to Matthew J Roth 4 1 Prerequisites A working QueueMetrics instance served by an Apache 2 front end Wildcard SSL certificates created by a recognized authority e g GoDaddy com The examples below are based on Apache 2 running on CentOS 5 3 Details may vary It is important to note that configuring Tomcat to take advantage of secure sockets is usually only necessary when running it as a stand alone web server When running Tomcat primarily as a Servlet JSP container behind another web server such as Apache or Microsoft IIS it is usually necessary to configure the primary web server to handle the SSL connections from users Typically this server will negotiate all SSL related functionality then pass on any requests destined for the Tomcat container only after decrypting those requests Likewise Tomcat will return cleartext responses that will be encrypted before being returned to the user s browser In this environment Tomcat knows that communications between the primary web server and the client are taking place over a secure connection because your application needs to be able to ask about this but it does not participate in the encryption or decryption itself
32. aa aa aiana daaa aea ddaa deta iaa aie dasta ERR ai iipon 8 4 Serving QueueMetrics over Apache SSL sssssssssssssssssssssee eee emen eene ee e s se see ehh entes ens e e ens nnne 9 LEBER 9 4 2 Configure the Name Based SSL Virtual Hosts 00s cece cece ee eter I I mme e mene mene nnns 9 4 3 Install the Apache HTTP Server and its SSL TLS Module ssssssssss III II m meme eme eene nnns 9 4 4 Configure the global Apache Settings ccc eee cece eee reer I e e me me me esse ens e nene nnn nnns 9 4 5 Configure the global SSL TLS Settings csssssssssssssssssssssII en mene mene emen he se enhn 10 4 6 Create DNS r cords iac eh ed gatur ube eek Lp e Pte sk Rea irent aA aa RETE RE RIP XCI4 bri 2s 10 4 7 Create the Application Directories sssssssssssese e II II III Ie heme hene ee ess e he enhn tenente 10 4 8 Install the CRT GSR and KEY flles 3 22 1 c9 ei ead ELI esd eta cuiii eG hed ctu Sates eho 10 4 9 Configure the Virtual Hosts iiir uniana etadur aeaiee lees oe de epe e aeii ogee ARA iiiad DN INDE ROC Rp 11 4 10 Verity the Configuration n i srest npma Peters ERROR HER ERDici PR a ppt dA a YER Gadves uda fe zr MD RR iaa pR R ner ER Edda 12 4 11 Setup the service for automated startup sssssssssssssssese Ee Een e eme menthe mener 12 4 12 Troubleshooting EET 12 4 13 Summary of Log Files used by A
33. allel GC on the New generation avoididing promotion of useless objects to the old generation XX CMSParallelRemarkEnabled lowers remarking pauses when running with Concurrent Mark Sweep 64 bit servers XX UseCompressedOops will use less heap on 64 bit systems that have less than 32G installed May speed things significantly up Debugging The following options may be helpful in understanding what is going on verbose gc logs garbage collections XX PrintGCTimeStamps prints the thimestamp of a garbage collection XX PrintGCDetails print details of a garbage collection XX OnError runs a script on errors XX OnOutOfMemoryError runs a script on memory errors Misc server mode should always be turned on for QueueMetrics systems 44 Chapter 19 CRM Integration with QueueMetrics SugarCRM and VTigerCRM are two widely used CRM software packages used to track contacts and opportunities that are widely used by call centres worldwide QueueMetrics can be easily integrated with them thanks to its ability to automatically open a specific URL from the agnet s Live agent page When integrated any new call answered by an agent opens the associated CRM contact page if present or pre fills a new form with the incoming caller ID 19 1 Prerequisites A working QueueMetrics instance One of the supported CRM packages already installed and working A working PHP Apache instance usually the same wher
34. allelGC XX PermSize 512M XX MaxPermSize 512M XX OnError bin javaerrormailgen sh XX OnOutOfMemoryError bin javaerrormailmem sh Though the finer details of tuning your own JVM depend on the total system memory whether you have a multi core machine or not and whether you run a 32 or 64 bit server the process described in this article will offer you data you can work with and wil be a reasonable start for large sites looking for real life QueueMetrics implementations 18 6 Quick JVM cheatsheet Memory size It is better to set the default and maximum memory setting to the same amount so that memory can be efficiently allocated from the starts Xmx 1000M Xmx 1000M set the total heap to 1000 Megabytes this does not include Permgen XX PermSize 512M XX MaxPermSize 512M set the total PermGen size to 512M this does not include the heap Garbage collection models You must choose only one of these options based on your hardware and throughput specifications XX UseSerialGC this is the default model but may cause large application pauses XX UseParallelGC this tries collecting memory in parallel ideal for large heaps and multi CPU systems uses a parallel version of the young generation collector XX UseConcMarkSweepGC the Concurrent Low Pause Collector may offer better throughput at the price of some additional heap usage 43 Tuning QueueMetrics memory settings XX UseParNewGC runs par
35. ame based SSL virtual host s dese eue the ek su vircuel nosis Eor Watson 0 port 80 and port 443 This virual host exists solely to redirect all non SSL traffic to the SSL virtual host This is done in an SEO friendly manner by using the 4 RedirectPermanent directive If the redirect is somehow circumvented the DocumentRoot directive is set to serve content from a non secure f directory ServerAdmin admin example com ServerName https testl example com ServerAlias https testl DocumentRoot var www html ErrorLog var www https testl example com logs error log CustomLog var www https testl example com logs access log common RedirectPermanent https https testl example com VirtualHost lt VirtualHost 443 gt This is the SSL virtual host It is configured so that strong cryptography 128 bit encryption or greater is required to access any web Content ServerAdmin admin example com ServerName https testl example com ServerAlias https testl DocumentRoot var www https testl example com html ErrorLog var www https testl exampl com logs ssl error log CustomLog var www https testl exampl com logs ssl access log common Mentem Enable SSL for this virtual host SSLEngine on Deny all requests which are not using SSL Directory var www https testl exampl SSLRequireSSL lt Directory gt even under a
36. app XML element closes add lt resource ref gt lt description gt DB Connection lt description gt res ref name jdbc qm res ref name res type javax sql DataSource c res type res auth Container c res auth resource ref This basically tells QueueMetrics that instead of connecting straight to the database it must fetch a connection from a pool called jdbc qm that is managed by Tomcat at the container level 8 4 Changes to Tomcat First remove the username and password from the JDBC URI they are passed separately here Modify the file server xml that is usually held in usr local queuemetrics tomcat config adding the following long section before the closing Host element Context docBase MYOMAPP path MYQMAPP reloadable true gt lt Resource name jdbc qm auth Container type javax sql DataSource ResourceParams name jdbc qm gt lt parameter gt lt name gt factory lt name gt lt value gt org apache commons dbcp BasicDataSourceFactory lt value gt 20 Database connection pooling lt parameter gt Maximum number of dB connections in pool Make sure you configure your mysqld max connections large enough to handle eudLl dcr your olo ioueecu Loms See e 0 wei no lit gt lt parameter gt lt name gt maxActive lt name gt lt value gt 50 lt value gt lt parameter gt lt You don t want to many idle connections hanging around if you can avo
37. e creen errem ccna nae dene hehehe neret eu ex rank a ka and kr ehh eher geh Meee en ree 50 21 3 Backing u p the temporary table ird rentrer htt rrr rentrer rre rhe khe re rex exe E TER 50 21 4 Restoring data esc err rrr ertt re rre EEEE GA Pea vse Pease Fer rese FESTAN GA rr vy wet rere rer eger ree RE Fre pne Ee 51 Removing duplicate rows from the queue log table cc cece sees eect eee e nee nme nme hne hne hne hne hne hne nne rre ann anna 52 22 ls JCceccmee C s 52 22 2 Reality CHO CK HM Em 52 22 3 Loading unique TOWS jis oe cer t Gast nity oi od extremi eed oh xb de cana oy ex VINETE cane eed ed Ueber sa e e rene rr DERE ceed tebe wera 52 22 4 Cleaning Ups stele tror aureus ues ur pH UR dene beige oven sues Gee reope bene bl deoeea abe deed bd i ree podria dede eric aai 53 Printing all QueueMetrics users and agents in one go cece eee ete ne III I m I meme eme eme ehe teer 54 Bulk renaming a dio filosss ccr oet ete herir esa bine EVENE nga erre ete er eer ees erras vac eune ed vacet eoa ardere are td v eee kx alg pe 55 24 1 Removing the initial character in new files cc eee e eee cece ee ne cent eens eenseeneeeneeeneeeneeeeeeeneeeneeeeseeeeeeeeeeeeeeeees 55 24 2 Renaming old files to remove the plus character ccc III meme ehe hene tenerent 55 Using the WebRTC softphone on the Icon agent page ss
38. e eene hehe hen ehh hen ehh ena rh eerie na nenne nna 26 LE IICSM tase can ts 26 14 2 Ch nges to MySQL 25 ceieete dices aden apanan HER RB Eee Vip de IBARRA M ion cece bead dE i apR UAR UAER ence SAN 26 11 3 Changes to Que eMBIrics venido Et po dace eo ta ie te dp oes ek RO REIR ERE T ME RRROD US tala tiaraa adede da t pRie deii 27 12 Using Master master database replication for strong high availability csscssssssssssess HH III 28 LA CC IIR 28 12 2 Ch nges to MySQL 5 atii oar ape er tp PARERE BIER ERR ARAB UBER UR S UR ABEL cece Lap dI ATE ARV ER agence ee 29 12 3 Changes to QUeueMBtrics ssc ise 5335 cogebat ebat e ade rdg eto aada d Fi ROS Lege dace EROS dU Eripe per ERES ERA 31 13 Native MySQL logging of queue log data csssssssssse III I me mene she e mer ee en enne enne 32 IKE s 32 14 Separating audio recordings in a daily folder csse m me me he m mene eme ee e enn 33 EP em 33 14 2 Archiving Serpia 33 14 3 Changes to QuevieMettics erte pi tases ssieedensdanes dette ee aa ba E io pe Pec daaa da e PR MAR ar baaada raat da saraaa ta 34 14 4 Making older files accessible 1 iiir eren trn open he nip rrt hope a rhe niin area Pear ex ER Re aea eridi 34 15 Show ringing phones in the realtime page sssssssssssI HH Ime memes m Ih IH
39. e the CRM is running A copy of the OpenQueueMetricsAddOns package available at https github com Loway OpenQueueMetricsAddOns 19 2 Integration with SugarCRM Integration with SugarCRM is implemented by mean of an external script that is to be copied on the Apache webroot folder The script is supplied within the addon library present on https github com Loway OpenQueueMetricsAddOns When properly configured the QueueMetrics agent call history page opens an external URL for each taken call This feature is be used to trigger the provided PHP script The script searches among contacts in the SugarCRM database using the current caller id and opens either the caller s record if present on SugarCRM database or preloads a new contact page filling in the calling party number The steps for installing and configuring the script are reported below We suppose to use the Apache webserver where SugarCRM is running We install the script on the Apache webserver main document root Download the nusoap library from http sourceforge net projects nusoap Extract the source zip on the main document web root and rename it to nusoap chown to the apache user and set proper permissions Copy the QueueMetrics SugarCRM php file on the web root folder chown to the apache user and set proper permissions Generate a queuemetrics user for SugarCRM The queuemetrics user should be able to perform searches and access contacts Annotate the password genera
40. e the following command yum update queuemetrics Edit the SQL connector string used by QueueMetrics to connect to the database Through a bash in your QueueMetrics server locate the web xml file for yam based install this file is located in the usr local queuemetrics qm current WEB INF folder Append to the param value key in the JDBC URL section the following codes amp amp useUnicode true amp amp characterEncoding utf8 amp amp characterSetResults utf8 Restart QueueMetrics Update the gloader with a version greater than 1 31 937 For a standard yum based install through a bash in your asterisk box issue the following command yum update qloaderd queue log file generated by asterisk for the whole dataset period In order to to this stop the qloader daemon empty the queue log table then start the qloader daemon The qloader will start to push the whole dataset since the beginning of the Historical queue log data present into the database needs to be reloaded This could be done only if you have the original queue_log file QA informations already present in the database cannot be migrated For this reason historical QA data cannot be s guarrantied 61
41. eH mener 35 16 Using pre purchased keys PPK correre n tad hh Rx LER nagd a aen RAN uae deeds pavers a en suea pee aevo verde 37 16 1 Terminology USCd 37 QueueMetrics Advanced Configuration Manual 17 18 19 20 21 22 23 24 25 26 16 2 Converting a PPK into a License Key isin nere e Ee se venae ere e fe eee YE gael eee 37 16 3 Upgrading downgrading a PPK i euer ve vena cobra sire rnnt rythme mr Enn ter rmt PETETA a FE Hrs Fre Rire rea 38 Enabling log rotation oue 39 IAS UC E 39 1722 TNS TOLANON Messi seae E 39 17 3 MISCICNANGES D 39 17 44 GChanges toxQUeueMEIFics ex err sees tee Weer m eerte eae ree bete Er aer een ae ead ede een eke cee D PR 40 17 5 FOr UML TOAGING p 40 Tuning QueveMetrics memory settings roit rece aereo ae ess eee use petet rne a ge ee eee usn p Ar ee ee eee Ig 41 18 1 Prerequisltes on einer o aE e rne Cased WAE TETEE UT eres eden SAUE AERE des do ere E sica devs Case eir i ec ael 41 18 2 Usage scenario seaside renoncer rrr ce vee ae OFS see ne FEE shies Fer aea PP rne erri e FEU ree rer eres rrr E er vp Heeb rera 41 18 3 Monitoring basics Java Visual VM iis eorr rh
42. ed to QueueMetrics through minor modifications in Asterisk configuration files Since Asterisk 1 4 a new RINGNOANSWER event is available in the queue log This event shows the last agent that did not pick up the phone when ringing but obviously this information is available only when the phone stops ringing With the hereby listed modifications it is possible to have ringing phone information as soon as a call enters in a particular queue This option is available only for systems where the hotdesking is not enabled for systems where hotdesking is required the realtime ringing information can not be written in the queue log but the standard RINGNOANSWER information is available directly from asterisk Realtime ringing information is fed to QueueMetrics by means of AGENTATTEMPT events inserted in the queue log This information should be generated by the Asterisk dialplan For this reason it s mandatory to specify Local Channel extensions as members in the queues definitions this will enable the app queue to pass from the dialplan to start ringing phones We take as example the queue queue aps defined in the queues conf as reported below queue dps annou annou eventmemberstatus no nce frequency 0 nce holdtime no ventwhencalled no joinempty yes leavewhenempty no maxlen 0 periodic announce frequency 0 queue callswaiting silence 1 qu qu TAS ue thereare silence 1 ue youarenext silence 1 try 5 strategy
43. er aligned with QueueMetrics For already installed QueueMetrics instead a set of steps needs to be performed in order to generate the correct environment Below is a list of these steps Change the default database charset ALTER DATABASE queuemetrics DEFAULT CHARACTER SET utf8 COLLATE utf8 general ci For each table in the database change the default charset by issuing ALTER TABLE table CONVERT TO CHARACTER SET utf8 COLLATE utf8 general ci where table should be replaced with the name of the table you re working on Repeate this step for all tables present in the QueueMetrics database qm tasks table ships with a key that needs to be limited before table conversion If you receive an error when converting f this table please issue the following step ALTER TABLE qm tasks DROP INDEX pFamily ADDETNDE qgimewnily jelly 20 prb 20 He ALTER TABLE qm tasks CONVERT TO CHARACTER SET utf8 COLLATE utf8 general ci Update your Tomcat with the version you can find on QueueMetrics website Tomcat 6 0 43 23 rpms is the minimum requirement able to properly handle UTF 8 For yum based installs from a bash on QueueMetrics server issue the following command yum update queuemetrics tomcat Update your QueueMetrics with a version greater than 14 10 5 build 937 From yum based installs from a bash on QueueMetrics server issu
44. er master database replication for strong high availability 12 2 Changes to MySQL 12 2 1 Changes to the insert order On server A you add the following lines to your etc my cnf configuration file under the mysqld section auto_increment_increment 2 auto_increment_offset 1 This way all inserted lines will be odd You do the same on server B auto_increment_increment 2 auto_increment_offset 2 In this case all inserted lines will be even On both servers make sure that the MySQL server is available on a public IP by editing etc mysql my cnf this is not so by default bind address 0 0 0 0 Restart both MySQL servers 12 2 2 Configure replica from A master to B slave First upload the QM default database on MySQL server A On server A we create a slave for replica to server B I GRANT REPLICATION SLAVE ON queuemetrics TO slave_b IDENTIFIED BY slave b pass FLUSH PRIVILEGES then we edit server B s my cnf file and set mysqld server id 1 replicate same server id 0 auto increment increment 2 auto increment offset 2 master NOS dis 110 il TES master user slave a master password slave a password master connect retry 60 replicate do db queuemetrics log bin var log mysql mysql bin log binlog do db queuemetrics log slave updates relay log var lib mysql slave relay log relay log index
45. ernal callcounter yes busylevel 1 eu llama dt encryption yes qualify yes avpf yes allow all icesupport yes srtpcapable yes videosupport no STPPhone deny 0 0 0 0 0 0 0 0 dtmfmode rfc2833 canreinvite no context from internal host dynamic type friend qualify yes permit 0 0 0 0 0 0 0 0 cigub IL db agna 1 Then specialize the templates by adding two peers 101 WebRTC username 101 58 Using the WebRTC softphone on the Icon agent page secret 101 200 SIPPhone username 200 secret 200 callerid customer QueueMetrics needs to connect to Asterisk 12 through AMI This could be enabled by editing the manager conf file and changing the following relevant keys enabled yes admin secret password deny 0 0 0 0 0 0 0 0 pxSimc 127 0 0 1 255 255 255 0 read system call log verbose command agent user config command dtmf reporting cdr dialplan originate write system call log verbose command agent user config command dtmf reporting cdr dialplan originate In this example we want to have an inbound queue This has to be specified in the queues conf file by adding at the end of the file the following code 300 strategy ringall We suppose the caller impersoned by our regular SIP phone registered with username 200 would be able to place calls into the queue To enable this we need to modify the extensions conf file by adding the following code at t
46. es with apxs usr sbin apxs with tomcat41 S CATALINA HOME with java home JAVA HOME e uat ers make make install This will build mod jk and install it as an Apache module 3 3 Configuration of Apache and mod jk Add the following lines to etc http conf httpd conf Check for paths to be correct Om amp e Load mod jk module LoadModule jk module modules mod_jk so Where to find workers properties JkWorkersFile etc httpd conf workers properties Where to put jk logs JkLogFile var log httpd mod jk log JkLogLevel info tulere ener ampRorma e MES CONES I MESES LEES VICE ME YA RU Serving QueueMetrics through Apache JkOptions indicate to send SSL KEY SIZE JkOptions ForwardKeySize ForwardURICompat ForwardDirectories JkRequestLogFormat set the request format JkRequestLogFormat w V T Send everything for context examples to worker named workerl ajp13 t JkMount examples workerl JkMount workerl We comment out JkMount lines because we will define them at the virtual host level Configure workers by creating the file etc httpd conf workers properties Define 1 real worker using ajp13 worker list workerl Set properties for workerl ajp13 worker workerl type ajp13 worker workerl host localhost worker workerl port 8009 worker workerl lbfactor 50 worker workerl cachesize 10 worker workerl cache timeout 600 worker
47. ge MGC activity ElHespzzs Used hesp x Threads x 20 20 05 E uve threads Bl Daemon threads E Tota baded casses M Shared loaced classes 7 3 3 Things you can do in VisualVM A number of interesing things can be done with VisualVM 18 Advanced QueueMetrics monitoring Know your JVM you can see the JVM settings from Overview JVM arguments Memory monitoring you can see the current CPU memory and thread usage from the Monitor page Note that with most settings it is normal that all memory be used up before a garbage collection is performed so you would expect to see spikes and falls in the graph You can also force a garbage collection if you want to see the true memory usage but this may be unwise on heavily loaded production servers Thread monitoring you can get a textual thread dump like the one discussed above by selecting Threads Thread dump You can use the Sampler to acquire a breakdown of memory and CPU usage per class you first need to install the plugin VisualVM Sampler from the Plugins menu You can keep a server open with multiple instances of VisualVM in order to monitor multiple QM servers 19 Chapter 8 Database connection pooling Each QueueMetrics transaction requires a connection to the database in order to access call and configuration data By using a connection pool in Tomcat a given set of database connections is opened at startup and then recycled as needed thus saving t
48. hat shows port 8080 and change it as follows Connector port 8080 maxHttpHeaderSize 8192 maxThreads 150 minSpareThreads 25 maxSpareThreads 75 enableLookups false redirectPort 8443 acceptCount 100 connectionTimeout 20000 disableUploadTimeout true compression on compressionMinSize 2048 noCompressionUserAgents gozilla traviata compressableMimeType text html text xml JS Restart QueueMetrics 6 3 Changes to QueueMetrics None required 6 4 For further reading http viralpatel net blogs 2008 1 1 enable gzip compression in tomcat html 16 Chapter 7 Advanced QueueMetrics monitoring Recent versions of the Java JVM offer very powerful APIs to monitor and diagnose live systems while they are running they are meant to be run in production with negligible performance impact This can be useful to diagnose specific problems e g Java heap exhaustion issues or to monitor the activity of your QM servers A real life example of JVM memory tuning with a working solution for 400 agent call centers can be found at Tuning QueueMetrics memory settings Chapter 18 Tuning QueueMetrics memory settings 7 1 Prerequisites A QueueMetrics instance runnining under JDK 6 or newer The specific version of Java that is being run can easily be seen under the License page of QueueMetrics Recent versions of QueueMetrics installed using yum should already be running under JDK 6 If this is not yo
49. he cost of opening and closing a connection for every transaction While this cost is negligible for general usage with a local database generally in the order of 10 to 30 milliseconds it can be a performace boost if the MySQL database is remote or your server is very busy The advantages of this technique can be summed up as faster database access mostly when the database is over a network or when there are many configuration parameters needed to fire up a connection easier monitoring of JDBC resource usage by third party tools maximum advantage when running AGAW clients 8 1 Prerequisites A working QueueMetrics instance version 1 6 0 or newer Before you start find your JDBC URI in your web xml file and copy it for future reference 8 2 Changes to the MySQL server Make sure that the total number of allowed connections is more than the maximum you configured for your pool The number we use here is 50 as set by the maxActive parameter below and should be OK for most MySQL servers Keep in mind that if you need to access your MySQL server with other applications or a monitoring script you will need more connections 8 3 Changes to QueueMetrics Modify the file web xml in QueueMetrics as follows Change the parameter JDBC URL Where the JDBC URI was to init param param name JDBC URL param name param value pool jdbc qm param value init param By the end of the file just before the web
50. he end of the file from internal exten gt 300 1 NoOp Called Queue EXTEN exten gt 300 im Queus S 1EXTEN p Epe Don t forget to add include extensions_queuemetrics conf at the very beginning of the extensions conf file This includes the QueueMetrics dialplan logic needed by Asterisk QueueMetrics integration You are now ready to start Asterisk 12 by issuing a etc init d asterisk start 25 5 Configuring QueueMetrics Access to QueueMetrics by pointing Chrome to the URL https yourserverip 8443 queuemetrics and specifying the default administrative username and password demoadmin demo Click on Edit system parameters on the Administrative tools menu section you find in the main page Perform the following changes through the editor shown in the page default queue_log_file sql P001 callfile dir tcp admin password 127 0 0 1 default rewriteLocalChannels true default hotdesking 86400 Default keys for the sofphone definition default sipaddress yourasteriskip default websocketurl ws youasteriskip 8088 ws Ce tavit o aee c WelolBiere sie E ell You need to specify to QueueMetrics to operate on the queue we defined in Asterisk This could be done by adding a new queue through the Edit queues link in the main page and clicking on the button Create New Specify 300 in the Queue alias and Queue s fields then select Inbound calls from the Call flow dropdown Save the queue t
51. hen assign the agent 101 as Main by clicking on the Agents button located at the bottom of the queue definition page 59 Using the WebRTC softphone on the Icon agent page To enable the softphone for the agent 101 click on the Cfg Agents on the top menu then enter on the agent 101 detail page In this page fill the fields WebPhone Username and WebPhone Password with the proper values we defined in Asterisk the SIP peer 101 with 101 as username and password then fill the Current terminal field with the extension you want to assign to a specific user In this example you need to set it at 101 Log off as administator and log back in as agent 101 Through the agent page login to the 300 inbound queue You re now ready to use the softphone to answer to any call to the extension 300 generated by the regular SIP phone Make sure your agents hold the security key NEWAGENTPAGE so they see the Icon page Good luck 60 Chapter 26 QueueMetrics running with UTF 8 charset QueueMetrics since version 14 10 5 build 937 is compliant with UTF 8 charset meaning that is possible to use UTF 8 characters when defining agents QA forms notes and more in general all items in the report For new QueueMetrics intalls where Tomcat and the database are installed together with rpm there is nothing to do except to use the proper gloader on the Asterisk server since 14 10 5 build 937 the gloader and the wqloader packages are named with build numb
52. hould not give you a large performace gain as all accesses to the table are index based performance will be stable even with very large tables but will make backups easier and quicker 21 1 Prerequisites A working QueueMetrics instance with MySQL storage Make sure you have enough disk space to carry out these operations one of the few things MySQL does not like is N finishing up disk space on a live system So you should have at least enough space to make a full copy of the queue log b table with indexes and all 2mm The following procedure is to be run when the system is idle as it uses a lot of I O for large tables and may lock tables On a very large table each query might take tens of minutes to run so beware You may keep on having gloaderd uploading data to your normal table but it would be better not to have QM running queries on it you need to make a complete database backup before attempting this 21 2 Moving data to a temporary table First we create a backup table called queue log oldto hold data we don t need anymore CREATE TABLE queue log old LIKE queue log Decide a timestamp in the past that will be your cutoff point in our case it is 1326826989 that stands for Jan 17 2012 9 7 03 09pm UTC There are a number of services that will do the conversion for you For example see http www unixtimestamp com index php You need also to know the partition you wan
53. id it only enough to soak up a spike in tle loai gt lt parameter gt lt name gt maxIdle lt name gt lt value gt 5 lt value gt lt parameter gt lt Don t use autoReconnect true it s going away eventually anc ab S a Cruce or Older CoOMMSccriGia jOOoOls ien oullcla ie test connections You need to decide whether your application is supposed to deal with SQLExceptions hint it should and how much of a performance penalty you re willing to pay to ensure freshness of the connection lt parameter gt lt name gt validationQuery lt name gt lt value gt SELECT 1 lt value gt lt parameter gt The most conservative approach is to test connections before they re given to your application For most applications this is okay the query used above is very small and takes no real server resources to process other than the time used CO trayerss itle imet If you have a high load application you ll need to rely on something else lt parameter gt lt name gt testOnBorrow lt name gt lt value gt true lt value gt lt parameter gt Otherwise or in addition to testOnBorrow you can test while connections are sitting idle lt parameter gt lt name gt testWhileIdle lt name gt lt value gt true lt value gt lt parameter gt You have to set this value otherwis ven though you ve asked connections to be tested while idle the
54. ing directories as needed A problem arises if you do not have control of where your recordings will be stored possibly because you use a GUI that does not help you with this It is still possible to obtain the same result by making the folder where Asterisk writes its own recordings a symbolic link that actually points to the folder that recordings are stored under This makes implementing various NAS solutions simple to do The following steps will archive voice recordings by month and day as subfolders of the folder recordings as in the following example recordings 2010 11 15 audio 123456 789 wav This way audio is archived by month and day aa If you use such a solution with an external NAS make sure you do not overload the I O and network capacities of your Server If e g you record all traffic you are going to double the Asterisk related network bandwidth used so beware 14 1 Prerequisites A working Asterisk sending recordings to var spool asterisk monitor An external NAS or disk volume mounted on recordings where you will store all audio data A working QueueMetrics system 14 2 Archiving script The following script will create the destination directory and a symbolic link to it Before running it copy the contents of var spool asterisk monitor to a different location or they will be lost bin bash VAR1 date Y m VAR2 date d mkdir recordings VAR1 mkdir recordings S VAR1 SV
55. instance uses a distinct partition E 31 Chapter 13 Native MySQL logging of queue_log data Recent versions of Asterisk have a way of writing the queue log file right to the database without needing the gloaderd process We do not advise using native logging instead of qloaderd because It s way more likely that a different networked process will be unavailable and so data will be lost unless the disk is full a file should always be writable The gloaderd is on the other side exteremely reliable and lightweight The qloaderd process allows for clustering while you can only have one Asterisk server when using native logging Still this option could be useful in some scenarios e g read only disks for embedded systems running Asterisk so we support it 13 1 Prerequisites Asterisk 1 6 or 1 8 compiled with MySQL support 32 Chapter 14 Separating audio recordings in a daily folder If you have full access to the configuration files of your Asterisk system it is easy to save audio recordings in separate folders each day this helps QueueMetrics in finding them quickly and makes them way more manageable e g for archiving You can obtain this result by the following dialplan code exten gt 999 n Set MONITOR FILENAME recordings S STRFTIME EPOCH Y m d audio S enten gt 909m Queue 3 T8 ic p Asterisk should automatically create miss
56. ion wildcard NameVirtualHosts and _default_ exampl SIS SS 443 is a NameVirtualHost default server https testl example com etc httpd vhosts d 000 https testl port 443 namevhost https testl example com etc httpd vhosts d 000 https tes port 443 namevhost https test2 example com etc httpd vhosts d 001 https tes 5 9 90 is a NameVirtualHost default server https testl example com etc httpd vhosts d 000 https testl port 80 namevhost https testl example com etc httpd vhosts d 000 https test port 80 namevhost https test2 example com etc httpd vhosts d 001 https test Syntax OK 4 11 Setup the service for automated startup q ClikC omirle lenEjoxel Om p Chikconiig ligt metge httpd 0 8 et 1e LORE 2 8 Gal 330i 4 on 5 2 eai OS GE ic service httpd start Starting httpd Ok 4 12 Troubleshooting openssl s client connect localhost 443 SSL Connection Establishment G su 7 JN HTTP 1 1 200 OK HTTP Headers Web Pag closed Contents 12 Serving QueueMetrics over Apache SSL 4 13 Summary of Log Files used by Apache var log httpd access_log var log httpd error_log var www hittps test1 example com logs access_log var www https test1 example com logs error_log var www https test1 example com logs ssl_access_log var www hittps test1 example com logs ssl_error_log var www https test1 example com logs ssl_request_log var www hittps test2 examp
57. ive monitoring asks for an extension to send the call to this is an extension dialed on the active voicemail server as defined in the System settings If there is no active voicemail defined then the live monitor will place the call to the extension on the server that the agent is on Chapter 3 Serving QueueMetrics through Apache You may want to serve QueueMetrics through an Apache front end instead of using Tomcat natively This is useful if You require better efficiency so that static files are served natively without passing through Tomcat You need to integrate Qm on a virtual server that offers other services e g applications written in PHP Perl CGI You need to serve QM on the public internet and want to use the security tools Apache offers 3 1 Prerequisites e A working QueueMetrics instance Apache 2 0 installed with headers and compilation tools 3 2 Installing mod jk Download mod jk from the Apache Tomcat website it will be in a file named e g jakarta tomcat connectors jk 1 2 src current tar gz Run the following commands per mvi JEUKCNE CSIC Oe 6 OI eei 915 gk J Sige CUUAINSINIE CEE C pz cd jk native Check where the apxs command is by running ocate apxs Default location is usr sbin apxs Check that SCATALINA HOME and JAVA HOME are defined default values are usr local queuemetrics tomcat and usr local queuemetrics java respectively Configure mod jk by running feComricuic
58. k like er 1L2 S 3 1 2 2 28 53 56090 20 LAOS 220 0 7 LOS6 LAOOSS 8 1 2 c 32217 wen Where 412225555688 is the number dialed These names are not compatible with some versions of QueueMetrics 24 1 Removing the initial character in new files Add the following to etc asterisk extension custom conf from pstn custom exeem essc eosscm Gosscm essem gt X 1 GotoIf S CALT gt _X n plusstart NoOp Changing Caller ID number from CALLI ERTED amp L3 ERID num gt _X n noplusstart NoOp Caller ID does not need adjustment gt X gt X rn Set CAI ERID num CAL rn Set CAL Then load the new dialplan code with asteri Ski rX ERID ANT CAI dialplan reload This will fix all calls going forward 24 2 Renaming old files to remove the plus character To fix all calls retroactively you need to rename the existing call recordings like in for d in find var spool asterisk monitor mindepth 3 type d do eel Sele EOT aL abe owen Iva i EA done done 3 This recipe was originally contribuited by one user on our forums who wished to remain anonymous do 55 SUED Gone 80g dL V e War SrebesheeutIE Bored visse eee ERID num to S CALL Chapter 25 Using the WebRTC softphone on the Icon agent page This chapter is a reference guide to install Asterisk 12 and QueueMetrics 14 06 in order to
59. le com logs access_log var www https test2 example com logs error_log var www https test2 example com logs ssl_access_log var www https test2 example com logs ssl_error_log var www https test2 example com logs ssl_request_log 4 14 Notes Warnings related to name based SSL virtual hosts such as the following can be ignored warn Init SSL server IP port conflict https testl example com 443 etc httpd vhosts warn Init You should not use name based virtual hosts in conjunction with SSL warn RSA server certificate CommonName CN example com does NOT match server name References Setting Up a Secure Apache 2 Server http www informit com articles article aspx p 301 15 Apache 2 with SSL TLS Step by Step http www securityfocus com infocus 1818 How to Create Self Signed SSL Certificates with OpenSSL http www xenocafe com tutorials linux centos openssl self signed certificates index php NameBasedSSLVHosts Httpd Wiki http wiki apache org httpd NameBasedSSL VHosts What is a Wildcard SSL certificate http help godaddy com article 567 Best SSL Wildcard Certificates http www sslshopper com best ssl wildcard certificate html Apache SSL in htaccess examples http www askapache com htaccess apache ssl in htaccess examples html Apache SSL TLS Encryption http httpd apache org docs 2 2 ssl Apache Module mod alias http httpd apache org docs 2 2 mod mod_alias html 13
60. lems eorr tret mr Re RR RR RR REN ERREUR ERR REESE DER RR RR deaa daada AR daa 17 7 3 Remote monitoring with VisualVM cesses ene enhn hehehe nnn hen neg hn aha hn una nn 18 8 Database connection Pooling rere ttr atr pee ERR TR RR DRE da ieia enda ERAT A ERAS DRRRTREX SERA SR ADERAT 20 CEBIT aaa t 20 8 2 Changes to the MySQL server ssiri renidi anendra dened kp pande do OR Do Po XO Lo ieee coy ERROdda tanpa AD EERE CQR pip bear aneia 20 8 3 Ghanges to QueueMetrics uitset niteni aerae RE ep TR Re An p ee cee aaa TR SR at RATED pA a URP AUD Pac ipe dn en 20 8 4 Changes to Tomcat ad orte IR ee Hep de Aa Blue Re NL RARE age Riu Le PATER LepA ALIE AER ER UE RIDE PATRES 20 9 Monitoring and fixing slow queries in MySQL sssssssssssss I HI e eme he hee ee eh nre ehe nenne 24 9 1 Prerequisites M 24 9 2 Changes to QueueMetrics 25 ceci aded teer Rd ep EUR I4 p Ran PADO Il api UR SNR RR BAR dR A E Ve p BO Ii nae 24 10 Moving QueueMetrics to a different server 0 kee cece nn eI I e m me Ie ems eme e ene se e se see eene eene 25 LAPIS e 25 10 2 Required EJCILD 25 11 Moving the queue log table to InnoDB cesses en
61. ment program We suggest installing the newly generated key on the destination instance by calling the method QM setActivationKey on the QM instance and passing the new key This way the whole provisioning process can be easily automated For more information see QueueMetrics XML RPC manual 16 3 Upgrading downgrading a PPK You cannot upgrade or downgrade a PPK or a license generated from a PPK if you need a larger license you simply activate a new one This is not an issue as PPK keys are meant to be short lived for most environments 38 Chapter 17 Enabling log rotation in Tomcat This document details the required steps for setting up log rotation in Tomcat running on CentOS 5 when it is installed from the Loway repository 17 1 Prerequisites A working QueueMetrics instance installed via yum 17 2 The rotation file If you would like to setup Tomcat logrotation you can do the following vi etc logrotate d qm tomcat6 This will create the logriotate file that you will have to set up as follows usr local queuemetrics tomcat logs log notifempty CONO is DU e SHES daily rotate 10 compress missingok usr local queuemetrics tomcat logs catalina out notifempty COP IE i8 10i ene dateext daily rotate 10 compress missingok If you want to you can make it take care of cleaning out temp files as well or just do it from cron as you would normally usr local queuemetrics tomcat logs
62. nce use NTP 10 2 Required steps The following steps must be followed 1 2 Install a barebone QM same version on the new server Move the database from the old server to the new one overwrite the existing database Move the files web xml tpf properties and configuration properties to the new server make sure you use the correct path on each server you can find this on the License page Edit the file etc sysconfig gloaderd so that you can upload data to the new server You will likely be adding grants on the new server s MySQI so that a user from the Asterisk box can connect Restart qloaderd and make sure it is uploading data to the new server You can see if this works from the DBTEST Live DB inspector When there is a new line on the queue log you should also see it in the database after 1 2 seconds Edit the configuration properties file to make sure that the AMI connection strings those properties that contain strings like with tcp point to your Asterisk server You will probably have to edit Asterisk etc asterisk manager conf to allow AMI connections from a new server You can test if this works from DBTEST AMI Tester If you use audio recordings make sure that you can access them from the new server you may have to use a network mount on the Asterisk server and edit the path in configuration properties 25 Chapter 11 Moving the queue log table to InnoDB Thanks to Je
63. nd a lot of it differs between Java versions so make sure your reading matches your Java version The default collector in Java 6 is selected based on your hardware and OS but you can force which collector to use by adjusting your tomcat settings For single CPU setups use a serial collector XX UseSerialGC for multi CPU servers use a parallel aka throughput collector XX UseParallelGC Before discovered my PermGen size problem also tried a concurrent collector XX UseConcMarkSweepGC This seems to perform better where PermGen size is limited Once increased my PermGen size went back to UseParallelGC as Loway recommended this My server has 2 x quad core CPUs with HT so it makes sense to use it While we are talking about GC let s also look at some additional logging you can turn on for GC You can add the following to your tomcat settings verbose gc XX PrintGCTimeStamps XX PrintGCDetails This adds additional logging to your catalina out file Often when QM was in a hung state would only see GC log events in catalina out this generally coincided with Heap being maxed out Later when paid more attention to PermGen and CPU would see the same effects when they were maxed You can also add settings to alert you when Java runs out of memory Add the following to tomcat settings XX OnError bin javaerrormailgen sh XX OnOutOfMemoryError bin javaerrormailmem sh The scripts can contain anything you like you could
64. ns von Bulow Most QueueMetrics tables use a storage engine called myISAM this was the default storage engine and works well on tables that are written infrequently and read often If you run a clustered call center with multiple partitions and many rows being inserted per second you may see database response times degrade In this case moving the storage engine to InnoDB a storage engine that is way better for contended tables may make a difference 11 1 Prerequisites e A working QueueMetrics instance MySQL server version 5 Before you consider doing this make sure that you have read the current MySQL documentation on Converting tables to MySQL http dev mysql com doc refman 5 6 en converting tables to innodb html your server settings may require some tweaking to get good performance out of the new table 11 2 Changes to MySQL In order to convert the table we will Make sure you have enough space on disk at least 2x the size of your current queue log table Make sure you have a complete backup of the old DB in case something goes wrong and you have a suitable maintenance window so you can work comfortably Create a new table called queue log i where we will load old data We will create it with the following definition make sure that the set of fields exactly matches your current fields CREATE TABLE queue log i perrito varche 20 INOW NULIGO IDyggPXUn EUD VU igne stel shine iil wasige NO
65. ol import trustcacerts alias root file ca root cer keystore keystore jks Install the site certificate usr local queuemetrics jdk1 6 0 22 bin keytool import trustcacerts alias server file queuemetrics domain net cer keystore queuemetrics domain net jks Edit the Tomcat configuration file and enter the path to the certificate in the keystoreFile section enter the keystore password in the keepass section SSLEnabled should be set to true and the port should be set to 443 as that is the default port for HTTPS nano usr local queuemetrics tomcat conf server xml 48 Securing QueueMetrics Tomcat With A SSL Certificate lt Connector port 443 maxHttpHeaderSize 8192 maxThreads 150 minSpareThreads 25 maxSpareThreads 75 enableLookups false disableUploadTimeout true acceptCount 100 secure true SSLEnabled true clientAuth false sslProtocol TLS keyAlias server keystoreFile usr local queuemetrics jdk1 6 0 22 bin certificates queuemetrics domain n scheme https keypass secret gt This link http www coolestguyplanettech com redirecting http https tomcat will show you how to also have HTTP J requests redirect to HTTPS Restart QueueMetrics service queuemetrics restart Once this is done you should be able to access your QueueMetrics or other Tomcat based website application by going to https queuemetrics domain com and assuming you have the CA installed
66. one is doing at a given moment This is useful to diagnose load based issues where too many requests and open sessions flood the QM server root qm usr java jdk1 6 0_17 bin jstack i 12345 This lets you know what a frozen server with high CPU usage is actually doing 17 Advanced QueueMetrics monitoring 7 3 Remote monitoring with VisualVM VisualVM is a graphical tool developed by Sun that lets you monitor a remote QueueMetrics instance while it s running it can actually be used with any Java based process It allows monitoring over a network so it is common to run it on a workstation to monitor one or more remote servers You can find it at https visualvm dev java net and it is already included in all Java 7 downloads so it is likely you already have it on your PC 7 3 1 Allowing remote access The standard JVM settings for QM do not allow remote access over a network for obvious security reasons In order to allow it you should add the following line to etc init d qm tomcat6 export JAVA OPTS Dcom sun management jmxremote Dcom sun management jmxremote port 12345 Dcom sun management jmxremote authenticate false Dcom sun management jmxremote ssl false Djava rmi server hostname 10 10 5 106 SJAVA OPTS Restart the JVM after adding it You can change the port in this case we set it to 12345 for security purposes Please note you must also set an host name or IP address for the machine failu
67. our reference only In order to activate the PPK you issue an HTTP GET call to the activation URL you will be given as in the example below note it has to be written all on the same line wget O http my server llm licence wave gen do K enduser ABC amp K email me8gmail com amp K id XQI LOWAY 74KKMREX6TOH1 0M 50 1 90 The output will look like the following ZOR SZOLI O8 26 T5951 38 a52 SIE ESZ ZANO E 5 o 4 5 6 e2 011 09 25 199459515 820 3L 140 6 2741 M R PSOEX ACCU A successful call will start with the S OK status preamble any other status is invalid The D parameter shows the current time on the activation server The K parameter holds the key itself the key can be 50 200 characters long The I parameter shows the Issue date subsequent calls made with the same activation key will always return the same key with a different D parameter The X parameter shows the expiration date for this license note that QM may stop working at any time after the expiration date is through The M parameter should be ignored In case there is an error the output will look like 37 Using pre purchased keys PPK SKO Key moc iow Us1234 iDs2 011 09 26 15553331 K n a IS Dg M ERR And will start with S KO f Automatic key installation Although the key can be manually generated by issuing the wget command the process was built so that it can easily be automated via a script or a client manage
68. ow much data is available and under which partitions SELECT partition Coume h FROM queue_log CROURRR E Paneo ORDER BY partition ASC Make sure that you have no partitions which name starts with o 22 3 Loading unique rows First we make a backup of the queue log table into a temporary table this is not strictly needed as you should already have a full database backup before attempting this but may come in handy in case you need to restore quickly CREATE TABLE queue log backup AS SELECT FROM queue 10g 52 Removing duplicate rows from the queue_log table Then we move all data from their current partition to a partition of the same name but prefixed with o_ From now onwards QueueMetrics will not find data in the database until the procedure completes UPDATE queue_log Sart pakcncionm comeac Ug VU mpeutitiom 2 Now we keep the highest unique_row for each duplicate row belonging to a partition starting with o_ and load it to a partition with their original name INSERT INTO queue log SELEC gulosc inel pereici 3 aS Pacce time acl call ae emewe r ewe sedo clawed clerca2 Cereso oera p clacaS seieweicicl max unique row count FROM queue log WMSUMIE Iexeueiedbiedbkoum Idle gy mU GROUP BY iweueibaiibidgium 5 time acl cmi ael ememe agence wexdo eme olnEAZ bleues 5 eeu y
69. pache ssssssssssssseeI IH mme ehem seme men mee mene nnne 13 Luc 13 5 Installing QM as a ROOT webapp oi 2 eiit detta de eed recor ob RA ti dene ads aa HRIR Tcu Eaa Db Tk y ane bends DE RR 4E 14 HRMd t 14 5 2 Model 1 sing as ROOT Webapp iiiter nicer see pte neu Do vag este ein dd aed det Rx de ER Ea be PIRA T REP ee ERROR MAE 14 5 3 Model 2 defining a ro t context cene eh nee RR naa RR a ER HR ERR NR REN ERA Ra ERR ER RR YR 14 5 4 Changes to QueueMeltrics artesan teni daea pro ER TRE ARA VAI Dp Edu Rp APER RUE E RAM IPAE da ep Dp dapR UTER 15 6 Enabling GZIP compression in Tomcat 1 onore bees uve RR ieee Pep TR REO RAE REIR data Rd pA DEdilabR ee DRE EA edana 16 SEC P 16 6 2 Changes to Tomcat cust e dope rine In eI PUR a eds ERE e S dare EPA SAIL RA RD iape UR tp IRURE weeds 16 6 3 Chariges to QueueMetrics ordo dap rM tioned nad ABEL PAIRE GRADA IRR RE ARRA AAT CIR PATE IR ep DEA gRPR TR d 16 6 4 For further reading coord roter rr reae hehe aidaa RE Ra RR ERAT EA ER ERE ERA TRE X RATER ERAT AR aedi AS 16 7 Advanced QueueMetrics monitoring 0 cece EEE EEE Eee see e se he he he esse e e e e e e sre n se nenne 17 VEU 17 7 2 Assessing memory prob
70. re S009 gt Connector port 8009 enableLookups false redirectPort 8443 debug 0 protocol AJP 1 3 gt This is the access point for Apache This port should be unreachable outside this box 3 5 2 Enabling the virtual host By the end of server xml after the default virtual host section lt Host gt lt Host gt add an entry like Host name queuemetrics example com debug 0 appBase var www virtualhost example com queuemetrics unpackWARs true lt Alias gt qm2 example com lt Alias gt Logger className org apache catalina logger FileLogger directory var log httpd prefix queuemetrics example com tomcat suffix log timestamp false Context path docBase debug 0 reloadable true gt Context path manager debug 0 privileged true docBase usr local queuemetrics tomcat webapps manager Context Host If you want the manager webapp to be available you need to include the context path as in the example above check the path to be correct Serving QueueMetrics through Apache Restart everything etc init d httpd restart etc init d queuemetrics restart Check the logs when restarting Go to http queuemetrics example com queuemetrics and check that QueueMetrics is working 3 6 Troubleshooting If you see lines like these appear on catalina out org apache jk common HandlerRequest decodeRequest WARNING Error registering request
71. re to do so will prevent all remote monitoring If you run this on a publicly available server and or you have a firewall you should set up an encrypted connection and use SSL and password authentication see http docs oracle com javase 1 5 0 docs guide management agent html To make sure that the system restared correctly and the JMX connection is actually used you can run the following command root localhost lsof i P grep 12345 java 1253 3 ROOT SU TEYS IL AL S CRINES Wee 23129545 5I STEN As you can see Java process 14513 is listening on port 12345 7 3 2 Starting VisualVM To start VisualVM you run bin visualvm exe When started click on Remote and enter the IP address of your QM server Click on Advanced settings and set the port to the one you specified in the QM configuration 12345 in this example After that you select your server and select Add JMX connection from the right button menu You enter the JMX connection as IP 12345 By clicking on it you get a working connection like in the picture below VisualVM 1 3 e x Eie Applications Yew Took Window Help ae Shas Applications 4 x StartPage amp 1010 12 98 m Eljtecal B overview HE Montor ES threads Samoler er Visual E ii nevote 10 10 5 12 c f Dalet 10 10 5 12 Monitor v CPU V Memory V Osses Y Threads A 10 10 5 12 AE Snapshots Uptime 7 min 3 sec Perform GC Heap Dump 2004 2005 a BPuuse
72. rennen eher Pee eher ree rer Fee ene ra Fide er re eire Fera eret 41 18 4 Troubleshooting taking thread and memory dumps isssssssssssII II meme e eme e ee e ene enne 42 18 5 ital Settings operc ee inr uci nie ecd eser e ne ren Ere Send wales ere tut craquer enn E comic ded tim ocd ncs ree OTIDE eue 43 18 6 Quick J VM cheatsheet oue dee ceeded raat eet Hie edet o ee pere e err ser E c mese Qetnnudq teer Ede err eed 43 CRM Integration with QueueMelrics ec Win eee ees eee a eee piger va sex ihe ny day el eee gern sax ee ee eric e E Mr UE oe 45 IS MICI 45 19 2 Integratiori with SugarGB Ms wa Aine erga cee der oe cutee Ee AEO PENR E re bea For hen rn PL geicdm dr rere ie Ver pude c NS IT per ng 45 19 3 Integration with V TigerG RM an teed e rre seea eevee ee rre e PET OU a renenbe rn date deste ce RE VER a oiled aaa E EY ERREYRMITEY rip 46 Securing QueueMetrics Tomcat With A SSL Certificate sssssssssssssssssss I m me mme nne nenne 48 20 1 Introduction seintes m 48 20 25 Instr ctlOfls e pcan run vase ree demere reae rero rever reete Peeing ae FEDEN E PEPUN ce rere Rr vr Re ele Pee ote eee ea 48 20 3 Removing obsolete Diffie Hellman ciphers 0c ee e eme eme eme ese eene 49 Offlining apart of the queue log tables ccc ren erar metae Pe exec eS belied rrr er ret Vee yer re uae i Erb aod o ree see YER E E aan ene 50 APRI CONEIC RT EUEEEUUEEIEITUIMT 50 21 2 Moving data toa temporary tabl
73. ringall ie a meout 15 wrapuptime 0 me me me mber Local 100 from internal custom mber Local 101 from internal custom mber Local 102 from internal custom Let s assume we have three members tied to the extensions 100 101 and 102 defined in the from internal custom context We assume that the extension 200 from internal custom mailto 200 from internal custom is the entry point for the queue queue dps The extensions conf should be defined as ae GA ex Cus Cus Cus ex CS e eS Sz Cus Cus ex TO CS c De pc ce ES eS c De Dc c Dc Ce D 2 45 2p 2 5B RoR INO ISS TN ISS Se D xo ey O O O D QOO 0 0 0 m internal custom 1 System echo S EPOCH S PCHANNEL queue dps SIP S aly Dral S308 1 00 n Hangup n Dial SIP 101 n Hangup n Dial SIP 102 n Hangup 1 NoOp Here is a call for the queue n Set __PCHANNEL S UNIQUEID n Queue queue dps subq n Hangup 35 EXT EN AG ENTATT EMPT 1 System echo S EPOCH S PCHANNEL queue dps SIP S EXT EN AG ENTATT EMPT EXT EN AG ENTATT EMPT 1 System echo S EPOCH PCHANNEL queue dps SIP S gt gt gt Show ringing phones in the realtime page In the example above the PCHANNEL variable is set in
74. root g apache tmp wildcard example com key var www https testl example com conf ssl key install m 400 o root g apache tmp wildcard example com key unsecure var www https testl example com conf ssl key install m 440 o root g apache tmp wildcard example com crt var www https testl example com conf ssl crt install m 440 o root g apache tmp gd bundle crt var www https testl example com conf ssl crt install m 440 o root g apache tmp wildcard example com csr var www https testl example com conf ssl csr install m 400 o root g apache tmp wildcard example com key var www https test2 example com conf ssl key install m 400 o root g apache tmp wildcard example com key unsecure var www https test2 example com conf ssl key install m 440 o root g apache tmp wildcard example com crt 10 Serving QueueMetrics over Apache SSL var www https test2 f install m 440 o root g apache tmp gd bundle crt var www https test2 install m 440 o root g apache tmp wildcard example var www https test2 xample com conf ssl crt xample com conf ssl crt COMIC Siam xample com conf ssl csr rm f tmp wildcard example com gd bundle crt 4 9 Configure the Virtual Hosts vi etc httpd vhosts d 000 https testl exampl c SWAN OOOAnccse cesic 1 e xampl COM omic CON COMA CORE ENTS Define the https testl xampl com n
75. root context It is also possible to define a specific webapp as the root webapp for a virtual host by setting it as a root context This can be achieved quite easily by editing the server xml file in Tomcat Host name example com debug 0 appBase www example com www unpackWARs true gt lt Alias gt www example com lt Alias gt lt Logger className org apache catalina logger FileLogger elitseexene ronem ickia hogy hee oct prefix queuemetrics suffix log timestamp false Context path docBase queuemetrics debug 0 reloadable true gt 14 Installing QM as a ROOT webapp lt Host gt This example assumes that your QueueMetrics is installed in www example com www queuemetrics and that you want to server QM as a root webapp for domains example com and www example com 5 4 Changes to QueueMetrics None required 15 Chapter 6 Enabling GZIP compression in Tomcat You can speed up the serving of QueueMetrics pages over a WAN by transparently compressing the page before being sent it will be transparently decompressed by your browser As QueueMetrics pages especially large tables are highly redundant this technique can buy large improvements in the user experience at a cost of some CPU time on the server 6 1 Prerequisites A working QueueMetrics instance 6 2 Changes to Tomcat Edit the server xml file under tomcat config locate the HTTP connector instance the one t
76. root folder Create a queuemetrics user on VTigerCRM with permissions to look at contacts and retrieve the required access key generated by VTigerCRM on the user page settings Open the QueueMetrics VTigerCRM php file and edit the variables e server url set it to your VTigerCRM server address name Susername the user you created on the step above SaccessKey setit to the accessKey generated by VTigerCRM for the queuemetrics user Configure QueueMetrics to open an external URL for each received call The URL should contain the caller number as callid parameter http 10 10 1 1 QueueMetrics VTigerCRM php callid C Restart QueueMetrics and log on as agent Open the live agent page Each time a new call is shown in the agent page your browser will open the VTigerCRM contact page if any The very first time the contact page will open you ll be asked for login on the VTigerCRM This is because you want to f access to VTigerCRM with your proper username and password and not as the queuemetrics user 19 3 2 Integrate with VTigerCRM PBX Manager Module VTigerCRM already provide a PBX Manager module that integrates with your Asterisk PBX With the current implementation VTiger CRM 5 4 0 the PBX Manager is able to open a popup whith caller id information each time a new call is directed to the extension configured by a VTiger user The PBX Manager is able also to enable a handy click to call feature that is out of the scope of thi
77. s document to describe 46 CRM Integration with QueueMetrics Unfortunately the PBX Manager does not handle calls coming from a queue You need to make a little modification to the VTigerCRM PBX Manager module source code in order to have the popup shown for calls coming from queues as explained below First of all you need to activate and configure the PBX Manager Module on VTigerCRM Log in to the VTiger panel as administrator Goto the CRM Settings from the top right most icon on the page Click on Module Manager From the list you have on that page click on the hammer icon present on the PBX Manager row This lets you to access to the PBX Manager settings Fill in the relevant Asterisk information server IP AMI port AMI username and password Stick with 1 6 Asterisk version we don t provide Asterisk 1 4 integration Press Update Go to the user preferences page and fill the section 7 Asterisk Configuration with your internal extension Enable the Receive Incoming Calls tickbox You then need to modify the script responsible for reading Asterisk AMI events and inject calls events on the VTiger database On the VTiger webroot folder open the file AsteriskClient php present on the cron modules PBXManager subfolder e Look forthe asterisk handleResponse2 function There is a set of if else block LE mainresponse Event strstr Sappdata Newexten amp amp strs
78. ssssssssss M mH m e e e heh enne e erre 56 25A dicic 56 25 2 Installing Asterisk 12 320 ore en retener og emer reus res e eter niis tees rone ES uper uer og ere ka nea cs npe e Exe petat 56 25 3 Install G TETUR 57 25 4 GOnfig ritig ASIOFISK eoo RED pr E ee urere e a Se hn tdv edu Esc epe urere E va ov Au tudet nde oe ER UU T ORIPE prede 58 25 5 Config ring Que eMetfics s rr ere iiaa okies Pade gaa vaca Seger Pediatr he PR EVETRR Peds EE EES E E sat URRe YR EROR ees meee 59 QueueMetrics r nning with UTF 8 charset oie eti ehem reper rea FE ERIA FE ed eR Faas pri erri VP YR ER Rr de Fn eas 61 Chapter 1 Acknowledgements We would like to thank the following people for their precious contributions Matt Florell from the ViciDial Group USA lt mattf vicidial com mailto mattf vicidial com gt Matthew J Roth of InterMedia Marketing USA Jens von Bulow of Xantech South Africa Rahul Rajan of M H Alshaya Co Emile Coetzee of Clarotech Consulting South Africa www clarotech co za deobfuscate USA Chapter 2 ViciDial integration ViciDial is an enterprise class open source call center suite in use by many large call centers around the world VICIdial has a full featured predictive dialer It can also function as an ACD for inbound calls or closer calls coming from VICIdial outbound frontiers It is capable of inbound outbound and
79. sting NameVirtualHost 443 Load virtual hosts from the vhosts directory etc httpd vhosts d Include vhosts d conf Serving QueueMetrics over Apache SSL 4 5 Configure the global SSL TLS Settings cp etc httpd conf d ssl conf etc httpd conf d ssl conf orig vi etc httpd conf d ssl conf Use the lt IfDefine gt directive to disable the default SSL virtual host as follows abewedole twis ekeuewle SSL swibxwbiell Inosic IfDefine 0 FE a Su Vrircual hogre Comes FE lt VirtualHost default 443 lt VirtualHost gt IfDefine Change the following lines from SSLRandomSeed startup file dev urandom 256 SSLSessionCacheTimeout 300 to SSLRandomSeed startup file dev urandom 1024 SSLSessionCacheTimeout 600 4 6 Create DNS records https test1 example com https test2 example com 4 7 Create the Application Directories mkdir var www https mkdir var www https mkdir var www https mkdir var www https mkdir var www https mkdir var www https stl example com stl example com conf html logs webapps stl example com conf ssl crl crt csr key st2 example com st2 example com conf html logs webapps st2 example com conf ssl crl crt csr key 4 8 Install the CRT CSR and KEY files Sk db db db db d GP Gr Gr GP GP Ge install m 400 o
80. t somewhere for Loway 21472 Is the Java Tomcat PID have found that both these commands will pause Tomcat while the information is extracted so running this on a working O system will cause it to stop while it executes Obviously if the system is already hung it doesn t matter Once had a larger PermGen set did see an improvement in the sense that no longer would QM simply hang but it would still slow down This was evident in the JVM where you could see as PermGen usage climbed so did the CPU In the past when PermGen was maxed out it would eventually cause QM to become completely unresponsive Once you have more overhead in PermGen it can actually recover QueueMetrics release 12 09 and greater requires less PermGen space for string handling but may still require a sizeable quantity that exceeds the JVM defaults 18 5 Final Settings For a quick copy and paste here are my final settings for a 400 Agent server with 2 x Quad CPU and 12GB RAM running Tomcat MySQL amp Apache These settings must be set in the JAVA_OPTS property in etc init d qm tomcat6 Bare essentials Xms4096M Xmx4096M server XX 4UseParallelGC XX PermSize 512M XX MaxPermSize 512M With extra logging JVM and Java alerts Xms4096M Xmx4096M server Dcom sun management jmxremote port 9003 Dcom sun management jmxremote authenticate false Dcom sun management jmxremote ssl fals verbose gc XX PrintGCTimeStamps XX PrintGCDetails XX UsePar
81. t to move INSERT INTO queue log old SEEE FROM queue_log WHERE partition POO1 AND time_id lt 1326826989 And then delete it from the queue_log table DELETE FROM queue_log WHERE partition P001 AND time_id lt 1326826989 And optimize the queue_log table so space is claimed back OPTIMIZE TABLE queue_log at this point you might run a backup of the new queue_log_old table save its contents to disk and delete it 21 3 Backing up the temporary table You may use the mysqldump tool to create a backup of the table 50 Offlining a part of the queue_log table S gt mysqldump queuemetrics queue_log_old gt queue_log_old sql S gt bzip2 queue_log_old sql You may then drop the table to have it removed DROP TABLE queue_log_old 21 4 Restoring data In case you need to put data back on the main table e g because you want to be able to access it again through QM INSERT INTO queue log Simba cw FROM queue log old 51 Chapter 22 Removing duplicate rows from the queue_log table If multiple instances of the qloaderd were run at the same time it is possible that data was loaded multiple times The correct way to handle this is to use the Data Queue Partial Update mode see http manuals loway ch QLoader chunked ar01s03 html and reload any queue_log files involved If this is not possible for example because that data
82. ted by SugarCRM when creating the queuemetrics user you must use a valid e mail address where SugarCRM will send the password Open the QueueMetrics_SugarCRM php file and edit the variables e server url set it to your SugarCRM server address name Susername the user you created on the step above Spassword set it to the password generated by SugarCRM for the queuemetrics user Edit the configuration properties file you can find on the QueueMetrics installation folder Look for the default crmapp key and change it in order to point to your Apache server The URL should contain a reference to the current caller ID for this reason the dynamic token C must be included The URL will be something like http 10 10 1 1 QueueMetrics_SugarCRM php callid C Restart QueueMetrics and log on as agent Open the live agent page Each time a new call is shown in the agent page your browser will open the SugarCRM contact page if any The very first time the contact page will open you ll be asked for login on the SugarCRM This is because you want to f access to SugarCRM with your proper username and password and not as the queuemetrics user 19 2 1 A more advanced configuration You may want to avoid the SugarCRM authentication procedure that happens when the agent receiveds the first call To do this you need to implement some logic into the QueueMetrics SugarCRM php script where you retrieve the agent s username and password before
83. the extension 200 to the UNIQUEID for each incoming call in the queue The variable is used by the extensions 100 101 and 102 to write a signature in the queue_log file The same should be replicated for each agent for each queue and for each internal extension in the system To have real time ringing information the last step to be performed is to modify che configuration key default ignoreRingNoAnswer present in the configuration properties file in the QueueMetrics installation folder This key should be set to true This switches the QueueMetrics analyzer to the proper working modality where RINGNOANSWER verbs are discarded because ringing information is now provided by the AGENTATTEMPT events 36 Chapter 16 Using pre purchased keys PPK Since QueueMetrics 1 7 pre purchased license keys can be used instead of normal license keys This is of interest for resellers and installers who want to pre purchase a set of blank activation keys and then convert them into regular activation keys immediately as and when required The advantages of this model are that You can generate a key as soon as your clients ask for it no delays due to bank payments different time zones etc If your business model is hosting remote call centers with QueueMetrics instances you can purchase QM licenses that last as long as your client has paid you for if they pay you monthly you do not have to commit to a four year license in advance Also when
84. tr Sappdata DIALED NUMBER EXTTOCALL else if Smainrespons Event OriginateResponse Change it inserting a new e 1 se block as reported below LE mainresponse Event Newexten amp amp strstr Sappdata DIALED NUMBER strstr Sappdata EXTTOCALL else if Smainrespons Event AgentCalled Suniqueid Smainresponse Uniqueid Schannel Smainresponse ChannelCalling Splits explode Schannel ScallerType Sega lols Ssplits explode S mainresponse AgentCalled Sextension splits l1 parseSuccess true else if Smainrespons Event OriginateResponse Save and run the script as by VTiger documentation Each Agent could log in on the QueueMetrics agent page and through this log in on the preferred queues specifying the internal extension already set on the VTiger user preferences As soon as a new call coming from the queue is received on that extension a popup is presented in the VTiger pages 47 Chapter 20 Securing QueueMetrics Tomcat With A SSL Certificate Reposted from deobfuscate s blog http deobfuscate net 2013 08 15 securing queuemetrics tomcat with a ssl certificate 20 1 Introduction These instructions should hopefully help you with implementing on your QueueMetrics installation which runs on Tomcat 6 as of this post A CSR will be generated on the ser
85. ul NS 150 6JUN 7 EL U iS Ce U U real name AS NAME nome classe as CLASS cmuLenyaL as CIWASS IES chiavi utente as USER KEYS ultimo logon as LAST LOGON AG descr agente as AGENT CODE AG aliases as FRIENDLY NAMES LOC loc name as LOCATION SW lkeejlia 2s SWIM ISO GRO group_name as AGENT_GROUP SELECT group_concat CP nome_coda SEPARATOR AS QUE FROM code_possibili CP Wales C2 AGON inmemor Ibi Comes Vis llla 45 OR Cl exeyewucaL Sjouiib ueic il Gige Comers 5 U looin OR CP are Siaici jsjoilliloirie 2 Ibis Cometic Ys UW local AS QuisUES FROM JOIN LEFT LEFT LEFT LEFT arch users U arch classes C on C id classe U classe JOIN JOIN JOIN JOIN WHER agenti noti AG on AG nome agente U login locations LOC on LOC id location AG location arch users SUP on SUP user id AG supervised by agent groups GRO on GRO id group AG group by E U abilitato 1 AN ORDE D U masterkey 0 REPY Ue Ileealin ASIC By running it agains the QueueMetrics database from any MySQL shell you will get a complete report you can export or reprocess as you see fit 54 Chapter 24 Bulk renaming audio files Some PBXs especially the ones based on FreePBX 2 11 may save a prepending sign in audio file names Those file names will loo
86. ur case you should upgrade the queuemetrics java package 7 2 Assessing memory problems If you feel you are experiencing memory issues you should take multiple memory and thread dumps spaced a couple of hours in between and send them to Loway for inspection We will usually need The current memory settings Amemory dump Athread dump They should be obtained as described below 7 2 1 Finding the current QueueMetrics PID In order to perform the procedures described below you must know the PID of your currently running QueueMetrics instance It can usually be found out by running root qm ps fax grep catalina 3293 3 qos 0 SH 0 00 _ grep catalina 12345 7 S1 OLA yusr Jjeva 7dkinG Only balm jeva earn dE SML ees Here in the example QM is running with a PID of 12345 The PID is used to attach to the current JVM and query it It is also possible to start the JVM so that it allows administrative access over a network therefore all the procedures described below can be run on a remote JVM as well 7 2 2 Taking a memory dump A memory dump presents a long list of all the loaded Java classes and how many instances of each are present in memory root gqm usr java jdk1 6 0_17 bin jmap histo live 12345 You should also collect general memory area usage statistics by running root gqm usr java jdk1 6 0_17 bin jmap 12345 7 2 3 Taking a thread dump A thread dump prints out thread by thread what each
87. use the softphone embedded in Icon the new realtime agent page The softphone is based on sipML5 The support offered for WebRTC by different browsers is in flux so expect minor differences in the set up We welcome your comments and suggestions 25 1 Prerequisites We focus on A fresh install of Centos 6 4 i686 32bit version Asterisk 12 3 0 and required libraries compiled from sources QueueMetrics 14 06 served through HTTPS Secured HTTP or HTTP over SSL in single server mode Chrome 35 0 1916 153 m running on a Windows 8 1 machine At the end of the chapter the reader will have Aregular SIP phone configured as caller An inbound queue An agent accessing the QueueMetrics agent page able to receive calls through the integrated WebRTC softphone 25 2 Installing Asterisk 12 3 0 We suppose to have an already installed Centos 6 4 with working Internet connection and a root privileges The first step installs the bare minimum tools needed to compile Asterisk and other required libraries Perform the following steps from a console or remote shell yum update yum install gcc c make gnutls devel kernel devel libxml2 devel yum install ncurses devel subversion doxygen texinfo curl devel yum install net snmp devel neon devel yum install uuid devel libuuid devel sqlite devel sqlite git speex devel gsm devel yum install wget It is now time to compile the SRTP library We focus on version 1 4
88. ver and processed by an internal Microsoft certificate authority This document will also describe how to redirect HTTP traffic to HTTPS to ensure encryption Digicert was also used for reference 20 2 Instructions SSH into the server and change directories to where the keystore utility resides cd usr local queuemetrics jdk1 6 0 22 bin Generate an empty Java keystore keytool genkey alias foo keystore keystore jks keytool delete alias foo keystore keystore jks Generate a Java keystore and key pair keytool genkey alias queuemetrics domain net keyalg RSA keystore keystore jks key Generate a certificate signing request CSR for an existing Java keystore usr local queuemetrics jdk1 6 0 22 bin keytool certreq alias queuemetrics domain com Copy the CSR cat queuemetrics domain net csr Go to httos ca domain com certsrv and request certificate then select advanced certificate and paste in the CSR This process will be the same but have a different interface when using another CA Download the certificate not certificate chain with DER encoding as well as the CA root certificate as both will be needed Certificate Issued The certificate you requested was issued to you DER encoded or Base 64 encoded pu Download certificate Download certificate chain Upload the certificates to the server and move the files to usr local queuemetrics jdk1 6 0 22 bin Install the CA root certificate keyto
89. w or inaccessible High CPU usage caused by Java Out of memory errors in catalina out High run time values recorded in catalina out XML RPC queries time out For a number of clients simply setting up a cron job to restart Tomcat once a day was generally enough to prevent slowdowns from occurring might still happen once or twice a month This unfortunately did not work for the larger sites with 400 agents where I d often have to restart Tomcat multiple times during office hours 18 3 Monitoring basics Java Visual VM So where does one start The first thing you want to do is get your Java Visual VM monitoring working This is detailed earlier in this manual Advanced JVM monitoring Chapter 7 Advanced QueueMetrics monitoring The 3 things you want to look at on the Monitor page are CPU Memory Heap Memory PermGen 18 3 1 Memory Settings Heap After discussion with Loway they require 5 6Mb of RAM in the Heap per agent accessing the GUI On top of that you need to allow overhead for Java as well as your reporting At one client site had about 400 agents So 400 x 6 2400 I m not sure how much to allocate for reports so played it safe and rounded up to 4096 as they do pull large reports You then use this value to set your Xms and Xmx values You can read how to set them in the QM Manual http queuemetrics com manuals QM_UserManual chunked ar01s02 html understanding queuemetrics memory requirements
90. was rotated out of the system and original queue_log files are unavailable it is possible to do this operation at the SQL level If you do not feel confortable doing this Loway offers Per Incident Support Tickets so that a qualified technician may connect to your QueueMetrics system and perform this procedure for you 22 1 Prerequisites A working QueueMetrics instance with MySQL storage About 2x the current size of the queue_log table as free disk space Make sure all qloaderd instances are stopped Make sure you have enough disk space to carry out these operations one of the few things MySQL does not like is finishing up disk space on a live system So you should have at least enough space to make a full copy of the queue log table with indexes and all RN The following procedure is to be run when the system is idle as it uses a lot of I O for large tables and may lock tables On a very large table each query might take tens of minutes to run so beware You need to make a complete database backup before attempting this 22 2 Reality check Before you attempt this procedure make sure you run the following query SELECT PALELCIOM cime abel tmicte cow Cow comu FROM queue log GROUP BY partition time id unique row count HAVINCHEOUTEI NT It shoud return exactly zero results If it is not so the following procedure may not work correctly Also you should be aware of h
91. workerl socket keepalive 1 worker workerl socket timeout 300 Each worker is a Tomcat instance you can define more than one if you run multiple webapps each in their own Virtual Machine for maximum security 3 4 Virtual host configuration You basically have two possible approaches to mounting webapps in Apache so that their content s handled by Tomcat Redirecting you tell Tomcat that some URLs e g the ones ending in jsp are to be handled by Tomcat while all other files are server statically by Apache itself This requires the webapp to be present on the same host as Tomcat Proxying you tell Apache to forward all requests within a specified virtual host to Tomcat for serving The server may be on a different host therefore making it possible to server contents from an external server You can use either model but of course you cannot use both for the same QueueMetrics instance 3 4 1 Model 1 Redirecting some URLs to JK Check the following lines in httpd conf Listen 80 NameVirtualHost Add the following lines for each Virtual Host you want to support KWALIACMEIUOSC SS ServerName queuemetrics example com ServerAlias queuemetrics_test example com ServerAdmin webmaster example com DocumentRoot var www virtualhost example com queuemetrics CustomLog var log httpd queuemetrics example com_access log common ErrorLog var log httpd queuemetrics example com error log AddDefaultCharset UTF 8

Download Pdf Manuals

image

Related Search

Related Contents

Blues Jr III_079644a.indd  Handleiding SOLIDDIGITAL  MAGNETIC DOOR CONTACT MAGNETINIS DURŲ KONTAKTAS  Interaction D esign A lm anacco 2004  家庭ごみ収集カレンダー    カタログDL  Artwizz AZ1174ZZ screen protector  IMC Toys 720015 toy  MODE D`EMPLOI DE LA CALCULATRICE POUR LES  

Copyright © All rights reserved.
Failed to retrieve file