projects
/
freeside.git
/ commitdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
| commitdiff |
tree
raw
|
patch
|
inline
| side by side (parent:
e3a2ca0
)
VoipNow export, minor fixes
author
mark
<mark>
Tue, 1 Mar 2011 04:38:31 +0000
(
04:38
+0000)
committer
mark
<mark>
Tue, 1 Mar 2011 04:38:31 +0000
(
04:38
+0000)
FS/FS/part_export/voipnow_did.pm
patch
|
blob
|
history
bin/populate-areacodes
patch
|
blob
|
history
diff --git
a/FS/FS/part_export/voipnow_did.pm
b/FS/FS/part_export/voipnow_did.pm
index
cd13a44
..
514db8d
100644
(file)
--- a/
FS/FS/part_export/voipnow_did.pm
+++ b/
FS/FS/part_export/voipnow_did.pm
@@
-5,7
+5,6
@@
use Tie::IxHash;
use FS::Record qw(qsearch qsearchs dbh);
use FS::part_export;
use FS::areacode;
use FS::Record qw(qsearch qsearchs dbh);
use FS::part_export;
use FS::areacode;
-use XML::Writer;
use XML::Simple 'XMLin';
use Net::SSLeay 'post_https';
use Cache::FileCache;
use XML::Simple 'XMLin';
use Net::SSLeay 'post_https';
use Cache::FileCache;
@@
-19,6
+18,7
@@
tie my %options, 'Tie::IxHash',
'login' => { label=>'VoipNow client login' },
'password' => { label=>'VoipNow client password' },
'country' => { label=>'Country (two-letter code)' },
'login' => { label=>'VoipNow client login' },
'password' => { label=>'VoipNow client password' },
'country' => { label=>'Country (two-letter code)' },
+ 'cache_time' => { label=>'Cache lifetime (seconds)' },
;
%info = (
;
%info = (
@@
-38,7
+38,8
@@
sub did_cache {
my $self = shift;
$CACHE ||= new Cache::FileCache( {
'namespace' => __PACKAGE__,
my $self = shift;
$CACHE ||= new Cache::FileCache( {
'namespace' => __PACKAGE__,
- 'default_expires_in' => 300,
+ 'default_expires_in' => $self->option('cache_time') || 300,
+ 'cache_root' => $FS::UID::cache_dir.'/cache'.$FS::UID::datasrc,
} );
return $CACHE->get($self->exportnum) || $self->reload_cache;
}
} );
return $CACHE->get($self->exportnum) || $self->reload_cache;
}
@@
-259,6
+260,9
@@
sub voipnow_command {
my $host = $self->machine;
my $path = "/soap2/${endpoint}_agent.php";
my $host = $self->machine;
my $path = "/soap2/${endpoint}_agent.php";
+ eval "use XML::Writer";
+ die $@ if $@;
+
warn "[$method] constructing request\n" if $DEBUG;
my $soap_request;
my $writer = XML::Writer->new(
warn "[$method] constructing request\n" if $DEBUG;
my $soap_request;
my $writer = XML::Writer->new(
diff --git
a/bin/populate-areacodes
b/bin/populate-areacodes
index
f5e8ae1
..
7e4c52f
100644
(file)
--- a/
bin/populate-areacodes
+++ b/
bin/populate-areacodes
@@
-40,7
+40,7
@@
while(<$fh>) {
}
my $areacode = FS::areacode->new({
}
my $areacode = FS::areacode->new({
- '
npa'
=> $npa,
+ '
code'
=> $npa,
'state' => $statecode,
'country' => $countrycode,
'description' => $desc,
'state' => $statecode,
'country' => $countrycode,
'description' => $desc,