projects
/
freeside.git
/ blobdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
|
commitdiff
|
tree
raw
|
inline
| side by side
RT#29296: API stuff: Add new locations [added eval field specs, debugged]
[freeside.git]
/
FS
/
FS
/
part_export
/
pbxware.pm
diff --git
a/FS/FS/part_export/pbxware.pm
b/FS/FS/part_export/pbxware.pm
index
3da4c2a
..
467b79f
100644
(file)
--- a/
FS/FS/part_export/pbxware.pm
+++ b/
FS/FS/part_export/pbxware.pm
@@
-5,7
+5,7
@@
use strict;
use Tie::IxHash;
use LWP::UserAgent;
use Tie::IxHash;
use LWP::UserAgent;
-use
JSON
;
+use
Cpanel::JSON::XS
;
use HTTP::Request::Common;
use Digest::MD5 qw(md5_hex);
use FS::Record qw(dbh);
use HTTP::Request::Common;
use Digest::MD5 qw(md5_hex);
use FS::Record qw(dbh);
@@
-140,6
+140,11
@@
sub import_cdrs {
uniqueid => $uniqueid,
);
@hash{@names} = @$row;
uniqueid => $uniqueid,
);
@hash{@names} = @$row;
+ # strip non-numeric junk that sometimes gets appended to these (it
+ # causes problems creating Freeside detail records)
+ foreach (qw(src dst)) {
+ $hash{$_} =~ s/\D*$//;
+ }
my $cdr = FS::cdr->new(\%hash);
$error = $cdr->insert;
my $cdr = FS::cdr->new(\%hash);
$error = $cdr->insert;
@@
-163,6
+168,10
@@
sub api_request {
my $self = shift;
my ($method, $content) = @_;
$DEBUG ||= 1 if $self->option('debug');
my $self = shift;
my ($method, $content) = @_;
$DEBUG ||= 1 if $self->option('debug');
+
+# kludge to curb excessive paranoia in LWP 6.0+
+local $ENV{'PERL_LWP_SSL_VERIFY_HOSTNAME'} = 0;
+
my $url = 'https://' . $self->machine;
my $request = POST($url,
[ %$content,
my $url = 'https://' . $self->machine;
my $request = POST($url,
[ %$content,