From 874667ff398d07a5a7e3f5ef41d4e525103aaca9 Mon Sep 17 00:00:00 2001 From: Victor Seva Date: Thu, 29 Sep 2016 14:43:15 +0200 Subject: [PATCH] TT#4110 add support for pbx scenario.yml: - is_pbx_pilot - pbx_extension Change-Id: I57d57d936162c56dbf3649656a0654b0d0c654ca --- bin/create_subscribers.pl | 2 ++ bin/scenario.pl | 5 +++-- 2 files changed, 5 insertions(+), 2 deletions(-) diff --git a/bin/create_subscribers.pl b/bin/create_subscribers.pl index ef55cdf8..a2bc0ad2 100755 --- a/bin/create_subscribers.pl +++ b/bin/create_subscribers.pl @@ -61,6 +61,8 @@ sub get_data { customer_id => $val->{customer_id}, username => $val->{username}, password => $val->{password}, + is_pbx_pilot => $val->{is_pbx_pilot}, + pbx_extension => $val->{pbx_extension}, primary_number => { cc => $val->{cc}, ac => $val->{ac}, diff --git a/bin/scenario.pl b/bin/scenario.pl index aad3431f..05e35974 100755 --- a/bin/scenario.pl +++ b/bin/scenario.pl @@ -85,6 +85,7 @@ sub get_subs_info my $subs = $data_sub->{$domain}->{$username}; $data->{password} = $subs->{password}; eval { $data->{number} = $subs->{cc}.$subs->{ac}.$subs->{sn}; } unless defined($presence); + $data->{'pbx_extension'} = $subs->{'pbx_extension'}; } else { @@ -128,7 +129,7 @@ sub generate $_->{password} = "wrongpass"; } my $auth = "[authentication username=$_->{username} password=$_->{password}]"; - my $csv_data = [$_->{username}, $auth, $_->{domain}, $test_uuid]; + my $csv_data = [$_->{username}, $auth, $_->{domain}, $test_uuid, $_->{'pbx_extension'}]; $csv->{caller}->print($io_caller, $csv_data); $csv_data = ["sipp_scenario".sprintf("%02i", $id).".xml", $_->{proto}, $_->{ip}]; $csv->{scenario}->print($io_scenario, $csv_data); @@ -148,7 +149,7 @@ sub generate # by default proto is udp $_->{proto} = "udp" unless defined($_->{proto}); $auth = "[authentication username=$_->{username} password=$_->{password}]"; - $csv_data = [$_->{username}, $_->{number}, $auth, $_->{domain}, $test_uuid]; + $csv_data = [$_->{username}, $_->{number}, $auth, $_->{domain}, $test_uuid, $_->{'pbx_extension'}]; $csv->{callee}->print($io_callee, $csv_data); $csv_data = ["sipp_scenario_responder".sprintf("%02i", $res_id).".xml", $_->{proto}, $_->{ip}, $_->{peer_host}, $_->{foreign}]; $csv->{scenario}->print($io_scenario, $csv_data);