X-Git-Url: http://git.freeside.biz/gitweb/?a=blobdiff_plain;f=FS%2FFS%2Fpart_export%2Fnetsapiens.pm;h=83f0f01847de007600ffcf746c9f7173a800c6db;hb=e25080d6e892945c0031c964528f5d6458d95dc9;hp=332edccc0426452a5dc0bc1866ceef3a21f0d646;hpb=b791eaffd0526bdbf4eb011d6ca6620816e7482d;p=freeside.git diff --git a/FS/FS/part_export/netsapiens.pm b/FS/FS/part_export/netsapiens.pm index 332edccc0..83f0f0184 100644 --- a/FS/FS/part_export/netsapiens.pm +++ b/FS/FS/part_export/netsapiens.pm @@ -21,7 +21,7 @@ tie my %options, 'Tie::IxHash', ; %info = ( - 'svc' => 'svc_phone', + 'svc' => [ 'svc_phone', ], # 'part_device', 'desc' => 'Provision phone numbers to NetSapiens', 'options' => \%options, 'notes' => <<'END' @@ -72,10 +72,15 @@ sub _ns_command { $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); - my $domain = $self->option('domain'); + my $domain = $self->ns_domain($svc_phone); my $phonenum = $svc_phone->phonenum; "/domains_config/$domain/subscriber_config/$phonenum"; @@ -91,7 +96,7 @@ sub ns_registrar { 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; @@ -121,7 +126,7 @@ sub ns_device { 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; @@ -238,7 +243,7 @@ sub _export_unsuspend { 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; @@ -256,7 +261,7 @@ sub export_device_insert { #'notes' => 'server' => 'SiPbx', - 'domain' => $self->option('domain'), + 'domain' => $domain, 'brand' => $phone_device->part_device->devicename,