TT#68855 support different transport on perm registrations

* fix delete perm registration: subscriber needs to exists
  move delete before deletion of domain
* bench.sh: obey PROFILE environment variable
* bin/config_debug.pl: set tcp for one of the extra_sockets

Change-Id: I4650058f22ffcac68fa44913e1b03ecf090c2f28
changes/59/41459/2
Victor Seva 5 years ago
parent 8e19a04311
commit 5872e2130c

@ -1,6 +1,6 @@
#!/bin/bash
SKIP_CONFIG=false
PROFILE=CE
PROFILE="${PROFILE:-CE}"
GROUP="${GROUP:-scenarios}"
usage() {

@ -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

@ -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';

@ -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";

@ -2,7 +2,7 @@
testuser1003@spce.test:
- nat: false
contact: sip:127.3.0.5:8008
socket: sip:127.3.0.1:5074
path: <sip:lb@127.0.0.1:5060;lr;socket=sip:127.3.0.1:5074>
socket: tcp:127.3.0.1:5074
path: <sip:lb@127.0.0.1:5060;lr;socket=tcp:127.3.0.1:5074>
q: 0.5
expires: 1977-07-26 23:47:37

@ -39,3 +39,4 @@ scenarios:
username: testuser1003
domain: spce.test
register: permanent
proto: tcp

@ -2,7 +2,7 @@
testuser1003@spce.test:
- nat: false
contact: sip:127.3.0.5:8008
socket: sip:127.3.0.1:5074
path: <sip:lb@127.0.0.1:5060;lr;socket=sip:127.3.0.1:5074>
socket: tcp:127.3.0.1:5074
path: <sip:lb@127.0.0.1:5060;lr;socket=tcp:127.3.0.1:5074>
q: 0.5
expires: 1977-07-26 23:47:37

@ -39,3 +39,4 @@ scenarios:
username: testuser1003
domain: spce.test
register: permanent
proto: tcp

@ -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}

Loading…
Cancel
Save