diff --git a/bin/check.sh b/bin/check.sh index 6f5be845..c5b65fd3 100755 --- a/bin/check.sh +++ b/bin/check.sh @@ -40,7 +40,7 @@ function check_test # $1 domain function create_voip { - ${BIN_DIR}/create_domain.pl $1 + /usr/bin/ngcp-create_domain $1 if [[ $? -ne 0 ]]; then echo "$(date) - Cannot create domain" exit 1 @@ -76,7 +76,7 @@ function create_voip_prefs # $1 domain function delete_voip { - ${BIN_DIR}/delete_domain.pl $1 + /usr/bin/ngcp-delete_domain $1 } function delete_locations diff --git a/bin/create_domain.pl b/bin/create_domain.pl deleted file mode 100755 index 7d8bdb52..00000000 --- a/bin/create_domain.pl +++ /dev/null @@ -1,62 +0,0 @@ -#!/usr/bin/perl -use strict; -use warnings; - -use Data::Dumper; -use Getopt::Std; -use Sipwise::Provisioning::Billing; - -our %CONFIG = ( - admin => 'administrator', - password => 'administrator', - ); - -die usage() unless ($#ARGV == 0); - -sub main { - my ($bprov) = @_; - call_prov( $bprov, 'create_domain', - { - domain => $ARGV[0] - } - ); - exit; -} - -sub call_prov { - # scalar, scalar, hash-ref - my ($bprov, $function, $parameter) = @_; - my $result; - - eval { - $result = $bprov->handle_request( $function, - { - authentication => { - type => 'admin', - username => $CONFIG{admin}, - password => $CONFIG{password}, - }, - parameters => $parameter, - }); - }; - - if($@) { - if(ref $@ eq 'SOAP::Fault') { - die "Billing\::$function failed: ". $@->faultstring; - } else { - die "Billing\::$function failed: $@"; - } - } - - return $result; -} - -sub usage { - die "Usage:\n$0 \n". - "\ne.g.: $0 sip.sipwise.com\n"; -} - -my $bprov = Sipwise::Provisioning::Billing->new(); - -main($bprov); - diff --git a/bin/delete_domain.pl b/bin/delete_domain.pl deleted file mode 100755 index a27a94c0..00000000 --- a/bin/delete_domain.pl +++ /dev/null @@ -1,97 +0,0 @@ -#!/usr/bin/perl -use strict; -use warnings; - -use Data::Dumper; -use Getopt::Std; -use Sipwise::Provisioning::Billing; - -our %CONFIG = ( - admin => 'administrator', - password => 'administrator', - ); - -die usage() unless ($#ARGV == 0); - -sub main { - my ($bprov) = @_; - - call_prov_exists( $bprov, 'get_domain', - { - domain => $ARGV[0] - } - ); - call_prov( $bprov, 'delete_domain', - { - domain => $ARGV[0] - } - ); - exit; -} - -sub call_prov_exists { - # scalar, scalar, hash-ref - my ($bprov, $function, $parameter) = @_; - my $result; - - eval { - $result = $bprov->handle_request( $function, - { - authentication => { - type => 'admin', - username => $CONFIG{admin}, - password => $CONFIG{password}, - }, - parameters => $parameter, - }); - }; - - if($@) { - if(ref $@ eq 'SOAP::Fault') { - exit 0 if($@->faultstring =~ 'unknown domain'); - die "Billing\::$function failed: ". $@->faultstring; - } else { - die "Billing\::$function failed: $@"; - } - } - - return $result; -} - -sub call_prov { - # scalar, scalar, hash-ref - my ($bprov, $function, $parameter) = @_; - my $result; - - eval { - $result = $bprov->handle_request( $function, - { - authentication => { - type => 'admin', - username => $CONFIG{admin}, - password => $CONFIG{password}, - }, - parameters => $parameter, - }); - }; - - if($@) { - if(ref $@ eq 'SOAP::Fault') { - die "Billing\::$function failed: ". $@->faultstring; - } else { - die "Billing\::$function failed: $@"; - } - } - - return $result; -} - -sub usage { - die "Usage:\n$0 \n". - "\ne.g.: $0 sip.sipwise.com\n"; -} - -my $bprov = Sipwise::Provisioning::Billing->new(); - -main($bprov); - diff --git a/debian/control b/debian/control index 5e28f2b9..0d2b4d3f 100644 --- a/debian/control +++ b/debian/control @@ -9,6 +9,7 @@ Homepage: http://www.sipwise.com/ Package: kamailio-config-tests Architecture: all Depends: ${misc:Depends}, + ngcp-ossbss-clients-perl, python-yaml, libgraphviz-perl, libtemplate-perl,