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;
'login' => { label=>'VoipNow client login' },
'password' => { label=>'VoipNow client password' },
'country' => { label=>'Country (two-letter code)' },
+ 'cache_time' => { label=>'Cache lifetime (seconds)' },
;
%info = (
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;
}
+sub can_get_dids { 1; }
+
sub get_dids {
my $self = shift;
my %opt = @_;
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(