X-Git-Url: http://git.freeside.biz/gitweb/?p=freeside.git;a=blobdiff_plain;f=FS%2FFS%2Fpart_export%2Fsipwise.pm;h=287e604bd924a188c49cb11f43bb259205949f72;hp=5cbe89ce0f3c229e9260f6e43a561477672b397c;hb=5372897f367498972c96f5494e142e6e11b29eb8;hpb=fd6aec2041579fbb5d790371c5e5e5152e3075ce diff --git a/FS/FS/part_export/sipwise.pm b/FS/FS/part_export/sipwise.pm index 5cbe89ce0..287e604bd 100644 --- a/FS/FS/part_export/sipwise.pm +++ b/FS/FS/part_export/sipwise.pm @@ -5,6 +5,7 @@ use strict; use FS::Record qw(qsearch qsearchs dbh); use Tie::IxHash; +use IO::Socket::SSL; use LWP::UserAgent; use URI; use Cpanel::JSON::XS; @@ -13,6 +14,7 @@ use FS::Misc::DateTime qw(parse_datetime); use DateTime; use Number::Phone; use Try::Tiny; +use Carp qw(carp); our $me = '[sipwise]'; our $DEBUG = 0; @@ -27,7 +29,7 @@ tie my %options, 'Tie::IxHash', default => 'default', }, 'subscriber_profile_set' => { - label => 'Subscriber profile set name', + label => 'Subscriber profile set name (optional)', }, 'reseller_id' => { label => 'Reseller ID' }, 'ssl_no_verify' => { label => 'Skip SSL certificate validation', @@ -63,12 +65,10 @@ our %info = ( will receive calls at this number.

-

Export options: -

END ); -sub export_insert { +sub _export_insert { my($self, $svc_x) = (shift, shift); local $SIG{__DIE__}; @@ -89,7 +89,7 @@ sub export_insert { ''; } -sub export_replace { +sub _export_replace { my ($self, $svc_new, $svc_old) = @_; local $SIG{__DIE__}; @@ -111,7 +111,7 @@ sub export_replace { ''; } -sub export_delete { +sub _export_delete { my ($self, $svc_x) = (shift, shift); local $SIG{__DIE__}; @@ -136,7 +136,7 @@ sub export_delete { # logic to set subscribers to locked/active is in replace_subscriber -sub export_suspend { +sub _export_suspend { my $self = shift; my $svc_x = shift; my $role = $self->svc_role($svc_x); @@ -149,7 +149,7 @@ sub export_suspend { ''; } -sub export_unsuspend { +sub _export_unsuspend { my $self = shift; my $svc_x = shift; my $role = $self->svc_role($svc_x); @@ -296,6 +296,13 @@ previously, and the one it's linked to now. sub export_did { my $self = shift; my ($new, $old) = @_; + + if ( $FS::svc_Common::noexport_hack ) { + carp 'export_did() suppressed by noexport_hack' + if $self->option('debug') || $DEBUG; + return; + } + if ( $old and $new->forward_svcnum ne $old->forward_svcnum ) { my $old_svc_acct = $self->acct_for_did($old); $self->replace_subscriber( $old_svc_acct ) if $old_svc_acct; @@ -803,7 +810,10 @@ sub ua { $self->{_ua} ||= do { my @opt; if ( $self->option('ssl_no_verify') ) { - push @opt, ssl_opts => { verify_hostname => 0 }; + push @opt, ssl_opts => { + verify_hostname => 0, + SSL_verify_mode => IO::Socket::SSL::SSL_VERIFY_NONE, + }; } my $ua = LWP::UserAgent->new(@opt); $ua->credentials(