TT#180200 KCT handles User Agent header in registration

Now KCT can read from the registration section of the scenario.yml file the value 'ua'.
If this is set (and registration is set to yes), KCT will add in the registration xml files
meant for SIPP the header 'User Agent' with the value specified.

To demonstrate how it works the scenario invite_callforward has also been extended and
now it sends registrations with User-Agent: KCT SIPP, additionally it enables feature ua_reject_missing
to check if this header is present and also tests if in the sems loop the ua_reject_missing
is ignored (whitelisting sems).

Change-Id: I709a0e0c3532b8e5246834dc3566b26e95b5f3be
mr11.0
Alessio Garzi 4 years ago
parent 953e52195e
commit c63bbe923a

@ -421,7 +421,7 @@ sub generate
$csv->{scenario}->print($io_scenario, $csv_data);
if($resp->{register} eq "yes" && $resp->{active} eq "yes")
{
generate_reg($res_id, $test_uuid, $resp->{q});
generate_reg($res_id, $test_uuid, $resp->{q}, $resp->{ua});
}
if($resp->{foreign} eq "yes")
{
@ -436,8 +436,8 @@ sub generate
sub generate_reg
{
my ($num, $test_uuid, $q) = @_;
my $vars = { line => $num, test_uuid => $test_uuid, q => $q };
my ($num, $test_uuid, $q, $ua) = @_;
my $vars = { line => $num, test_uuid => $test_uuid, q => $q, ua => $ua };
my $fn = File::Spec->catfile($base_check_dir, "sipp_scenario_responder".(sprintf "%02i", $num)."_reg.xml");
$tt->process($template_reg, $vars, $fn) or die($tt->error(), "\n");
return;

@ -1,5 +1,6 @@
{
"@invite-callforward.scenarios.test": {
"nat_sipping": "no"
"nat_sipping": "no",
"ua_reject_missing" : 1
}
}

@ -59,6 +59,7 @@ scenarios:
username: testuser1003
domain: invite-callforward.scenarios.test
register: 'yes'
ua: 'KCT SIPP'
- ip: 127.126.0.1
username: testuser1002
domain: invite-callforward.scenarios.test
@ -67,7 +68,9 @@ scenarios:
username: testuser1004
domain: invite-callforward.scenarios.test
register: 'yes'
ua: 'KCT SIPP'
- ip: 127.1.0.5
username: testuser1005
domain: invite-callforward.scenarios.test
register: 'yes'
ua: 'KCT SIPP'

@ -11,6 +11,7 @@
Call-ID: NGCP%[field4 file="callee.csv" line=0]%///[call_id]
CSeq: 1 INVITE
Contact: <sip:[field0 file="caller.csv" line=0]@[local_ip]:[local_port]>
User-Agent: KCT SIPP
Max-Forwards: 70
Content-Type: application/sdp
Content-Length: [len]
@ -60,6 +61,7 @@
Call-ID: NGCP%[field4 file="callee.csv" line=0]%///[call_id]
CSeq: 2 INVITE
Contact: <sip:[field0 file="caller.csv" line=0]@[local_ip]:[local_port]>
User-Agent: KCT SIPP
Max-Forwards: 70
[field1 file="caller.csv" line=0]
Content-Type: application/sdp

@ -11,6 +11,7 @@
Call-ID: NGCP%[field4 file="callee.csv" line=0]%///[call_id]
CSeq: 1 INVITE
Contact: <sip:[field0 file="caller.csv" line=1]@[local_ip]:[local_port]>
User-Agent: KCT SIPP
Max-Forwards: 70
Content-Type: application/sdp
Content-Length: [len]
@ -60,6 +61,7 @@
Call-ID: NGCP%[field4 file="callee.csv" line=0]%///[call_id]
CSeq: 2 INVITE
Contact: <sip:[field0 file="caller.csv" line=1]@[local_ip]:[local_port]>
User-Agent: KCT SIPP
Max-Forwards: 70
[field1 file="caller.csv" line=1]
Content-Type: application/sdp

@ -12,6 +12,7 @@
Call-ID: NGCP%[field4 file="callee.csv" line=0]%///[call_id]
CSeq: 1 REGISTER
Contact: sip:[field0 file="callee.csv" line=[% line -%]]@[local_ip]:[local_port];transport=[transport][% IF q %];q=[% q %][% END %]
[% IF ua %]User-Agent: [% ua %][% END %]
Expires: 600
Max-Forwards: 70
Content-Length: 0
@ -36,6 +37,7 @@
CSeq: 2 REGISTER
[field2 file="callee.csv" line=[% line -%]]
Contact: sip:[field0 file="callee.csv" line=[% line -%]]@[local_ip]:[local_port];transport=[transport][% IF q %];q=[% q %][% END %]
[% IF ua %]User-Agent: [% ua %][% END %]
Expires: 600
Max-Forwards: 70
Content-Length: 0

Loading…
Cancel
Save