From 083c97d86fdcce89bfcb97127de71d4f6051403c Mon Sep 17 00:00:00 2001 From: Alessio Garzi Date: Mon, 1 Jul 2024 13:22:03 +0200 Subject: [PATCH] MT#60035 Scenario invite_blockout_ncos extended for adm_ncos_exceptions Scenario invite_blockout_ncos now performs an additional test call to test adm_ncos_exceptions, the second call must be accepted even if it matches the ncos pattern because destination is listed into adm_ncos_exceptions new user preference Change-Id: Icc5f78d9b0c2982dc0ab34f5eba7505a156e42d4 --- .../invite_blockout_ncos/0003_test.yml.tt2 | 2 + .../invite_blockout_ncos/cdr_test.yml.tt2 | 10 ++ scenarios/invite_blockout_ncos/prefs.json.tt2 | 3 +- scenarios/invite_blockout_ncos/scenario.yml | 21 ++++ .../invite_blockout_ncos/sipp_scenario01.xml | 107 ++++++++++++++++++ .../sipp_scenario01_test.yml.tt2 | 26 +++++ 6 files changed, 168 insertions(+), 1 deletion(-) create mode 100644 scenarios/invite_blockout_ncos/sipp_scenario01.xml create mode 100644 scenarios/invite_blockout_ncos/sipp_scenario01_test.yml.tt2 diff --git a/scenarios/invite_blockout_ncos/0003_test.yml.tt2 b/scenarios/invite_blockout_ncos/0003_test.yml.tt2 index 5b03c448..cef20d90 100644 --- a/scenarios/invite_blockout_ncos/0003_test.yml.tt2 +++ b/scenarios/invite_blockout_ncos/0003_test.yml.tt2 @@ -58,6 +58,8 @@ flow: - start|ROUTE_FIND_CALLEE: - start|ROUTE_DETECT_LOOP: - return|ROUTE_DETECT_LOOP: + - start|ROUTE_CALLEE_PROCESS_SPEEDDIALS: + - return|ROUTE_CALLEE_PROCESS_SPEEDDIALS: - start|ROUTE_CLEAR_CALLEE_PREF: - return|ROUTE_CLEAR_CALLEE_PREF: - start|ROUTE_LOAD_CALLEE_PREF: diff --git a/scenarios/invite_blockout_ncos/cdr_test.yml.tt2 b/scenarios/invite_blockout_ncos/cdr_test.yml.tt2 index 38c1fa59..ed74d18a 100644 --- a/scenarios/invite_blockout_ncos/cdr_test.yml.tt2 +++ b/scenarios/invite_blockout_ncos/cdr_test.yml.tt2 @@ -8,4 +8,14 @@ cdr: call_type: 'call' call_status: 'other' call_code: '403' + duration: '0' + - source_user: 'testuser1002' + source_domain: 'invite-blockout-ncos.scenarios.test' + source_cli: '[% invite_blockout_ncos_scenarios_test.testuser1002.phone_number %]' + destination_user: 'testuser1004' + destination_domain: 'invite-blockout-ncos.scenarios.test' + destination_user_dialed: '[% invite_blockout_ncos_scenarios_test.testuser1004.phone_number %]' + call_type: 'call' + call_status: 'noanswer' + call_code: '480' duration: '0' \ No newline at end of file diff --git a/scenarios/invite_blockout_ncos/prefs.json.tt2 b/scenarios/invite_blockout_ncos/prefs.json.tt2 index e718914a..79c61690 100644 --- a/scenarios/invite_blockout_ncos/prefs.json.tt2 +++ b/scenarios/invite_blockout_ncos/prefs.json.tt2 @@ -3,6 +3,7 @@ "nat_sipping": "no" }, "testuser1002@invite-blockout-ncos.scenarios.test": { - "ncos": "ncos_test_00" + "ncos": "ncos_test_00", + "adm_ncos_exceptions": ["[% invite_blockout_ncos_scenarios_test.testuser1004.phone_number %]"] } } diff --git a/scenarios/invite_blockout_ncos/scenario.yml b/scenarios/invite_blockout_ncos/scenario.yml index 630d7e22..391d8cca 100644 --- a/scenarios/invite_blockout_ncos/scenario.yml +++ b/scenarios/invite_blockout_ncos/scenario.yml @@ -1,5 +1,11 @@ --- test_uuid: invite_blockout_ncos +description: | + this scenario checks ncos feature. + Fist call gets blocked by ncos because callee matches pattern ^431. + Second call also matches pattern ^431 but + it is allowed because destination is listed into + adm_ncos_exceptions preference domains: invite-blockout-ncos.scenarios.test: reseller_id: 1 @@ -15,6 +21,12 @@ customers: reseller_id: 1 subscribers: invite-blockout-ncos.scenarios.test: + testuser1004: + customer: 'customer.test' + password: testuser + cc: 43 + ac: 1 + sn: 1003 testuser1003: customer: 'customer.test' password: testuser @@ -37,3 +49,12 @@ scenarios: domain: invite-blockout-ncos.scenarios.test register: 'no' active: 'no' + - ip: 127.126.0.1 + username: testuser1002 + domain: invite-blockout-ncos.scenarios.test + responders: + - ip: 127.1.0.2 + username: testuser1004 + domain: invite-blockout-ncos.scenarios.test + register: 'no' + active: 'no' \ No newline at end of file diff --git a/scenarios/invite_blockout_ncos/sipp_scenario01.xml b/scenarios/invite_blockout_ncos/sipp_scenario01.xml new file mode 100644 index 00000000..7e4e42a1 --- /dev/null +++ b/scenarios/invite_blockout_ncos/sipp_scenario01.xml @@ -0,0 +1,107 @@ + + + + + ;tag=[pid]SIPpTag00[call_number] + To: + Call-ID: NGCP%[field4 file="callee.csv" line=1]%///[call_id] + CSeq: 1 INVITE + Contact: + Max-Forwards: 70 + Content-Type: application/sdp + Content-Length: [len] + + v=0 + o=user1 53655765 2353687637 IN IP[local_ip_type] [local_ip] + s=- + c=IN IP[media_ip_type] [media_ip] + t=0 0 + m=audio [media_port] RTP/AVP 8 + a=rtpmap:8 PCMA/8000 + a=ptime:50 + + ]]> + + + + + + + + + ;tag=[pid]SIPpTag00[call_number] + To: [peer_tag_param] + Call-ID: NGCP%[field4 file="callee.csv" line=1]%///[call_id] + CSeq: 1 ACK + Contact: + Max-Forwards: 70 + Content-Length: 0 + + ]]> + + + + + + ;tag=[pid]SIPpTag00[call_number] + To: + Call-ID: NGCP%[field4 file="callee.csv" line=1]%///[call_id] + CSeq: 2 INVITE + Contact: + Max-Forwards: 70 + [field1 file="caller.csv" line=1] + Content-Type: application/sdp + Content-Length: [len] + + v=0 + o=user1 53655765 2353687637 IN IP[local_ip_type] [local_ip] + s=- + c=IN IP[media_ip_type] [media_ip] + t=0 0 + m=audio [media_port] RTP/AVP 8 + a=rtpmap:8 PCMA/8000 + a=ptime:50 + + ]]> + + + + + + + + + + ;tag=[pid]SIPpTag00[call_number] + To: [peer_tag_param] + Call-ID: NGCP%[field4 file="callee.csv" line=1]%///[call_id] + CSeq: 2 ACK + Contact: + Max-Forwards: 70 + Content-Length: 0 + + ]]> + + + + + + + + diff --git a/scenarios/invite_blockout_ncos/sipp_scenario01_test.yml.tt2 b/scenarios/invite_blockout_ncos/sipp_scenario01_test.yml.tt2 new file mode 100644 index 00000000..744a3d5b --- /dev/null +++ b/scenarios/invite_blockout_ncos/sipp_scenario01_test.yml.tt2 @@ -0,0 +1,26 @@ +messages: +- - 'SIP/2.0 100 Trying' + - 'From: ;tag=[\w-]+' + - 'To: ' + - 'CSeq: \d+ INVITE' + - 'Server: Sipwise NGCP LB' + - 'Content-Length: 0' +- - 'SIP/2.0 407 Proxy Authentication Required' + - 'From: ;tag=[\w-]+' + - 'To: ;tag=[\w-]+' + - 'CSeq: \d+ INVITE' + - 'Proxy-Authenticate: Digest realm="invite-blockout-ncos.scenarios.test", nonce="[^"]+"' + - 'Server: Sipwise NGCP Proxy' + - 'Content-Length: 0' +- - 'SIP/2.0 100 Trying' + - 'From: ;tag=[\w-]+' + - 'To: ' + - 'CSeq: \d+ INVITE' + - 'Server: Sipwise NGCP LB' + - 'Content-Length: 0' +- - 'SIP/2.0 480 Offline' + - 'From: ;tag=[\w-]+' + - 'To: ;tag=[\w-]+' + - 'CSeq: \d+ INVITE' + - 'Server: Sipwise NGCP Proxy' + - 'Content-Length: 0'