X-Git-Url: http://git.freeside.biz/gitweb/?a=blobdiff_plain;f=FS%2FFS%2Fpart_export%2Fpbxware.pm;h=e535e6ed05649b6485537121e37a7d88f1294dbe;hb=ffa18709ee8a4d05e18d2d406cf73afe79e52524;hp=467b79f46ce5afbc82ea1b4f6d737497b957a9ad;hpb=cd73f00695cd1d118133669f09585c1b3d4322f6;p=freeside.git diff --git a/FS/FS/part_export/pbxware.pm b/FS/FS/part_export/pbxware.pm index 467b79f46..e535e6ed0 100644 --- a/FS/FS/part_export/pbxware.pm +++ b/FS/FS/part_export/pbxware.pm @@ -17,9 +17,12 @@ our $DEBUG = 0; # our $DEBUG = 2; # log requests and content of replies tie my %options, 'Tie::IxHash', - 'apikey' => { label => 'API key' }, - 'debug' => { label => 'Enable debugging', type => 'checkbox', value => 1 }, -; # best. API. ever. + 'apikey' => { label => 'API key' }, + 'debug' => { label => 'Enable debugging', type => 'checkbox', value => 1 }, + 'ext' => { label => 'PBXware "ext" field in CDR download request', }, + 'cdrtype' => { label => 'PBXware "cdrtype" field in CDR download request', }, + 'trunkdst' => { label => 'PBXware "trunkdst" field in CDR download request', }, +; our %info = ( 'svc' => [qw(svc_phone)], @@ -28,7 +31,7 @@ our %info = ( 'notes' => <<'END'

Export to Bicom PBXware softswitch.

-

This export does not provision services. Currently you will need +

This export does not yet provision services. Currently you will need to provision trunks and extensions through PBXware. The export only downloads CDRs.

Set the export machine to the name or IP address of your PBXware server, @@ -96,6 +99,10 @@ sub import_cdrs { end => $ed->strftime('%b-%d-%Y'), endtime => $ed->strftime('%H:%M:%S'), ); + + $opt{$_} = $self->option($_) + for grep length( $self->option($_) ), qw( ext cdrtype trunkdst ); + # unlike Certain Other VoIP providers, this one does proper pagination if # the result set is too big to fit in a single chunk. my $page = 1; @@ -131,7 +138,7 @@ sub import_cdrs { # page's IDs or something. my $uniqueid = md5_hex(join(',',@$row)); if ( FS::cdr->row_exists('uniqueid = ?', $uniqueid) ) { - warn "skipped duplicate row in page $page\n" if $DEBUG > 1; + warn "skipped duplicate row in page $page\n" if $DEBUG; next CDR; } @@ -180,7 +187,7 @@ local $ENV{'PERL_LWP_SSL_VERIFY_HOSTNAME'} = 0; ] ); warn "$me $method\n" if $DEBUG; - warn $request->as_string."\n" if $DEBUG > 1; + warn $request->as_string."\n" if $DEBUG; my $ua = LWP::UserAgent->new; my $response = $ua->request($request);