projects
/
freeside.git
/ blobdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
|
commitdiff
|
tree
raw
|
inline
| side by side
RT# 83450 - added fields interface and map_location to export
[freeside.git]
/
FS
/
FS
/
part_export
/
thinktel.pm
diff --git
a/FS/FS/part_export/thinktel.pm
b/FS/FS/part_export/thinktel.pm
index
d208523
..
9ab6455
100644
(file)
--- a/
FS/FS/part_export/thinktel.pm
+++ b/
FS/FS/part_export/thinktel.pm
@@
-7,7
+7,7
@@
use Tie::IxHash;
use URI::Escape;
use LWP::UserAgent;
use URI::Escape;
use URI::Escape;
use LWP::UserAgent;
use URI::Escape;
-use
JSON
;
+use
Cpanel::JSON::XS
;
use FS::Record qw( qsearch qsearchs );
use FS::Record qw( qsearch qsearchs );
@@
-131,7
+131,7
@@
sub check_svc { # check the service for validity
'';
}
'';
}
-sub export_insert {
+sub
_
export_insert {
my($self, $svc_x) = (shift, shift);
my $error = $self->check_svc($svc_x);
my($self, $svc_x) = (shift, shift);
my $error = $self->check_svc($svc_x);
@@
-214,7
+214,7
@@
sub insert_gateway {
my $content = {
ContactIPAddress => $svc_x->ip_addr,
ContactPort => 5060,
my $content = {
ContactIPAddress => $svc_x->ip_addr,
ContactPort => 5060,
- IPMatchRequired =>
JSON
::true,
+ IPMatchRequired =>
Cpanel::JSON::XS
::true,
SipDomainName => $self->option('proxy'),
SipTrunkType => $self->option('trunktype'),
SipUsername => $trunknum,
SipDomainName => $self->option('proxy'),
SipTrunkType => $self->option('trunktype'),
SipUsername => $trunknum,
@@
-270,7
+270,7
@@
sub insert_trunk {
my $endpoint = "SipTrunks";
my $content = {
Account => $self->option('username'),
my $endpoint = "SipTrunks";
my $content = {
Account => $self->option('username'),
- Enabled =>
JSON
::true,
+ Enabled =>
Cpanel::JSON::XS
::true,
Label => $svc_x->phone_name_or_cust,
Locale => $locales{$self->option('locale')},
MaxChannels => $svc_x->max_simultaneous,
Label => $svc_x->phone_name_or_cust,
Locale => $locales{$self->option('locale')},
MaxChannels => $svc_x->max_simultaneous,
@@
-294,7
+294,7
@@
sub insert_trunk {
}
}
}
}
-sub export_replace {
+sub
_
export_replace {
my ($self, $svc_new, $svc_old) = @_;
my $error = $self->check_svc($svc_new);
my ($self, $svc_new, $svc_old) = @_;
my $error = $self->check_svc($svc_new);
@@
-325,7
+325,7
@@
sub replace_trunk {
my $self = FS::part_export->by_key($exportnum);
my $svc_x = FS::svc_phone->by_key($svcnum);
my $self = FS::part_export->by_key($exportnum);
my $svc_x = FS::svc_phone->by_key($svcnum);
- my $enabled =
JSON
::is_bool( $self->cust_svc->cust_pkg->susp == 0 );
+ my $enabled =
Cpanel::JSON::XS
::is_bool( $self->cust_svc->cust_pkg->susp == 0 );
my $phonenum = $svc_x->phonenum;
my $endpoint = "SipTrunks/$phonenum";
my $phonenum = $svc_x->phonenum;
my $endpoint = "SipTrunks/$phonenum";
@@
-398,7
+398,7
@@
sub replace_gateway {
ContactIPAddress => $svc_x->ip_addr,
ContactPort => 5060,
ID => $binding_id,
ContactIPAddress => $svc_x->ip_addr,
ContactPort => 5060,
ID => $binding_id,
- IPMatchRequired =>
JSON
::true,
+ IPMatchRequired =>
Cpanel::JSON::XS
::true,
Name => $binding_name,
SipDomainName => $self->option('proxy'),
SipTrunkType => $self->option('trunktype'),
Name => $binding_name,
SipDomainName => $self->option('proxy'),
SipTrunkType => $self->option('trunktype'),
@@
-412,7
+412,7
@@
sub replace_gateway {
}
}
}
}
-sub export_delete {
+sub
_
export_delete {
my ($self, $svc_x) = (shift, shift);
my $role = $self->svc_role($svc_x)
my ($self, $svc_x) = (shift, shift);
my $role = $self->svc_role($svc_x)
@@
-606,7
+606,7
@@
have a 'Message' element.
sub api_request {
my $self = shift;
my ($method, $endpoint, $content) = @_;
sub api_request {
my $self = shift;
my ($method, $endpoint, $content) = @_;
- my $json =
JSON
->new->canonical(1); # hash keys are ordered
+ my $json =
Cpanel::JSON::XS
->new->canonical(1); # hash keys are ordered
$DEBUG ||= 1 if $self->option('debug');
$DEBUG ||= 1 if $self->option('debug');