Index: /freepbx/tags/2.10.1/amp_conf/htdocs/admin/modules/cdr/cdr_audio.php =================================================================== --- /freepbx/tags/2.10.1/amp_conf/htdocs/admin/modules/cdr/cdr_audio.php (revision 13091) +++ /freepbx/tags/2.10.1/amp_conf/htdocs/admin/modules/cdr/cdr_audio.php (revision 13091) @@ -0,0 +1,65 @@ +decrypt($opath,$REC_CRYPT_PASSWORD); + + // Gather relevent info about file + $size = filesize($path); + $name = basename($path); + $extension = strtolower(substr(strrchr($name,"."),1)); + // This will set the Content-Type to the appropriate setting for the file + $ctype =''; + switch( $extension ) { + case "WAV": + $ctype="audio/x-wav"; + break; + case "wav": + $ctype="audio/x-wav"; + break; + case "ulaw": + $ctype="audio/basic"; + break; + case "alaw": + $ctype="audio/x-alaw-basic"; + break; + case "sln": + $ctype="audio/x-wav"; + break; + case "gsm": + $ctype="audio/x-gsm"; + break; + case "g729": + $ctype="audio/x-g729"; + break; + // not downloadable + default: +// echo ("404 File not found! foo"); +// TODO: what to do if none of the above work? + break ; + } + + $fp=fopen($path, "rb"); + if ($size && $ctype && $fp) { + header("Pragma: public"); + header("Expires: 0"); + header("Cache-Control: must-revalidate, post-check=0, pre-check=0"); + header("Cache-Control: public"); + header("Content-Description: wav file"); + header("Content-Type: " . $ctype); + header("Content-Disposition: attachment; filename=" . $name); + header("Content-Transfer-Encoding: binary"); + header("Content-length: " . $size); + fpassthru($fp); + } +} + +?> Index: /freepbx/tags/2.10.1/amp_conf/htdocs/admin/modules/cdr/i18n/sv_SE/LC_MESSAGES/cdr.po =================================================================== --- /freepbx/tags/2.10.1/amp_conf/htdocs/admin/modules/cdr/i18n/sv_SE/LC_MESSAGES/cdr.po (revision 12696) +++ /freepbx/tags/2.10.1/amp_conf/htdocs/admin/modules/cdr/i18n/sv_SE/LC_MESSAGES/cdr.po (revision 12696) @@ -0,0 +1,433 @@ +# This file is part of FreePBX. +# +# FreePBX is free software: you can redistribute it and/or modify +# it under the terms of the GNU General Public License as published by +# the Free Software Foundation, either version 2 of the License, or +# (at your option) any later version. +# +# FreePBX is distributed in the hope that it will be useful, +# but WITHOUT ANY WARRANTY; without even the implied warranty of +# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +# GNU General Public License for more details. +# +# You should have received a copy of the GNU General Public License +# along with FreePBX. If not, see . +# +# FreePBX language template for cdr +# Copyright (C) 2011 Mikael Carlsson +# +msgid "" +msgstr "" +"Project-Id-Version: cdr\n" +"Report-Msgid-Bugs-To: \n" +"POT-Creation-Date: 2011-09-23 09:52+0000\n" +"PO-Revision-Date: 2011-07-29 20:45+0200\n" +"Last-Translator: Mikael Carlsson \n" +"Language-Team: LANGUAGE \n" +"MIME-Version: 1.0\n" +"Content-Type: text/plain; charset=UTF-8\n" +"Content-Transfer-Encoding: 8bit\n" + +msgid "CDR Reports" +msgstr "" + +msgid "Reports" +msgstr "" + +msgid "Call Data Record report tools for viewing reports of your calls" +msgstr "Rapportverktyg för samtalsregister" + +msgid "UniqueID" +msgstr "Unikt ID" + +msgid "Channel" +msgstr "Kanal" + +msgid "CallerID" +msgstr "Nummerpres." + +msgid "DID" +msgstr "" + +msgid "Application" +msgstr "Applikation" + +msgid "Destination Context" +msgstr "Destinationssammanhang" + +msgid "AMA Flag" +msgstr "AMA-flagga" + +msgid "Billing Duration" +msgstr "Debiterbar lÀngd" + +msgid "Checking if field did is present in cdr table.." +msgstr "" + +msgid "Adding did field to cdr" +msgstr "" + +msgid "This might take a while......" +msgstr "" + +msgid "Added field did to cdr" +msgstr "" + +msgid "did field already present." +msgstr "" + +msgid "Call Detail Record Search" +msgstr "Sök samtalsregister" + +msgid "Order By" +msgstr "Sortera enligt" + +msgid "Search conditions" +msgstr "Sökvillkor" + +msgid "" +"Select time span for your report. You can select Date, Month, Year, Hour and " +"Minute to narrow your search" +msgstr "" +"VÀlj period för din rapport. Du kan vÀlja datum, månad, timme och minut för " +"att begrÀnsa din sökning." + +msgid "Call Date" +msgstr "Datum" + +msgid "From" +msgstr "Från" + +msgid "January" +msgstr "Januari" + +msgid "February" +msgstr "Februari" + +msgid "March" +msgstr "Mars" + +msgid "April" +msgstr "April" + +msgid "May" +msgstr "Maj" + +msgid "June" +msgstr "Juni" + +msgid "July" +msgstr "Juli" + +msgid "August" +msgstr "Augusti" + +msgid "September" +msgstr "September" + +msgid "October" +msgstr "Oktober" + +msgid "November" +msgstr "November" + +msgid "December" +msgstr "December" + +msgid "To" +msgstr "Till" + +msgid "Extra options" +msgstr "Extraval" + +msgid "Report type" +msgstr "Rapporttyp" + +msgid "CDR search" +msgstr "Sök CDR" + +msgid "CSV file" +msgstr "CSV-fil" + +msgid "Call Graph" +msgstr "Samtalsgraf" + +msgid "Concurrent Calls" +msgstr "Samtidiga samtal" + +msgid "Result limit" +msgstr "BegrÀnsa resultat" + +msgid "" +"Select Source Channel to search for. You can enter just the channel type " +"like SIP, IAX2 or Local. You can also include the destination for the " +"channel, like SIP/1234." +msgstr "" +"Mata in sökvillkor för kÀllkanal. Du kan skriva endast kanaltypen såsom SIP, " +"IAX2 eller Local. Du kan Àven begrÀnsa sökningen genom att ange " +"destinationen såsom SIP/1234" + +msgid "Src Channel" +msgstr "KÀllkanal" + +msgid "Not" +msgstr "Ej" + +msgid "Begins With" +msgstr "Börjar med" + +msgid "Contains" +msgstr "Innehåller" + +msgid "Ends With" +msgstr "Slutar med" + +msgid "Exactly" +msgstr "Exakt" + +msgid "" +"Search for source calls. You can enter multiple sources separated by a " +"comma. This field support Asterisk regular expression. Example
" +msgstr "" +"Sök efter kÀllsamtal. Du kan skriva in flera kÀllor separerade med komma. " +"Detta fÀlt stöder Asterisk reguljÀra uttryck. Exempel
" + +msgid "_2XXN, _562., _.0075 = search for any match of these numbers
" +msgstr "" +"_2XXN, _562., _.0075 = sök efter någon match för dessa nummer
" + +msgid "" +"_!2XXN, _562., _.0075 = Search for any match except for these " +"numbers" +msgstr "" +"_!2XXN, _562., _.0075 = Sök efter någon match förutom dessa " +"nummer" + +msgid "
Asterisk pattern matching
" +msgstr "
Asterisk mönstermatchning
" + +msgid "X = matches any digit from 0-9
" +msgstr "X = matchar alla siffror från 0-9
" + +msgid "Z = matches any digit from 1-9
" +msgstr "Z = matchar alla siffror från 1-9
" + +msgid "N = matches any digit from 2-9
" +msgstr "N = matchar alla siffror från 2-9
" + +msgid "" +"[1237-9] = matches any digit or letter in the brackets
(in this " +"example, 1,2,3,7,8,9)
" +msgstr "" +"[1237-9] = matchar alla siffror och bokstÀver inom hakperanteserna
" +"(i detta exempel, 1,2,3,7,8,9)
" + +msgid ". = wildcard, matches one or more characters
" +msgstr ". = jokertecken, matchar en eller flera tecken
" + +msgid "Source" +msgstr "KÀlla" + +msgid "" +"Search for CallerID. If your CallerID begins with \" then you must supply " +"this in your search if you select Begins With." +msgstr "" +"Sök efter nummerpresentation. Om din nummerpresentation börjar med ett \"-" +"tecken måste du ange detta om du vÀljer Börjar med." + +msgid "Search for a DID." +msgstr "" + +msgid "" +"Select Destination Channel to search for. It can be just the channel type " +"like SIP, IAX2 or Local. It can include the destination for the channel, " +"like SIP/1234." +msgstr "" +"VÀlj destinationskanal at söka efter. Det kan vara endast kanaltypen såsom " +"IP, IAX2 eller Local. Du kan Àven ange destinationen för kanalen såsom " +"SIP/1234" + +msgid "Dst Channel" +msgstr "Dest. kanal" + +msgid "" +"Search for destination calls. You can enter multiple sources separated by a " +"comma. This field support Asterisk regular expression. Example
" +msgstr "" +"Sök efter destinationssamtal. Du kan ange flera kÀllor separerade med ett " +"komma. Detta fÀlt stöder Asterisk reguljÀra uttryck." + +msgid "Destination" +msgstr "Destination" + +msgid "Search for userfield data (if enabled)." +msgstr "Sök efter data i anvÀndarfÀltet (om detta Àr aktiverat)" + +msgid "Userfield" +msgstr "AnvÀndarfÀlt" + +msgid "Search for accountcode." +msgstr "Sök efter kontokod" + +msgid "Account Code" +msgstr "Kontokod" + +msgid "Search for calls that matches the call length specified." +msgstr "Sök efter samtal som matchar den angivna samtalsintervallen" + +msgid "Duration" +msgstr "LÀngd" + +msgid "Between" +msgstr "Mellan" + +msgid "And" +msgstr "och" + +msgid "Seconds" +msgstr "sekunder" + +msgid "" +"Search for calls that matches either ANSWERED, BUSY, FAILED or NO ANSWER." +msgstr "Sök efter samtal som matchar ANSWERED, BUSY, FAILED eller NO ANSWER." + +msgid "Disposition" +msgstr "Disposition" + +msgid "All Dispositions" +msgstr "Alla dispositioner" + +msgid "Answered" +msgstr "Besvarade" + +msgid "Busy" +msgstr "Upptaget" + +msgid "Failed" +msgstr "Misslyckade" + +msgid "No Answer" +msgstr "Inget svar" + +msgid "Oldest First" +msgstr "" + +msgid "Newest First" +msgstr "" + +msgid "Group By" +msgstr "Gruppera enligt" + +msgid "Account Information" +msgstr "Kontoinformation" + +msgid "User Field" +msgstr "AnvÀndarfÀlt" + +msgid "Date/Time" +msgstr "Datum/tid" + +msgid "Minute" +msgstr "Minut" + +msgid "10 Minutes" +msgstr "10 minuter" + +msgid "Hour" +msgstr "Timme" + +msgid "Hour of day" +msgstr "Per timme" + +msgid "Day of week" +msgstr "Veckodag" + +msgid "Day" +msgstr "Dag" + +msgid "Week ( Sun-Sat )" +msgstr "Vecka (sön-lör)" + +msgid "Month" +msgstr "MÃ¥nad" + +msgid "Telephone Number" +msgstr "Telefonnummer" + +msgid "Source Number" +msgstr "KÀllnummer" + +msgid "Destination Number" +msgstr "Destinationsnummer" + +msgid "Tech info" +msgstr "" + +msgid "Search" +msgstr "Sök" + +msgid "Call Detail Record - Search Returned" +msgstr "Samtalsrapport - sökningen returnerade" + +msgid "Calls" +msgstr "samtal" + +msgid "File" +msgstr "Fil" + +msgid "System" +msgstr "System" + +msgid "Src Chan." +msgstr "" + +msgid "App." +msgstr "" + +msgid "Dest." +msgstr "" + +msgid "Dst. Chan." +msgstr "" + +msgid "Account" +msgstr "Konto" + +msgid "Call Detail Record - Call Graph by" +msgstr "Samtalsrapport - graf - sorterad pÃ¥" + +msgid "Total Calls" +msgstr "Antal samtal" + +msgid "Max Calls" +msgstr "Max samtal" + +msgid "Total Duration" +msgstr "Total lÀngd" + +msgid "Average Call Time" +msgstr "Genomsnittlig tid" + +msgid "Go to the top of the CDR table" +msgstr "GÃ¥ till toppen av tabellen" + +msgid "Go to the CDR Graph" +msgstr "GÃ¥ till grafen" + +msgid "Call Detail Record - Concurrent Calls by" +msgstr "Samtalsrapport - samtidiga samtal sorterad pÃ¥" + +msgid "Time" +msgstr "Tid" + +#~ msgid "CDR Viewer" +#~ msgstr "Rapporter" + +#~ msgid "System Administration" +#~ msgstr "Systemadministration" + +#~ msgid "Ascending" +#~ msgstr "Ökande" + +#~ msgid "Descending" +#~ msgstr "Minskande" Index: /freepbx/tags/2.10.1/amp_conf/htdocs/admin/modules/cdr/i18n/he_IL/LC_MESSAGES/cdr.po =================================================================== --- /freepbx/tags/2.10.1/amp_conf/htdocs/admin/modules/cdr/i18n/he_IL/LC_MESSAGES/cdr.po (revision 12696) +++ /freepbx/tags/2.10.1/amp_conf/htdocs/admin/modules/cdr/i18n/he_IL/LC_MESSAGES/cdr.po (revision 12696) @@ -0,0 +1,402 @@ +# This file is part of FreePBX. +# +# FreePBX is free software: you can redistribute it and/or modify +# it under the terms of the GNU General Public License as published by +# the Free Software Foundation, either version 2 of the License, or +# (at your option) any later version. +# +# FreePBX is distributed in the hope that it will be useful, +# but WITHOUT ANY WARRANTY; without even the implied warranty of +# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +# GNU General Public License for more details. +# +# You should have received a copy of the GNU General Public License +# along with FreePBX. If not, see . +# +# FreePBX language template for cdr +# Copyright (C) 2008, 2009, 2010 Bandwith.com +# +msgid "" +msgstr "" +"Project-Id-Version: PACKAGE VERSION\n" +"Report-Msgid-Bugs-To: \n" +"POT-Creation-Date: 2011-09-23 09:52+0000\n" +"PO-Revision-Date: YEAR-MO-DA HO:MI+ZONE\n" +"Last-Translator: FULL NAME \n" +"Language-Team: LANGUAGE \n" +"MIME-Version: 1.0\n" +"Content-Type: text/plain; charset=utf-8\n" +"Content-Transfer-Encoding: 8bit\n" + +msgid "CDR Reports" +msgstr "" + +msgid "Reports" +msgstr "" + +msgid "Call Data Record report tools for viewing reports of your calls" +msgstr "" + +msgid "UniqueID" +msgstr "" + +msgid "Channel" +msgstr "" + +msgid "CallerID" +msgstr "" + +msgid "DID" +msgstr "" + +msgid "Application" +msgstr "" + +msgid "Destination Context" +msgstr "" + +msgid "AMA Flag" +msgstr "" + +msgid "Billing Duration" +msgstr "" + +msgid "Checking if field did is present in cdr table.." +msgstr "" + +msgid "Adding did field to cdr" +msgstr "" + +msgid "This might take a while......" +msgstr "" + +msgid "Added field did to cdr" +msgstr "" + +msgid "did field already present." +msgstr "" + +msgid "Call Detail Record Search" +msgstr "" + +msgid "Order By" +msgstr "" + +msgid "Search conditions" +msgstr "" + +msgid "" +"Select time span for your report. You can select Date, Month, Year, Hour and " +"Minute to narrow your search" +msgstr "" + +msgid "Call Date" +msgstr "" + +msgid "From" +msgstr "" + +msgid "January" +msgstr "" + +msgid "February" +msgstr "" + +msgid "March" +msgstr "" + +msgid "April" +msgstr "" + +msgid "May" +msgstr "" + +msgid "June" +msgstr "" + +msgid "July" +msgstr "" + +msgid "August" +msgstr "" + +msgid "September" +msgstr "" + +msgid "October" +msgstr "" + +msgid "November" +msgstr "" + +msgid "December" +msgstr "" + +msgid "To" +msgstr "" + +msgid "Extra options" +msgstr "" + +msgid "Report type" +msgstr "" + +msgid "CDR search" +msgstr "" + +msgid "CSV file" +msgstr "" + +msgid "Call Graph" +msgstr "" + +msgid "Concurrent Calls" +msgstr "" + +msgid "Result limit" +msgstr "" + +msgid "" +"Select Source Channel to search for. You can enter just the channel type " +"like SIP, IAX2 or Local. You can also include the destination for the " +"channel, like SIP/1234." +msgstr "" + +msgid "Src Channel" +msgstr "" + +msgid "Not" +msgstr "" + +msgid "Begins With" +msgstr "" + +msgid "Contains" +msgstr "" + +msgid "Ends With" +msgstr "" + +msgid "Exactly" +msgstr "" + +msgid "" +"Search for source calls. You can enter multiple sources separated by a " +"comma. This field support Asterisk regular expression. Example
" +msgstr "" + +msgid "_2XXN, _562., _.0075 = search for any match of these numbers
" +msgstr "" + +msgid "" +"_!2XXN, _562., _.0075 = Search for any match except for these " +"numbers" +msgstr "" + +msgid "
Asterisk pattern matching
" +msgstr "" + +msgid "X = matches any digit from 0-9
" +msgstr "" + +msgid "Z = matches any digit from 1-9
" +msgstr "" + +msgid "N = matches any digit from 2-9
" +msgstr "" + +msgid "" +"[1237-9] = matches any digit or letter in the brackets
(in this " +"example, 1,2,3,7,8,9)
" +msgstr "" + +msgid ". = wildcard, matches one or more characters
" +msgstr "" + +msgid "Source" +msgstr "" + +msgid "" +"Search for CallerID. If your CallerID begins with \" then you must supply " +"this in your search if you select Begins With." +msgstr "" + +msgid "Search for a DID." +msgstr "" + +msgid "" +"Select Destination Channel to search for. It can be just the channel type " +"like SIP, IAX2 or Local. It can include the destination for the channel, " +"like SIP/1234." +msgstr "" + +msgid "Dst Channel" +msgstr "" + +msgid "" +"Search for destination calls. You can enter multiple sources separated by a " +"comma. This field support Asterisk regular expression. Example
" +msgstr "" + +msgid "Destination" +msgstr "" + +msgid "Search for userfield data (if enabled)." +msgstr "" + +msgid "Userfield" +msgstr "" + +msgid "Search for accountcode." +msgstr "" + +msgid "Account Code" +msgstr "" + +msgid "Search for calls that matches the call length specified." +msgstr "" + +msgid "Duration" +msgstr "" + +msgid "Between" +msgstr "" + +msgid "And" +msgstr "" + +msgid "Seconds" +msgstr "" + +msgid "" +"Search for calls that matches either ANSWERED, BUSY, FAILED or NO ANSWER." +msgstr "" + +msgid "Disposition" +msgstr "" + +msgid "All Dispositions" +msgstr "" + +msgid "Answered" +msgstr "" + +msgid "Busy" +msgstr "" + +msgid "Failed" +msgstr "" + +msgid "No Answer" +msgstr "" + +msgid "Oldest First" +msgstr "" + +msgid "Newest First" +msgstr "" + +msgid "Group By" +msgstr "" + +msgid "Account Information" +msgstr "" + +msgid "User Field" +msgstr "" + +msgid "Date/Time" +msgstr "" + +msgid "Minute" +msgstr "" + +msgid "10 Minutes" +msgstr "" + +msgid "Hour" +msgstr "" + +msgid "Hour of day" +msgstr "" + +msgid "Day of week" +msgstr "" + +msgid "Day" +msgstr "" + +msgid "Week ( Sun-Sat )" +msgstr "" + +msgid "Month" +msgstr "" + +msgid "Telephone Number" +msgstr "" + +msgid "Source Number" +msgstr "" + +msgid "Destination Number" +msgstr "" + +msgid "Tech info" +msgstr "" + +msgid "Search" +msgstr "" + +msgid "Call Detail Record - Search Returned" +msgstr "" + +msgid "Calls" +msgstr "" + +msgid "File" +msgstr "" + +msgid "System" +msgstr "" + +msgid "Src Chan." +msgstr "" + +msgid "App." +msgstr "" + +msgid "Dest." +msgstr "" + +msgid "Dst. Chan." +msgstr "" + +msgid "Account" +msgstr "" + +msgid "Call Detail Record - Call Graph by" +msgstr "" + +msgid "Total Calls" +msgstr "" + +msgid "Max Calls" +msgstr "" + +msgid "Total Duration" +msgstr "" + +msgid "Average Call Time" +msgstr "" + +msgid "Go to the top of the CDR table" +msgstr "" + +msgid "Go to the CDR Graph" +msgstr "" + +msgid "Call Detail Record - Concurrent Calls by" +msgstr "" + +msgid "Time" +msgstr "" Index: /freepbx/tags/2.10.1/amp_conf/htdocs/admin/modules/cdr/i18n/cdr.pot =================================================================== --- /freepbx/tags/2.10.1/amp_conf/htdocs/admin/modules/cdr/i18n/cdr.pot (revision 12696) +++ /freepbx/tags/2.10.1/amp_conf/htdocs/admin/modules/cdr/i18n/cdr.pot (revision 12696) @@ -0,0 +1,402 @@ +# This file is part of FreePBX. +# +# FreePBX is free software: you can redistribute it and/or modify +# it under the terms of the GNU General Public License as published by +# the Free Software Foundation, either version 2 of the License, or +# (at your option) any later version. +# +# FreePBX is distributed in the hope that it will be useful, +# but WITHOUT ANY WARRANTY; without even the implied warranty of +# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +# GNU General Public License for more details. +# +# You should have received a copy of the GNU General Public License +# along with FreePBX. If not, see . +# +# FreePBX language template for cdr +# Copyright (C) 2008, 2009, 2010 Bandwith.com +# +msgid "" +msgstr "" +"Project-Id-Version: PACKAGE VERSION\n" +"Report-Msgid-Bugs-To: \n" +"POT-Creation-Date: 2011-09-23 09:52+0000\n" +"PO-Revision-Date: YEAR-MO-DA HO:MI+ZONE\n" +"Last-Translator: FULL NAME \n" +"Language-Team: LANGUAGE \n" +"MIME-Version: 1.0\n" +"Content-Type: text/plain; charset=utf-8\n" +"Content-Transfer-Encoding: 8bit\n" + +msgid "CDR Reports" +msgstr "" + +msgid "Reports" +msgstr "" + +msgid "Call Data Record report tools for viewing reports of your calls" +msgstr "" + +msgid "UniqueID" +msgstr "" + +msgid "Channel" +msgstr "" + +msgid "CallerID" +msgstr "" + +msgid "DID" +msgstr "" + +msgid "Application" +msgstr "" + +msgid "Destination Context" +msgstr "" + +msgid "AMA Flag" +msgstr "" + +msgid "Billing Duration" +msgstr "" + +msgid "Checking if field did is present in cdr table.." +msgstr "" + +msgid "Adding did field to cdr" +msgstr "" + +msgid "This might take a while......" +msgstr "" + +msgid "Added field did to cdr" +msgstr "" + +msgid "did field already present." +msgstr "" + +msgid "Call Detail Record Search" +msgstr "" + +msgid "Order By" +msgstr "" + +msgid "Search conditions" +msgstr "" + +msgid "" +"Select time span for your report. You can select Date, Month, Year, Hour and " +"Minute to narrow your search" +msgstr "" + +msgid "Call Date" +msgstr "" + +msgid "From" +msgstr "" + +msgid "January" +msgstr "" + +msgid "February" +msgstr "" + +msgid "March" +msgstr "" + +msgid "April" +msgstr "" + +msgid "May" +msgstr "" + +msgid "June" +msgstr "" + +msgid "July" +msgstr "" + +msgid "August" +msgstr "" + +msgid "September" +msgstr "" + +msgid "October" +msgstr "" + +msgid "November" +msgstr "" + +msgid "December" +msgstr "" + +msgid "To" +msgstr "" + +msgid "Extra options" +msgstr "" + +msgid "Report type" +msgstr "" + +msgid "CDR search" +msgstr "" + +msgid "CSV file" +msgstr "" + +msgid "Call Graph" +msgstr "" + +msgid "Concurrent Calls" +msgstr "" + +msgid "Result limit" +msgstr "" + +msgid "" +"Select Source Channel to search for. You can enter just the channel type " +"like SIP, IAX2 or Local. You can also include the destination for the " +"channel, like SIP/1234." +msgstr "" + +msgid "Src Channel" +msgstr "" + +msgid "Not" +msgstr "" + +msgid "Begins With" +msgstr "" + +msgid "Contains" +msgstr "" + +msgid "Ends With" +msgstr "" + +msgid "Exactly" +msgstr "" + +msgid "" +"Search for source calls. You can enter multiple sources separated by a " +"comma. This field support Asterisk regular expression. Example
" +msgstr "" + +msgid "_2XXN, _562., _.0075 = search for any match of these numbers
" +msgstr "" + +msgid "" +"_!2XXN, _562., _.0075 = Search for any match except for these " +"numbers" +msgstr "" + +msgid "
Asterisk pattern matching
" +msgstr "" + +msgid "X = matches any digit from 0-9
" +msgstr "" + +msgid "Z = matches any digit from 1-9
" +msgstr "" + +msgid "N = matches any digit from 2-9
" +msgstr "" + +msgid "" +"[1237-9] = matches any digit or letter in the brackets
(in this " +"example, 1,2,3,7,8,9)
" +msgstr "" + +msgid ". = wildcard, matches one or more characters
" +msgstr "" + +msgid "Source" +msgstr "" + +msgid "" +"Search for CallerID. If your CallerID begins with \" then you must supply " +"this in your search if you select Begins With." +msgstr "" + +msgid "Search for a DID." +msgstr "" + +msgid "" +"Select Destination Channel to search for. It can be just the channel type " +"like SIP, IAX2 or Local. It can include the destination for the channel, " +"like SIP/1234." +msgstr "" + +msgid "Dst Channel" +msgstr "" + +msgid "" +"Search for destination calls. You can enter multiple sources separated by a " +"comma. This field support Asterisk regular expression. Example
" +msgstr "" + +msgid "Destination" +msgstr "" + +msgid "Search for userfield data (if enabled)." +msgstr "" + +msgid "Userfield" +msgstr "" + +msgid "Search for accountcode." +msgstr "" + +msgid "Account Code" +msgstr "" + +msgid "Search for calls that matches the call length specified." +msgstr "" + +msgid "Duration" +msgstr "" + +msgid "Between" +msgstr "" + +msgid "And" +msgstr "" + +msgid "Seconds" +msgstr "" + +msgid "" +"Search for calls that matches either ANSWERED, BUSY, FAILED or NO ANSWER." +msgstr "" + +msgid "Disposition" +msgstr "" + +msgid "All Dispositions" +msgstr "" + +msgid "Answered" +msgstr "" + +msgid "Busy" +msgstr "" + +msgid "Failed" +msgstr "" + +msgid "No Answer" +msgstr "" + +msgid "Oldest First" +msgstr "" + +msgid "Newest First" +msgstr "" + +msgid "Group By" +msgstr "" + +msgid "Account Information" +msgstr "" + +msgid "User Field" +msgstr "" + +msgid "Date/Time" +msgstr "" + +msgid "Minute" +msgstr "" + +msgid "10 Minutes" +msgstr "" + +msgid "Hour" +msgstr "" + +msgid "Hour of day" +msgstr "" + +msgid "Day of week" +msgstr "" + +msgid "Day" +msgstr "" + +msgid "Week ( Sun-Sat )" +msgstr "" + +msgid "Month" +msgstr "" + +msgid "Telephone Number" +msgstr "" + +msgid "Source Number" +msgstr "" + +msgid "Destination Number" +msgstr "" + +msgid "Tech info" +msgstr "" + +msgid "Search" +msgstr "" + +msgid "Call Detail Record - Search Returned" +msgstr "" + +msgid "Calls" +msgstr "" + +msgid "File" +msgstr "" + +msgid "System" +msgstr "" + +msgid "Src Chan." +msgstr "" + +msgid "App." +msgstr "" + +msgid "Dest." +msgstr "" + +msgid "Dst. Chan." +msgstr "" + +msgid "Account" +msgstr "" + +msgid "Call Detail Record - Call Graph by" +msgstr "" + +msgid "Total Calls" +msgstr "" + +msgid "Max Calls" +msgstr "" + +msgid "Total Duration" +msgstr "" + +msgid "Average Call Time" +msgstr "" + +msgid "Go to the top of the CDR table" +msgstr "" + +msgid "Go to the CDR Graph" +msgstr "" + +msgid "Call Detail Record - Concurrent Calls by" +msgstr "" + +msgid "Time" +msgstr "" Index: /freepbx/tags/2.10.1/amp_conf/htdocs/admin/modules/cdr/i18n/ru_RU/LC_MESSAGES/cdr.po =================================================================== --- /freepbx/tags/2.10.1/amp_conf/htdocs/admin/modules/cdr/i18n/ru_RU/LC_MESSAGES/cdr.po (revision 12696) +++ /freepbx/tags/2.10.1/amp_conf/htdocs/admin/modules/cdr/i18n/ru_RU/LC_MESSAGES/cdr.po (revision 12696) @@ -0,0 +1,446 @@ +# This file is part of FreePBX. +# +# FreePBX is free software: you can redistribute it and/or modify +# it under the terms of the GNU General Public License as published by +# the Free Software Foundation, either version 2 of the License, or +# (at your option) any later version. +# +# FreePBX is distributed in the hope that it will be useful, +# but WITHOUT ANY WARRANTY; without even the implied warranty of +# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +# GNU General Public License for more details. +# +# You should have received a copy of the GNU General Public License +# along with FreePBX. If not, see . +# +# FreePBX language template for cdr +# Copyright (C) 2011 Igor Okunev +# +msgid "" +msgstr "" +"Project-Id-Version: cdr\n" +"Report-Msgid-Bugs-To: \n" +"POT-Creation-Date: 2011-09-23 09:52+0000\n" +"PO-Revision-Date: 2011-07-29 20:45+0200\n" +"Last-Translator: Igor Okunev \n" +"Language-Team: LANGUAGE \n" +"MIME-Version: 1.0\n" +"Content-Type: text/plain; charset=UTF-8\n" +"Content-Transfer-Encoding: 8bit\n" + +msgid "CDR Reports" +msgstr "" + +msgid "Reports" +msgstr "" + +msgid "Call Data Record report tools for viewing reports of your calls" +msgstr "ПрПсЌПтр запОсей П ÑÐŸÐ²ÐµÑ€ÑˆÐµÐœÐœÑ‹Ñ + Ð·Ð²ÐŸÐœÐºÐ°Ñ +" + +msgid "UniqueID" +msgstr "ИЎеМтОфОкатПр" + +msgid "Channel" +msgstr "КаМал" + +msgid "CallerID" +msgstr "ИЌя звПМящегП" + +msgid "DID" +msgstr "" + +msgid "Application" +msgstr "ПрОлПжеМОе" + +msgid "Destination Context" +msgstr "КПМтекст" + +msgid "AMA Flag" +msgstr "AMA-флаг" + +msgid "Billing Duration" +msgstr "ВреЌя разгПвПра" + +msgid "Checking if field did is present in cdr table.." +msgstr "" + +msgid "Adding did field to cdr" +msgstr "" + +msgid "This might take a while......" +msgstr "" + +msgid "Added field did to cdr" +msgstr "" + +msgid "did field already present." +msgstr "" + +msgid "Call Detail Record Search" +msgstr "Отчет пП звПМкаЌ" + +msgid "Order By" +msgstr "СПртОрПвать пП" + +msgid "Search conditions" +msgstr "УслПвОя пПОска" + +msgid "" +"Select time span for your report. You can select Date, Month, Year, Hour and " +"Minute to narrow your search" +msgstr "" +"ВыберОте ОМтервал вреЌеМО за кПтПрый Вы Ñ +ПтОте пПлучОть Птчет. Вы ЌПжОте " +"указать: ДеМь, Месяц, ГПЎ, Час О МОМуту Ўля бПлее тПчМПгП пПОска " + +msgid "Call Date" +msgstr "Дата звПМка" + +msgid "From" +msgstr "МежЎу" + +msgid "January" +msgstr "ЯМварь" + +msgid "February" +msgstr "Ѐевраль" + +msgid "March" +msgstr "Март" + +msgid "April" +msgstr "Апрель" + +msgid "May" +msgstr "Май" + +msgid "June" +msgstr "ИюМь" + +msgid "July" +msgstr "Июль" + +msgid "August" +msgstr "Август" + +msgid "September" +msgstr "СеМтябрь" + +msgid "October" +msgstr "Октябрь" + +msgid "November" +msgstr "НПябрь" + +msgid "December" +msgstr "Декабрь" + +msgid "To" +msgstr "О" + +msgid "Extra options" +msgstr "ДПпПлМОтельМП" + +msgid "Report type" +msgstr "ППказать" + +msgid "CDR search" +msgstr "СпОсПк звПМкПв" + +msgid "CSV file" +msgstr "ДаЌп в CSV-файл" + +msgid "Call Graph" +msgstr "СуЌЌарМый графОк" + +msgid "Concurrent Calls" +msgstr "ОЎМПвреЌеММые звПМкО" + +msgid "Result limit" +msgstr "ЗапОсей" + +msgid "" +"Select Source Channel to search for. You can enter just the channel type " +"like SIP, IAX2 or Local. You can also include the destination for the " +"channel, like SIP/1234." +msgstr "" +"ВыберОте каМал ОстПчМОка. Вы ЌПжОте прПстП ввестО тОп каМала, МапрОЌер SIP, " +"IAX2, Local. ИлО ввестО пПлМПе ОЌя каМала, МапрОЌер SIP/1234." + +msgid "Src Channel" +msgstr "Ð’Ñ +. каМал" + +msgid "Not" +msgstr "Не" + +msgid "Begins With" +msgstr "НачОМается с" + +msgid "Contains" +msgstr "СПЎержОт" + +msgid "Ends With" +msgstr "ОкаМчОвается Ма" + +msgid "Exactly" +msgstr "РавМП" + +msgid "" +"Search for source calls. You can enter multiple sources separated by a " +"comma. This field support Asterisk regular expression. Example
" +msgstr "" +"ППОск пП МПЌеру звПМящегП. МПжМП ввестО ПЎОМ МПЌер ОлО МескПлькП Asterisk " +"ÑÐŸÐ²ÐŒÐµÑÑ‚ÐžÐŒÑ‹Ñ + Ñ€ÐµÐ³ÑƒÐ»ÑÑ€ÐœÑ‹Ñ + выражеМОй Ñ€Ð°Ð·ÐŽÐµÐ»ÐµÐœÐœÑ‹Ñ + запятПй, МапрОЌер:
" + +msgid "_2XXN, _562., _.0075 = search for any match of these numbers
" +msgstr "" +"_2XXN, _562., _.0075 эквОвалеМтМП любПЌу МПЌеру пПЎпаЎающеЌу пПЎ " +"любПй Оз ÑÑ‚ÐžÑ + Ñ‚Ñ€ÐµÑ + шаблПМПв
" + +msgid "" +"_!2XXN, _562., _.0075 = Search for any match except for these " +"numbers" +msgstr "" +"_!2XXN, _562., _.0075 МайтО все МПЌера кПтПрые Ме сПвпаЎают сП всеЌО " +"этОЌО треЌя шаблПМаЌО
" + +msgid "
Asterisk pattern matching
" +msgstr "
РегулярМые выражеМОя Asterisk
" + +msgid "X = matches any digit from 0-9
" +msgstr "X = любПЌу чОслу Пт 0 ЎП 9
" + +msgid "Z = matches any digit from 1-9
" +msgstr "Z = любПЌу чОслу Пт 1 ЎП 9
" + +msgid "N = matches any digit from 2-9
" +msgstr "N = любПЌу чОслу Пт 2 ЎП 9
" + +msgid "" +"[1237-9] = matches any digit or letter in the brackets
(in this " +"example, 1,2,3,7,8,9)
" +msgstr "" +"[1237-9] = любПе чОслП ОлО буква Оз скПбПк
( зЎесь МапрОЌер этП: " +"1,2,3,7,8,9
" + +msgid ". = wildcard, matches one or more characters
" +msgstr ". = ПЎОМ ОлО МескПлькП Ð»ÑŽÐ±Ñ‹Ñ + сОЌвПлПв
" + +msgid "Source" +msgstr "КтП звПМОл" + +msgid "" +"Search for CallerID. If your CallerID begins with \" then you must supply " +"this in your search if you select Begins With." +msgstr "" +"ППОск пП ОЌеМО О МПЌеру звПМящегП. ЕслО ОЌя МачОМается с \" ВаЌ МужМП " +"указать этП еслО Вы выбралО пПОск пП Мачалу стрПкО" + +msgid "Search for a DID." +msgstr "" + +msgid "" +"Select Destination Channel to search for. It can be just the channel type " +"like SIP, IAX2 or Local. It can include the destination for the channel, " +"like SIP/1234." +msgstr "" +"ВыберОте каМал МазМачеМОя. Вы ЌПжОте прПстП ввестО тОп каМала, МапрОЌер SIP, " +"IAX2, Local. ИлО ввестО пПлМПе ОЌя каМала, МапрОЌер SIP/1234." + +msgid "Dst Channel" +msgstr "Ð˜ÑÑ +. каМал" + +msgid "" +"Search for destination calls. You can enter multiple sources separated by a " +"comma. This field support Asterisk regular expression. Example
" +msgstr "" +"ППОск пП МПЌеру МазМачеМОя. МПжМП ввестО ПЎОМ МПЌер ОлО МескПлькП Asterisk " +"ÑÐŸÐ²ÐŒÐµÑÑ‚ÐžÐŒÑ‹Ñ + Ñ€ÐµÐ³ÑƒÐ»ÑÑ€ÐœÑ‹Ñ + выражеМОй Ñ€Ð°Ð·ÐŽÐµÐ»ÐµÐœÐœÑ‹Ñ + запятПй, МапрОЌер:
" + +msgid "Destination" +msgstr "КуЎа звПМОл" + +msgid "Search for userfield data (if enabled)." +msgstr "ППОск пП ЎПпПлМОтельМПЌу пПлю Userfield ( еслО ОспПльзуется )" + +msgid "Userfield" +msgstr "Userfield" + +msgid "Search for accountcode." +msgstr "ППОск пП accountcode." + +msgid "Account Code" +msgstr "Account Code" + +msgid "Search for calls that matches the call length specified." +msgstr "ППОск звПМкПв ПпреЎелеММПй ЎлОтельМПстО." + +msgid "Duration" +msgstr "ДлОтельМПсть" + +msgid "Between" +msgstr "МежЎу" + +msgid "And" +msgstr "О" + +msgid "Seconds" +msgstr "СекуМЎ" + +msgid "" +"Search for calls that matches either ANSWERED, BUSY, FAILED or NO ANSWER." +msgstr "ППОск пП статусу звПМка: ОтвечеМ / ЗаМят / НеуЎавшОйся / Без Птвета" + +msgid "Disposition" +msgstr "Статус звПМка" + +msgid "All Dispositions" +msgstr "ЛюбПй статус" + +msgid "Answered" +msgstr "ОтвечеМП" + +msgid "Busy" +msgstr "ЗаМятП" + +msgid "Failed" +msgstr "НеуЎавшОйся" + +msgid "No Answer" +msgstr "Без Птвета" + +msgid "Oldest First" +msgstr "" + +msgid "Newest First" +msgstr "" + +msgid "Group By" +msgstr "ГруппОрПвать пП" + +msgid "Account Information" +msgstr "УчетМая ОМфПрЌацОя" + +msgid "User Field" +msgstr "User Field" + +msgid "Date/Time" +msgstr "Дата/ВреЌя" + +msgid "Minute" +msgstr "МОМута" + +msgid "10 Minutes" +msgstr "10 ЌОМут" + +msgid "Hour" +msgstr "Час" + +msgid "Hour of day" +msgstr "Час ЎМя" + +msgid "Day of week" +msgstr "ДеМь МеЎелО" + +msgid "Day" +msgstr "ДеМь" + +msgid "Week ( Sun-Sat )" +msgstr "НеЎеля (Вск-Суб)" + +msgid "Month" +msgstr "Месяц" + +msgid "Telephone Number" +msgstr "НПЌера телефПМа" + +msgid "Source Number" +msgstr "КтП звПМОл" + +msgid "Destination Number" +msgstr "КуЎа звПМОл" + +msgid "Tech info" +msgstr "" + +msgid "Search" +msgstr "Искать" + +msgid "Call Detail Record - Search Returned" +msgstr "Отчет пП звПМкаЌ - Результат пПОска" + +msgid "Calls" +msgstr "ЗвПМкО" + +msgid "File" +msgstr "Ѐайл" + +msgid "System" +msgstr "ИЎеМтОфОкатПр" + +msgid "Src Chan." +msgstr "" + +msgid "App." +msgstr "" + +msgid "Dest." +msgstr "" + +msgid "Dst. Chan." +msgstr "" + +msgid "Account" +msgstr "Account" + +msgid "Call Detail Record - Call Graph by" +msgstr "Отчет пП звПМкаЌ - суЌЌарМые графОкО" + +msgid "Total Calls" +msgstr "ВсегП звПМкПв" + +msgid "Max Calls" +msgstr "МаксОЌальМП звПМкПв" + +msgid "Total Duration" +msgstr "СуЌЌарМая прПЎПлжОтельМПсть" + +msgid "Average Call Time" +msgstr "СреЎМяя прПЎПлжОтельМПсть звПМка" + +msgid "Go to the top of the CDR table" +msgstr "ПерейтО к спОску звПМкПв" + +msgid "Go to the CDR Graph" +msgstr "ПерейтО к графОкаЌ" + +msgid "Call Detail Record - Concurrent Calls by" +msgstr "Отчет пП звПМкаЌ - ПЎМПвреЌеММые звПМкО" + +msgid "Time" +msgstr "ВреЌя" + +#~ msgid "CDR Viewer" +#~ msgstr "Отчет пП звПМкаЌ" + +#~ msgid "System Administration" +#~ msgstr "СОстеЌМПе аЎЌОМОстрОрПваМОе" + +#~ msgid "Ascending" +#~ msgstr "вПзрПстаМОю" + +#~ msgid "Descending" +#~ msgstr "убываМОю" Index: /freepbx/tags/2.10.1/amp_conf/htdocs/admin/modules/cdr/assets/css/cdr.css =================================================================== --- /freepbx/tags/2.10.1/amp_conf/htdocs/admin/modules/cdr/assets/css/cdr.css (revision 13250) +++ /freepbx/tags/2.10.1/amp_conf/htdocs/admin/modules/cdr/assets/css/cdr.css (revision 13250) @@ -0,0 +1,130 @@ +/* HTML tag styles */ +a { + cursor : pointer; +} + +img { + border-width : 0; +} + +#header_logo { + height: 105px; + width: 121px; + vertical-align: top; +} + +#header_title { + color: #000000; + font-family: serif; + font-size: 32pt; + font-variant: small-caps; + font-weight: bold; + height: 60px; +} + +#header_subtitle { + color: #68878a; + font-family: Verdana,Arial,'Bitstream Vera Sans',Helvetica,sans-serif; + font-size: 12pt; + font-weight: bold; + height: 60px; + padding-left: 10px; + vertical-align: top; +} + +#main { + margin : 0; + padding-top : 115px; +} + +/* Class styles */ +.bar_calls { + background-color : #aaf5d0; + float : none; + padding : 0 0 0 2px; +} + + +.bar_duration { + background-color : #e5edf9; + float : none; + padding : 0 0 0 2px; +} + + +.cdr { + margin : 0 5%; + border-width : 0; + width : 92%; + font-size: 8pt; +} + + +.cdr th { + background-color : #5ebeff; + border-color : #000; + border-width : 2px; + text-align : center; +} + + +.cdr .center_col { + width : 78%; + padding : 2px; +} + + +.cdr .end_col { + width : 11%; + padding : 1px; +} + +.cdr .chart_data { + width : 3%; + padding : 0px; + text-align : right; +} + + +.cdr .img_col { + width : 16px; + height : 16px; +} + + +.form legend, .title, .title a { + color: #777; + font-size: 1em; + font-weight: bold; +} + + +.record { + background-color : #fff; + empty-cells : hide; +} + + +.record:hover { + background : #ffdca8; + color : #000; + empty-cells : hide; +} + + +.record_col { + padding-left : 2px; + padding-right : 2px; + border-width : 0; +} + + +.center { + text-align : center; +} + +.right { + padding-right : 80px; + text-align : right; + font-size: 9pt; +} Index: /freepbx/tags/2.10.1/amp_conf/htdocs/admin/modules/cdr/assets/js/cdr.js =================================================================== --- /freepbx/tags/2.10.1/amp_conf/htdocs/admin/modules/cdr/assets/js/cdr.js (revision 12495) +++ /freepbx/tags/2.10.1/amp_conf/htdocs/admin/modules/cdr/assets/js/cdr.js (revision 12495) @@ -0,0 +1,21 @@ +function cdr_play(row_num, link) { + var i = 0; + var playbackId = "CURRENT_MSG"; + var file=encodeURIComponent(link) + var cmTable = document.getElementById('cdr_table'); + // Only one playback row is allowed to be open at a time. + // If one is already open, close it. + for (i = 0; i < cmTable.rows.length; i++) { + if (cmTable.rows[i].id == playbackId) { + // Delete the row; it's a Playback control row. + cmTable.deleteRow(cmTable.rows[i].rowIndex); + } + } + // Make our Playback row. + playback_src = ""; + newRow = cmTable.insertRow(row_num); + newRow.id = playbackId; + cell_left = newRow.insertCell(0); + cell_left.colSpan = 15; + cell_left.innerHTML = playback_src; +} Index: /freepbx/tags/2.10.1/amp_conf/htdocs/admin/modules/cdr/cdr_play.php =================================================================== --- /freepbx/tags/2.10.1/amp_conf/htdocs/admin/modules/cdr/cdr_play.php (revision 13089) +++ /freepbx/tags/2.10.1/amp_conf/htdocs/admin/modules/cdr/cdr_play.php (revision 13089) @@ -0,0 +1,37 @@ + + + + + CDR Viewer + + + + +decrypt($_REQUEST['recordingpath'],$REC_CRYPT_PASSWORD); + $file = urlencode($crypt->encrypt($path,$REC_CRYPT_PASSWORD)); + if (isset($file)) { + echo("
"); + } +?> + + Index: /freepbx/tags/2.10.1/amp_conf/htdocs/admin/modules/cdr/module.xml =================================================================== --- /freepbx/tags/2.10.1/amp_conf/htdocs/admin/modules/cdr/module.xml (revision 14020) +++ /freepbx/tags/2.10.1/amp_conf/htdocs/admin/modules/cdr/module.xml (revision 14020) @@ -0,0 +1,38 @@ + + cdr + standard + Call Data Record report tools for viewing reports of your calls + CDR Reports + 2.10.0.6 + FreePBX + GPLv2+ + Reports + + CDR Reports + + + *2.10.0.6* #5788 install script + *2.10.0.5* #5788 + *2.10.0.4* formatting tweaks + *2.10.0.3* #5500 + *2.10.0.2* #5478, $5479 + *2.10.0.1* add call recordings to CDR + *2.10.0.0* #1426 + *2.10.0.beta4* Bug fixes, re-categorizations + *2.10.0.beta3* Speed up download of csv + *2.10.0.beta2* Bug fixes + *2.10.0.beta1* Play recorded files + *2.10.0.alpha6* Bug fix in recordings settings + *2.10.0.alpha5* Added localization + *2.10.0.alpha4* Added csv export + *2.10.0.alpha3* First public release + *2.10.0.alpha2* Not released to public + *2.10.0.alpha1* Not released to public + *2.10.0.alpha0* Not released to public + + + core ge 2.6.0 + + release/2.10/cdr-2.10.0.6.tgz + c4b9a0470673eb35582260988460e6cf + Index: /freepbx/tags/2.10.1/amp_conf/htdocs/admin/modules/cdr/functions.inc.php =================================================================== --- /freepbx/tags/2.10.1/amp_conf/htdocs/admin/modules/cdr/functions.inc.php (revision 14017) +++ /freepbx/tags/2.10.1/amp_conf/htdocs/admin/modules/cdr/functions.inc.php (revision 14017) @@ -0,0 +1,226 @@ +. +// +// cdr module for FreePBX 2.7+ +// Copyright (C) 2010, 2011 Anthony Joseph Messina +// Portions Copyright (C) 2011 Igor Okunev +// Portions Copyright (C) 2011 Mikael Carlsson +// Portions Copyright (C) 2006 Seth Sargent, Steven Ward + +// NOTE: This function should probably be in a FreePBX library +// php function empty() treats 0 as empty, that is why I need the function below +// to be able to search for any number starting with 0 +function is_blank($value) { + return empty($value) && !is_numeric($value); +} + +/* CDR Table Display Functions */ +function cdr_formatCallDate($calldate) { + echo "".$calldate.""; +} + +function cdr_formatUniqueID($uniqueid) { + $system = explode('-', $uniqueid, 2); + echo '' + . $system[0] . ""; +} + +function cdr_formatChannel($channel) { + $chan_type = explode('/', $channel, 2); + echo '' . $chan_type[0] . ""; +} + +function cdr_formatSrc($src, $clid) { + if (empty($src)) { + echo "UNKNOWN"; + } else { + $clid = htmlspecialchars($clid); + echo '' . $src . ""; + } +} + +function cdr_formatDID($did) { + echo '' . $did . ""; +} + +function cdr_formatApp($app, $lastdata) { + echo '' + . $app . ""; +} + +function cdr_formatDst($dst, $dcontext) { + echo '' + . $dst . ""; +} + +function cdr_formatDisposition($disposition, $amaflags) { + switch ($amaflags) { + case 0: + $amaflags = 'DOCUMENTATION'; + break; + case 1: + $amaflags = 'IGNORE'; + break; + case 2: + $amaflags = 'BILLING'; + break; + case 3: + default: + $amaflags = 'DEFAULT'; + } + echo '' + . $disposition . ""; +} + +function cdr_formatDuration($duration, $billsec) { + $duration = sprintf('%02d', intval($duration/60)).':'.sprintf('%02d', intval($duration%60)); + $billduration = sprintf('%02d', intval($billsec/60)).':'.sprintf('%02d', intval($billsec%60)); + echo '' + . $duration . ""; +} + +function cdr_formatUserField($userfield) { + echo "".$userfield.""; +} + +function cdr_formatAccountCode($accountcode) { + echo "".$accountcode.""; +} + +function cdr_formatRecordingFile($recordingfile, $basename, $id) { + + global $REC_CRYPT_PASSWORD; + + if ($recordingfile) { + $crypt = new Crypt(); + // Encrypt the complete file + $audio = urlencode($crypt->encrypt($recordingfile, $REC_CRYPT_PASSWORD)); + $recurl=$_SERVER['PHP_SELF']."?display=cdr&action=cdr_play&recordingpath=$audio"; + $playbackRow = $id +1; + // + echo "\"Call"; + } else { + echo ""; + } +} + +/* Asterisk RegExp parser */ +function cdr_asteriskregexp2sqllike( $source_data, $user_num ) { + $number = $user_num; + if ( strlen($number) < 1 ) { + $number = $_POST[$source_data]; + } + if ( '__' == substr($number,0,2) ) { + $number = substr($number,1); + } elseif ( '_' == substr($number,0,1) ) { + $number_chars = preg_split('//', substr($number,1), -1, PREG_SPLIT_NO_EMPTY); + $number = ''; + foreach ($number_chars as $chr) { + if ( $chr == 'X' ) { + $number .= '[0-9]'; + } elseif ( $chr == 'Z' ) { + $number .= '[1-9]'; + } elseif ( $chr == 'N' ) { + $number .= '[2-9]'; + } elseif ( $chr == '.' ) { + $number .= '.+'; + } elseif ( $chr == '!' ) { + $_POST[ $source_data .'_neg' ] = 'true'; + } else { + $number .= $chr; + } + } + $_POST[ $source_data .'_mod' ] = 'asterisk-regexp'; + } + return $number; +} + +function cdr_download($data, $name) { + $filesize = strlen($data); + $mimetype = "application/octet-stream"; + + // Make sure there's not anything else left + cdr_ob_clean_all(); + // Start sending headers + header("Pragma: public"); // required + header("Expires: 0"); + header("Cache-Control: must-revalidate, post-check=0, pre-check=0"); + header("Cache-Control: private",false); // required for certain browsers + header("Content-Transfer-Encoding: binary"); + header("Content-Type: " . $mimetype); + header("Content-Length: " . $filesize); + header("Content-Disposition: attachment; filename=\"" . $name . "\";" ); + // Send data + echo $data; + die(); +} + +function cdr_export_csv($csvdata) { + // Searching for more than 10,000 records take more than 30 seconds. + // php default timeout is 30 seconds, hard code it to 3000 seconds for now (which is WAY overkill). + // TODO: make this value a setting in Advanced Settings + set_time_limit(3000); + $fname = "cdr__" . (string) time() . $_SERVER["SERVER_NAME"] . ".csv"; + $csv_header ="calldate,clid,src,dst,dcontext,channel,dstchannel,lastapp,lastdata,duration,billsec,disposition,amaflags,accountcode,uniqueid,userfield\n"; + $data = $csv_header; + + foreach ($csvdata as $csv) { + $csv_line[0] = $csv['calldate']; + $csv_line[1] = $csv['clid']; + $csv_line[2] = $csv['src']; + $csv_line[3] = $csv['dst']; + $csv_line[4] = $csv['dcontext']; + $csv_line[5] = $csv['channel']; + $csv_line[6] = $csv['dstchannel']; + $csv_line[7] = $csv['lastapp']; + $csv_line[8] = $csv['lastdata']; + $csv_line[9] = $csv['duration']; + $csv_line[10] = $csv['billsec']; + $csv_line[11] = $csv['disposition']; + $csv_line[12] = $csv['amaflags']; + $csv_line[13] = $csv['accountcode']; + $csv_line[14] = $csv['uniqueid']; + $csv_line[15] = $csv['userfield']; + + for ($i = 0; $i < count($csv_line); $i++) { + /* If the string contains a comma, enclose it in double-quotes. */ + if (strpos($csv_line[$i], ",") !== FALSE) { + $csv_line[$i] = "\"" . $csv_line[$i] . "\""; + } + if ($i != count($csv_line) - 1) { + $data .= $csv_line[$i] . ","; + } else { + $data .= $csv_line[$i]; + } + } + $data .= "\n"; + unset($csv_line); + } + cdr_download($data, $fname); + return; +} + +function cdr_ob_clean_all () { + $ob_active = ob_get_length () !== false; + while($ob_active) { + ob_end_clean(); + $ob_active = ob_get_length () !== false; + } + return true; +} + +?> Index: /freepbx/tags/2.10.1/amp_conf/htdocs/admin/modules/cdr/crypt.php =================================================================== --- /freepbx/tags/2.10.1/amp_conf/htdocs/admin/modules/cdr/crypt.php (revision 13091) +++ /freepbx/tags/2.10.1/amp_conf/htdocs/admin/modules/cdr/crypt.php (revision 13091) @@ -0,0 +1,82 @@ + 0) { + $iv .= chr(mt_rand() & 0xff); + } + return $iv; + } + + /** + * Encrypts string + * - From php.net docs + * + * @param $str + * string to encrypt + * @param $salt + * password to use for encryption + * @param $iv_len + * length of random number + */ + function encrypt($str, $salt, $iv_len = 16) { + + $str .= "\x13"; + $n = strlen($str); + if ($n % 16) $str .= str_repeat("\0", 16 - ($n % 16)); + $i = 0; + $enc_text = $this->getRndIV($iv_len); + $iv = substr($salt ^ $enc_text, 0, 512); + while ($i < $n) { + $block = substr($str, $i, 16) ^ pack('H*', md5($iv)); + $enc_text .= $block; + $iv = substr($block . $iv, 0, 512) ^ $salt; + $i += 16; + } + return base64_encode($enc_text); + } + + /** + * Decrypts string + * - From php.net docs + * + * @param $enc + * encrypted string to decrypt + * @param $salt + * password to use for encryption + * @param $iv_len + * length of random number + */ + function decrypt($enc, $salt, $iv_len = 16) { + + $enc = base64_decode($enc); + $n = strlen($enc); + $i = $iv_len; + $str = ''; + $iv = substr($salt ^ substr($enc, 0, $iv_len), 0, 512); + while ($i < $n) { + $block = substr($enc, $i, 16); + $str .= $block ^ pack('H*', md5($iv)); + $iv = substr($block . $iv, 0, 512) ^ $salt; + $i += 16; + } + return preg_replace('/\\x13\\x00*$/', '', $str); + } +} + + +?> Index: /freepbx/tags/2.10.1/amp_conf/htdocs/admin/modules/cdr/page.cdr.php =================================================================== --- /freepbx/tags/2.10.1/amp_conf/htdocs/admin/modules/cdr/page.cdr.php (revision 13995) +++ /freepbx/tags/2.10.1/amp_conf/htdocs/admin/modules/cdr/page.cdr.php (revision 13995) @@ -0,0 +1,797 @@ +. +// +// cdr module for FreePBX 2.7+ +// Copyright (C) 2010, 2011 Anthony Joseph Messina +// Portions Copyright (C) 2011 Igor Okunev +// Portions Copyright (C) Mikael Carlsson + +if (!defined('FREEPBX_IS_AUTH')) { die('No direct script access allowed'); } + +// For use in encrypt-decrypt of path and filename for the recordings +include_once("crypt.php"); +switch ($action) { + case 'cdr_play': + case 'cdr_audio': + include_once("$action.php"); + exit; + break; + default: + break; +} + +global $amp_conf; +// Are a crypt password specified? If not, use the supplied. +$REC_CRYPT_PASSWORD = (isset($amp_conf['AMPPLAYKEY']) && trim($amp_conf['AMPPLAYKEY']) != "")?trim($amp_conf['AMPPLAYKEY']):'TheWindCriesMary'; +$dispnum = "cdr"; +$db_result_limit = 100; + +// Check if cdr database and/or table is set, if not, use our default settings +$db_name = !empty($amp_conf['CDRDBNAME'])?$amp_conf['CDRDBNAME']:"asteriskcdrdb"; +$db_table_name = !empty($amp_conf['CDRDBTABLENAME'])?$amp_conf['CDRDBTABLENAME']:"cdr"; +$system_monitor_dir = isset($amp_conf['ASTSPOOLDIR'])?$amp_conf['ASTSPOOLDIR']."/monitor":"/var/spool/asterisk/monitor"; + +// if CDRDBHOST and CDRDBTYPE are not empty then we assume an external connection and don't use the default connection +// +if (!empty($amp_conf["CDRDBHOST"]) && !empty($amp_conf["CDRDBTYPE"])) { + $db_hash = array('mysql' => 'mysql', 'postgres' => 'pgsql'); + $db_type = $db_hash[$amp_conf["CDRDBTYPE"]]; + $db_host = $amp_conf["CDRDBHOST"]; + $db_port = empty($amp_conf["CDRDBPORT"]) ? '' : ':' . $amp_conf["CDRDBPORT"]; + $db_user = empty($amp_conf["CDRDBUSER"]) ? $amp_conf["AMPDBUSER"] : $amp_conf["CDRDBUSER"]; + $db_pass = empty($amp_conf["CDRDBPASS"]) ? $amp_conf["AMPDBPASS"] : $amp_conf["CDRDBPASS"]; + $datasource = $db_type . '://' . $db_user . ':' . $db_pass . '@' . $db_host . $db_port . '/' . $db_name; + $dbcdr = DB::connect($datasource); // attempt connection + if(DB::isError($dbcdr)) { + die_freepbx($dbcdr->getDebugInfo()); + } +} else { + $dbcdr = $db; +} + +$h_step = 30; +?> +


+
+ + + +
+
+
+ + + + + + + + + + + + + + + + + + + +");?> +_2XXN, _562., _.0075 = search for any match of these numbers
");?> +_!2XXN, _562., _.0075 = Search for any match except for these numbers");?> +Asterisk pattern matching
");?> +X = matches any digit from 0-9
");?> +Z = matches any digit from 1-9
");?> +N = matches any digit from 2-9
");?> +[1237-9] = matches any digit or letter in the brackets
(in this example, 1,2,3,7,8,9)
");?> +. = wildcard, matches one or more characters
");?> + + + + + + + + + + + + + + + + + + + +");?> +_2XXN, _562., _.0075 = search for any match of these numbers
");?> +_!2XXN, _562., _.0075 = Search for any match except for these numbers");?> +Asterisk pattern matching
");?> +X = matches any digit from 0-9
");?> +Z = matches any digit from 1-9
");?> +N = matches any digit from 2-9
");?> +[1237-9] = matches any digit or letter in the brackets
(in this example, 1,2,3,7,8,9)
");?> +. = wildcard, matches one or more characters
");?> + + + + + + + + + + + + + + + + + + + + + + + + + + + +
 
type="radio" name="order" value="calldate" /> "._("Call Date")."".$calldate_tooltip.""?>:: + + + + : + : + + + + : + + +
+ + + + + + + + + + +
: + type="checkbox" name="need_html" value="true" /> :
+ type="checkbox" name="need_csv" value="true" /> :
+ type="checkbox" name="need_chart" value="true" /> :
+ +
+ +
+
+
type="radio" name="order" value="channel" />  +: type="checkbox" name="channel_neg" value="true" /> +: type="radio" name="channel_mod" value="begins_with" /> +: type="radio" name="channel_mod" value="contains" /> +: type="radio" name="channel_mod" value="ends_with" /> +: type="radio" name="channel_mod" value="exact" /> +
type="radio" name="order" value="src" />  +: type="checkbox" name="src_neg" value="true" /> +: type="radio" name="src_mod" value="begins_with" /> +: type="radio" name="src_mod" value="contains" /> +: type="radio" name="src_mod" value="ends_with" /> +: type="radio" name="src_mod" value="exact" /> +
type="radio" name="order" value="clid" />  +: type="checkbox" name="clid_neg" value="true" /> +: type="radio" name="clid_mod" value="begins_with" /> +: type="radio" name="clid_mod" value="contains" /> +: type="radio" name="clid_mod" value="ends_with" /> +: type="radio" name="clid_mod" value="exact" /> +
type="radio" name="order" value="did" />  +: type="checkbox" name="did_neg" value="true" /> +: type="radio" name="did_mod" value="begins_with" /> +: type="radio" name="did_mod" value="contains" /> +: type="radio" name="did_mod" value="ends_with" /> +: type="radio" name="did_mod" value="exact" /> +
type="radio" name="order" value="dstchannel" />  +: type="checkbox" name="dstchannel_neg" value="true" /> +: type="radio" name="dstchannel_mod" value="begins_with" /> +: type="radio" name="dstchannel_mod" value="contains" /> +: type="radio" name="dstchannel_mod" value="ends_with" /> +: type="radio" name="dstchannel_mod" value="exact" /> +
type="radio" name="order" value="dst" />  +: type="checkbox" name="dst_neg" value="true" /> +: type="radio" name="dst_mod" value="begins_with" /> +: type="radio" name="dst_mod" value="contains" /> +: type="radio" name="dst_mod" value="ends_with" /> +: type="radio" name="dst_mod" value="exact" /> +
type="radio" name="order" value="userfield" />  +: type="checkbox" name="userfield_neg" value="true" /> +: type="radio" name="userfield_mod" value="begins_with" /> +: type="radio" name="userfield_mod" value="contains" /> +: type="radio" name="userfield_mod" value="ends_with" /> +: type="radio" name="userfield_mod" value="exact" /> +
type="radio" name="order" value="accountcode" />  +: type="checkbox" name="accountcode_neg" value="true" /> +: type="radio" name="accountcode_mod" value="begins_with" /> +: type="radio" name="accountcode_mod" value="contains" /> +: type="radio" name="accountcode_mod" value="ends_with" /> +: type="radio" name="accountcode_mod" value="exact" /> +
type="radio" name="order" value="duration" /> : + +: + + +
type="radio" name="order" value="disposition" />  + + +: type="checkbox" name="disposition_neg" value="true" /> +
+ +
+ + +" /> +
+
+
+
+
+ + + date('t', strtotime("$startyear-$startmonth")))) { + $startday = $_POST['startday'] = date('t', strtotime("$startyear-$startmonth")); +} else { + $startday = sprintf('%02d',$_POST['startday']); +} +$starthour = empty($_POST['starthour']) ? '00' : sprintf('%02d',$_POST['starthour']); +$startmin = empty($_POST['startmin']) ? '00' : sprintf('%02d',$_POST['startmin']); + +$startdate = "'$startyear-$startmonth-$startday $starthour:$startmin:00'"; +$start_timestamp = mktime( $starthour, $startmin, 59, $startmonth, $startday, $startyear ); + +$endmonth = empty($_POST['endmonth']) ? date('m') : $_POST['endmonth']; +$endyear = empty($_POST['endyear']) ? date('Y') : $_POST['endyear']; + +if (empty($_POST['endday']) || (isset($_POST['endday']) && ($_POST['endday'] > date('t', strtotime("$endyear-$endmonth-01"))))) { + $endday = $_POST['endday'] = date('t', strtotime("$endyear-$endmonth")); +} else { + $endday = sprintf('%02d',$_POST['endday']); +} +$endhour = empty($_POST['endhour']) ? '23' : sprintf('%02d',$_POST['endhour']); +$endmin = empty($_POST['endmin']) ? '59' : sprintf('%02d',$_POST['endmin']); + +$enddate = "'$endyear-$endmonth-$endday $endhour:$endmin:59'"; +$end_timestamp = mktime( $endhour, $endmin, 59, $endmonth, $endday, $endyear ); + +# +# asterisk regexp2sqllike +# +if ( !isset($_POST['src']) ) { + $src_number = NULL; +} else { + $src_number = cdr_asteriskregexp2sqllike( 'src', '' ); +} + +if ( !isset($_POST['dst']) ) { + $dst_number = NULL; +} else { + $dst_number = cdr_asteriskregexp2sqllike( 'dst', '' ); +} + +$date_range = "calldate BETWEEN $startdate AND $enddate"; +$mod_vars['channel'][] = !isset($_POST['channel']) ? NULL : $_POST['channel']; +$mod_vars['channel'][] = empty($_POST['channel_mod']) ? NULL : $_POST['channel_mod']; +$mod_vars['channel'][] = empty($_POST['channel_neg']) ? NULL : $_POST['channel_neg']; +$mod_vars['src'][] = $src_number; +$mod_vars['src'][] = empty($_POST['src_mod']) ? NULL : $_POST['src_mod']; +$mod_vars['src'][] = empty($_POST['src_neg']) ? NULL : $_POST['src_neg']; +$mod_vars['clid'][] = !isset($_POST['clid']) ? NULL : $_POST['clid']; +$mod_vars['clid'][] = empty($_POST['clid_mod']) ? NULL : $_POST['clid_mod']; +$mod_vars['clid'][] = empty($_POST['clid_neg']) ? NULL : $_POST['clid_neg']; +$mod_vars['did'][] = !isset($_POST['did']) ? NULL : $_POST['did']; +$mod_vars['did'][] = empty($_POST['did_mod']) ? NULL : $_POST['did_mod']; +$mod_vars['did'][] = empty($_POST['did_neg']) ? NULL : $_POST['did_neg']; +$mod_vars['dstchannel'][] = !isset($_POST['dstchannel']) ? NULL : $_POST['dstchannel']; +$mod_vars['dstchannel'][] = empty($_POST['dstchannel_mod']) ? NULL : $_POST['dstchannel_mod']; +$mod_vars['dstchannel'][] = empty($_POST['dstchannel_neg']) ? NULL : $_POST['dstchannel_neg']; +$mod_vars['dst'][] = $dst_number; +$mod_vars['dst'][] = empty($_POST['dst_mod']) ? NULL : $_POST['dst_mod']; +$mod_vars['dst'][] = empty($_POST['dst_neg']) ? NULL : $_POST['dst_neg']; +$mod_vars['userfield'][] = !isset($_POST['userfield']) ? NULL : $_POST['userfield']; +$mod_vars['userfield'][] = empty($_POST['userfield_mod']) ? NULL : $_POST['userfield_mod']; +$mod_vars['userfield'][] = empty($_POST['userfield_neg']) ? NULL : $_POST['userfield_neg']; +$mod_vars['accountcode'][] = !isset($_POST['accountcode']) ? NULL : $_POST['accountcode']; +$mod_vars['accountcode'][] = empty($_POST['accountcode_mod']) ? NULL : $_POST['accountcode_mod']; +$mod_vars['accountcode'][] = empty($_POST['accountcode_neg']) ? NULL : $_POST['accountcode_neg']; +$result_limit = !isset($_POST['limit']) ? $db_result_limit : $_POST['limit']; + +foreach ($mod_vars as $key => $val) { + if (is_blank($val[0])) { + unset($_POST[$key.'_mod']); + $$key = NULL; + } else { + $pre_like = ''; + if ( $val[2] == 'true' ) { + $pre_like = ' NOT '; + } + switch ($val[1]) { + case "contains": + $$key = "AND $key $pre_like LIKE '%$val[0]%'"; + break; + case "ends_with": + $$key = "AND $key $pre_like LIKE '%$val[0]'"; + break; + case "exact": + if ( $val[2] == 'true' ) { + $$key = "AND $key != '$val[0]'"; + } else { + $$key = "AND $key = '$val[0]'"; + } + break; + case "asterisk-regexp": + $ast_dids = preg_split('/\s*,\s*/', $val[0], -1, PREG_SPLIT_NO_EMPTY); + $ast_key = ''; + foreach ($ast_dids as $did) { + if (strlen($ast_key) > 0 ) { + if ( $pre_like == ' NOT ' ) { + $ast_key .= " and "; + } else { + $ast_key .= " or "; + } + if ( '_' == substr($did,0,1) ) { + $did = substr($did,1); + } + } + $ast_key .= " $key $pre_like RLIKE '^$did\$'"; + } + $$key = "AND ( $ast_key )"; + break; + case "begins_with": + default: + $$key = "AND $key $pre_like LIKE '$val[0]%'"; + } + } +} + +if ( isset($_POST['disposition_neg']) && $_POST['disposition_neg'] == 'true' ) { + $disposition = (empty($_POST['disposition']) || $_POST['disposition'] == 'all') ? NULL : "AND disposition != '$_POST[disposition]'"; +} else { + $disposition = (empty($_POST['disposition']) || $_POST['disposition'] == 'all') ? NULL : "AND disposition = '$_POST[disposition]'"; +} + +$duration = (!isset($_POST['dur_min']) || is_blank($_POST['dur_max'])) ? NULL : "AND duration BETWEEN '$_POST[dur_min]' AND '$_POST[dur_max]'"; +$order = empty($_POST['order']) ? 'ORDER BY calldate' : "ORDER BY $_POST[order]"; +$sort = empty($_POST['sort']) ? 'DESC' : $_POST['sort']; +$group = empty($_POST['group']) ? 'day' : $_POST['group']; + +// Build the "WHERE" part of the query +$where = "WHERE $date_range $channel $dstchannel $src $clid $did $dst $userfield $accountcode $disposition $duration"; + +if ( isset($_POST['need_csv']) && $_POST['need_csv'] == 'true' ) { + $query = "(SELECT calldate, clid, did, src, dst, dcontext, channel, dstchannel, lastapp, lastdata, duration, billsec, disposition, amaflags, accountcode, uniqueid, userfield FROM $db_name.$db_table_name $where $order $sort LIMIT $result_limit)"; + $resultcsv = $dbcdr->getAll($query, DB_FETCHMODE_ASSOC); + cdr_export_csv($resultcsv); +} + +if ( isset($_POST['need_html']) && $_POST['need_html'] == 'true' ) { + $query = "SELECT `calldate`, `clid`, `did`, `src`, `dst`, `dcontext`, `channel`, `dstchannel`, `lastapp`, `lastdata`, `duration`, `billsec`, `disposition`, `amaflags`, `accountcode`, `uniqueid`, `userfield`, unix_timestamp(calldate) as `call_timestamp`, `recordingfile` FROM $db_name.$db_table_name $where $order $sort LIMIT $result_limit"; + $results = $dbcdr->getAll($query, DB_FETCHMODE_ASSOC); +} +if ( isset($results) ) { + $tot_calls_raw = sizeof($results); +} else { + $tot_calls_raw = 0; +} +if ( $tot_calls_raw ) { + echo "

"._("Call Detail Record - Search Returned")." ".$tot_calls_raw." "._("Calls")."

"; + echo ""; + + $i = $h_step - 1; + $id = -1; // tracker for recording index + foreach($results as $row) { + ++$id; // Start at table row 1 + ++$i; + if ($i == $h_step) { + ?> + + + + + + + + + + + + + + + + + + \n"; + cdr_formatCallDate($row['calldate']); + cdr_formatRecordingFile($recordingfile, $row['recordingfile'], $id); + cdr_formatUniqueID($row['uniqueid']); + cdr_formatChannel($row['channel']); + cdr_formatSrc($row['src'], $row['clid']); + cdr_formatDID($row['did']); + cdr_formatApp($row['lastapp'], $row['lastdata']); + cdr_formatDst($row['dst'], $row['dcontext']); + cdr_formatChannel($row['dstchannel']); + cdr_formatDisposition($row['disposition'], $row['amaflags']); + cdr_formatDuration($row['duration'], $row['billsec']); + cdr_formatUserField($row['userfield']); + cdr_formatAccountCode($row['accountcode']); + echo " \n"; + echo " \n"; + echo " \n"; + } + echo "
CDR TableCDR Graph
"; +} +?> + + +'; + +//NEW GRAPHS +$group_by_field = $group; +// ConcurrentCalls +$group_by_field_php = array( '', 32, '' ); + +switch ($group) { + case "disposition_by_day": + $graph_col_title = 'Disposition by day'; + $group_by_field_php = array('%Y-%m-%d / ',17,''); + $group_by_field = "CONCAT(DATE_FORMAT(calldate, '$group_by_field_php[0]'),disposition)"; + break; + case "disposition_by_hour": + $graph_col_title = 'Disposition by hour'; + $group_by_field_php = array( '%Y-%m-%d %H / ', 20, '' ); + $group_by_field = "CONCAT(DATE_FORMAT(calldate, '$group_by_field_php[0]'),disposition)"; + break; + case "disposition": + $graph_col_title = 'Disposition'; + break; + case "dcontext": + $graph_col_title = 'Destination context'; + break; + case "accountcode": + $graph_col_title = _("Account Code"); + break; + case "dst": + $graph_col_title = _("Destination Number"); + break; + case "src": + $graph_col_title = _("Source Number"); + break; + case "userfield": + $graph_col_title = _("User Field"); + break; + case "hour": + $group_by_field_php = array( '%Y-%m-%d %H', 13, '' ); + $group_by_field = "DATE_FORMAT(calldate, '$group_by_field_php[0]')"; + $graph_col_title = _("Hour"); + break; + case "hour_of_day": + $group_by_field_php = array('%H',2,''); + $group_by_field = "DATE_FORMAT(calldate, '$group_by_field_php[0]')"; + $graph_col_title = _("Hour of day"); + break; + case "week": + $group_by_field_php = array('%V',2,''); + $group_by_field = "DATE_FORMAT(calldate, '$group_by_field_php[0]') "; + $graph_col_title = _("Week ( Sun-Sat )"); + break; + case "month": + $group_by_field_php = array('%Y-%m',7,''); + $group_by_field = "DATE_FORMAT(calldate, '$group_by_field_php[0]')"; + $graph_col_title = _("Month"); + break; + case "day_of_week": + $group_by_field_php = array('%w - %A',20,''); + $group_by_field = "DATE_FORMAT( calldate, '%W' )"; + $graph_col_title = _("Day of week"); + break; + case "minutes1": + $group_by_field_php = array( '%Y-%m-%d %H:%M', 16, '' ); + $group_by_field = "DATE_FORMAT(calldate, '%Y-%m-%d %H:%i')"; + $graph_col_title = _("Minute"); + break; + case "minutes10": + $group_by_field_php = array('%Y-%m-%d %H:%M',15,'0'); + $group_by_field = "CONCAT(SUBSTR(DATE_FORMAT(calldate, '%Y-%m-%d %H:%i'),1,15), '0')"; + $graph_col_title = _("10 Minutes"); + break; + case "day": + default: + $group_by_field_php = array('%Y-%m-%d',10,''); + $group_by_field = "DATE_FORMAT(calldate, '$group_by_field_php[0]')"; + $graph_col_title = _("Day"); +} + +if ( isset($_POST['need_chart']) && $_POST['need_chart'] == 'true' ) { + $query2 = "SELECT $group_by_field AS group_by_field, count(*) AS total_calls, sum(duration) AS total_duration FROM $db_name.$db_table_name $where GROUP BY group_by_field ORDER BY group_by_field ASC LIMIT $result_limit"; + $result2 = $dbcdr->getAll($query2, DB_FETCHMODE_ASSOC); + + $tot_calls = 0; + $tot_duration = 0; + $max_calls = 0; + $max_duration = 0; + $tot_duration_secs = 0; + $result_array = array(); + foreach($result2 as $row) { + $tot_duration_secs += $row['total_duration']; + $tot_calls += $row['total_calls']; + if ( $row['total_calls'] > $max_calls ) { + $max_calls = $row['total_calls']; + } + if ( $row['total_duration'] > $max_duration ) { + $max_duration = $row['total_duration']; + } + array_push($result_array,$row); + } + $tot_duration = sprintf('%02d', intval($tot_duration_secs/60)).':'.sprintf('%02d', intval($tot_duration_secs%60)); + + if ( $tot_calls ) { + $html = "

"._("Call Detail Record - Call Graph by")." ".$graph_col_title."

"; + $html .= ""; + $html .= ""; + $html .= ""; + $html .= ""; + $html .= ""; + $html .= ""; + echo $html; + + foreach ($result_array as $row) { + $avg_call_time = sprintf('%02d', intval(($row['total_duration']/$row['total_calls'])/60)).':'.sprintf('%02d', intval($row['total_duration']/$row['total_calls']%60)); + $bar_calls = $row['total_calls']/$max_calls*100; + $percent_tot_calls = intval($row['total_calls']/$tot_calls*100); + $bar_duration = $row['total_duration']/$max_duration*100; + $percent_tot_duration = intval($row['total_duration']/$tot_duration_secs*100); + $html_duration = sprintf('%02d', intval($row['total_duration']/60)).':'.sprintf('%02d', intval($row['total_duration']%60)); + echo " \n"; + echo " \n"; + echo " \n"; + echo " \n"; + echo " \n"; + } + echo "
". $graph_col_title . ""._("Total Calls").": ". $tot_calls ." / "._("Max Calls").": ". $max_calls ." / "._("Total Duration").": ". $tot_duration .""._("Average Call Time")."\"CDR\"CDR
".$row['group_by_field']."
".$row['total_calls']." - $percent_tot_calls%
$html_duration - $percent_tot_duration%
$avg_call_time
"; + } +} +if ( isset($_POST['need_chart_cc']) && $_POST['need_chart_cc'] == 'true' ) { + $date_range = "( (calldate BETWEEN $startdate AND $enddate) or (calldate + interval duration second BETWEEN $startdate AND $enddate) or ( calldate + interval duration second >= $enddate AND calldate <= $startdate ) )"; + $where = "WHERE $date_range $channel $dstchannel $src $clid $dst $userfield $accountcode $disposition $duration"; + + $tot_calls = 0; + $max_calls = 0; + $result_array_cc = array(); + $result_array = array(); + if ( strpos($group_by_field,'DATE_FORMAT') === false ) { + /* not date time fields */ + $query3 = "SELECT $group_by_field AS group_by_field, count(*) AS total_calls, unix_timestamp(calldate) AS ts, duration FROM $db_name.$db_table_name $where GROUP BY group_by_field, unix_timestamp(calldate) ORDER BY group_by_field ASC LIMIT $result_limit"; + $result3 = $dbcdr->getAll($query3, DB_FETCHMODE_ASSOC); + $group_by_str = ''; + foreach($result3 as $row) { + if ( $group_by_str != $row['group_by_field'] ) { + $group_by_str = $row['group_by_field']; + $result_array = array(); + } + for ( $i=$row['ts']; $i<=$row['ts']+$row['duration']; ++$i ) { + if ( isset($result_array[ "$i" ]) ) { + $result_array[ "$i" ] += $row['total_calls']; + } else { + $result_array[ "$i" ] = $row['total_calls']; + } + if ( $max_calls < $result_array[ "$i" ] ) { + $max_calls = $result_array[ "$i" ]; + } + if ( ! isset($result_array_cc[ $row['group_by_field'] ]) || $result_array_cc[ $row['group_by_field'] ][1] < $result_array[ "$i" ] ) { + $result_array_cc[$row['group_by_field']][0] = $i; + $result_array_cc[$row['group_by_field']][1] = $result_array[ "$i" ]; + } + } + $tot_calls += $row['total_calls']; + } + } else { + /* data fields */ + $query3 = "SELECT unix_timestamp(calldate) AS ts, duration FROM $db_name.$db_table_name $where ORDER BY unix_timestamp(calldate) ASC LIMIT $result_limit"; + $result3 = $dbcdr->getAll($query3, DB_FETCHMODE_ASSOC); + $group_by_str = ''; + foreach($result3 as $row) { + $group_by_str_cur = substr(strftime($group_by_field_php[0],$row['ts']),0,$group_by_field_php[1]) . $group_by_field_php[2]; + if ( $group_by_str_cur != $group_by_str ) { + if ( $group_by_str ) { + for ( $i=$start_timestamp; $i<$row['ts']; ++$i ) { + if ( ! isset($result_array_cc[ "$group_by_str" ]) || ( isset($result_array["$i"]) && $result_array_cc[ "$group_by_str" ][1] < $result_array["$i"] ) ) { + $result_array_cc[ "$group_by_str" ][0] = $i; + $result_array_cc[ "$group_by_str" ][1] = isset($result_array["$i"]) ? $result_array["$i"] : 0; + } + unset( $result_array[$i] ); + } + $start_timestamp = $row['ts']; + } + $group_by_str = $group_by_str_cur; + } + for ( $i=$row['ts']; $i<=$row['ts']+$row['duration']; ++$i ) { + if ( isset($result_array["$i"]) ) { + ++$result_array["$i"]; + } else { + $result_array["$i"]=1; + } + if ( $max_calls < $result_array["$i"] ) { + $max_calls = $result_array["$i"]; + } + } + $tot_calls++; + } + for ( $i=$start_timestamp; $i<=$end_timestamp; ++$i ) { + $group_by_str = substr(strftime($group_by_field_php[0],$i),0,$group_by_field_php[1]) . $group_by_field_php[2]; + if ( ! isset($result_array_cc[ "$group_by_str" ]) || ( isset($result_array["$i"]) && $result_array_cc[ "$group_by_str" ][1] < $result_array["$i"] ) ) { + $result_array_cc[ "$group_by_str" ][0] = $i; + $result_array_cc[ "$group_by_str" ][1] = isset($result_array["$i"]) ? $result_array["$i"] : 0; + } + } + } + if ( $tot_calls ) { + $html = "

"._("Call Detail Record - Concurrent Calls by")." ".$graph_col_title."

"; + $html .= ""; + $html .= ""; + $html .= ""; + $html .= ""; + echo $html; + + ksort($result_array_cc); + + foreach ( array_keys($result_array_cc) as $group_by_key ) { + $full_time = strftime( '%Y-%m-%d %H:%M:%S', $result_array_cc[ "$group_by_key" ][0] ); + $group_by_cur = $result_array_cc[ "$group_by_key" ][1]; + $bar_calls = $group_by_cur/$max_calls*100; + echo " \n"; + echo " \n"; + echo " \n"; + } + + echo "
". $graph_col_title . ""._("Total Calls").": ". $tot_calls ." / "._("Max Calls").": ". $max_calls .""._("Time")."
$group_by_key
 $group_by_cur
$full_time
"; + } +} + +?> +
Index: /freepbx/tags/2.10.1/amp_conf/htdocs/admin/modules/cdr/install.php =================================================================== --- /freepbx/tags/2.10.1/amp_conf/htdocs/admin/modules/cdr/install.php (revision 14017) +++ /freepbx/tags/2.10.1/amp_conf/htdocs/admin/modules/cdr/install.php (revision 14017) @@ -0,0 +1,84 @@ +. +// +// cdr module for FreePBX 2.7+ +// Copyright (C) Mikael Carlsson +// +// Update cdr database with did field +// +global $db; +global $amp_conf; + +// Retrieve database and table name if defined, otherwise use FreePBX default +$db_name = !empty($amp_conf['CDRDBNAME'])?$amp_conf['CDRDBNAME']:"asteriskcdrdb"; +$db_table_name = !empty($amp_conf['CDRDBTABLENAME'])?$amp_conf['CDRDBTABLENAME']:"cdr"; + +// if CDRDBHOST and CDRDBTYPE are not empty then we assume an external connection and don't use the default connection +// +if (!empty($amp_conf["CDRDBHOST"]) && !empty($amp_conf["CDRDBTYPE"])) { + $db_hash = array('mysql' => 'mysql', 'postgres' => 'pgsql'); + $db_type = $db_hash[$amp_conf["CDRDBTYPE"]]; + $db_host = $amp_conf["CDRDBHOST"]; + $db_port = empty($amp_conf["CDRDBPORT"]) ? '' : ':' . $amp_conf["CDRDBPORT"]; + $db_user = empty($amp_conf["CDRDBUSER"]) ? $amp_conf["AMPDBUSER"] : $amp_conf["CDRDBUSER"]; + $db_pass = empty($amp_conf["CDRDBPASS"]) ? $amp_conf["AMPDBPASS"] : $amp_conf["CDRDBPASS"]; + $datasource = $db_type . '://' . $db_user . ':' . $db_pass . '@' . $db_host . $db_port . '/' . $db_name; + $dbcdr = DB::connect($datasource); // attempt connection + if(DB::isError($dbcdr)) { + die_freepbx($dbcdr->getDebugInfo()); + } +} else { + $dbcdr = $db; +} + +if (! function_exists("out")) { + function out($text) { + echo $text."
"; + } +} +out(_("Checking if field did is present in cdr table..")); +$sql = "SELECT did FROM $db_name.$db_table_name"; +$confs = $dbcdr->getRow($sql, DB_FETCHMODE_ASSOC); +if (DB::IsError($confs)) { // no error... Already there + out(_("Adding did field to cdr")); + out(_("This might take a while......")); + $sql = "ALTER TABLE $db_name.$db_table_name ADD did VARCHAR ( 50 ) NOT NULL DEFAULT ''"; + $results = $dbcdr->query($sql); + if(DB::IsError($results)) { + die($results->getMessage()); + } + out(_("Added field did to cdr")); +} else { + out(_("did field already present.")); +} + +out(_("Checking if field recordingfile is present in cdr table..")); +$sql = "SELECT recordingfile FROM $db_name.$db_table_name"; +$confs = $dbcdr->getRow($sql, DB_FETCHMODE_ASSOC); +if (DB::IsError($confs)) { // no error... Already there + out(_("Adding recordingfile field to cdr")); + $sql = "ALTER TABLE $db_name.$db_table_name ADD recordingfile VARCHAR ( 255 ) NOT NULL DEFAULT ''"; + $results = $dbcdr->query($sql); + if(DB::IsError($results)) { + out(_('Unable to add recordingfile field to cdr table')); + freepbx_log(FPBX_LOG_ERROR,"failed to add recordingfile field to cdr table"); + } else { + out(_("Added field recordingfile to cdr")); + } +} else { + out(_("recordingfile field already present.")); +}