Monitoring Module and some tunning up!

randallflagg

Joined
Oct 13, 2010
Messages
16
Likes
0
Points
0
#1
First of all, hello to everyone!
I've been working with Elastix 1.6 a while now, but there are always new requiments from the client, and some development to do, so I'll be sharing some of the stuff I've already done and ask for some help too.

I've been working on monitoring now and I needed more complete reports, and for all kind of agents, so first thing I did was to take off the admin checking for the report. Went well, and now everyuser can see their report (but I can change through admin panel who's gonna see what, like PBX or monitoring).

Then, I had to take off the button of "delete", since I really didn't understand why could you ever want to erase a recorded call.

Then I needed to do many filters, like filter by Source of call, Destination, or agent.
After some work, cool, I had all of that and I like the result of everything. (You can download the whole module of monitoring with more filters) http://forum.elastix.org/old_files/monitoring_for_ELASTIX_1_6.zip



Now, the problem started when we wanted to make predictive calls. Everything got wrong in the reports. I can't seem to have a clear destination call, but only the tail of the predictive calls I've made. I can't see where is "x" agent really calling when they work that way.

Destination call, agent searches and stuff like that got messed up.
So, first thing first. We needed to change the querys to match what we wanted.

The thing till now is to change two functions (as you can see them in the uploaded file)
obtenerCDROutgoing and obtenerCDR_with_uniqueid. All of them look like this now.
Code:
SELECT calldate,clid, src, 
CASE WHEN T.phone IS NULL THEN dst 
ELSE T.phone END 
AS dst, channel, dstchannel, disposition, cdr.uniqueid, cdr.duration,billsec, accountcode 
FROM cdr LEFT OUTER JOIN call_center.calls T ON cdr.uniqueid = T.uniqueid 
WHERE cdr.uniqueid='$unique_id' 
// Uncomment this line for obtenerCDROutgoing(); 
//AND calldate='$calldate'
What we did there is to match our outgoing call of this user with our actual database. We went to the "call_center" database and compare our uniqueid with our uniqueid in our "asteriskcdrdb", so that way we get our destination call for predictive calls.
Nice, the query works very well, but it doesn't work in the site.
Doing some research I got to the problem in here:
Code:
 $arr_result=$db->getFirstRowQuery($query,TRUE);
As I saw, the problme goes way deeper, in the getFirstRowQuery, which returns me FALSE always. But the funny thing is that I checked the Class in /libs/ and got this:

Code:
function getFirstRowQuery($query, $arr_colnames = FALSE, $param = NULL)
    {
        $matriz = $this->fetchTable($query, $arr_colnames, $param);
        if (is_array($matriz)) {
            if (count($matriz) > 0) {
                return $matriz[0];
            } else {
                return array();
            }
        } else {
            return FALSE;
        }
    }
The fetchTable() function as for what I understand just return me false, cause I could get in the function getFirstRowQuery() to the "if (count($matriz) > 0)" part.

What am I doing wrong? I tried everything but I can't seem to make this to work!
 

randallflagg

Joined
Oct 13, 2010
Messages
16
Likes
0
Points
0
#2
:( nobody? any idea?
Hablo castellano tambien :)
 

javapaul

Joined
Jul 1, 2009
Messages
99
Likes
0
Points
0
#3
Thanks for the fixed module, i'm gonna try it out, y necesito refrescar mi php para ver si puedo ayudar en algo
 

mibcadet

Joined
Dec 1, 2010
Messages
19
Likes
0
Points
0
#4
Hello,

I got huge problem with this module tunned. After uploading your files I have white (empty) page if I open elastix-> pbx -> monitoring ! :(

Please help, very important thing for me and my company.

How can I debug this ?
 

randallflagg

Joined
Oct 13, 2010
Messages
16
Likes
0
Points
0
#5
Thats weird midcadet.
Here I uploaded various version of what I did with the module that worked out fine with me. (All of this is for Elastix 1.6)
Ah! Btw, you should uncompress locally the zip (both, the one I uploaded now and the other) because there's a folder inside called "monitoring".
In any case, replace the files from /modules/monitoring/ with whats here, all of it.

Hope it helps! http://forum.elastix.org/old_files/monitoring16_noagent.zip
 

mibcadet

Joined
Dec 1, 2010
Messages
19
Likes
0
Points
0
#6
You mean uncompress locally to uncomress on elastix itself? Cause I uncompressed on PC with windows then copied with WinSCP, same as you shown on screenshot.

[edit]
I did it locally, didn't solve my problem :/ Still empty page, totally white, in web browser source of page also is empty, it looks like not even opened. Any chmod changes needed after uploading that module ?

 

randallflagg

Joined
Oct 13, 2010
Messages
16
Likes
0
Points
0
#7
No, no chmod changes.
If yoy know to go into the code, add this lines at the begginng of your "index.php" file.
Code:
error_reporting(E_ALL);
ini_set('display_errors', '1');
And copy what it says here.

Can you access to the rest of modules? like http://{you elastix url}.com/index.php ?
(I had a problem with elastix, that didn't want to upadate a thing...)

EDIT


BTW, I just added this to the forum.
http://www.elastix.org/en/component/kunena/18-modules/65854-monitoring-20-for-elastix-16.html
Is the monitoring 2.0 module for the elastix 1.6.
 

randallflagg

Joined
Oct 13, 2010
Messages
16
Likes
0
Points
0
#8
wow... I just saw your screenshot.
Have you notice that the folder have different dates than your index.php?
Make sure you're updating all the folders.
 

mibcadet

Joined
Dec 1, 2010
Messages
19
Likes
0
Points
0
#9
( ! ) Notice: Undefined index: search in /var/www/html/modules/monitoring/index.php on line 126
Call Stack
# Time Memory Function Location
1 0.0008 108628 {main}( ) ../index.php:0
2 0.0580 1280328 paloSantoNavigation->showContent( ) ../index.php:163
3 0.0580 1280552 paloSantoNavigation->includeModule( ) ../paloSantoNavigation.class.php:257
4 0.0613 1487252 _moduleContent( ) ../paloSantoNavigation.class.php:292

( ! ) Notice: Undefined index: search2 in /var/www/html/modules/monitoring/index.php on line 127
Call Stack
# Time Memory Function Location
1 0.0008 108628 {main}( ) ../index.php:0
2 0.0580 1280328 paloSantoNavigation->showContent( ) ../index.php:163
3 0.0580 1280552 paloSantoNavigation->includeModule( ) ../paloSantoNavigation.class.php:257
4 0.0613 1487252 _moduleContent( ) ../paloSantoNavigation.class.php:292

( ! ) Fatal error: Smarty error: unable to write to $compile_dir '/var/www/html/var/templates_c'. Be sure $compile_dir is writable by the web server user. in /var/www/html/libs/smarty/libs/Smarty.class.php on line 1095
Call Stack
# Time Memory Function Location
1 0.0008 108628 {main}( ) ../index.php:0
2 0.0580 1280328 paloSantoNavigation->showContent( ) ../index.php:163
3 0.0580 1280552 paloSantoNavigation->includeModule( ) ../paloSantoNavigation.class.php:257
4 0.0613 1487252 _moduleContent( ) ../paloSantoNavigation.class.php:292
5 0.0844 2072772 paloForm->fetchForm( ) ../index.php:158
6 0.0859 2113524 Smarty->fetch( ) ../paloSantoForm.class.php:320
7 0.0861 2155608 Smarty->_compile_resource( ) ../Smarty.class.php:1263
8 0.1017 2807832 smarty_core_write_compiled_resource( ) ../Smarty.class.php:1433
9 0.1018 2808100 Smarty->trigger_error( ) ../core.write_compiled_resource.php:23
10 0.1018 2808412 trigger_error ( ) ../Smarty.class.php:1095


Other modules are working well. Only thing is if I try to use "Load module" (f.e. i tried to load CallCenter module) I haven't see any modules uploaded (however it said its successfully uploaded)
 

mibcadet

Joined
Dec 1, 2010
Messages
19
Likes
0
Points
0
#10
Yes, cause left window shows your creation date of those files, right window shows todays date due to I copied it from left to right window today :) All folders updated.
 

randallflagg

Joined
Oct 13, 2010
Messages
16
Likes
0
Points
0
#11
Mmmm.. Be sure you're replacing this:
index.php
themes/default/filter.tpl

In the theme we add the new input filters.
 

mibcadet

Joined
Dec 1, 2010
Messages
19
Likes
0
Points
0
#12
Yes, 100% of sure. ;/
 

randallflagg

Joined
Oct 13, 2010
Messages
16
Likes
0
Points
0
#13
which version of elasix are you running?
 

mibcadet

Joined
Dec 1, 2010
Messages
19
Likes
0
Points
0
#14
1.6.2-7
 

randallflagg

Joined
Oct 13, 2010
Messages
16
Likes
0
Points
0
#15
mmm... I don't know what's happening then. I'm on Elastix 1.6.2-1 and I don't think there should be major changes... :/

What the error is saying there is that Elastix find the definition of the "search" field, but is nowhere to be found.
Something is mess up there, but I don't know what.
 

mibcadet

Joined
Dec 1, 2010
Messages
19
Likes
0
Points
0
#16
FOUND SOLLUTION :D !

had to do chmod 0777 /var/www/html/var/templates_c/

Its working !

Thanks for helping dude, at all you didn't solve the problem but I seen you have been trying really hard so it was nice to post with you !

Thanks for upgraded module :) I'm waiting for more upgrade.

Best regards
Paul Smolka
 

randallflagg

Joined
Oct 13, 2010
Messages
16
Likes
0
Points
0
#17
nice!
I never had to do that change!
 

bmacias

Joined
Sep 27, 2007
Messages
205
Likes
0
Points
0
#18
Hola,

Gracias por meter mano en el codigo elastix :). Me parece muy buena iniciativa. Ultimamente he estado cambiando ese módulo y me gustaría que lo chequees como esta ahora en los ultimos updates de los rpms de elastix-pbx (para 2.0) y (elastix para 1.6), seria bueno ver si tus ideas las aceptamos al core de código elastix.

Saludos.

Bruno Macias
Coordinador, Desarrollo Elastix.
 

randallflagg

Joined
Oct 13, 2010
Messages
16
Likes
0
Points
0
#19
Bueno, primero me parece tonto que alguien jamas tenga que borrar un llamada, ya que esto documentacion sea como sea.. almenos, asi lo veo yo.

Sería bueno los filtros para el modulo del 1.6 sean más faciles de implementar y modificar, ya que es bastante caotico el codigo (en comparacion con el 2.0).

Lo que si no pude lograr es estirar el numero de destino cuando se usa el precdictivo. O sea, la query esa me anda de lujo al pasarla a la base de datos, pero alguna funcion me anda mal por el camino.
De todas maneras, me gustaria meterle mas pata al 2.0 para el 1.6, ya que esta mejor programado y es mas facil trabajarlo.

Tambien creo que el modulo debe estar habilitado para todos, sin restriccion solamente para el admin. ¿porque? por que talvez sea el supervisor, que no tiene permisos de admin, necesite escuchar que dijo un agente y como estos modulos los podes deshabilitar por permiso de grupo, creo que con eso ya se soluciona quien ve que cosa, sin pasarlo por un filtro de admin.
 

adorah

Joined
Sep 30, 2009
Messages
36
Likes
0
Points
6
#20
Thx a lot randallflagg. Your post just saved me from traveling 200KM each direction to reinstall Elastix since I needed that monitoring and it stopped working after update.

BUT:

When I try to listen to a recording I get a popup window with the message:
Not Found

The requested URL /libs/popup.php was not found on this server.

When I try to download I get the message:
Not Found

The requested URL /libs/audio.php was not found on this server.

unlike the former folder there is no libs subfolder in your file.

Please kindly help :(
 

Members online

No members online now.

Latest posts

Forum statistics

Threads
30,902
Messages
130,887
Members
17,565
Latest member
omarmenichetti
Top