summaryrefslogtreecommitdiff
path: root/FS/FS/cdr
diff options
context:
space:
mode:
authorChristopher Burger <burgerc@freeside.biz>2017-05-26 14:20:51 -0400
committerChristopher Burger <burgerc@freeside.biz>2017-05-26 14:20:51 -0400
commite4ceced95d8b5906d1589ffe7b5f778b6477f31e (patch)
treeccc639cf9f4313b5d1c1fe92b3bced43ab0420e8 /FS/FS/cdr
parentcfd80c91527e3eebb6b81bef07dd191f37f9c212 (diff)
RT# 74523 - added check for status table argument for /bin/cdr-ivr.import compatibility
Diffstat (limited to 'FS/FS/cdr')
-rw-r--r--FS/FS/cdr/Import.pm13
1 files changed, 7 insertions, 6 deletions
diff --git a/FS/FS/cdr/Import.pm b/FS/FS/cdr/Import.pm
index 35069ae..f32a7bd 100644
--- a/FS/FS/cdr/Import.pm
+++ b/FS/FS/cdr/Import.pm
@@ -71,6 +71,7 @@ sub dbi_import {
my $table = $opt{T} || $args{table};
my $pkey = $args{primary_key};
+ my $status_table = $opt{S} || $args{status_table};
#just doing this manually with IVR MSSQL databases for now
# # check for existence of freesidestatus
@@ -91,9 +92,9 @@ sub dbi_import {
#my @cols = values %{ $args{column_map} };
my $sql = "SELECT $table.* FROM $table "; # join(',', @cols). " FROM $table ".
- $sql .= 'LEFT JOIN '. $opt{S}.
- " ON ( $table.$pkey = ". $opt{S}. ".$pkey )"
- if $opt{S};
+ $sql .= 'LEFT JOIN '. $status_table.
+ " ON ( $table.$pkey = ". $status_table. ".$pkey )"
+ if $status_table;
$sql .= ' WHERE freesidestatus IS NULL ';
#$sql .= ' LIMIT '. $opt{L} if $opt{L};
@@ -141,10 +142,10 @@ sub dbi_import {
$imported++;
my $st_sql;
- if ( $opt{S} ) {
+ if ( $status_table ) {
$st_sql =
- 'INSERT INTO '. $opt{S}. " ( $pkey, freesidestatus ) ".
+ 'INSERT INTO '. $status_table. " ( $pkey, freesidestatus ) ".
" VALUES ( ?, 'done' )";
} else {
@@ -191,4 +192,4 @@ L<FS::cdr>
=cut
-1;
+1; \ No newline at end of file