cdr and monitoring - workaround

Discussion in 'General' started by witekprytek, Jan 25, 2011.

  1. witekprytek

    Joined:
    Dec 19, 2007
    Messages:
    145
    Likes Received:
    0
    1. The new monitoring modules does not show recorded files. I have this issue in elastix 1.6.2-27, but some users reported it in elastix 2.0.2 too
    Simply- the new monitoring module need the information about record file name added to cdr record in db.
    This filename is added by new [macro-record-enable] asterisk script stored in extensions_override_freepbx.conf

    exten => s,n,Set(CDR(userfield)=audio:${CALLFILENAME}.${MIXMON_FORMAT})

    probably some scripts don't use this new file (e.g. queue monitoring) and files are stored on the disk without proper description in CDR DB.

    The simplest solution is to reindex files in monitoring folder and add right description for CDR using unique_id from files name.

    It could be done using attached modified scripts (designed by Jelly-Fighter)

    Please try it. if you want, but remember to backup your original files before any modification.
    It should work with 1.6.27 and 2.xx version too.

    1. copy attached file to some folder and untar it:
    mkdir /usr/src/monitor_new

    scp or wget monitoring.tar.gz to new folder
    cd /usr/src/monitor_new
    tar -zxvf monitoring.tar.gz

    now backup your original files
    mv /var/www/html/modules/monitoring/index.php /var/www/html/modules/monitoring/index.php.origin

    mv /var/www/html/modules/monitoring/libs/paloSantoMonitoring.class.php mv /var/www/html/modules/monitoring/libs/paloSantoMonitoring.class.php.origin

    copy new files:
    cp /usr/src/monitor_new/var/www/html/modules/monitoring/index.php cp /var/www/html/modules/monitoring/
    chown asterisk:asterisk /var/www/html/modules/monitoring/index.php

    cp /usr/src/monitor_new/var/www/html/modules/monitoring/libs/* /var/www/html/modules/monitoring/libs/

    (2 files mike.php and paloSantoMonitoring.class.php)
    chown asterisk:asterisk /var/www/html/modules/monitoring/libs/*

    now you should have an "reindex button" on your monitoring screen
    Push the button and go :)
    Reindexing take some time (in may pabx 6000 files where reindexed in about 4 second). Recorded monitor files should be now visible and playable form www interface.
    http://forum.elastix.org/old_files/monitoring.gz http://forum.elastix.org/old_files/monitoring.gz

    added lines:
    index.php
    from line 90:
    /* reindexing DataBase as Workaround - MK */
    case "reindex":
    include(include_once "modules/$module_name/libs/mike.php");
    $content = reportMonitoring($smarty, $module_name, $local_templates_dir, $pDB, $pDBACL, $arrConf, $arrLang);
    break;
    /* end of reindexing */

    line 265:
    /* reindexing DataBase as Workaround - MK */
    $reindex = '





    ';
    /* end of reindexing */
    $content = $reindex.$oGrid->fetchGrid($arrGrid, $arrData,$arrLang);

    line 446:
    /* reindexing DataBase as Workaround - MK */
    else if(getParameter("action")=="reindex")
    return "reindex";
    /* end reindexing */


    changes in paloSantoMonitoring.class.php

    /* reindexing DataBase as Workaround - MK */
    function clearRecordingsFilenames($path){
    $query = "update cdr set userfield='' where userfield like '%audio:%{$path}%'";
    $result = $this->_DB->genQuery($query);
    if($result==FALSE){
    $this->errMsg = $this->_DB->errMsg;
    return null;
    }
    return true;
    }



    mike.php -new file
     
  2. folser

    Joined:
    Jan 11, 2011
    Messages:
    16
    Likes Received:
    0
    change files.
    Now browser in monitoring shows me blank page.
    Wget return next:

    http://pastebin.com/i6vVtEZY

    <html>
    <head>
    <title>Elastix - Login page</title>

    <link rel="stylesheet" href="themes/elastixwave/styles.css">
    </head>

    <body bgcolor="#ffffff" leftmargin="0" topmargin="0" marginwidth="0" marginheight="0">
    <table cellspacing="0" cellpadding="0" width="100%" border="0" class="menulogo2" height="74">
    <tr>
    <td class="menulogo" valign="top">

    <img border="0" src="themes/elastixwave/images/logo_elastix.gif"/>

    </td>
    </tr>
    </table>
    <form method="POST">
    <p>&nbsp;</p>
    <p>&nbsp;</p>
    <table width="400" border="0" cellspacing="0" cellpadding="0" align="center">
    <tr>
    <td width="498" class="menudescription2">
    <table width="100%" border="0" cellspacing="0" cellpadding="4" align="center">
    <tr>
    <td>
    <div align="left"><font color="#ffffff">&nbsp;&raquo;&nbsp;Welcome to Elastix</font></div>
    </td>
    </tr>
    </table>
    </td>
    </tr>
    <tr>
    <td width="498" bgcolor="#ffffff">
    <table width="100%" border="0" cellspacing="0" cellpadding="8" class="tabForm">
    <tr>
    <td colspan="2">
    <div align="center">Please enter your username and password<br><br></div>
    </td>
    </tr>
    <tr>
    <td>
    <div align="right">Username:</div>
    </td>
    <td>
    <input type="text" name="input_user" style="color:#000000; FONT-FAMILY: verdana, arial, helvetica, sans-serif; FONT-SIZE: 8pt;
    font-weight: none; text-decoration: none; background: #fbfeff; border: 1 solid #000000;">
    </td>
    </tr>
    <tr>
    <td>
    <div align="right">Password:</div>
    </td>
    <td>
    <input type="password" name="input_pass" style="color:#000000; FONT-FAMILY: verdana, arial, helvetica, sans-serif; FONT-SIZE: 8pt;
    font-weight: none; text-decoration: none; background: #fbfeff; border: 1 solid #000000;">
    </td>
    </tr>
    <tr>
    <td colspan="2" align="center">
    <input type="submit" name="submit_login" value="Submit" class="button">
    </td>
    </tr>
    <tr>
    <td colspan="2">&nbsp;&nbsp;</td>
    </tr>
    </table>
    </td>
    </tr>
    </table>
    </form>
    <br>
    <div align="center" class="copyright">Elastix is licensed under GPL by PaloSanto Solutions. 2006 - 2011.</div>
    <br>
    </body>
    </html>
     
  3. witekprytek

    Joined:
    Dec 19, 2007
    Messages:
    145
    Likes Received:
    0
    could you please put here your original files (tarred folder /var/www/html/modules/monitor with original files.)
     
  4. folser

    Joined:
    Jan 11, 2011
    Messages:
    16
    Likes Received:
    0
  5. tfan

    Joined:
    Jan 26, 2011
    Messages:
    3
    Likes Received:
    0
    Hi all
    I'm using Elastix 2.0.3, the monitoring seems OK for the admin account ( internal and external calls), but when i create a new account (simple user or admin), and i loggon with it, I can't see the recording external calls (Only the internal calls).

    Is there anyway to create a new account who can access to the monitoring for:
    - All extensions.
    - Internal Callls
    - External Calls.
    - With the search option
    Like the admin account.
     
  6. folser

    Joined:
    Jan 11, 2011
    Messages:
    16
    Likes Received:
    0
    tfan,
    i use extension user group with attached extension number. Users can watch only their own records.

    You can create group with rights as you want. Go to System=>UserManagement=>Groups Create group, then System=>UserManagement=>GroupPermissions choose you group and use checkboxes to select group rights.

    P.S. This is topic with other monitoring error.
     
  7. tfan

    Joined:
    Jan 26, 2011
    Messages:
    3
    Likes Received:
    0
    Thanks folser for your answer,

    I did it, i created a new account with the same permissions of admin, but i can't show all extensions.

    My object is: I want create a new account who can see all CDR Report for all extension and monitoring also.
    Is this possible with Elastix?

    Thanks



    Sorry to post here.
     
  8. witekprytek

    Joined:
    Dec 19, 2007
    Messages:
    145
    Likes Received:
    0
  9. folser

    Joined:
    Jan 11, 2011
    Messages:
    16
    Likes Received:
    0
    it works. I have bution "Reindex Recordings"
    But it doesn't solve my problem. All recordings have external source number =(
     
  10. marcmiranda

    Joined:
    Jan 27, 2011
    Messages:
    5
    Likes Received:
    0
    Hi all,

    I had the same problem with tfan (sorry to post here). Users in user group "administrator" can view recordings (PBX -> Monitoring) but users in other group cannot. I have already tried the above indexing solution but the problem still exists. What I noticed is that on other user groups the Search fields are missing (dropdown [source,destination,type] and textbox), only the Show button is visible.

    This is because I want to make some sort of a leaders group that can monitor the calls (listen and download) but not the same access as administrators.

    Thank you very much!
     
  11. folser

    Joined:
    Jan 11, 2011
    Messages:
    16
    Likes Received:
    0
  12. marcmiranda

    Joined:
    Jan 27, 2011
    Messages:
    5
    Likes Received:
    0
    thanks a lot, and sorry for the off topic post :s
     
  13. dingoland82

    Joined:
    Jan 15, 2008
    Messages:
    37
    Likes Received:
    0
    Thanks a lot, working like a charm B)

    I got the same problem on Elastix 1.6.27 and now it is solved thank to you.

    Regards
    Greg
     
  14. kaisarkz

    Joined:
    Aug 11, 2010
    Messages:
    7
    Likes Received:
    0
    Hi. When I wget monitoring.gz, and tar zxvf it, it shows:

    And no libs folder, no reindex appears. Can you help please?
     
  15. folser

    Joined:
    Jan 11, 2011
    Messages:
    16
    Likes Received:
    0
    /var/www/html/modules/monitoring/libs/mike.php
    /var/www/html/modules/monitoring/libs/paloSantoMonitoring.class.php
    here they are ^)
     
  16. kaisarkz

    Joined:
    Aug 11, 2010
    Messages:
    7
    Likes Received:
    0
    Hi dude. I copied that files. But nothing happens when I press button.
    1) Is there any other way asterisk could insert calls into Db itself?
    2) Will it work if I copy configs of old Elastix version?
     
  17. kaisarkz

    Joined:
    Aug 11, 2010
    Messages:
    7
    Likes Received:
    0
    Hi again.
    I had the same problem after restoring from earlier backup.

    1) I tried "cdr mysql status" in CLI. It showed that I have no mysql addon connected to *;
    2) in /etc/asterisk/ I typed "grep asteriskuser *.conf". And changed passwords to asteriskuser to proper one and deleted leading spaces. Esp. in files:
    cdr_mysql.conf
    res_mysql.conf
    cb_mysql.conf
    then "amportal restart". And it worked. Now I have recorded calls in Monitoring tab.
     
  18. witekprytek

    Joined:
    Dec 19, 2007
    Messages:
    145
    Likes Received:
    0
    What version of elastix do you use?
     
  19. mostafa33

    Joined:
    May 25, 2010
    Messages:
    121
    Likes Received:
    0
    if i logged-in using non admin user, there is no search field
    the function:

    $arrFilter = array(
    "src" => $arrLang["Source"],
    "dst" => $arrLang["Destination"],
    "userfield" => $arrLang["Type"],
    "clid" => $arrLang["Username"],
    );


    is already exist in the index.php file but search is missing

    how can i show it??
     
  20. tsopis

    Joined:
    Sep 2, 2008
    Messages:
    3
    Likes Received:
    0
    Hi
    I have installed latest version of Elastix: 2.3 64bit.
    My old version was 1.6 which had no userfield data at asteriskcdrdb database.
    I restored my old database to new one.
    Your workaround did not help as my version uses different files.
    Could you post the new files workaround?
    I attach you my original files. http://forum.elastix.org/old_files/files.zip
     

Share This Page