Show Posts

This section allows you to view all posts made by this member. Note that you can only see posts made in areas you currently have access to.


Messages - Wessel

Pages: [1] 2
1
Thank you! Just what i was looking for. Did you also manage to intreptert the calls with an aggregate? I'll have a go for that now if i cant find it on the net. I think its worth creating :-)

2
Hi,
In the steps of putting Apache in front of Tomcat we use mod_jk.
However if we use the default settings on tomcat, it binds to 0.0.0.0 exposing the 8080 port for the world to exploid.

Now we can put a firewall in front of it but that;s way to brutal.
Binding Tomcat to 127.0.0.1 instead of 0.0.0.0 solves this problem elegantly.
Now apache mod_jk can reach the tomcat server and pull its pages out there as requests come in on the apache webserver.
But nobody from outside can reach the 8080 port any more.
( i know this works with unix/linux, i have no clue if Windows understands a lo interface )

Go to the follow lines in your tomcat setup:
Code: [Select]
    <!-- Define an AJP 1.3 Connector on port 8009 -->
    <Connector port="8009"
               enableLookups="false" redirectPort="8443" protocol="AJP/1.3" />

And change it into:
Code: [Select]
    <!-- Define an AJP 1.3 Connector on port 8009 -->
    <Connector port="8009" address="127.0.0.1"
               enableLookups="false" redirectPort="8443" protocol="AJP/1.3" />

And the HTTP port:
Code: [Select]
<Connector port="8080"  protocol="HTTP/1.1"
               connectionTimeout="20000"
               URIEncoding="UTF-8"
               redirectPort="8443" />

into
Code: [Select]
<Connector port="8080" address="127.0.0.1" protocol="HTTP/1.1"
               connectionTimeout="20000"
               URIEncoding="UTF-8"
               redirectPort="8443" />
PLEASE NOTE!!! Once you bind it to 127.0.0.1 you cant reach it any more from outside with your InternetExplorer! as this is the whole purpose of this excersise :-D
Use a ssh tunnel like:
ssh -L 8080:127.0.0.1:8080 <your remote host with Queuemetrics & tomcat >
now you can look at it again with http://127.0.0.1/

Now do the same with the cmd port:
Code: [Select]
<Server port="8005" address="127.0.0.1" shutdown="SHUTDOWN">

Then follow all the steps of the mod_jk
MAKE SURE YOUR Acces the worker also on localhost:
Code: [Select]
worker.ajp13_worker.port=8009
worker.ajp13_worker.host=localhost
worker.ajp13_worker.type=ajp13

Enjoy!
        Wessel

3
It's solved in 1.8.8
No need to hack the code anymore  :o

4
Hi,

SETUP: Asterisk 1.8.8 with FreePBX 2.9
using hotdesking ( set FreePBX on devicesandusers mode )
qloader.pl pushing the data into an external database

Problem:
Asterisk 1.8.8+ & FreePBX write out the Usernames to the queue_log and uses Local channels

Solution:
The local channels can be rewritten by qloader.pl, however the full agent names needs a table that contains all teh rewrite rules ( see the qloader manual how to setup this table )

What I've created is a trigger for Queuemetrics that updates the qlog_rewrite table automatically as soon as a full Agent name is added or changed.
So as long as you use exactly the same full name in Quemetrics for your agent as you use in FreePBX you no longer need to add rewrite rules to qloader as they are generated automatically by the two triggers below.
These triggers need to be created inside the Queuemetrics database which should contain the table agenti_noti and qlog_rewrite

It's basic code that does the job. However if you change the full name of your agent 10x it will leave you with 10 rewrite rules. So advise check the rewrite table from time to time if all rewrite rules are still used. However if if time stamps are updated in the table 1000x nothing is added to the table as it checks the uniqueness of the rewrite rules. If you have any improvements, please add them  :)

Enjoy!
      Wessel de Roode

Code: [Select]
/* Create a trigger that updates the rewrite table every time a new user is added to Queuemetrics */
CREATE TRIGGER self_update_qlog_rewrite_insert AFTER INSERT ON agenti_noti
    FOR EACH ROW
         INSERT INTO qlog_rewrite ( ag_from, ag_rewritten )
               SELECT descr_agente, nome_agente FROM agenti_noti
                    WHERE descr_agente NOT IN (SELECT ag_from FROM qlog_rewrite);

/* Create a trigger that updates the rewrite table every time a user altered in Queuemetrics */
CREATE TRIGGER self_update_qlog_rewrite_update AFTER UPDATE ON agenti_noti
     FOR EACH ROW
         INSERT INTO qlog_rewrite (ag_from, ag_rewritten )
               SELECT descr_agente, nome_agente FROM agenti_noti
                    WHERE descr_agente NOT IN (SELECT ag_from FROM qlog_rewrite);

Qloader.pl rewrite rules switched on:
Code: [Select]
my $rewriteToAgent = 1; # 0 no; 1 yes
my @channelsToAgent = ( 'Local', 'SIP' );
my $dbAgentRewrite = 1; # 0 no; 1 yes - rewrite according to rules in table qlog_rewrite
See the manual of Qloader how to setup the table. After that, apply the triggers. It does not matter if you already had some users in your queuemetrics. But add at least 1 user to trigger the SQL so it wil update your rewrite rules.

5
AGAW / agaw-runner SQL problem?
« on: December 18, 2008, 19:28:32 »
Hi running the agaw-runner under a normal linux user with the admin user a login account some how blows up with a strange error. Here are the details:

First thing I needed to to fix is that the line

VMOPTS=-server -Xmx256M -Xms256M

gives an error:
./agaw-runner.sh: line 14: -Xmx256M: command not found

Fixing this (I'm not a bash guru but i think it can be fixed like this)
VMOPTS='-server -Xmx256M -Xms256M'

After this the scripts starts up, but still gives some weired errors:

QM: 1.5.0
Java: 1.5.0_14
MySQL: Ver 14.12 Distrib 5.0.32
AppSer: TomCat 5.5

agaw-runner.sh
JAVA=/usr/bin/java
VMOPTS=-server -Xmx256M -Xms256M

USER=admin
PASS=admin
JDBC="jdbc:mysql://127.0.0.1/queuemetrics?zeroDateTimeBehavior=convertToNull&jdbcCompliantTruncation=false&user=queuemetrics&password=javadude"
QMPATH=/var/lib/tomcat5.5/webapps/queuemetrics
ITER=10
IDLE=15000
RUNLOG=false
RUNLOGDIR=/root/runlog

MYSQLJAR=/usr/share/java/mysql-connector-java.jar  (5.0.4)
SERVLET=/usr/share/java/servlet-api.jar (2.4)
==============================

============
QM User name: admin
QM password:  admin
QM path:      /var/lib/tomcat5.5/webapps/queuemetrics
JDBC URI:     jdbc:mysql://127.0.0.1/queuemetrics?zeroDateTimeBehavior=convertToNull&jdbcCompliantTruncation=false&user=queuemetrics&password=javadude
Number of loops:         10
Idle time between loops: 15000 ms
Keep run log: false
Run log dir: /root/runlog
Path: '/var/lib/tomcat5.5/webapps/queuemetrics/WEB-INF/agaw.properties'
Chiave: '5231317C-4E324465-6D6F2D31-2E352E30-2D52232D-23516D52-756E6E65-727C5333-31323539-38383132-30303030-307C'
 *** LOWAY TPF licence: to 'Demo-1.5.0-R' up to 'Fri Dec 04 00:00:00 CET 2009'
Data Scad [2009-12-04]: Fri Dec 04 00:00:00 CET 2009
Data scad:Fri Dec 04 00:00:00 CET 2009 - Scaduto: 0
Servlet A01 - Step X3
Servlet A01 - Step X4 - 103
-- Inner Exception --
Exception: it.loway.tpf.common.exceptions.TechException
Stack trace:
Problema DB: com.mysql.jdbc.exceptions.MySQLSyntaxErrorException: You have an error in your SQL syntax; check the manual that corresponds to your MySQL server version for the right syntax to use near ')' at line 1
   at it.loway.tpf.SQL.selectScalare(Unknown Source)
   at it.loway.app.queuemetrics.agaw.BO.AgentReader.closeRunsCreatedByAPreviousExecution(AgentReader.java:436)
   at it.loway.app.queuemetrics.agaw.QueueRunner.run(QueueRunner.java:157)
   at it.loway.app.queuemetrics.agaw.QueueRunner.main(QueueRunner.java:728)
-- End Inner Exception --

============
QM User name: admin
QM password:  admin
QM path:      /var/lib/tomcat5.5/webapps/queuemetrics
JDBC URI:     jdbc:mysql://127.0.0.1/queuemetrics?zeroDateTimeBehavior=convertToNull&jdbcCompliantTruncation=false&user=queuemetrics&password=javadude
Number of loops:         10
Idle time between loops: 15000 ms
Keep run log: false
Run log dir: /root/runlog
Path: '/var/lib/tomcat5.5/webapps/queuemetrics/WEB-INF/agaw.properties'
Chiave: '5231317C-4E324465-6D6F2D31-2E352E30-2D52232D-23516D52-756E6E65-727C5333-31323539-38383132-30303030-307C'
 *** LOWAY TPF licence: to 'Demo-1.5.0-R' up to 'Fri Dec 04 00:00:00 CET 2009'
Data Scad [2009-12-04]: Fri Dec 04 00:00:00 CET 2009
Data scad:Fri Dec 04 00:00:00 CET 2009 - Scaduto: 0
Servlet A01 - Step X3
============
QM User name: admin
QM password:  admin
QM path:      /var/lib/tomcat5.5/webapps/queuemetrics
JDBC URI:     jdbc:mysql://127.0.0.1/queuemetrics?zeroDateTimeBehavior=convertToNull&jdbcCompliantTruncation=false&user=queuemetrics&password=javadude
Number of loops:         10
Idle time between loops: 15000 ms
Keep run log: false
Run log dir: /root/runlog
Path: '/var/lib/tomcat5.5/webapps/queuemetrics/WEB-INF/agaw.properties'
Chiave: '5231317C-4E324465-6D6F2D31-2E352E30-2D52232D-23516D52-756E6E65-727C5333-31323539-38383132-30303030-307C'
 *** LOWAY TPF licence: to 'Demo-1.5.0-R' up to 'Fri Dec 04 00:00:00 CET 2009'
Data Scad [2009-12-04]: Fri Dec 04 00:00:00 CET 2009
Data scad:Fri Dec 04 00:00:00 CET 2009 - Scaduto: 0
Servlet A01 - Step X3
Servlet A01 - Step X4 - 103
-- Inner Exception --
Exception: it.loway.tpf.common.exceptions.TechException
Stack trace:
Problema DB: com.mysql.jdbc.exceptions.MySQLSyntaxErrorException: You have an error in your SQL syntax; check the manual that corresponds to your MySQL server version for the right syntax to use near ')' at line 1
   at it.loway.tpf.SQL.selectScalare(Unknown Source)
   at it.loway.app.queuemetrics.agaw.BO.AgentReader.closeRunsCreatedByAPreviousExecution(AgentReader.java:436)
   at it.loway.app.queuemetrics.agaw.QueueRunner.run(QueueRunner.java:157)
   at it.loway.app.queuemetrics.agaw.QueueRunner.main(QueueRunner.java:728)
-- End Inner Exception --


Any hints ?  ???

Wessel

6
Translations / Re: Looking for translators
« on: August 10, 2008, 21:08:30 »
Ok finished,

It's up to HQ for the next release of QM


Wessel

7
Thanks!

I'll test it this week,

Wessel

8
Running QueueMetrics / Re: QM and after hours.
« on: June 14, 2008, 01:03:34 »
Question,

I would like to have some of my agents stay in there for a week as a fall back. would it hurt to make this window hudge? Or will this impact the calculation of the stats?

Wessel

9
Hi!

What method do you use for the outbound calls?

1. queueDial.agi
2. The new outBound dial script for asterisk: http://forum.queuemetrics.com/index.php?topic=261.0

The 2nd one I've seen it has CallMonitoring incorporated, the first one i am not sure.

Wessel

10
I've been running this now for some time. Didn't find any errors or flaws. Anybody else tried this AEL script for QM ?

Wessel

11
QueueMetrics news / Re: QueueMetrics 1.4.4 released today
« on: June 13, 2008, 21:45:54 »
Hi!

Do you think you could find the time to update the demo system? I would like to peek at 1.4.4 before I condsider diving in or else I'll prob. wait for 1.4.5 :-) Any rough idea in what time frame you would like to release it

Thnx!

Wessel

12
Outbound and QueueMetrics / Re: queueDial.agi not working
« on: June 13, 2008, 18:16:20 »
Addition to the FAQ
4. Check if the file /var/log/asterisk/agi-log.txt is read/writeable by Asterisk


Wessel

13
QueueMetrics installation / TOMCAT5_SECURITY=yes, one issue left
« on: June 11, 2008, 23:05:14 »
Hi,

I know I can switch of security, but wouldn't it be nice to have it working :-)

I've managed to get most of QM working with security tight enabled in tomcat5. I used the following security rules:

// QueueMetrics rules
 grant {
permission java.net.SocketPermission "localhost:3306", "connect,resolve";
permission java.io.FilePermission "/var/log/asterisk/queue_log", "read";
permission java.io.FilePermission "/var/lib/tomcat5.5/webapps/queuemetrics/WEB-INF/classes/logging.properties", "rea
d";
};

This will work for all the functions (as far as i tested it) but it breaks as soon as I request the license information with the error below, If anybody was able to work around this error, please let me know

Wessel

It forwards to the page: http://localhost:8180/queuemetrics/$WEBAPP/sys_errore.jsp
And in the log it bumps the following dump.
[F56D8F8D70E367938D4451F1DCC357E5] Tempo totale esecuzione verbo 'qm_start': 467 ms
[F56D8F8D70E367938D4451F1DCC357E5] [ERR] -- Inner Exception --
Exception: java.security.AccessControlException
Error:
access denied (java.util.PropertyPermission * read,write)Stack trace:
java.security.AccessControlException: access denied (java.util.PropertyPermission * read,write)
   at java.security.AccessControlContext.checkPermission(AccessControlContext.java:264)
   at java.security.AccessController.checkPermission(AccessController.java:427)
   at java.lang.SecurityManager.checkPermission(SecurityManager.java:532)
   at java.lang.SecurityManager.checkPropertiesAccess(SecurityManager.java:1252)
   at java.lang.System.getProperties(System.java:561)
   at it.loway.app.queuemetrics.autenticazione.caricaDatiPaginaLicenza.doRun(Unknown Source)
   at it.loway.tpf.transaction.servlets.LowayTransactionController.serveRequest(Unknown Source)
   at it.loway.tpf.transaction.servlets.LowayTransactionController.serveRequestWrapper(Unknown Source)
   at it.loway.tpf.transaction.servlets.LowayTransactionController.doPost(Unknown Source)
   at javax.servlet.http.HttpServlet.service(HttpServlet.java:709)
   at javax.servlet.http.HttpServlet.service(HttpServlet.java:802)
   at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
   at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:39)
   at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:25)
   at java.lang.reflect.Method.invoke(Method.java:585)
   at org.apache.catalina.security.SecurityUtil$1.run(SecurityUtil.java:243)
   at java.security.AccessController.doPrivileged(Native Method)
   at javax.security.auth.Subject.doAsPrivileged(Subject.java:517)
   at org.apache.catalina.security.SecurityUtil.execute(SecurityUtil.java:275)
   at org.apache.catalina.security.SecurityUtil.doAsPrivilege(SecurityUtil.java:161)
   at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:245)
   at org.apache.catalina.core.ApplicationFilterChain.access$0(ApplicationFilterChain.java:177)
   at org.apache.catalina.core.ApplicationFilterChain$1.run(ApplicationFilterChain.java:156)
   at java.security.AccessController.doPrivileged(Native Method)
   at org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:152)
   at org.apache.catalina.core.StandardWrapperValve.invoke(StandardWrapperValve.java:213)
   at org.apache.catalina.core.StandardContextValve.invoke(StandardContextValve.java:178)
   at org.apache.catalina.core.StandardHostValve.invoke(StandardHostValve.java:126)
   at org.apache.catalina.valves.ErrorReportValve.invoke(ErrorReportValve.java:105)
   at org.apache.catalina.core.StandardEngineValve.invoke(StandardEngineValve.java:107)
   at org.apache.catalina.connector.CoyoteAdapter.service(CoyoteAdapter.java:148)
   at org.apache.coyote.http11.Http11Processor.process(Http11Processor.java:869)
   at org.apache.coyote.http11.Http11BaseProtocol$Http11ConnectionHandler.processConnection(Http11BaseProtocol.java:664)
   at org.apache.tomcat.util.net.PoolTcpEndpoint.processSocket(PoolTcpEndpoint.java:527)
   at org.apache.tomcat.util.net.LeaderFollowerWorkerThread.runIt(LeaderFollowerWorkerThread.java:80)
   at org.apache.tomcat.util.threads.ThreadPool$ControlRunnable.run(ThreadPool.java:684)
   at java.lang.Thread.run(Thread.java:595)
-- End Inner Exception --

<code>

14
QueueMetrics installation / Re: QM 1.4 and Trixbox 2.6.1
« on: May 06, 2008, 22:54:59 »
Looks like you did not include the context of the login/logout of the agents in your dial plan

Wessel

15
Hi,

Here's a translation of the old Asterisk extensions_queuemetrics.conf into the new Asterisk 1.4+ AEL language. Useful for people who are setting up a new call center based on asterisk 1.4+ and the new AEL language to describe their dial plan.
For more information about this extensions please read the manual (1.4.1) Appendix III: The (queuemetrics) context
Change the bold context into your own context if needed (recommended to leave though and fix your own dial plan  ::) )
QM could you please add this to the distribution?

Thanks,

    Wessel de Roode

---------extensions_queuemetrics.ael ----------------------------
Quote
//                           
//   QueueMetrics Extensions
//
// Based on the old queuemetrics/WEB-INF/mysql-utils/extensions-examples/extensions_queuemetrics.conf
//

context queuemetrics
{

// extension 0 is a dummy end point
  10 => {
              Answer;
              Wait(10);
              Hangup;
  }

// extension 11 makes remote monitoring possible
  11 => {
              Answer;
              NoOp( "QM_AGENT_CODE: ${QM_AGENT_CODE}" );
              NoOp( "QM_EXT_MONITOR: ${QM_EXT_MONITOR}" );
              NoOp( "QM_AGENT_EXT: ${QM_AGENT_EXT}" );
              ChanSpy(${QM_AGENT_CODE});
              Hangup;
  }

// extension 12: set call status code
  12 => {
               Answer;
               NoOp( "QM: Setting call status '${CALLSTATUS}' on call '${CALLID}' for agent '${AGENTCODE}'" );
               System( echo "${EPOCH}|${CALLID}|NONE|Agent/${AGENTCODE}|CALLSTATUS|${CALLSTATUS}" >> /var/log/asterisk/queue_log );
               Hangup;
  }

// extension 20: agent callback login
//               For this to work, there must be no password on the agent.
  20 => {
                Answer;
                NoOp( "QM: Logging on Agent/${AGENTCODE} to extension ${AGENT_EXT}@from-internal" );
                AgentCallBackLogin(${AGENTCODE}||${AGENT_EXT}@from-internal);
                Hangup;
  }

// extension 21: agent callback logoff
  21 => {
                Answer;
                NoOp( "QM: Logging off Agent/${AGENTCODE}" );
                System(asterisk -rx "agent logoff Agent/${AGENTCODE}");
                Hangup;
  }

// extension 22: agent pause (with pause code)
  22 => {
               Answer;
               NoOp( "QM: Pausing Agent/${AGENTCODE} with pause reason '${PAUSEREASON}' " );
               PauseQueueMember(|Agent/${AGENTCODE});
               System( echo "${EPOCH}|${UNIQUEID}|NONE|Agent/${AGENTCODE}|PAUSEREASON|${PAUSEREASON}" >> /var/log/asterisk/queue_log);
               Hangup;
  }

// extension 23: agent unpause
  23 => {
              Answer;
              NoOp( "QM: Unpausing Agent/${AGENTCODE} " );
              UnpauseQueueMember(|Agent/${AGENTCODE});
              Hangup;
  }
}

Pages: [1] 2