X-Git-Url: http://git.freeside.biz/gitweb/?a=blobdiff_plain;f=FS%2FFS%2Fpart_export%2Fbandwidth_com.pm;h=6d868e64068a9ccac07df1b6b61d44b6645d8120;hb=674cb2d9d7105f4cc2871539b2e9f7088cdaa750;hp=7bb26e08d3b0d404c7286a6139626bf755db2733;hpb=0aa5e2e2028e3d4b717302173d397daa91037683;p=freeside.git diff --git a/FS/FS/part_export/bandwidth_com.pm b/FS/FS/part_export/bandwidth_com.pm index 7bb26e08d..6d868e640 100644 --- a/FS/FS/part_export/bandwidth_com.pm +++ b/FS/FS/part_export/bandwidth_com.pm @@ -56,6 +56,16 @@ with this IP address exists, one will be created.

If you are operating a central SIP gateway to receive traffic for all (or a subset of) customers, you should configure a phone service with a fixed value, or a list of fixed values, for the sip_server field.

+

To find your account ID and site ID: +

+

END ); @@ -151,43 +161,46 @@ sub can_get_dids { 1 } sub get_dids_npa_select { 1 } sub get_dids { - local $SIG{__DIE__}; my $self = shift; my %opt = @_; my ($exportnum) = $self->exportnum =~ /^(\d+)$/; - return [] if $opt{'tollfree'}; # we'll come back to this + try { + return [] if $opt{'tollfree'}; # we'll come back to this - my ($state, $npa, $nxx) = @opt{'state', 'areacode', 'exchange'}; + my ($state, $npa, $nxx) = @opt{'state', 'areacode', 'exchange'}; - if ( $nxx ) { + if ( $nxx ) { - die "areacode required\n" unless $npa; - my $limit = $self->option('num_dids') || 20; - my $result = $self->api_get('availableNumbers', [ - 'npaNxx' => $npa.$nxx, - 'quantity' => $limit, - 'LCA' => 'false', - # find only those that match the NPA-NXX, not those thought to be in - # the same local calling area. though that might be useful. - ]); - return [ $result->findnodes('//TelephoneNumber')->to_literal_list ]; + die "areacode required\n" unless $npa; + my $limit = $self->option('num_dids') || 20; + my $result = $self->api_get('availableNumbers', [ + 'npaNxx' => $npa.$nxx, + 'quantity' => $limit, + 'LCA' => 'false', + # find only those that match the NPA-NXX, not those thought to be in + # the same local calling area. though that might be useful. + ]); + return [ $result->findnodes('//TelephoneNumber')->to_literal_list ]; - } elsif ( $npa ) { + } elsif ( $npa ) { - return $self->npanxx_cache($npa); + return $self->npanxx_cache($npa); - } elsif ( $state ) { + } elsif ( $state ) { - return $self->npa_cache($state); + return $self->npa_cache($state); - } else { # something's wrong + } else { # something's wrong - warn "get_dids called with no arguments"; - return []; + warn "get_dids called with no arguments"; + return []; + } + } catch { + die "$me $_\n"; } } @@ -427,6 +440,7 @@ sub host { $self->{_host} ||= do { my $host = 'dashboard.bandwidth.com'; $host = "test.$host" if $self->option('test'); + $host; }; }