projects
/
freeside.git
/ blobdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
|
commitdiff
|
tree
raw
|
inline
| side by side
enable package class condition for invoices, #14499
[freeside.git]
/
FS
/
FS
/
part_export
/
netsapiens.pm
diff --git
a/FS/FS/part_export/netsapiens.pm
b/FS/FS/part_export/netsapiens.pm
index
b806894
..
31d16a8
100644
(file)
--- a/
FS/FS/part_export/netsapiens.pm
+++ b/
FS/FS/part_export/netsapiens.pm
@@
-1,7
+1,6
@@
package FS::part_export::netsapiens;
use vars qw(@ISA $me %info);
package FS::part_export::netsapiens;
use vars qw(@ISA $me %info);
-use URI;
use MIME::Base64;
use Tie::IxHash;
use FS::part_export;
use MIME::Base64;
use Tie::IxHash;
use FS::part_export;
@@
-72,10
+71,15
@@
sub _ns_command {
$ns;
}
$ns;
}
+sub ns_domain {
+ my($self, $svc_phone) = (shift, shift);
+ $svc_phone->domain || $self->option('domain');
+}
+
sub ns_subscriber {
my($self, $svc_phone) = (shift, shift);
sub ns_subscriber {
my($self, $svc_phone) = (shift, shift);
- my $domain = $self->
option('domain'
);
+ my $domain = $self->
ns_domain($svc_phone
);
my $phonenum = $svc_phone->phonenum;
"/domains_config/$domain/subscriber_config/$phonenum";
my $phonenum = $svc_phone->phonenum;
"/domains_config/$domain/subscriber_config/$phonenum";
@@
-91,7
+95,7
@@
sub ns_registrar {
sub ns_devicename {
my( $self, $svc_phone ) = (shift, shift);
sub ns_devicename {
my( $self, $svc_phone ) = (shift, shift);
- my $domain = $self->
option('domain'
);
+ my $domain = $self->
ns_domain($svc_phone
);
#my $countrycode = $svc_phone->countrycode;
my $phonenum = $svc_phone->phonenum;
#my $countrycode = $svc_phone->countrycode;
my $phonenum = $svc_phone->phonenum;
@@
-106,7
+110,7
@@
sub ns_dialplan {
my $phonenum = $svc_phone->phonenum;
#"/dialplans/DID+Table/dialplan_config/sip:$countrycode$phonenum\@*"
my $phonenum = $svc_phone->phonenum;
#"/dialplans/DID+Table/dialplan_config/sip:$countrycode$phonenum\@*"
- "/d
ialplans/DID+Table/dialplan_config/sip:$phonenum\@*"
+ "/d
omains_config/admin-only/dialplans/DID+Table/dialplan_config/sip:$phonenum\@*,*,*,*,*,*,*";
}
sub ns_device {
}
sub ns_device {
@@
-121,7
+125,7
@@
sub ns_device {
sub ns_create_or_update {
my($self, $svc_phone, $dial_policy) = (shift, shift, shift);
sub ns_create_or_update {
my($self, $svc_phone, $dial_policy) = (shift, shift, shift);
- my $domain = $self->
option('domain'
);
+ my $domain = $self->
ns_domain($svc_phone
);
#my $countrycode = $svc_phone->countrycode;
my $phonenum = $svc_phone->phonenum;
#my $countrycode = $svc_phone->countrycode;
my $phonenum = $svc_phone->phonenum;
@@
-238,12
+242,10
@@
sub _export_unsuspend {
sub export_device_insert {
my( $self, $svc_phone, $phone_device ) = (shift, shift, shift);
sub export_device_insert {
my( $self, $svc_phone, $phone_device ) = (shift, shift, shift);
-
#my $domain = $self->option('domain'
);
+
my $domain = $self->ns_domain($svc_phone
);
my $countrycode = $svc_phone->countrycode;
my $phonenum = $svc_phone->phonenum;
my $countrycode = $svc_phone->countrycode;
my $phonenum = $svc_phone->phonenum;
- my $device = $self->ns_devicename($svc_phone);
-
my $ns = $self->ns_device_command(
'PUT', $self->ns_device($svc_phone, $phone_device),
'line1_enable' => 'yes',
my $ns = $self->ns_device_command(
'PUT', $self->ns_device($svc_phone, $phone_device),
'line1_enable' => 'yes',
@@
-256,7
+258,7
@@
sub export_device_insert {
#'notes' =>
'server' => 'SiPbx',
#'notes' =>
'server' => 'SiPbx',
- 'domain' => $
self->option('domain')
,
+ 'domain' => $
domain
,
'brand' => $phone_device->part_device->devicename,
'brand' => $phone_device->part_device->devicename,