recordings separated by day directory.

Discussions about development of VICIDIAL and astGUIclient

Moderators: gerski, enjay, williamconley, Op3r, Staydog, gardo, mflorell, MJCoate, mcargile, Kumba, Michael_N

recordings separated by day directory.

Postby Op3r » Tue Mar 03, 2009 12:58 pm

I am thinking how do you guys implement it? Cos looking at the GSM directory by browser kinda takes a long time and sometimes the browser just hangs up.

Did you guys edit the recording_log too? How do you link it to the recordings stats of the agent?
Get paid for US outbound Toll Free calls. PM me.
Op3r
 
Posts: 1424
Joined: Wed Jun 07, 2006 7:53 pm
Location: Manila

Postby mflorell » Tue Mar 03, 2009 3:20 pm

the latest codebase for both 2.0.4 and trunk the recordings are stored in dated directories on the archive server. We don't really build the scripts for storage of thousands of recordings on the dialer itself, that's not really a good idea. Yes, the recording_log links to the location, we have done a lot in trunk to integrate recordings to their user, lead and call.
mflorell
Site Admin
 
Posts: 18338
Joined: Wed Jun 07, 2006 2:45 pm
Location: Florida

Postby Op3r » Tue Mar 03, 2009 3:46 pm

Ok

I'll take a look at it. Never really had much used for a archive server before :(
Get paid for US outbound Toll Free calls. PM me.
Op3r
 
Posts: 1424
Joined: Wed Jun 07, 2006 7:53 pm
Location: Manila

Postby aouyar » Wed Jul 15, 2009 4:50 pm

In single server implementations for small Call Centers recordings might end up being stored in the same server.

I had modified the first step audio processing script AST_CRON_audio_1_move_VDonly.pl in the 2.0.5 stable series to separate recordings into diretories per day. I did some additional changes in the script so that it will treat file names as case sensitive. The original script does not differenciate between the extensions wav and WAV extension, whereas in Asterisk wav stands for slinear encapsulated in Windows WAV format and WAV stands for GSM encapsulated in Windows WAV format.

I was planning to send it to Matt first, but I had been postponing it, because I did not have the time to document the changes I made in the script.

I posting you a diff against the original script below...

Code: Select all
--- AST_CRON_audio_1_move_VDonly.pl   2009-07-16 00:43:10.048906252 +0300
+++ AST_CRON_audio_1_move_VDonly_DirTree.pl   2009-07-16 00:43:44.516907222 +0300
@@ -1,6 +1,6 @@
 #!/usr/bin/perl
 #
-# AST_CRON_audio_1_move_VDonly.pl
+# AST_CRON_audio_1_move_VDonly_DirTree.pl
 #
 # This is a STEP-1 program in the audio archival process
 #
@@ -32,6 +32,9 @@
 # 80731-2253 - Changed size comparisons for more efficiency
 #
 
+use File::Path;
+
+
 ### begin parsing run-time options ###
 if (length($ARGV[0])>1)
 {
@@ -171,19 +174,16 @@
       $FILEsize2[$i] = (-s "$dir1/$FILES[$i]");
       if ($DBX) {print "$FILES[$i] $FILEsize2[$i]\n\n";}
 
-      if ( ($FILES[$i] !~ /out\.wav|out\.gsm|lost\+found/i) && ($FILEsize1[$i] eq $FILEsize2[$i]) && (length($FILES[$i]) > 4))
+      if ( ($FILES[$i] =~ /^(.*)-in\.(wav|gsm|WAV)$/) && ($FILEsize1[$i] eq $FILEsize2[$i]) && (length($FILES[$i]) > 4))
          {
+         $root = $1;
+         $ext = $2;
          $INfile = $FILES[$i];
-         $OUTfile = $FILES[$i];
-         $OUTfile =~ s/-in\.wav/-out.wav/gi;
-         $OUTfile =~ s/-in\.gsm/-out.gsm/gi;
-         $ALLfile = $FILES[$i];
-         $ALLfile =~ s/-in\.wav/-all.wav/gi;
-         $ALLfile =~ s/-in\.gsm/-all.gsm/gi;
-         $SQLFILE = $FILES[$i];
-         $SQLFILE =~ s/-in\.wav|-in\.gsm//gi;
+         $OUTfile = "$root-out.$ext";
+         $ALLfile = "$root-all.$ext";
+         $SQLFILE = $root;
 
-         $stmtA = "select recording_id from recording_log where filename='$SQLFILE' order by recording_id desc LIMIT 1;";
+         $stmtA = "select recording_id,DATE_FORMAT(start_time,'%Y/%m/%d') from recording_log where filename='$SQLFILE' order by recording_id desc LIMIT 1;";
          if($DBX){print STDERR "\n|$stmtA|\n";}
          $sthA = $dbhA->prepare($stmtA) or die "preparing: ",$dbhA->errstr;
          $sthA->execute or die "executing: $stmtA ", $dbhA->errstr;
@@ -192,22 +192,29 @@
             {
             @aryA = $sthA->fetchrow_array;
             $recording_id =   "$aryA[0]";
+            $recording_dir = "$aryA[1]";
             }
          $sthA->finish();
 
       if ($DB) {print "|$recording_id|$INfile|     |$ALLfile|\n";}
 
+         $dst_dir = "$dir2/$recording_dir";
+
+         if( ! -d $dst_dir ) {
+               mkpath( $dst_dir, 0, 0755 ) or die "$0: Creation of directory $dstDir failed.\n";
+            }
+
          if (!$T)
             {
-            `mv -f "$dir1/$INfile" "$dir2/$ALLfile"`;
+            `mv -f "$dir1/$INfile" "$dst_dir/$ALLfile"`;
             `rm -f "$dir1/$OUTfile"`;
             }
          else
             {
-            `cp -f "$dir1/$INfile" "$dir2/$ALLfile"`;
+            `cp -f "$dir1/$INfile" "$dst_dir/$ALLfile"`;
             }
 
-         $stmtA = "UPDATE recording_log set location='http://$server_ip/RECORDINGS/$ALLfile' where recording_id='$recording_id';";
+         $stmtA = "UPDATE recording_log set location='http://$server_ip/RECORDINGS/$recording_dir/$ALLfile' where recording_id='$recording_id';";
             if($DBX){print STDERR "\n|$stmtA|\n";}
          $affected_rows = $dbhA->do($stmtA); #  or die  "Couldn't execute query:|$stmtA|\n";
 
aouyar
 
Posts: 124
Joined: Fri Jan 30, 2009 12:49 pm

Postby mflorell » Wed Jul 15, 2009 5:03 pm

Please create a ticket in the issue tracker and post your diff file patch to that.
mflorell
Site Admin
 
Posts: 18338
Joined: Wed Jun 07, 2006 2:45 pm
Location: Florida

Postby aouyar » Wed Jul 15, 2009 6:23 pm

Here it is...
http://www.eflo.net/VICIDIALmantis/view.php?id=221

I would be glad to answer any questions you might have.
aouyar
 
Posts: 124
Joined: Fri Jan 30, 2009 12:49 pm


Return to Development

Who is online

Users browsing this forum: No registered users and 17 guests