From 28b6d7d7f1abb741a90f89f440006cc591c0d80d Mon Sep 17 00:00:00 2001 From: Victor Seva Date: Mon, 10 May 2021 14:12:24 +0200 Subject: [PATCH] TT#116100 permanent registrations * just obey what is defined at scenario.yml * bin/create_registrations.pl: add transport to contact Change-Id: Ia851594064f348b778f1be0979b345090a303d20 --- bin/create_registrations.pl | 3 ++- bin/scenario.pl | 11 ++++++++++- 2 files changed, 12 insertions(+), 2 deletions(-) diff --git a/bin/create_registrations.pl b/bin/create_registrations.pl index 38f5bdc6..ce72eb78 100755 --- a/bin/create_registrations.pl +++ b/bin/create_registrations.pl @@ -95,7 +95,8 @@ sub contact { if( $resp->{username} eq $subscriber && $resp->{domain} eq $domain) { - return "sip:$resp->{ip}:$resp->{port}"; + $resp->{proto} = 'udp' unless(defined($resp->{proto})); + return "sip:$resp->{ip}:$resp->{port};transport=$resp->{proto}"; } } } diff --git a/bin/scenario.pl b/bin/scenario.pl index ccfd4d6a..7af4b63c 100755 --- a/bin/scenario.pl +++ b/bin/scenario.pl @@ -284,7 +284,11 @@ sub network_data foreach my $resp (@{$scen->{responders}}) { my $rdata = {}; - if(defined($resp->{peer_host})) { + if(defined($resp->{register}) && $resp->{register} eq "permanent") { + $rdata->{ip} = $resp->{ip}; + $rdata->{port} = $resp->{port}; + $rdata->{mport} = $resp->{mport}; + } elsif(defined($resp->{peer_host})) { $rdata->{peer} = $resp->{peer_host}; $rdata = $hm->merge($rdata, peer_data($resp->{peer_host})); } else { @@ -299,6 +303,11 @@ sub network_data $resp->{port} = $rdata->{port}; $resp->{mport} = $rdata->{mport}; if(defined($resp->{domain})) { $rdata->{domain} = $resp->{domain}; } + if(defined($resp->{register})) { + $rdata->{register} = $resp->{register}; + $resp->{proto} = 'udp' unless(defined($resp->{proto})); + $rdata->{proto} = $resp->{proto}; + } push @{$data->{responders}}, $rdata; } push @{$ids->{scenarios}}, $data;