diff --git a/bench.sh b/bench.sh index ad61e0a6..83919232 100755 --- a/bench.sh +++ b/bench.sh @@ -1,6 +1,6 @@ #!/bin/bash SKIP_CONFIG=false -PROFILE=CE +PROFILE="${PROFILE:-CE}" GROUP="${GROUP:-scenarios}" usage() { diff --git a/bin/check.sh b/bin/check.sh index 6c8d69f0..f459997d 100755 --- a/bin/check.sh +++ b/bin/check.sh @@ -238,6 +238,11 @@ create_voip_prefs() { # $1 domain delete_voip() { + if [ -f "${SCEN_CHECK_DIR}/registration.yml" ]; then + echo "$(date) - Deleting registrations" + "${BIN_DIR}/create_registrations.pl" -delete "${SCEN_CHECK_DIR}/registration.yml" + fi + /usr/bin/ngcp-delete-domain "$1" >/dev/null 2>&1 if [ -f "${SCEN_CHECK_DIR}/peer.yml" ]; then @@ -286,11 +291,6 @@ delete_voip() { echo "$(date) - Deleting soundsets" "${BIN_DIR}/create_soundsets.pl" -delete "${SCEN_CHECK_DIR}/soundsets.yml" fi - - if [ -f "${SCEN_CHECK_DIR}/registration.yml" ]; then - echo "$(date) - Deleting registrations" - "${BIN_DIR}/create_registrations.pl" -delete "${SCEN_CHECK_DIR}/registration.yml" - fi } release_appearance() { @@ -492,7 +492,7 @@ run_sipp() { if [ "${registration}" == "permanent" ]; then echo "$(date) - Update permanent reg:${subscriber} ${ip}:${PORT} info" if ! "${BIN_DIR}/update_perm_reg.pl" \ - "${subscriber}" "${ip}" "${PORT}"; + -t "${transport}" "${subscriber}" "${ip}" "${PORT}"; then error_helper "$(date) - error updating peer info" 15 fi diff --git a/bin/config_debug.pl b/bin/config_debug.pl index 74d3acbe..0a4ba2d6 100755 --- a/bin/config_debug.pl +++ b/bin/config_debug.pl @@ -109,7 +109,7 @@ else $yaml->{kamailio}{lb}{cfgt} = 'yes'; $yaml->{kamailio}{lb}{dns}{use_dns_cache} = 'off'; $yaml->{kamailio}{lb}{extra_sockets}->{test} = "udp:127.2.0.1:5064"; - $yaml->{kamailio}{lb}{extra_sockets}->{other} = "udp:127.3.0.1:5074"; + $yaml->{kamailio}{lb}{extra_sockets}->{other} = "tcp:127.3.0.1:5074"; $yaml->{kamailio}{proxy}{children} = $children if($children > 0); $yaml->{kamailio}{proxy}{cfgt} = 'yes'; $yaml->{sems}{cfgt} = 'yes'; diff --git a/bin/update_perm_reg.pl b/bin/update_perm_reg.pl index dc17b6a3..d33650c2 100755 --- a/bin/update_perm_reg.pl +++ b/bin/update_perm_reg.pl @@ -39,19 +39,21 @@ my $api = Sipwise::API->new($opts); $opts = $api->opts; sub usage { - return "Usage:\n$PROGRAM_NAME [-h]" . + return "Usage:\n$PROGRAM_NAME [-h] [-t transport]" . " subscriber IP PORT\n"; } my $help = 0; +my $trans = "udp"; GetOptions ("h|help" => \$help, - "d|debug" => \$opts->{verbose}) - or die("Error in command line arguments\n".usage()); + "d|debug" => \$opts->{verbose}, + "t|transport=s" => \$trans, +) or die("Error in command line arguments\n".usage()); die(usage()) unless (!$help); die("Wrong number of arguments\n".usage()) unless ($#ARGV == 2); -my $data = {ip=> $ARGV[1], port=>$ARGV[2]}; +my $data = {ip=> $ARGV[1], port=>$ARGV[2], transport=>$trans}; my ($subscriber, $domain) = split /@/, $ARGV[0]; sub do_update { @@ -66,6 +68,7 @@ sub do_update { print "registration[$r->{id}]: $r->{contact}\n"; if($r->{contact} =~ m/sip:$data->{ip}:/) { $r->{contact} = "sip:". $data->{ip}. ":" . $data->{port}; + $r->{contact} .= ";transport=". $data->{transport}; $api->set_subscriber_registration($r->{id}, $r) or die("Can't update permanent registration $r->{id}"); print "registration for ${ARGV[0]}[$r->{id}] updated to $r->{contact}\n"; diff --git a/scenarios/invite_perm_reg/registration.yml b/scenarios/invite_perm_reg/registration.yml index aec8a347..2efebe2f 100644 --- a/scenarios/invite_perm_reg/registration.yml +++ b/scenarios/invite_perm_reg/registration.yml @@ -2,7 +2,7 @@ testuser1003@spce.test: - nat: false contact: sip:127.3.0.5:8008 - socket: sip:127.3.0.1:5074 - path: + socket: tcp:127.3.0.1:5074 + path: q: 0.5 expires: 1977-07-26 23:47:37 diff --git a/scenarios/invite_perm_reg/scenario.yml b/scenarios/invite_perm_reg/scenario.yml index 5b1358c9..8c66796d 100644 --- a/scenarios/invite_perm_reg/scenario.yml +++ b/scenarios/invite_perm_reg/scenario.yml @@ -39,3 +39,4 @@ scenarios: username: testuser1003 domain: spce.test register: permanent + proto: tcp diff --git a/scenarios_pbx/invite_perm_reg/registration.yml b/scenarios_pbx/invite_perm_reg/registration.yml index aec8a347..2efebe2f 100644 --- a/scenarios_pbx/invite_perm_reg/registration.yml +++ b/scenarios_pbx/invite_perm_reg/registration.yml @@ -2,7 +2,7 @@ testuser1003@spce.test: - nat: false contact: sip:127.3.0.5:8008 - socket: sip:127.3.0.1:5074 - path: + socket: tcp:127.3.0.1:5074 + path: q: 0.5 expires: 1977-07-26 23:47:37 diff --git a/scenarios_pbx/invite_perm_reg/scenario.yml b/scenarios_pbx/invite_perm_reg/scenario.yml index b04f3cd7..89cfe144 100644 --- a/scenarios_pbx/invite_perm_reg/scenario.yml +++ b/scenarios_pbx/invite_perm_reg/scenario.yml @@ -39,3 +39,4 @@ scenarios: username: testuser1003 domain: spce.test register: permanent + proto: tcp diff --git a/set_config.sh b/set_config.sh index 117433d5..49f577bf 100755 --- a/set_config.sh +++ b/set_config.sh @@ -37,7 +37,7 @@ if ! ngcpcfg apply "config debug on via kamailio-config-tests" ; then echo "$(date) - ngcpcfg apply returned $?" error_flag=4 fi -echo "$(date) - Setting config debug on. Done[${error_flag}]" +echo "$(date) - Setting config[${GROUP}] debug on. Done[${error_flag}]" exit ${error_flag}