X-Git-Url: http://git.freeside.biz/gitweb/?a=blobdiff_plain;f=FS%2FFS%2Fpart_export%2Fphone_shellcommands.pm;h=3f01de36b73606f13bf2e603da1e8fefa0fce61d;hb=38e34bbc53a4222c7507e95914e1364a5a74623f;hp=161ffe0f5a03ef53b80fdf992e1b499d94245918;hpb=f3e0ac2b009c4edd5692cb587ff709dac2223ebe;p=freeside.git diff --git a/FS/FS/part_export/phone_shellcommands.pm b/FS/FS/part_export/phone_shellcommands.pm index 161ffe0f5..3f01de36b 100644 --- a/FS/FS/part_export/phone_shellcommands.pm +++ b/FS/FS/part_export/phone_shellcommands.pm @@ -5,6 +5,7 @@ use vars qw(@ISA %info); use Tie::IxHash; use String::ShellQuote; use FS::part_export; +use Carp qw(carp); @ISA = qw(FS::part_export); @@ -52,7 +53,10 @@ old_ for replace operations):
  • $pin - Personal identification number
  • $cust_name - Customer name (quoted for the shell)
  • $pkgnum - Internal package number +
  • $custnum - Internal customer number +
  • $phone_name - Phone name (quoted for the shell)
  • $mac_addr - MAC address (Device MAC address insert and delete commands only) +
  • $devicename - Device type (Device type insert and delete commands only) END ); @@ -82,14 +86,16 @@ sub _export_unsuspend { sub export_device_insert { my( $self, $svc_phone, $phone_device ) = @_; $self->_export_command('mac_insert', $svc_phone, - 'mac_addr'=>$phone_device->mac_addr + mac_addr => $phone_device->mac_addr, + devicename => $phone_device->part_device->devicename, ); } sub export_device_delete { my( $self, $svc_phone, $phone_device ) = @_; $self->_export_command('mac_delete', $svc_phone, - 'mac_addr'=>$phone_device->mac_addr + mac_addr => $phone_device->mac_addr, + devicename => $phone_device->part_device->devicename, ); } @@ -98,6 +104,12 @@ sub _export_command { my $command = $self->option($action); return '' if $command =~ /^\s*$/; + if ( $FS::svc_Common::noexport_hack ) { + carp "_export_command($action) suppressed by noexport_hack" + if $self->option('debug'); + return; + } + #set variable for the command no strict 'vars'; { @@ -107,9 +119,11 @@ sub _export_command { } my $cust_pkg = $svc_phone->cust_svc->cust_pkg; my $pkgnum = $cust_pkg ? $cust_pkg->pkgnum : ''; + my $custnum = $cust_pkg ? $cust_pkg->custnum : ''; my $cust_name = $cust_pkg ? $cust_pkg->cust_main->name : ''; $cust_name = shell_quote $cust_name; my $sip_password = shell_quote $svc_phone->sip_password; + my $phone_name = shell_quote $svc_phone->phone_name; #done setting variables for the command $self->shellcommands_queue( $svc_phone->svcnum, @@ -133,8 +147,10 @@ sub _export_replace { my $old_cust_pkg = $old->cust_svc->cust_pkg; my $old_pkgnum = $old_cust_pkg ? $old_cust_pkg->pkgnum : ''; + my $old_custnum = $old_cust_pkg ? $old_cust_pkg->custnum : ''; my $cust_pkg = $new->cust_svc->cust_pkg; my $new_pkgnum = $cust_pkg ? $cust_pkg->pkgnum : ''; + my $new_custnum = $new_cust_pkg ? $new_cust_pkg->custnum : ''; my $new_cust_name = $cust_pkg ? $cust_pkg->cust_main->name : ''; $new_cust_name = shell_quote $new_cust_name; #done setting variables for the command