From 03a5634b62f3068f112346bc19624fe91c5843af Mon Sep 17 00:00:00 2001 From: Victor Seva Date: Mon, 16 Aug 2021 18:53:46 +0200 Subject: [PATCH] TT#116101 scenarios_pbx: fix sipp generated templates * expire value is random * bin/generate_test_tt2.py: add case not to generate expires with values Change-Id: I5ac5c737ca458a9747b831368e224ec01e00f735 --- bin/generate_test_tt2.py | 2 + .../sipp_scenario_responder00_test.yml.tt2 | 4 +- .../sipp_scenario_responder01_test.yml.tt2 | 4 +- .../sipp_scenario_responder00_test.yml.tt2 | 10 +- .../incoming_shared_line/scenario_ids.yml | 74 +++++ .../incoming_shared_line/sipp_scenario00.msg | 28 ++ .../sipp_scenario00_test.yml.tt2 | 9 + .../incoming_shared_line/sipp_scenario01.msg | 28 ++ .../sipp_scenario01_test.yml.tt2 | 9 + .../incoming_shared_line/sipp_scenario02.msg | 217 +++++++++++++ .../sipp_scenario02_test.yml.tt2 | 73 +++++ .../sipp_scenario_responder00.msg | 299 ++++++++++++++++++ .../sipp_scenario_responder00_test.yml.tt2 | 85 +++++ .../sipp_scenario_responder01.msg | 299 ++++++++++++++++++ .../sipp_scenario_responder01_test.yml.tt2 | 85 +++++ .../sipp_scenario_responder02.msg | 100 ++++++ .../sipp_scenario_responder02_test.yml.tt2 | 32 ++ .../sipp_scenario_responder03.msg | 124 ++++++++ .../sipp_scenario_responder03_test.yml.tt2 | 40 +++ tests/test_generate_test_tt2.py | 80 +++++ 20 files changed, 1593 insertions(+), 9 deletions(-) create mode 100644 tests/fixtures/incoming_shared_line/scenario_ids.yml create mode 100644 tests/fixtures/incoming_shared_line/sipp_scenario00.msg create mode 100644 tests/fixtures/incoming_shared_line/sipp_scenario00_test.yml.tt2 create mode 100644 tests/fixtures/incoming_shared_line/sipp_scenario01.msg create mode 100644 tests/fixtures/incoming_shared_line/sipp_scenario01_test.yml.tt2 create mode 100644 tests/fixtures/incoming_shared_line/sipp_scenario02.msg create mode 100644 tests/fixtures/incoming_shared_line/sipp_scenario02_test.yml.tt2 create mode 100644 tests/fixtures/incoming_shared_line/sipp_scenario_responder00.msg create mode 100644 tests/fixtures/incoming_shared_line/sipp_scenario_responder00_test.yml.tt2 create mode 100644 tests/fixtures/incoming_shared_line/sipp_scenario_responder01.msg create mode 100644 tests/fixtures/incoming_shared_line/sipp_scenario_responder01_test.yml.tt2 create mode 100644 tests/fixtures/incoming_shared_line/sipp_scenario_responder02.msg create mode 100644 tests/fixtures/incoming_shared_line/sipp_scenario_responder02_test.yml.tt2 create mode 100644 tests/fixtures/incoming_shared_line/sipp_scenario_responder03.msg create mode 100644 tests/fixtures/incoming_shared_line/sipp_scenario_responder03_test.yml.tt2 diff --git a/bin/generate_test_tt2.py b/bin/generate_test_tt2.py index 1c8cf3a2..6c0a8ef8 100755 --- a/bin/generate_test_tt2.py +++ b/bin/generate_test_tt2.py @@ -270,6 +270,8 @@ class Generator: rules.append((r";ngcpct=[^;>]+", r";ngcpct=[^;]+")) elif hdr == "cseq": rules.append((r":\s+\d+", r": \\d+")) + elif hdr == "subscription-state": + rules.append((r";expires=[1-9]\d*", r";expires=\\d+")) for rule in rules: line = re.sub(rule[0], rule[1], line, flags=re.IGNORECASE) return line diff --git a/scenarios_pbx/incoming_shared_line/sipp_scenario_responder00_test.yml.tt2 b/scenarios_pbx/incoming_shared_line/sipp_scenario_responder00_test.yml.tt2 index a7d8dc58..e06b0f80 100644 --- a/scenarios_pbx/incoming_shared_line/sipp_scenario_responder00_test.yml.tt2 +++ b/scenarios_pbx/incoming_shared_line/sipp_scenario_responder00_test.yml.tt2 @@ -39,7 +39,7 @@ messages: - 'User-Agent: Sipwise NGCP Proxy' - 'Call-Info: ;appearance-index=1;appearance-state=active;appearance-uri="",;appearance-index=\*;appearance-state=idle' - 'Event: call-info' - - 'Subscription-State: active;expires=16' + - 'Subscription-State: active;expires=\d+' - 'Contact: ' - - 'NOTIFY sip:[% scenarios.0.responders.0.username %]@[% scenarios.0.responders.0.ip %]:[% scenarios.0.responders.0.port %] SIP/2.0' - 'Record-Route: ' @@ -51,7 +51,7 @@ messages: - 'User-Agent: Sipwise NGCP Proxy' - 'Call-Info: ;appearance-index=\*;appearance-state=idle' - 'Event: call-info' - - 'Subscription-State: active;expires=14' + - 'Subscription-State: active;expires=\d+' - 'Contact: ' - - 'SIP/2.0 407 Proxy Authentication Required' - 'From: ;tag=[\w-]+' diff --git a/scenarios_pbx/incoming_shared_line/sipp_scenario_responder01_test.yml.tt2 b/scenarios_pbx/incoming_shared_line/sipp_scenario_responder01_test.yml.tt2 index ed190377..0bfbdea7 100644 --- a/scenarios_pbx/incoming_shared_line/sipp_scenario_responder01_test.yml.tt2 +++ b/scenarios_pbx/incoming_shared_line/sipp_scenario_responder01_test.yml.tt2 @@ -39,7 +39,7 @@ messages: - 'User-Agent: Sipwise NGCP Proxy' - 'Call-Info: ;appearance-index=1;appearance-state=active;appearance-uri="",;appearance-index=\*;appearance-state=idle' - 'Event: call-info' - - 'Subscription-State: active;expires=16' + - 'Subscription-State: active;expires=\d+' - 'Contact: ' - - 'NOTIFY sip:[% scenarios.1.responders.0.username %]@[% scenarios.1.responders.0.ip %]:[% scenarios.1.responders.0.port %] SIP/2.0' - 'Record-Route: ' @@ -51,7 +51,7 @@ messages: - 'User-Agent: Sipwise NGCP Proxy' - 'Call-Info: ;appearance-index=\*;appearance-state=idle' - 'Event: call-info' - - 'Subscription-State: active;expires=14' + - 'Subscription-State: active;expires=\d+' - 'Contact: ' - - 'SIP/2.0 407 Proxy Authentication Required' - 'From: ;tag=[\w-]+' diff --git a/scenarios_pbx/invite_shared_line/sipp_scenario_responder00_test.yml.tt2 b/scenarios_pbx/invite_shared_line/sipp_scenario_responder00_test.yml.tt2 index 9ac58559..4dea6999 100644 --- a/scenarios_pbx/invite_shared_line/sipp_scenario_responder00_test.yml.tt2 +++ b/scenarios_pbx/invite_shared_line/sipp_scenario_responder00_test.yml.tt2 @@ -39,7 +39,7 @@ messages: - 'User-Agent: Sipwise NGCP Proxy' - 'Call-Info: ;appearance-index=1;appearance-state=seized,;appearance-index=\*;appearance-state=idle' - 'Event: call-info' - - 'Subscription-State: active;expires=9' + - 'Subscription-State: active;expires=\d+' - 'Contact: ' - - 'NOTIFY sip:[% scenarios.0.responders.0.username %]@[% scenarios.0.responders.0.ip %]:[% scenarios.0.responders.0.port %] SIP/2.0' - 'Record-Route: ' @@ -51,7 +51,7 @@ messages: - 'User-Agent: Sipwise NGCP Proxy' - 'Call-Info: ;appearance-index=1;appearance-state=seized,;appearance-index=\*;appearance-state=idle' - 'Event: call-info' - - 'Subscription-State: active;expires=7' + - 'Subscription-State: active;expires=\d+' - 'Contact: ' - - 'NOTIFY sip:[% scenarios.0.responders.0.username %]@[% scenarios.0.responders.0.ip %]:[% scenarios.0.responders.0.port %] SIP/2.0' - 'Record-Route: ' @@ -63,7 +63,7 @@ messages: - 'User-Agent: Sipwise NGCP Proxy' - 'Call-Info: ;appearance-index=1;appearance-state=progressing,;appearance-index=\*;appearance-state=idle' - 'Event: call-info' - - 'Subscription-State: active;expires=7' + - 'Subscription-State: active;expires=\d+' - 'Contact: ' - - 'NOTIFY sip:[% scenarios.0.responders.0.username %]@[% scenarios.0.responders.0.ip %]:[% scenarios.0.responders.0.port %] SIP/2.0' - 'Record-Route: ' @@ -75,7 +75,7 @@ messages: - 'User-Agent: Sipwise NGCP Proxy' - 'Call-Info: ;appearance-index=1;appearance-state=active;appearance-uri="",;appearance-index=\*;appearance-state=idle' - 'Event: call-info' - - 'Subscription-State: active;expires=6' + - 'Subscription-State: active;expires=\d+' - 'Contact: ' - - 'NOTIFY sip:[% scenarios.0.responders.0.username %]@[% scenarios.0.responders.0.ip %]:[% scenarios.0.responders.0.port %] SIP/2.0' - 'Record-Route: ' @@ -87,7 +87,7 @@ messages: - 'User-Agent: Sipwise NGCP Proxy' - 'Call-Info: ;appearance-index=\*;appearance-state=idle' - 'Event: call-info' - - 'Subscription-State: active;expires=5' + - 'Subscription-State: active;expires=\d+' - 'Contact: ' - - 'SIP/2.0 407 Proxy Authentication Required' - 'From: ;tag=[\w-]+' diff --git a/tests/fixtures/incoming_shared_line/scenario_ids.yml b/tests/fixtures/incoming_shared_line/scenario_ids.yml new file mode 100644 index 00000000..2fc0f773 --- /dev/null +++ b/tests/fixtures/incoming_shared_line/scenario_ids.yml @@ -0,0 +1,74 @@ +--- +domains: +- incoming_shared_line_scenarios_pbx_test +extra_info: {} +incoming_shared_line_customerpbx_test: + id: '345' +incoming_shared_line_scenarios_pbx_test: + testuser1002: + ac: '1' + cc: '43' + pbx_extension: 1002 + pbx_phone_number: '43110001002' + phone_number: '4311000' + sn: 1000 + uuid: e3a33659-36d4-4f94-a527-15efbdff8d69 + testuser1003: + ac: '1' + cc: '43' + pbx_extension: 1003 + pbx_phone_number: '43110001003' + phone_number: '4311001' + sn: 1001 + uuid: 4a108c90-8b33-4a74-b927-58e956846fd1 +scenarios: +- devid: testuser1002 + domain: incoming-shared-line.scenarios-pbx.test + ip: 10.20.29.2 + mport: 45003 + port: 51602 + responders: + - domain: incoming-shared-line.scenarios-pbx.test + ip: 10.20.29.2 + mport: 45006 + port: 51603 + proto: udp + register: no + username: testuser1002 + username: testuser1002 +- devid: testuser1002 + domain: incoming-shared-line.scenarios-pbx.test + ip: 10.20.29.2 + mport: 45009 + port: 51604 + responders: + - domain: incoming-shared-line.scenarios-pbx.test + ip: 10.20.29.2 + mport: 45012 + port: 51605 + proto: udp + register: no + username: testuser1002 + username: testuser1002 +- devid: testuser1003 + domain: incoming-shared-line.scenarios-pbx.test + ip: 10.20.29.2 + mport: 45015 + port: 51606 + responders: + - domain: incoming-shared-line.scenarios-pbx.test + ip: 10.20.29.2 + mport: 45018 + port: 51607 + proto: udp + register: yes + username: testuser1002 + - domain: incoming-shared-line.scenarios-pbx.test + ip: 10.20.29.2 + mport: 45021 + port: 51608 + proto: udp + register: yes + username: testuser1002 + username: testuser1003 +server_ip: 192.168.211.202 diff --git a/tests/fixtures/incoming_shared_line/sipp_scenario00.msg b/tests/fixtures/incoming_shared_line/sipp_scenario00.msg new file mode 100644 index 00000000..0a7501b7 --- /dev/null +++ b/tests/fixtures/incoming_shared_line/sipp_scenario00.msg @@ -0,0 +1,28 @@ +----------------------------------------------- 2021-08-16 06:46:28.670214 +UDP message sent (437 bytes): + +OPTIONS sip:testuser1002@incoming-shared-line.scenarios-pbx.test SIP/2.0 +Via: SIP/2.0/UDP 10.20.29.2:51602;branch=z9hG4bK-692067-1-0 +From: ;tag=692067SIPpTag001 +To: +Call-ID: NGCP%incoming_shared_line_opt%///1-692067@10.20.29.2 +CSeq: 1 OPTIONS +Contact: +Content-Length: 0 + + +----------------------------------------------- 2021-08-16 06:46:28.712562 +UDP message received [660] bytes : + +SIP/2.0 200 Alive +Record-Route: +Record-Route: +Via: SIP/2.0/UDP 10.20.29.2:51602;rport=51602;branch=z9hG4bK-692067-1-0 +From: ;tag=692067SIPpTag001 +To: ;tag=95c37a12bff1a2c36d72bf8333176544.78550000 +Call-ID: NGCP%incoming_shared_line_opt%///1-692067@10.20.29.2 +CSeq: 1 OPTIONS +Server: Sipwise NGCP Proxy 9.X +Content-Length: 0 + + diff --git a/tests/fixtures/incoming_shared_line/sipp_scenario00_test.yml.tt2 b/tests/fixtures/incoming_shared_line/sipp_scenario00_test.yml.tt2 new file mode 100644 index 00000000..5067ef36 --- /dev/null +++ b/tests/fixtures/incoming_shared_line/sipp_scenario00_test.yml.tt2 @@ -0,0 +1,9 @@ +messages: +- - 'SIP/2.0 200 Alive' + - 'Record-Route: ' + - 'Record-Route: ' + - 'From: ;tag=[\w-]+' + - 'To: ;tag=[\w-]+' + - 'CSeq: \d+ OPTIONS' + - 'Server: Sipwise NGCP Proxy' + - 'Content-Length: 0' diff --git a/tests/fixtures/incoming_shared_line/sipp_scenario01.msg b/tests/fixtures/incoming_shared_line/sipp_scenario01.msg new file mode 100644 index 00000000..335280b7 --- /dev/null +++ b/tests/fixtures/incoming_shared_line/sipp_scenario01.msg @@ -0,0 +1,28 @@ +----------------------------------------------- 2021-08-16 06:46:28.855648 +UDP message sent (437 bytes): + +OPTIONS sip:testuser1002@incoming-shared-line.scenarios-pbx.test SIP/2.0 +Via: SIP/2.0/UDP 10.20.29.2:51604;branch=z9hG4bK-692080-1-0 +From: ;tag=692080SIPpTag001 +To: +Call-ID: NGCP%incoming_shared_line_opt%///1-692080@10.20.29.2 +CSeq: 1 OPTIONS +Contact: +Content-Length: 0 + + +----------------------------------------------- 2021-08-16 06:46:28.876058 +UDP message received [660] bytes : + +SIP/2.0 200 Alive +Record-Route: +Record-Route: +Via: SIP/2.0/UDP 10.20.29.2:51604;rport=51604;branch=z9hG4bK-692080-1-0 +From: ;tag=692080SIPpTag001 +To: ;tag=95c37a12bff1a2c36d72bf8333176544.78550000 +Call-ID: NGCP%incoming_shared_line_opt%///1-692080@10.20.29.2 +CSeq: 1 OPTIONS +Server: Sipwise NGCP Proxy 9.X +Content-Length: 0 + + diff --git a/tests/fixtures/incoming_shared_line/sipp_scenario01_test.yml.tt2 b/tests/fixtures/incoming_shared_line/sipp_scenario01_test.yml.tt2 new file mode 100644 index 00000000..5067ef36 --- /dev/null +++ b/tests/fixtures/incoming_shared_line/sipp_scenario01_test.yml.tt2 @@ -0,0 +1,9 @@ +messages: +- - 'SIP/2.0 200 Alive' + - 'Record-Route: ' + - 'Record-Route: ' + - 'From: ;tag=[\w-]+' + - 'To: ;tag=[\w-]+' + - 'CSeq: \d+ OPTIONS' + - 'Server: Sipwise NGCP Proxy' + - 'Content-Length: 0' diff --git a/tests/fixtures/incoming_shared_line/sipp_scenario02.msg b/tests/fixtures/incoming_shared_line/sipp_scenario02.msg new file mode 100644 index 00000000..18bd7bc1 --- /dev/null +++ b/tests/fixtures/incoming_shared_line/sipp_scenario02.msg @@ -0,0 +1,217 @@ +----------------------------------------------- 2021-08-16 06:46:30.019014 +UDP message sent (685 bytes): + +INVITE sip:1002@incoming-shared-line.scenarios-pbx.test SIP/2.0 +Via: SIP/2.0/UDP 10.20.29.2:51606;branch=z9hG4bK-692096-1-1 +From: ;tag=692096SIPpTag001 +To: +Call-ID: NGCP%incoming_shared_line%///1-692096@10.20.29.2 +Call-Info: ;appearance-index=1 +CSeq: 1 INVITE +Contact: +Max-Forwards: 70 +Content-Type: application/sdp +Content-Length: 144 + +v=0 +o=user1 53655765 2353687637 IN IP4 10.20.29.2 +s=- +c=IN IP4 10.20.29.2 +t=0 0 +m=audio 45015 RTP/AVP 8 +a=rtpmap:8 PCMA/8000 +a=ptime:50 + +----------------------------------------------- 2021-08-16 06:46:30.019101 +UDP message received [361] bytes : + +SIP/2.0 100 Trying +Via: SIP/2.0/UDP 10.20.29.2:51606;branch=z9hG4bK-692096-1-1;rport=51606 +From: ;tag=692096SIPpTag001 +To: +Call-ID: NGCP%incoming_shared_line%///1-692096@10.20.29.2 +CSeq: 1 INVITE +Server: Sipwise NGCP LB 9.X +Content-Length: 0 + + +----------------------------------------------- 2021-08-16 06:46:30.061862 +UDP message received [551] bytes : + +SIP/2.0 407 Proxy Authentication Required +Via: SIP/2.0/UDP 10.20.29.2:51606;rport=51606;branch=z9hG4bK-692096-1-1 +From: ;tag=692096SIPpTag001 +To: ;tag=95c37a12bff1a2c36d72bf8333176544.78550000 +Call-ID: NGCP%incoming_shared_line%///1-692096@10.20.29.2 +CSeq: 1 INVITE +Proxy-Authenticate: Digest realm="incoming-shared-line.scenarios-pbx.test", nonce="YRnu0mEZ7aYAADn4ccoxqD0fZfRIGCYC" +Server: Sipwise NGCP Proxy 9.X +Content-Length: 0 + + +----------------------------------------------- 2021-08-16 06:46:30.062892 +UDP message sent (563 bytes): + +ACK sip:1002@incoming-shared-line.scenarios-pbx.test:5060 SIP/2.0 +Via: SIP/2.0/UDP 10.20.29.2:51606;rport=51606;branch=z9hG4bK-692096-1-1 +From: ;tag=692096SIPpTag001 +To: ;tag=95c37a12bff1a2c36d72bf8333176544.78550000 +Call-ID: NGCP%incoming_shared_line%///1-692096@10.20.29.2 +Call-Info: ;appearance-index=1 +CSeq: 1 ACK +Contact: +Max-Forwards: 70 +Content-Length: 0 + + +----------------------------------------------- 2021-08-16 06:46:30.580397 +UDP message sent (916 bytes): + +INVITE sip:1002@incoming-shared-line.scenarios-pbx.test SIP/2.0 +Via: SIP/2.0/UDP 10.20.29.2:51606;branch=z9hG4bK-692096-1-6 +From: ;tag=692096SIPpTag001 +To: +Call-ID: NGCP%incoming_shared_line%///1-692096@10.20.29.2 +Call-Info: ;appearance-index=1 +CSeq: 2 INVITE +Contact: +Max-Forwards: 70 +Proxy-Authorization: Digest username="testuser1003",realm="incoming-shared-line.scenarios-pbx.test",uri="sip:192.168.211.202:5060",nonce="YRnu0mEZ7aYAADn4ccoxqD0fZfRIGCYC",response="ddd8bd58c35ce8a6085061d508ba4b19",algorithm=MD5 +Content-Type: application/sdp +Content-Length: 144 + +v=0 +o=user1 53655765 2353687637 IN IP4 10.20.29.2 +s=- +c=IN IP4 10.20.29.2 +t=0 0 +m=audio 45015 RTP/AVP 8 +a=rtpmap:8 PCMA/8000 +a=ptime:50 + +----------------------------------------------- 2021-08-16 06:46:30.580443 +UDP message received [361] bytes : + +SIP/2.0 100 Trying +Via: SIP/2.0/UDP 10.20.29.2:51606;branch=z9hG4bK-692096-1-6;rport=51606 +From: ;tag=692096SIPpTag001 +To: +Call-ID: NGCP%incoming_shared_line%///1-692096@10.20.29.2 +CSeq: 2 INVITE +Server: Sipwise NGCP LB 9.X +Content-Length: 0 + + +----------------------------------------------- 2021-08-16 06:46:32.394738 +UDP message received [1122] bytes : + +SIP/2.0 180 Ringing +Record-Route: +Record-Route: +Record-Route: +Via: SIP/2.0/UDP 10.20.29.2:51606;rport=51606;branch=z9hG4bK-692096-1-6 +From: ;tag=692096SIPpTag001 +To: ;tag=5B198A52-6119EDA7000C54A0-52DED700 +Call-ID: NGCP%incoming_shared_line%///1-692096@10.20.29.2 +CSeq: 2 INVITE +Allow: INVITE, PRACK, ACK, BYE, CANCEL, OPTIONS, NOTIFY, REGISTER, SUBSCRIBE, REFER, PUBLISH, UPDATE, MESSAGE +Content-Length: 0 +P-Asserted-Identity: "1002" +Contact: + + +----------------------------------------------- 2021-08-16 06:46:33.064582 +UDP message received [1122] bytes : + +SIP/2.0 180 Ringing +Record-Route: +Record-Route: +Record-Route: +Via: SIP/2.0/UDP 10.20.29.2:51606;rport=51606;branch=z9hG4bK-692096-1-6 +From: ;tag=692096SIPpTag001 +To: ;tag=796115D3-6119EDA8000104FA-52CEC700 +Call-ID: NGCP%incoming_shared_line%///1-692096@10.20.29.2 +CSeq: 2 INVITE +Allow: INVITE, PRACK, ACK, BYE, CANCEL, OPTIONS, NOTIFY, REGISTER, SUBSCRIBE, REFER, PUBLISH, UPDATE, MESSAGE +Content-Length: 0 +P-Asserted-Identity: "1002" +Contact: + + +----------------------------------------------- 2021-08-16 06:46:33.364599 +UDP message received [1330] bytes : + +SIP/2.0 200 OK +Record-Route: +Record-Route: +Record-Route: +Via: SIP/2.0/UDP 10.20.29.2:51606;rport=51606;branch=z9hG4bK-692096-1-6 +From: ;tag=692096SIPpTag001 +To: ;tag=796115D3-6119EDA8000104FA-52CEC700 +Call-ID: NGCP%incoming_shared_line%///1-692096@10.20.29.2 +CSeq: 2 INVITE +Allow: INVITE, PRACK, ACK, BYE, CANCEL, OPTIONS, NOTIFY, REGISTER, SUBSCRIBE, REFER, PUBLISH, UPDATE, MESSAGE +Content-Type: application/sdp +Content-Length: 180 +P-Asserted-Identity: "1002" +Contact: + +v=0 +o=user1 53655765 2353687637 IN IP4 192.168.211.202 +s=- +c=IN IP4 192.168.211.202 +t=0 0 +m=audio 30008 RTP/AVP 8 +a=rtpmap:8 PCMA/8000 +a=sendrecv +a=rtcp:30009 +a=ptime:50 + +----------------------------------------------- 2021-08-16 06:46:33.366890 +UDP message sent (1003 bytes): + +ACK sip:ngcp-lb@192.168.211.202:5060;ngcpct=7369703a3132372e302e302e313a353038303b707278726f7574653d31 SIP/2.0 +Via: SIP/2.0/UDP 10.20.29.2:51606;branch=z9hG4bK-692096-1-11 +From: ;tag=692096SIPpTag001 +To: ;tag=796115D3-6119EDA8000104FA-52CEC700 +Call-ID: NGCP%incoming_shared_line%///1-692096@10.20.29.2 +Call-Info: ;appearance-index=1 +Route: , , +CSeq: 2 ACK +Contact: +Max-Forwards: 70 +Content-Length: 0 + + +----------------------------------------------- 2021-08-16 06:46:34.878449 +UDP message sent (1003 bytes): + +BYE sip:ngcp-lb@192.168.211.202:5060;ngcpct=7369703a3132372e302e302e313a353038303b707278726f7574653d31 SIP/2.0 +Via: SIP/2.0/UDP 10.20.29.2:51606;branch=z9hG4bK-692096-1-15 +From: ;tag=692096SIPpTag001 +To: ;tag=796115D3-6119EDA8000104FA-52CEC700 +Call-ID: NGCP%incoming_shared_line%///1-692096@10.20.29.2 +Call-Info: ;appearance-index=1 +CSeq: 3 BYE +Contact: +Route: , , +Max-Forwards: 70 +Content-Length: 0 + + +----------------------------------------------- 2021-08-16 06:46:35.224611 +UDP message received [839] bytes : + +SIP/2.0 200 OK +Record-Route: +Record-Route: +Record-Route: +Via: SIP/2.0/UDP 10.20.29.2:51606;rport=51606;branch=z9hG4bK-692096-1-15 +From: ;tag=692096SIPpTag001 +To: ;tag=796115D3-6119EDA8000104FA-52CEC700 +Call-ID: NGCP%incoming_shared_line%///1-692096@10.20.29.2 +CSeq: 3 BYE +Content-Length: 0 +P-Asserted-Identity: "1002" + + diff --git a/tests/fixtures/incoming_shared_line/sipp_scenario02_test.yml.tt2 b/tests/fixtures/incoming_shared_line/sipp_scenario02_test.yml.tt2 new file mode 100644 index 00000000..7c0888ce --- /dev/null +++ b/tests/fixtures/incoming_shared_line/sipp_scenario02_test.yml.tt2 @@ -0,0 +1,73 @@ +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="incoming-shared-line.scenarios-pbx.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 180 Ringing' + - 'Record-Route: ' + - 'Record-Route: ' + - 'Record-Route: ' + - 'From: ;tag=[\w-]+' + - 'To: ;tag=[\w-]+' + - 'CSeq: \d+ INVITE' + - 'Allow: INVITE, PRACK, ACK, BYE, CANCEL, OPTIONS, NOTIFY, REGISTER, SUBSCRIBE, REFER, PUBLISH, UPDATE, MESSAGE' + - 'Content-Length: 0' + - 'P-Asserted-Identity: "[% incoming_shared_line_scenarios_pbx_test.testuser1002.pbx_extension %]" ' + - 'Contact: ' +- - 'SIP/2.0 180 Ringing' + - 'Record-Route: ' + - 'Record-Route: ' + - 'Record-Route: ' + - 'From: ;tag=[\w-]+' + - 'To: ;tag=[\w-]+' + - 'CSeq: \d+ INVITE' + - 'Allow: INVITE, PRACK, ACK, BYE, CANCEL, OPTIONS, NOTIFY, REGISTER, SUBSCRIBE, REFER, PUBLISH, UPDATE, MESSAGE' + - 'Content-Length: 0' + - 'P-Asserted-Identity: "[% incoming_shared_line_scenarios_pbx_test.testuser1002.pbx_extension %]" ' + - 'Contact: ' +- - 'SIP/2.0 200 OK' + - 'Record-Route: ' + - 'Record-Route: ' + - 'Record-Route: ' + - 'From: ;tag=[\w-]+' + - 'To: ;tag=[\w-]+' + - 'CSeq: \d+ INVITE' + - 'Allow: INVITE, PRACK, ACK, BYE, CANCEL, OPTIONS, NOTIFY, REGISTER, SUBSCRIBE, REFER, PUBLISH, UPDATE, MESSAGE' + - 'Content-Type: application/sdp' + - 'Content-Length: \d+' + - 'P-Asserted-Identity: "[% incoming_shared_line_scenarios_pbx_test.testuser1002.pbx_extension %]" ' + - 'Contact: ' + - 'v=0' + - 'o=user1 \d+ \d+ IN IP4 [% server_ip %]' + - 's=-' + - 'c=IN IP4 [% server_ip %]' + - 't=0 0' + - 'm=audio \d+ RTP/AVP 8' + - 'a=rtpmap:8 PCMA/8000' + - 'a=sendrecv' + - 'a=rtcp:\d+' + - 'a=ptime:50' +- - 'SIP/2.0 200 OK' + - 'Record-Route: ' + - 'Record-Route: ' + - 'Record-Route: ' + - 'From: ;tag=[\w-]+' + - 'To: ;tag=[\w-]+' + - 'CSeq: \d+ BYE' + - 'Content-Length: 0' + - 'P-Asserted-Identity: "[% incoming_shared_line_scenarios_pbx_test.testuser1002.pbx_extension %]" ' diff --git a/tests/fixtures/incoming_shared_line/sipp_scenario_responder00.msg b/tests/fixtures/incoming_shared_line/sipp_scenario_responder00.msg new file mode 100644 index 00000000..ba49c698 --- /dev/null +++ b/tests/fixtures/incoming_shared_line/sipp_scenario_responder00.msg @@ -0,0 +1,299 @@ +----------------------------------------------- 2021-08-16 06:46:28.087627 +UDP message sent (567 bytes): + +SUBSCRIBE sip:testuser1002@incoming-shared-line.scenarios-pbx.test SIP/2.0 +Via: SIP/2.0/UDP 10.20.29.2:51603;branch=z9hG4bK-691964-1-0 +From: ;tag=691964SIPpTag001 +To: +Call-ID: NGCP%incoming_shared_line_sub%///1-691964@10.20.29.2 +CSeq: 1 SUBSCRIBE +Contact: +Allow: INVITE,ACK,CANCEL,BYE,PRACK,INFO,UPDATE,OPTIONS,MESSAGE,NOTIFY,REFER +Max-Forwards: 70 +Expires: 20 +Event: call-info +Content-Length: 0 + + +----------------------------------------------- 2021-08-16 06:46:28.098903 +UDP message received [566] bytes : + +SIP/2.0 407 Proxy Authentication Required +Via: SIP/2.0/UDP 10.20.29.2:51603;rport=51603;branch=z9hG4bK-691964-1-0 +From: ;tag=691964SIPpTag001 +To: ;tag=95c37a12bff1a2c36d72bf8333176544.78550000 +Call-ID: NGCP%incoming_shared_line_sub%///1-691964@10.20.29.2 +CSeq: 1 SUBSCRIBE +Proxy-Authenticate: Digest realm="incoming-shared-line.scenarios-pbx.test", nonce="YRnu0GEZ7aRLiUxxmyymvrHhPJiYusf+" +Server: Sipwise NGCP Proxy 9.X +Content-Length: 0 + + +----------------------------------------------- 2021-08-16 06:46:28.099000 +UDP message sent (490 bytes): + +ACK sip:testuser1002@incoming-shared-line.scenarios-pbx.test SIP/2.0 +Via: SIP/2.0/UDP 10.20.29.2:51603;rport=51603;branch=z9hG4bK-691964-1-0 +From: ;tag=691964SIPpTag001 +To: ;tag=95c37a12bff1a2c36d72bf8333176544.78550000 +Call-ID: NGCP%incoming_shared_line_sub%///1-691964@10.20.29.2 +CSeq: 1 SUBSCRIBE +Contact: +Content-Length: 0 + + +----------------------------------------------- 2021-08-16 06:46:28.100172 +UDP message sent (798 bytes): + +SUBSCRIBE sip:testuser1002@incoming-shared-line.scenarios-pbx.test SIP/2.0 +Via: SIP/2.0/UDP 10.20.29.2:51603;branch=z9hG4bK-691964-1-4 +From: ;tag=691964SIPpTag001 +To: +Proxy-Authorization: Digest username="testuser1002",realm="incoming-shared-line.scenarios-pbx.test",uri="sip:192.168.211.202:5060",nonce="YRnu0GEZ7aRLiUxxmyymvrHhPJiYusf+",response="bc363baaf1696207f4c187414e802b26",algorithm=MD5 +Call-ID: NGCP%incoming_shared_line_sub%///1-691964@10.20.29.2 +CSeq: 2 SUBSCRIBE +Contact: +Allow: INVITE,ACK,CANCEL,BYE,PRACK,INFO,UPDATE,OPTIONS,MESSAGE,NOTIFY,REFER +Max-Forwards: 70 +Expires: 20 +Event: call-info +Content-Length: 0 + + +----------------------------------------------- 2021-08-16 06:46:28.182746 +UDP message received [844] bytes : + +SIP/2.0 202 Accepted +Record-Route: +Record-Route: +Via: SIP/2.0/UDP 10.20.29.2:51603;rport=51603;branch=z9hG4bK-691964-1-4 +From: ;tag=691964SIPpTag001 +To: ;tag=f3067022b00c564156251ba2f28f331f-78550000 +Call-ID: NGCP%incoming_shared_line_sub%///1-691964@10.20.29.2 +CSeq: 2 SUBSCRIBE +Event: call-info +Allow-Events: call-info, line-seize +Expires: 20 +Server: Sipwise NGCP Proxy 9.X +Content-Length: 0 +Contact: + + +----------------------------------------------- 2021-08-16 06:46:28.183652 +UDP message received [1043] bytes : + +NOTIFY sip:testuser1002@10.20.29.2:51603 SIP/2.0 +Record-Route: +Record-Route: +Via: SIP/2.0/UDP 192.168.211.202;branch=z9hG4bK7c39.ba52242cd37f6e18dc0fd966823c1cc3.0 +Via: SIP/2.0/UDP 127.0.0.1:5062;rport=5062;branch=z9hG4bK7c39.a0663941000000000000000000000000.0 +To: ;tag=691964SIPpTag001 +From: ;tag=f3067022b00c564156251ba2f28f331f-78550000 +CSeq: 1 NOTIFY +Call-ID: NGCP%incoming_shared_line_sub%///1-691964@10.20.29.2 +Max-Forwards: 69 +Content-Length: 0 +User-Agent: Sipwise NGCP Proxy 9.X +Call-Info: ;appearance-index=*;appearance-state=idle +Event: call-info +Subscription-State: active +Contact: + + +----------------------------------------------- 2021-08-16 06:46:28.183722 +UDP message sent (541 bytes): + +SIP/2.0 200 OK +Via: SIP/2.0/UDP 192.168.211.202;branch=z9hG4bK7c39.ba52242cd37f6e18dc0fd966823c1cc3.0, SIP/2.0/UDP 127.0.0.1:5062;rport=5062;branch=z9hG4bK7c39.a0663941000000000000000000000000.0 +From: ;tag=f3067022b00c564156251ba2f28f331f-78550000 +To: ;tag=691964SIPpTag001 +Call-ID: NGCP%incoming_shared_line_sub%///1-691964@10.20.29.2 +CSeq: 1 NOTIFY +Contact: +Content-Length: 0 + + +----------------------------------------------- 2021-08-16 06:46:33.532763 +UDP message received [1219] bytes : + +NOTIFY sip:testuser1002@10.20.29.2:51603 SIP/2.0 +Record-Route: +Record-Route: +Via: SIP/2.0/UDP 192.168.211.202;branch=z9hG4bK4c39.d6cb826d31d257f31cfe4b7a2855266e.0 +Via: SIP/2.0/UDP 127.0.0.1:5062;rport=5062;branch=z9hG4bK4c39.35d797b0000000000000000000000000.0 +To: ;tag=691964SIPpTag001 +From: ;tag=f3067022b00c564156251ba2f28f331f-78550000 +CSeq: 2 NOTIFY +Call-ID: NGCP%incoming_shared_line_sub%///1-691964@10.20.29.2 +Max-Forwards: 69 +Content-Length: 0 +User-Agent: Sipwise NGCP Proxy 9.X +Call-Info: ;appearance-index=1;appearance-state=active;appearance-uri="",;appearance-index=*;appearance-state=idle +Event: call-info +Subscription-State: active;expires=15 +Contact: + + +----------------------------------------------- 2021-08-16 06:46:33.533445 +UDP message sent (545 bytes): + +SIP/2.0 200 OK +Via: SIP/2.0/UDP 192.168.211.202;branch=z9hG4bK4c39.d6cb826d31d257f31cfe4b7a2855266e.0, SIP/2.0/UDP 127.0.0.1:5062;rport=5062;branch=z9hG4bK4c39.35d797b0000000000000000000000000.0 +From: ;tag=f3067022b00c564156251ba2f28f331f-78550000 +To: ;tag=691964SIPpTag001 +Call-ID: NGCP%incoming_shared_line_sub%///1-691964@10.20.29.2 +CSeq: 2 NOTIFY +Contact: +Content-Length: 0 + + +----------------------------------------------- 2021-08-16 06:46:34.970985 +UDP message received [1054] bytes : + +NOTIFY sip:testuser1002@10.20.29.2:51603 SIP/2.0 +Record-Route: +Record-Route: +Via: SIP/2.0/UDP 192.168.211.202;branch=z9hG4bK5c39.2f66192281b91d5d10d9ec23e6bccdaf.0 +Via: SIP/2.0/UDP 127.0.0.1:5062;rport=5062;branch=z9hG4bK5c39.d518e116000000000000000000000000.0 +To: ;tag=691964SIPpTag001 +From: ;tag=f3067022b00c564156251ba2f28f331f-78550000 +CSeq: 3 NOTIFY +Call-ID: NGCP%incoming_shared_line_sub%///1-691964@10.20.29.2 +Max-Forwards: 69 +Content-Length: 0 +User-Agent: Sipwise NGCP Proxy 9.X +Call-Info: ;appearance-index=*;appearance-state=idle +Event: call-info +Subscription-State: active;expires=14 +Contact: + + +----------------------------------------------- 2021-08-16 06:46:34.972773 +UDP message sent (545 bytes): + +SIP/2.0 200 OK +Via: SIP/2.0/UDP 192.168.211.202;branch=z9hG4bK5c39.2f66192281b91d5d10d9ec23e6bccdaf.0, SIP/2.0/UDP 127.0.0.1:5062;rport=5062;branch=z9hG4bK5c39.d518e116000000000000000000000000.0 +From: ;tag=f3067022b00c564156251ba2f28f331f-78550000 +To: ;tag=691964SIPpTag001 +Call-ID: NGCP%incoming_shared_line_sub%///1-691964@10.20.29.2 +CSeq: 3 NOTIFY +Contact: +Content-Length: 0 + + +----------------------------------------------- 2021-08-16 06:46:35.989769 +UDP message sent (567 bytes): + +SUBSCRIBE sip:testuser1002@incoming-shared-line.scenarios-pbx.test SIP/2.0 +Via: SIP/2.0/UDP 10.20.29.2:51603;branch=z9hG4bK-691964-1-14 +From: ;tag=691964SIPpTag001 +To: +Call-ID: NGCP%incoming_shared_line_sub%///1-691964@10.20.29.2 +CSeq: 1 SUBSCRIBE +Contact: +Allow: INVITE,ACK,CANCEL,BYE,PRACK,INFO,UPDATE,OPTIONS,MESSAGE,NOTIFY,REFER +Max-Forwards: 70 +Expires: 0 +Event: call-info +Content-Length: 0 + + +----------------------------------------------- 2021-08-16 06:46:36.029846 +UDP message received [567] bytes : + +SIP/2.0 407 Proxy Authentication Required +Via: SIP/2.0/UDP 10.20.29.2:51603;rport=51603;branch=z9hG4bK-691964-1-14 +From: ;tag=691964SIPpTag001 +To: ;tag=95c37a12bff1a2c36d72bf8333176544.78550000 +Call-ID: NGCP%incoming_shared_line_sub%///1-691964@10.20.29.2 +CSeq: 1 SUBSCRIBE +Proxy-Authenticate: Digest realm="incoming-shared-line.scenarios-pbx.test", nonce="YRnu2GEZ7axtLG/a23NeGq4+S5fc2Q8P" +Server: Sipwise NGCP Proxy 9.X +Content-Length: 0 + + +----------------------------------------------- 2021-08-16 06:46:36.029951 +UDP message sent (502 bytes): + +ACK sip:testuser1002@incoming-shared-line.scenarios-pbx.test SIP/2.0 +Via: SIP/2.0/UDP 10.20.29.2:51603;rport=51603;branch=z9hG4bK-691964-1-14 +From: ;tag=691964SIPpTag001 +To: ;tag=95c37a12bff1a2c36d72bf8333176544.78550000 +Call-ID: NGCP%incoming_shared_line_sub%///1-691964@10.20.29.2 +CSeq: 1 ACK +Contact: +Max-Forwards: 70 +Content-Length: 0 + + +----------------------------------------------- 2021-08-16 06:46:36.031770 +UDP message sent (798 bytes): + +SUBSCRIBE sip:testuser1002@incoming-shared-line.scenarios-pbx.test SIP/2.0 +Via: SIP/2.0/UDP 10.20.29.2:51603;branch=z9hG4bK-691964-1-18 +From: ;tag=691964SIPpTag001 +To: +Proxy-Authorization: Digest username="testuser1002",realm="incoming-shared-line.scenarios-pbx.test",uri="sip:192.168.211.202:5060",nonce="YRnu2GEZ7axtLG/a23NeGq4+S5fc2Q8P",response="25004f0dfd0ed2684b7be7f1fe815a03",algorithm=MD5 +Call-ID: NGCP%incoming_shared_line_sub%///1-691964@10.20.29.2 +CSeq: 2 SUBSCRIBE +Contact: +Allow: INVITE,ACK,CANCEL,BYE,PRACK,INFO,UPDATE,OPTIONS,MESSAGE,NOTIFY,REFER +Max-Forwards: 70 +Expires: 0 +Event: call-info +Content-Length: 0 + + +----------------------------------------------- 2021-08-16 06:46:36.117987 +UDP message received [844] bytes : + +SIP/2.0 202 Accepted +Record-Route: +Record-Route: +Via: SIP/2.0/UDP 10.20.29.2:51603;rport=51603;branch=z9hG4bK-691964-1-18 +From: ;tag=691964SIPpTag001 +To: ;tag=f3067022b00c564156251ba2f28f331f-78550000 +Call-ID: NGCP%incoming_shared_line_sub%///1-691964@10.20.29.2 +CSeq: 2 SUBSCRIBE +Event: call-info +Allow-Events: call-info, line-seize +Expires: 0 +Server: Sipwise NGCP Proxy 9.X +Content-Length: 0 +Contact: + + +----------------------------------------------- 2021-08-16 06:46:36.118048 +UDP message received [1047] bytes : + +NOTIFY sip:testuser1002@10.20.29.2:51603 SIP/2.0 +Record-Route: +Record-Route: +Via: SIP/2.0/UDP 192.168.211.202;branch=z9hG4bK2c39.ca9ddfc2d95254c92468fc5f2d092054.0 +Via: SIP/2.0/UDP 127.0.0.1:5062;rport=5062;branch=z9hG4bK2c39.f39ac8f2000000000000000000000000.0 +To: ;tag=691964SIPpTag001 +From: ;tag=f3067022b00c564156251ba2f28f331f-78550000 +CSeq: 4 NOTIFY +Call-ID: NGCP%incoming_shared_line_sub%///1-691964@10.20.29.2 +Max-Forwards: 69 +Content-Length: 0 +User-Agent: Sipwise NGCP Proxy 9.X +Call-Info: ;appearance-index=*;appearance-state=idle +Event: call-info +Subscription-State: terminated +Contact: + + +----------------------------------------------- 2021-08-16 06:46:36.118096 +UDP message sent (541 bytes): + +SIP/2.0 200 OK +Via: SIP/2.0/UDP 192.168.211.202;branch=z9hG4bK2c39.ca9ddfc2d95254c92468fc5f2d092054.0, SIP/2.0/UDP 127.0.0.1:5062;rport=5062;branch=z9hG4bK2c39.f39ac8f2000000000000000000000000.0 +From: ;tag=f3067022b00c564156251ba2f28f331f-78550000 +To: ;tag=691964SIPpTag001 +Call-ID: NGCP%incoming_shared_line_sub%///1-691964@10.20.29.2 +CSeq: 4 NOTIFY +Contact: +Content-Length: 0 + + diff --git a/tests/fixtures/incoming_shared_line/sipp_scenario_responder00_test.yml.tt2 b/tests/fixtures/incoming_shared_line/sipp_scenario_responder00_test.yml.tt2 new file mode 100644 index 00000000..e06b0f80 --- /dev/null +++ b/tests/fixtures/incoming_shared_line/sipp_scenario_responder00_test.yml.tt2 @@ -0,0 +1,85 @@ +messages: +- - 'SIP/2.0 407 Proxy Authentication Required' + - 'From: ;tag=[\w-]+' + - 'To: ;tag=[\w-]+' + - 'CSeq: \d+ SUBSCRIBE' + - 'Proxy-Authenticate: Digest realm="incoming-shared-line.scenarios-pbx.test", nonce="[^"]+"' + - 'Server: Sipwise NGCP Proxy' + - 'Content-Length: 0' +- - 'SIP/2.0 202 Accepted' + - 'Record-Route: ' + - 'Record-Route: ' + - 'From: ;tag=[\w-]+' + - 'To: ;tag=[\w-]+' + - 'CSeq: \d+ SUBSCRIBE' + - 'Event: call-info' + - 'Allow-Events: call-info, line-seize' + - 'Server: Sipwise NGCP Proxy' + - 'Content-Length: 0' + - 'Contact: ' +- - 'NOTIFY sip:[% scenarios.0.responders.0.username %]@[% scenarios.0.responders.0.ip %]:[% scenarios.0.responders.0.port %] SIP/2.0' + - 'Record-Route: ' + - 'Record-Route: ' + - 'To: ;tag=[\w-]+' + - 'From: ;tag=[\w-]+' + - 'CSeq: \d+ NOTIFY' + - 'Content-Length: 0' + - 'User-Agent: Sipwise NGCP Proxy' + - 'Call-Info: ;appearance-index=\*;appearance-state=idle' + - 'Event: call-info' + - 'Subscription-State: active' + - 'Contact: ' +- - 'NOTIFY sip:[% scenarios.0.responders.0.username %]@[% scenarios.0.responders.0.ip %]:[% scenarios.0.responders.0.port %] SIP/2.0' + - 'Record-Route: ' + - 'Record-Route: ' + - 'To: ;tag=[\w-]+' + - 'From: ;tag=[\w-]+' + - 'CSeq: \d+ NOTIFY' + - 'Content-Length: 0' + - 'User-Agent: Sipwise NGCP Proxy' + - 'Call-Info: ;appearance-index=1;appearance-state=active;appearance-uri="",;appearance-index=\*;appearance-state=idle' + - 'Event: call-info' + - 'Subscription-State: active;expires=\d+' + - 'Contact: ' +- - 'NOTIFY sip:[% scenarios.0.responders.0.username %]@[% scenarios.0.responders.0.ip %]:[% scenarios.0.responders.0.port %] SIP/2.0' + - 'Record-Route: ' + - 'Record-Route: ' + - 'To: ;tag=[\w-]+' + - 'From: ;tag=[\w-]+' + - 'CSeq: \d+ NOTIFY' + - 'Content-Length: 0' + - 'User-Agent: Sipwise NGCP Proxy' + - 'Call-Info: ;appearance-index=\*;appearance-state=idle' + - 'Event: call-info' + - 'Subscription-State: active;expires=\d+' + - 'Contact: ' +- - 'SIP/2.0 407 Proxy Authentication Required' + - 'From: ;tag=[\w-]+' + - 'To: ;tag=[\w-]+' + - 'CSeq: \d+ SUBSCRIBE' + - 'Proxy-Authenticate: Digest realm="incoming-shared-line.scenarios-pbx.test", nonce="[^"]+"' + - 'Server: Sipwise NGCP Proxy' + - 'Content-Length: 0' +- - 'SIP/2.0 202 Accepted' + - 'Record-Route: ' + - 'Record-Route: ' + - 'From: ;tag=[\w-]+' + - 'To: ;tag=[\w-]+' + - 'CSeq: \d+ SUBSCRIBE' + - 'Event: call-info' + - 'Allow-Events: call-info, line-seize' + - 'Server: Sipwise NGCP Proxy' + - 'Content-Length: 0' + - 'Contact: ' +- - 'NOTIFY sip:[% scenarios.0.responders.0.username %]@[% scenarios.0.responders.0.ip %]:[% scenarios.0.responders.0.port %] SIP/2.0' + - 'Record-Route: ' + - 'Record-Route: ' + - 'To: ;tag=[\w-]+' + - 'From: ;tag=[\w-]+' + - 'CSeq: \d+ NOTIFY' + - 'Content-Length: 0' + - 'User-Agent: Sipwise NGCP Proxy' + - 'Call-Info: ;appearance-index=\*;appearance-state=idle' + - 'Event: call-info' + - 'Subscription-State: terminated' + - 'Contact: ' diff --git a/tests/fixtures/incoming_shared_line/sipp_scenario_responder01.msg b/tests/fixtures/incoming_shared_line/sipp_scenario_responder01.msg new file mode 100644 index 00000000..209e1ce1 --- /dev/null +++ b/tests/fixtures/incoming_shared_line/sipp_scenario_responder01.msg @@ -0,0 +1,299 @@ +----------------------------------------------- 2021-08-16 06:46:28.103325 +UDP message sent (567 bytes): + +SUBSCRIBE sip:testuser1002@incoming-shared-line.scenarios-pbx.test SIP/2.0 +Via: SIP/2.0/UDP 10.20.29.2:51605;branch=z9hG4bK-691980-1-0 +From: ;tag=691980SIPpTag001 +To: +Call-ID: NGCP%incoming_shared_line_sub%///1-691980@10.20.29.2 +CSeq: 1 SUBSCRIBE +Contact: +Allow: INVITE,ACK,CANCEL,BYE,PRACK,INFO,UPDATE,OPTIONS,MESSAGE,NOTIFY,REFER +Max-Forwards: 70 +Expires: 20 +Event: call-info +Content-Length: 0 + + +----------------------------------------------- 2021-08-16 06:46:28.129843 +UDP message received [566] bytes : + +SIP/2.0 407 Proxy Authentication Required +Via: SIP/2.0/UDP 10.20.29.2:51605;rport=51605;branch=z9hG4bK-691980-1-0 +From: ;tag=691980SIPpTag001 +To: ;tag=95c37a12bff1a2c36d72bf8333176544.78550000 +Call-ID: NGCP%incoming_shared_line_sub%///1-691980@10.20.29.2 +CSeq: 1 SUBSCRIBE +Proxy-Authenticate: Digest realm="incoming-shared-line.scenarios-pbx.test", nonce="YRnu0GEZ7aRLiUxxmyymvrHhPJiYusf+" +Server: Sipwise NGCP Proxy 9.X +Content-Length: 0 + + +----------------------------------------------- 2021-08-16 06:46:28.129939 +UDP message sent (490 bytes): + +ACK sip:testuser1002@incoming-shared-line.scenarios-pbx.test SIP/2.0 +Via: SIP/2.0/UDP 10.20.29.2:51605;rport=51605;branch=z9hG4bK-691980-1-0 +From: ;tag=691980SIPpTag001 +To: ;tag=95c37a12bff1a2c36d72bf8333176544.78550000 +Call-ID: NGCP%incoming_shared_line_sub%///1-691980@10.20.29.2 +CSeq: 1 SUBSCRIBE +Contact: +Content-Length: 0 + + +----------------------------------------------- 2021-08-16 06:46:28.131157 +UDP message sent (798 bytes): + +SUBSCRIBE sip:testuser1002@incoming-shared-line.scenarios-pbx.test SIP/2.0 +Via: SIP/2.0/UDP 10.20.29.2:51605;branch=z9hG4bK-691980-1-4 +From: ;tag=691980SIPpTag001 +To: +Proxy-Authorization: Digest username="testuser1002",realm="incoming-shared-line.scenarios-pbx.test",uri="sip:192.168.211.202:5060",nonce="YRnu0GEZ7aRLiUxxmyymvrHhPJiYusf+",response="bc363baaf1696207f4c187414e802b26",algorithm=MD5 +Call-ID: NGCP%incoming_shared_line_sub%///1-691980@10.20.29.2 +CSeq: 2 SUBSCRIBE +Contact: +Allow: INVITE,ACK,CANCEL,BYE,PRACK,INFO,UPDATE,OPTIONS,MESSAGE,NOTIFY,REFER +Max-Forwards: 70 +Expires: 20 +Event: call-info +Content-Length: 0 + + +----------------------------------------------- 2021-08-16 06:46:28.218567 +UDP message received [844] bytes : + +SIP/2.0 202 Accepted +Record-Route: +Record-Route: +Via: SIP/2.0/UDP 10.20.29.2:51605;rport=51605;branch=z9hG4bK-691980-1-4 +From: ;tag=691980SIPpTag001 +To: ;tag=f3067022b00c564156251ba2f28f331f-78550000 +Call-ID: NGCP%incoming_shared_line_sub%///1-691980@10.20.29.2 +CSeq: 2 SUBSCRIBE +Event: call-info +Allow-Events: call-info, line-seize +Expires: 20 +Server: Sipwise NGCP Proxy 9.X +Content-Length: 0 +Contact: + + +----------------------------------------------- 2021-08-16 06:46:28.218640 +UDP message received [1043] bytes : + +NOTIFY sip:testuser1002@10.20.29.2:51605 SIP/2.0 +Record-Route: +Record-Route: +Via: SIP/2.0/UDP 192.168.211.202;branch=z9hG4bKddf1.02ead20ff1996175891b5a999a23274c.0 +Via: SIP/2.0/UDP 127.0.0.1:5062;rport=5062;branch=z9hG4bKddf1.84a418e3000000000000000000000000.0 +To: ;tag=691980SIPpTag001 +From: ;tag=f3067022b00c564156251ba2f28f331f-78550000 +CSeq: 1 NOTIFY +Call-ID: NGCP%incoming_shared_line_sub%///1-691980@10.20.29.2 +Max-Forwards: 69 +Content-Length: 0 +User-Agent: Sipwise NGCP Proxy 9.X +Call-Info: ;appearance-index=*;appearance-state=idle +Event: call-info +Subscription-State: active +Contact: + + +----------------------------------------------- 2021-08-16 06:46:28.218701 +UDP message sent (541 bytes): + +SIP/2.0 200 OK +Via: SIP/2.0/UDP 192.168.211.202;branch=z9hG4bKddf1.02ead20ff1996175891b5a999a23274c.0, SIP/2.0/UDP 127.0.0.1:5062;rport=5062;branch=z9hG4bKddf1.84a418e3000000000000000000000000.0 +From: ;tag=f3067022b00c564156251ba2f28f331f-78550000 +To: ;tag=691980SIPpTag001 +Call-ID: NGCP%incoming_shared_line_sub%///1-691980@10.20.29.2 +CSeq: 1 NOTIFY +Contact: +Content-Length: 0 + + +----------------------------------------------- 2021-08-16 06:46:33.529575 +UDP message received [1219] bytes : + +NOTIFY sip:testuser1002@10.20.29.2:51605 SIP/2.0 +Record-Route: +Record-Route: +Via: SIP/2.0/UDP 192.168.211.202;branch=z9hG4bKadf1.1f87cc84e45aa8696f4e0735024eb167.0 +Via: SIP/2.0/UDP 127.0.0.1:5062;rport=5062;branch=z9hG4bKadf1.4773c527000000000000000000000000.0 +To: ;tag=691980SIPpTag001 +From: ;tag=f3067022b00c564156251ba2f28f331f-78550000 +CSeq: 2 NOTIFY +Call-ID: NGCP%incoming_shared_line_sub%///1-691980@10.20.29.2 +Max-Forwards: 69 +Content-Length: 0 +User-Agent: Sipwise NGCP Proxy 9.X +Call-Info: ;appearance-index=1;appearance-state=active;appearance-uri="",;appearance-index=*;appearance-state=idle +Event: call-info +Subscription-State: active;expires=15 +Contact: + + +----------------------------------------------- 2021-08-16 06:46:33.530009 +UDP message sent (545 bytes): + +SIP/2.0 200 OK +Via: SIP/2.0/UDP 192.168.211.202;branch=z9hG4bKadf1.1f87cc84e45aa8696f4e0735024eb167.0, SIP/2.0/UDP 127.0.0.1:5062;rport=5062;branch=z9hG4bKadf1.4773c527000000000000000000000000.0 +From: ;tag=f3067022b00c564156251ba2f28f331f-78550000 +To: ;tag=691980SIPpTag001 +Call-ID: NGCP%incoming_shared_line_sub%///1-691980@10.20.29.2 +CSeq: 2 NOTIFY +Contact: +Content-Length: 0 + + +----------------------------------------------- 2021-08-16 06:46:34.971080 +UDP message received [1054] bytes : + +NOTIFY sip:testuser1002@10.20.29.2:51605 SIP/2.0 +Record-Route: +Record-Route: +Via: SIP/2.0/UDP 192.168.211.202;branch=z9hG4bKbdf1.31a141fc817917e018e5b269947b46d2.0 +Via: SIP/2.0/UDP 127.0.0.1:5062;rport=5062;branch=z9hG4bKbdf1.ccce0d11000000000000000000000000.0 +To: ;tag=691980SIPpTag001 +From: ;tag=f3067022b00c564156251ba2f28f331f-78550000 +CSeq: 3 NOTIFY +Call-ID: NGCP%incoming_shared_line_sub%///1-691980@10.20.29.2 +Max-Forwards: 69 +Content-Length: 0 +User-Agent: Sipwise NGCP Proxy 9.X +Call-Info: ;appearance-index=*;appearance-state=idle +Event: call-info +Subscription-State: active;expires=14 +Contact: + + +----------------------------------------------- 2021-08-16 06:46:34.972588 +UDP message sent (545 bytes): + +SIP/2.0 200 OK +Via: SIP/2.0/UDP 192.168.211.202;branch=z9hG4bKbdf1.31a141fc817917e018e5b269947b46d2.0, SIP/2.0/UDP 127.0.0.1:5062;rport=5062;branch=z9hG4bKbdf1.ccce0d11000000000000000000000000.0 +From: ;tag=f3067022b00c564156251ba2f28f331f-78550000 +To: ;tag=691980SIPpTag001 +Call-ID: NGCP%incoming_shared_line_sub%///1-691980@10.20.29.2 +CSeq: 3 NOTIFY +Contact: +Content-Length: 0 + + +----------------------------------------------- 2021-08-16 06:46:35.989425 +UDP message sent (567 bytes): + +SUBSCRIBE sip:testuser1002@incoming-shared-line.scenarios-pbx.test SIP/2.0 +Via: SIP/2.0/UDP 10.20.29.2:51605;branch=z9hG4bK-691980-1-14 +From: ;tag=691980SIPpTag001 +To: +Call-ID: NGCP%incoming_shared_line_sub%///1-691980@10.20.29.2 +CSeq: 1 SUBSCRIBE +Contact: +Allow: INVITE,ACK,CANCEL,BYE,PRACK,INFO,UPDATE,OPTIONS,MESSAGE,NOTIFY,REFER +Max-Forwards: 70 +Expires: 0 +Event: call-info +Content-Length: 0 + + +----------------------------------------------- 2021-08-16 06:46:36.053388 +UDP message received [567] bytes : + +SIP/2.0 407 Proxy Authentication Required +Via: SIP/2.0/UDP 10.20.29.2:51605;rport=51605;branch=z9hG4bK-691980-1-14 +From: ;tag=691980SIPpTag001 +To: ;tag=95c37a12bff1a2c36d72bf8333176544.78550000 +Call-ID: NGCP%incoming_shared_line_sub%///1-691980@10.20.29.2 +CSeq: 1 SUBSCRIBE +Proxy-Authenticate: Digest realm="incoming-shared-line.scenarios-pbx.test", nonce="YRnu2GEZ7axtLG/a23NeGq4+S5fc2Q8P" +Server: Sipwise NGCP Proxy 9.X +Content-Length: 0 + + +----------------------------------------------- 2021-08-16 06:46:36.053474 +UDP message sent (506 bytes): + +ACK sip:testuser1002@incoming-shared-line.scenarios-pbx.test SIP/2.0 +Via: SIP/2.0/UDP 10.20.29.2:51605;rport=51605;branch=z9hG4bK-691980-1-14 +From: ;tag=691980SIPpTag001 +To: ;tag=95c37a12bff1a2c36d72bf8333176544.78550000 +Call-ID: NGCP%incoming_shared_line_sub%///1-691980@10.20.29.2 +CSeq: 1 ACK +Contact: +Max-Forwards: 70 +Content-Length: 0 + + +----------------------------------------------- 2021-08-16 06:46:36.055336 +UDP message sent (798 bytes): + +SUBSCRIBE sip:testuser1002@incoming-shared-line.scenarios-pbx.test SIP/2.0 +Via: SIP/2.0/UDP 10.20.29.2:51605;branch=z9hG4bK-691980-1-18 +From: ;tag=691980SIPpTag001 +To: +Proxy-Authorization: Digest username="testuser1002",realm="incoming-shared-line.scenarios-pbx.test",uri="sip:192.168.211.202:5060",nonce="YRnu2GEZ7axtLG/a23NeGq4+S5fc2Q8P",response="25004f0dfd0ed2684b7be7f1fe815a03",algorithm=MD5 +Call-ID: NGCP%incoming_shared_line_sub%///1-691980@10.20.29.2 +CSeq: 2 SUBSCRIBE +Contact: +Allow: INVITE,ACK,CANCEL,BYE,PRACK,INFO,UPDATE,OPTIONS,MESSAGE,NOTIFY,REFER +Max-Forwards: 70 +Expires: 0 +Event: call-info +Content-Length: 0 + + +----------------------------------------------- 2021-08-16 06:46:36.108071 +UDP message received [844] bytes : + +SIP/2.0 202 Accepted +Record-Route: +Record-Route: +Via: SIP/2.0/UDP 10.20.29.2:51605;rport=51605;branch=z9hG4bK-691980-1-18 +From: ;tag=691980SIPpTag001 +To: ;tag=f3067022b00c564156251ba2f28f331f-78550000 +Call-ID: NGCP%incoming_shared_line_sub%///1-691980@10.20.29.2 +CSeq: 2 SUBSCRIBE +Event: call-info +Allow-Events: call-info, line-seize +Expires: 0 +Server: Sipwise NGCP Proxy 9.X +Content-Length: 0 +Contact: + + +----------------------------------------------- 2021-08-16 06:46:36.111258 +UDP message received [1047] bytes : + +NOTIFY sip:testuser1002@10.20.29.2:51605 SIP/2.0 +Record-Route: +Record-Route: +Via: SIP/2.0/UDP 192.168.211.202;branch=z9hG4bK8df1.7ddee26e9e4806bdd5ec35c1871dd4bf.0 +Via: SIP/2.0/UDP 127.0.0.1:5062;rport=5062;branch=z9hG4bK8df1.88ca9554000000000000000000000000.0 +To: ;tag=691980SIPpTag001 +From: ;tag=f3067022b00c564156251ba2f28f331f-78550000 +CSeq: 4 NOTIFY +Call-ID: NGCP%incoming_shared_line_sub%///1-691980@10.20.29.2 +Max-Forwards: 69 +Content-Length: 0 +User-Agent: Sipwise NGCP Proxy 9.X +Call-Info: ;appearance-index=*;appearance-state=idle +Event: call-info +Subscription-State: terminated +Contact: + + +----------------------------------------------- 2021-08-16 06:46:36.111325 +UDP message sent (541 bytes): + +SIP/2.0 200 OK +Via: SIP/2.0/UDP 192.168.211.202;branch=z9hG4bK8df1.7ddee26e9e4806bdd5ec35c1871dd4bf.0, SIP/2.0/UDP 127.0.0.1:5062;rport=5062;branch=z9hG4bK8df1.88ca9554000000000000000000000000.0 +From: ;tag=f3067022b00c564156251ba2f28f331f-78550000 +To: ;tag=691980SIPpTag001 +Call-ID: NGCP%incoming_shared_line_sub%///1-691980@10.20.29.2 +CSeq: 4 NOTIFY +Contact: +Content-Length: 0 + + diff --git a/tests/fixtures/incoming_shared_line/sipp_scenario_responder01_test.yml.tt2 b/tests/fixtures/incoming_shared_line/sipp_scenario_responder01_test.yml.tt2 new file mode 100644 index 00000000..0bfbdea7 --- /dev/null +++ b/tests/fixtures/incoming_shared_line/sipp_scenario_responder01_test.yml.tt2 @@ -0,0 +1,85 @@ +messages: +- - 'SIP/2.0 407 Proxy Authentication Required' + - 'From: ;tag=[\w-]+' + - 'To: ;tag=[\w-]+' + - 'CSeq: \d+ SUBSCRIBE' + - 'Proxy-Authenticate: Digest realm="incoming-shared-line.scenarios-pbx.test", nonce="[^"]+"' + - 'Server: Sipwise NGCP Proxy' + - 'Content-Length: 0' +- - 'SIP/2.0 202 Accepted' + - 'Record-Route: ' + - 'Record-Route: ' + - 'From: ;tag=[\w-]+' + - 'To: ;tag=[\w-]+' + - 'CSeq: \d+ SUBSCRIBE' + - 'Event: call-info' + - 'Allow-Events: call-info, line-seize' + - 'Server: Sipwise NGCP Proxy' + - 'Content-Length: 0' + - 'Contact: ' +- - 'NOTIFY sip:[% scenarios.1.responders.0.username %]@[% scenarios.1.responders.0.ip %]:[% scenarios.1.responders.0.port %] SIP/2.0' + - 'Record-Route: ' + - 'Record-Route: ' + - 'To: ;tag=[\w-]+' + - 'From: ;tag=[\w-]+' + - 'CSeq: \d+ NOTIFY' + - 'Content-Length: 0' + - 'User-Agent: Sipwise NGCP Proxy' + - 'Call-Info: ;appearance-index=\*;appearance-state=idle' + - 'Event: call-info' + - 'Subscription-State: active' + - 'Contact: ' +- - 'NOTIFY sip:[% scenarios.1.responders.0.username %]@[% scenarios.1.responders.0.ip %]:[% scenarios.1.responders.0.port %] SIP/2.0' + - 'Record-Route: ' + - 'Record-Route: ' + - 'To: ;tag=[\w-]+' + - 'From: ;tag=[\w-]+' + - 'CSeq: \d+ NOTIFY' + - 'Content-Length: 0' + - 'User-Agent: Sipwise NGCP Proxy' + - 'Call-Info: ;appearance-index=1;appearance-state=active;appearance-uri="",;appearance-index=\*;appearance-state=idle' + - 'Event: call-info' + - 'Subscription-State: active;expires=\d+' + - 'Contact: ' +- - 'NOTIFY sip:[% scenarios.1.responders.0.username %]@[% scenarios.1.responders.0.ip %]:[% scenarios.1.responders.0.port %] SIP/2.0' + - 'Record-Route: ' + - 'Record-Route: ' + - 'To: ;tag=[\w-]+' + - 'From: ;tag=[\w-]+' + - 'CSeq: \d+ NOTIFY' + - 'Content-Length: 0' + - 'User-Agent: Sipwise NGCP Proxy' + - 'Call-Info: ;appearance-index=\*;appearance-state=idle' + - 'Event: call-info' + - 'Subscription-State: active;expires=\d+' + - 'Contact: ' +- - 'SIP/2.0 407 Proxy Authentication Required' + - 'From: ;tag=[\w-]+' + - 'To: ;tag=[\w-]+' + - 'CSeq: \d+ SUBSCRIBE' + - 'Proxy-Authenticate: Digest realm="incoming-shared-line.scenarios-pbx.test", nonce="[^"]+"' + - 'Server: Sipwise NGCP Proxy' + - 'Content-Length: 0' +- - 'SIP/2.0 202 Accepted' + - 'Record-Route: ' + - 'Record-Route: ' + - 'From: ;tag=[\w-]+' + - 'To: ;tag=[\w-]+' + - 'CSeq: \d+ SUBSCRIBE' + - 'Event: call-info' + - 'Allow-Events: call-info, line-seize' + - 'Server: Sipwise NGCP Proxy' + - 'Content-Length: 0' + - 'Contact: ' +- - 'NOTIFY sip:[% scenarios.1.responders.0.username %]@[% scenarios.1.responders.0.ip %]:[% scenarios.1.responders.0.port %] SIP/2.0' + - 'Record-Route: ' + - 'Record-Route: ' + - 'To: ;tag=[\w-]+' + - 'From: ;tag=[\w-]+' + - 'CSeq: \d+ NOTIFY' + - 'Content-Length: 0' + - 'User-Agent: Sipwise NGCP Proxy' + - 'Call-Info: ;appearance-index=\*;appearance-state=idle' + - 'Event: call-info' + - 'Subscription-State: terminated' + - 'Contact: ' diff --git a/tests/fixtures/incoming_shared_line/sipp_scenario_responder02.msg b/tests/fixtures/incoming_shared_line/sipp_scenario_responder02.msg new file mode 100644 index 00000000..bf2ae8a4 --- /dev/null +++ b/tests/fixtures/incoming_shared_line/sipp_scenario_responder02.msg @@ -0,0 +1,100 @@ +----------------------------------------------- 2021-08-16 06:46:31.895215 +UDP message received [1401] bytes : + +INVITE sip:testuser1002@10.20.29.2:51607 SIP/2.0 +Record-Route: +Record-Route: +Record-Route: +Via: SIP/2.0/UDP 192.168.211.202;branch=z9hG4bK5934.850595cf7b8c6d5598ad2d5f06890547.0 +Via: SIP/2.0/UDP 127.0.0.1:5062;rport=5062;branch=z9hG4bK5934.ea430803a2fe3d27015d8014bd9ef726.0 +Via: SIP/2.0/UDP 127.0.0.1:5080;received=127.0.0.1;branch=z9hG4bKOslfRark;rport=5080 +From: ;tag=4C85A051-6119EDA7000C7EAC-8BB80700 +To: +CSeq: 1037 INVITE +Call-ID: NGCP%incoming_shared_line%///1-692096@10.20.29.2_pbx-1 +Max-Forwards: 69 +P-Asserted-Identity: +Content-Type: application/sdp +Content-Length: 180 +Contact: + +v=0 +o=user1 53655765 2353687637 IN IP4 192.168.211.202 +s=- +c=IN IP4 192.168.211.202 +t=0 0 +m=audio 30028 RTP/AVP 8 +a=rtpmap:8 PCMA/8000 +a=sendrecv +a=rtcp:30029 +a=ptime:50 + +----------------------------------------------- 2021-08-16 06:46:32.199454 +UDP message sent (871 bytes): + +SIP/2.0 180 Ringing +Via: SIP/2.0/UDP 192.168.211.202;branch=z9hG4bK5934.850595cf7b8c6d5598ad2d5f06890547.0, SIP/2.0/UDP 127.0.0.1:5062;rport=5062;branch=z9hG4bK5934.ea430803a2fe3d27015d8014bd9ef726.0, SIP/2.0/UDP 127.0.0.1:5080;received=127.0.0.1;branch=z9hG4bKOslfRark;rport=5080 +From: ;tag=4C85A051-6119EDA7000C7EAC-8BB80700 +To: ;tag=692000SIPpTag011 +Call-ID: NGCP%incoming_shared_line%///1-692096@10.20.29.2_pbx-1 +CSeq: 1037 INVITE +Allow: INVITE, INFO, PRACK, ACK, BYE, CANCEL, OPTIONS, NOTIFY, REGISTER, SUBSCRIBE, REFER, PUBLISH, UPDATE, MESSAGE +Call-Info: ;appearance-index=1 +Allow-Events: talk,hold,conference,refer,check-sync +Contact: +Content-Length: 0 + + +----------------------------------------------- 2021-08-16 06:46:33.381712 +UDP message received [429] bytes : + +CANCEL sip:testuser1002@10.20.29.2:51607 SIP/2.0 +Via: SIP/2.0/UDP 192.168.211.202;branch=z9hG4bK5934.850595cf7b8c6d5598ad2d5f06890547.0 +From: ;tag=4C85A051-6119EDA7000C7EAC-8BB80700 +To: +CSeq: 1037 CANCEL +Call-ID: NGCP%incoming_shared_line%///1-692096@10.20.29.2_pbx-1 +Max-Forwards: 69 +Content-Length: 0 + + +----------------------------------------------- 2021-08-16 06:46:33.381779 +UDP message sent (428 bytes): + +SIP/2.0 200 OK +Via: SIP/2.0/UDP 192.168.211.202;branch=z9hG4bK5934.850595cf7b8c6d5598ad2d5f06890547.0 +From: ;tag=4C85A051-6119EDA7000C7EAC-8BB80700 +To: +Call-ID: NGCP%incoming_shared_line%///1-692096@10.20.29.2_pbx-1 +CSeq: 1037 CANCEL +Contact: +Content-Length: 0 + + +----------------------------------------------- 2021-08-16 06:46:33.382884 +UDP message sent (996 bytes): + +SIP/2.0 487 Request terminated +Via: SIP/2.0/UDP 192.168.211.202;branch=z9hG4bK5934.850595cf7b8c6d5598ad2d5f06890547.0, SIP/2.0/UDP 127.0.0.1:5062;rport=5062;branch=z9hG4bK5934.ea430803a2fe3d27015d8014bd9ef726.0, SIP/2.0/UDP 127.0.0.1:5080;received=127.0.0.1;branch=z9hG4bKOslfRark;rport=5080 +From: ;tag=4C85A051-6119EDA7000C7EAC-8BB80700 +To: +Call-ID: NGCP%incoming_shared_line%///1-692096@10.20.29.2_pbx-1 +Record-Route: , , +CSeq: 1037 INVITE +Contact: +Content-Length: 0 + + +----------------------------------------------- 2021-08-16 06:46:33.383153 +UDP message received [423] bytes : + +ACK sip:testuser1002@10.20.29.2:51607 SIP/2.0 +Via: SIP/2.0/UDP 192.168.211.202;branch=z9hG4bK5934.850595cf7b8c6d5598ad2d5f06890547.0 +From: ;tag=4C85A051-6119EDA7000C7EAC-8BB80700 +To: +CSeq: 1037 ACK +Call-ID: NGCP%incoming_shared_line%///1-692096@10.20.29.2_pbx-1 +Max-Forwards: 69 +Content-Length: 0 + + diff --git a/tests/fixtures/incoming_shared_line/sipp_scenario_responder02_test.yml.tt2 b/tests/fixtures/incoming_shared_line/sipp_scenario_responder02_test.yml.tt2 new file mode 100644 index 00000000..b33832d6 --- /dev/null +++ b/tests/fixtures/incoming_shared_line/sipp_scenario_responder02_test.yml.tt2 @@ -0,0 +1,32 @@ +messages: +- - 'INVITE sip:[% scenarios.2.responders.0.username %]@[% scenarios.2.responders.0.ip %]:[% scenarios.2.responders.0.port %] SIP/2.0' + - 'Record-Route: ' + - 'Record-Route: ' + - 'Record-Route: ' + - 'From: ;tag=[\w-]+' + - 'To: ' + - 'CSeq: \d+ INVITE' + - 'P-Asserted-Identity: ' + - 'Content-Type: application/sdp' + - 'Content-Length: \d+' + - 'Contact: ' + - 'v=0' + - 'o=user1 \d+ \d+ IN IP4 [% server_ip %]' + - 's=-' + - 'c=IN IP4 [% server_ip %]' + - 't=0 0' + - 'm=audio \d+ RTP/AVP 8' + - 'a=rtpmap:8 PCMA/8000' + - 'a=sendrecv' + - 'a=rtcp:\d+' + - 'a=ptime:50' +- - 'CANCEL sip:[% scenarios.2.responders.0.username %]@[% scenarios.2.responders.0.ip %]:[% scenarios.2.responders.0.port %] SIP/2.0' + - 'From: ;tag=[\w-]+' + - 'To: ' + - 'CSeq: \d+ CANCEL' + - 'Content-Length: 0' +- - 'ACK sip:[% scenarios.2.responders.0.username %]@[% scenarios.2.responders.0.ip %]:[% scenarios.2.responders.0.port %] SIP/2.0' + - 'From: ;tag=[\w-]+' + - 'To: ' + - 'CSeq: \d+ ACK' + - 'Content-Length: 0' diff --git a/tests/fixtures/incoming_shared_line/sipp_scenario_responder03.msg b/tests/fixtures/incoming_shared_line/sipp_scenario_responder03.msg new file mode 100644 index 00000000..e045662c --- /dev/null +++ b/tests/fixtures/incoming_shared_line/sipp_scenario_responder03.msg @@ -0,0 +1,124 @@ +----------------------------------------------- 2021-08-16 06:46:32.180117 +UDP message received [1401] bytes : + +INVITE sip:testuser1002@10.20.29.2:51608 SIP/2.0 +Record-Route: +Record-Route: +Record-Route: +Via: SIP/2.0/UDP 192.168.211.202;branch=z9hG4bKc36d.7ce580233bccfd51fa7117cf58d114d5.0 +Via: SIP/2.0/UDP 127.0.0.1:5062;rport=5062;branch=z9hG4bKc36d.f8c42ce424f5550df738464a3888b1ee.0 +Via: SIP/2.0/UDP 127.0.0.1:5080;received=127.0.0.1;branch=z9hG4bKX~X59aDn;rport=5080 +From: ;tag=7542D5F2-6119EDA8000119E1-8BB80700 +To: +CSeq: 2069 INVITE +Call-ID: NGCP%incoming_shared_line%///1-692096@10.20.29.2_pbx-1 +Max-Forwards: 69 +P-Asserted-Identity: +Content-Type: application/sdp +Content-Length: 180 +Contact: + +v=0 +o=user1 53655765 2353687637 IN IP4 192.168.211.202 +s=- +c=IN IP4 192.168.211.202 +t=0 0 +m=audio 30058 RTP/AVP 8 +a=rtpmap:8 PCMA/8000 +a=sendrecv +a=rtcp:30059 +a=ptime:50 + +----------------------------------------------- 2021-08-16 06:46:32.583472 +UDP message sent (871 bytes): + +SIP/2.0 180 Ringing +Via: SIP/2.0/UDP 192.168.211.202;branch=z9hG4bKc36d.7ce580233bccfd51fa7117cf58d114d5.0, SIP/2.0/UDP 127.0.0.1:5062;rport=5062;branch=z9hG4bKc36d.f8c42ce424f5550df738464a3888b1ee.0, SIP/2.0/UDP 127.0.0.1:5080;received=127.0.0.1;branch=z9hG4bKX~X59aDn;rport=5080 +From: ;tag=7542D5F2-6119EDA8000119E1-8BB80700 +To: ;tag=692044SIPpTag011 +Call-ID: NGCP%incoming_shared_line%///1-692096@10.20.29.2_pbx-1 +CSeq: 2069 INVITE +Allow: INVITE, INFO, PRACK, ACK, BYE, CANCEL, OPTIONS, NOTIFY, REGISTER, SUBSCRIBE, REFER, PUBLISH, UPDATE, MESSAGE +Call-Info: ;appearance-index=1 +Allow-Events: talk,hold,conference,refer,check-sync +Contact: +Content-Length: 0 + + +----------------------------------------------- 2021-08-16 06:46:33.087518 +UDP message sent (1423 bytes): + +SIP/2.0 200 OK +Via: SIP/2.0/UDP 192.168.211.202;branch=z9hG4bKc36d.7ce580233bccfd51fa7117cf58d114d5.0, SIP/2.0/UDP 127.0.0.1:5062;rport=5062;branch=z9hG4bKc36d.f8c42ce424f5550df738464a3888b1ee.0, SIP/2.0/UDP 127.0.0.1:5080;received=127.0.0.1;branch=z9hG4bKX~X59aDn;rport=5080 +From: ;tag=7542D5F2-6119EDA8000119E1-8BB80700 +To: ;tag=692044SIPpTag011 +Call-ID: NGCP%incoming_shared_line%///1-692096@10.20.29.2_pbx-1 +CSeq: 2069 INVITE +Record-Route: , , +Allow: INVITE, INFO, PRACK, ACK, BYE, CANCEL, OPTIONS, NOTIFY, REGISTER, SUBSCRIBE, REFER, PUBLISH, UPDATE, MESSAGE +Call-Info: ;appearance-index=1 +Allow-Events: talk,hold,conference,refer,check-sync +Contact: +Content-Type: application/sdp +Content-Length: 144 + +v=0 +o=user1 53655765 2353687637 IN IP4 10.20.29.2 +s=- +c=IN IP4 10.20.29.2 +t=0 0 +m=audio 45021 RTP/AVP 8 +a=rtpmap:8 PCMA/8000 +a=ptime:50 + +----------------------------------------------- 2021-08-16 06:46:33.642311 +UDP message received [1111] bytes : + +ACK sip:10.20.29.2:51608;transport=UDP SIP/2.0 +Record-Route: +Record-Route: +Record-Route: +Via: SIP/2.0/UDP 192.168.211.202;branch=z9hG4bKc36d.4c30913fce599a76e75c85fa86684937.0 +Via: SIP/2.0/UDP 127.0.0.1:5062;rport=5062;branch=z9hG4bKc36d.d564b27ba1f197601997fd6bc3025dda.0 +Via: SIP/2.0/UDP 127.0.0.1:5080;received=127.0.0.1;branch=z9hG4bKz4qCKa0J;rport=5080 +From: ;tag=7542D5F2-6119EDA8000119E1-8BB80700 +To: ;tag=692044SIPpTag011 +CSeq: 2069 ACK +Call-ID: NGCP%incoming_shared_line%///1-692096@10.20.29.2_pbx-1 +Max-Forwards: 68 +Content-Length: 0 +Contact: + + +----------------------------------------------- 2021-08-16 06:46:35.126376 +UDP message received [1060] bytes : + +BYE sip:10.20.29.2:51608;transport=UDP SIP/2.0 +Record-Route: +Record-Route: +Record-Route: +Via: SIP/2.0/UDP 192.168.211.202;branch=z9hG4bK417d.ad024f67ba26627f958f299d002db3e8.0 +Via: SIP/2.0/UDP 127.0.0.1:5062;rport=5062;branch=z9hG4bK417d.e5f1b5de7359e0cbc8be33c40de2572c.0 +Via: SIP/2.0/UDP 127.0.0.1:5080;received=127.0.0.1;branch=z9hG4bKGdl4vaVn;rport=5080 +From: ;tag=7542D5F2-6119EDA8000119E1-8BB80700 +To: ;tag=692044SIPpTag011 +CSeq: 2070 BYE +Call-ID: NGCP%incoming_shared_line%///1-692096@10.20.29.2_pbx-1 +Max-Forwards: 68 +P-Asserted-Identity: +Content-Length: 0 + + +----------------------------------------------- 2021-08-16 06:46:35.127056 +UDP message sent (620 bytes): + +SIP/2.0 200 OK +Via: SIP/2.0/UDP 192.168.211.202;branch=z9hG4bK417d.ad024f67ba26627f958f299d002db3e8.0, SIP/2.0/UDP 127.0.0.1:5062;rport=5062;branch=z9hG4bK417d.e5f1b5de7359e0cbc8be33c40de2572c.0, SIP/2.0/UDP 127.0.0.1:5080;received=127.0.0.1;branch=z9hG4bKGdl4vaVn;rport=5080 +From: ;tag=7542D5F2-6119EDA8000119E1-8BB80700 +To: ;tag=692044SIPpTag011 +Call-ID: NGCP%incoming_shared_line%///1-692096@10.20.29.2_pbx-1 +CSeq: 2070 BYE +Contact: +Content-Length: 0 + + diff --git a/tests/fixtures/incoming_shared_line/sipp_scenario_responder03_test.yml.tt2 b/tests/fixtures/incoming_shared_line/sipp_scenario_responder03_test.yml.tt2 new file mode 100644 index 00000000..ed135066 --- /dev/null +++ b/tests/fixtures/incoming_shared_line/sipp_scenario_responder03_test.yml.tt2 @@ -0,0 +1,40 @@ +messages: +- - 'INVITE sip:[% scenarios.2.responders.1.username %]@[% scenarios.2.responders.1.ip %]:[% scenarios.2.responders.1.port %] SIP/2.0' + - 'Record-Route: ' + - 'Record-Route: ' + - 'Record-Route: ' + - 'From: ;tag=[\w-]+' + - 'To: ' + - 'CSeq: \d+ INVITE' + - 'P-Asserted-Identity: ' + - 'Content-Type: application/sdp' + - 'Content-Length: \d+' + - 'Contact: ' + - 'v=0' + - 'o=user1 \d+ \d+ IN IP4 [% server_ip %]' + - 's=-' + - 'c=IN IP4 [% server_ip %]' + - 't=0 0' + - 'm=audio \d+ RTP/AVP 8' + - 'a=rtpmap:8 PCMA/8000' + - 'a=sendrecv' + - 'a=rtcp:\d+' + - 'a=ptime:50' +- - 'ACK sip:[% scenarios.2.responders.1.ip %]:[% scenarios.2.responders.1.port %];transport=UDP SIP/2.0' + - 'Record-Route: ' + - 'Record-Route: ' + - 'Record-Route: ' + - 'From: ;tag=[\w-]+' + - 'To: ;tag=[\w-]+' + - 'CSeq: \d+ ACK' + - 'Content-Length: 0' + - 'Contact: ' +- - 'BYE sip:[% scenarios.2.responders.1.ip %]:[% scenarios.2.responders.1.port %];transport=UDP SIP/2.0' + - 'Record-Route: ' + - 'Record-Route: ' + - 'Record-Route: ' + - 'From: ;tag=[\w-]+' + - 'To: ;tag=[\w-]+' + - 'CSeq: \d+ BYE' + - 'P-Asserted-Identity: ' + - 'Content-Length: 0' diff --git a/tests/test_generate_test_tt2.py b/tests/test_generate_test_tt2.py index 429509dd..6f26be0c 100644 --- a/tests/test_generate_test_tt2.py +++ b/tests/test_generate_test_tt2.py @@ -314,3 +314,83 @@ def test_incoming_peer_resp(generate_test_tt2_file, caplog): TT2_FILE.format("incoming_peer", "_responder00"), res.out_file ) assert res.returncode == 0 + + +def test_ok_incoming_shared_line(generate_test_tt2_file, caplog): + caplog.set_level(logging.DEBUG) + res = generate_test_tt2_file( + IDS_FILE.format("incoming_shared_line"), + MSG_FILE.format("incoming_shared_line", "00"), + ) + + assert check_filecontent( + TT2_FILE.format("incoming_shared_line", "00"), res.out_file + ) + assert res.returncode == 0 + + res = generate_test_tt2_file( + IDS_FILE.format("incoming_shared_line"), + MSG_FILE.format("incoming_shared_line", "01"), + ) + + assert check_filecontent( + TT2_FILE.format("incoming_shared_line", "01"), res.out_file + ) + assert res.returncode == 0 + + res = generate_test_tt2_file( + IDS_FILE.format("incoming_shared_line"), + MSG_FILE.format("incoming_shared_line", "02"), + ) + + assert check_filecontent( + TT2_FILE.format("incoming_shared_line", "02"), res.out_file + ) + assert res.returncode == 0 + + +def test_incoming_shared_line_resp(generate_test_tt2_file, caplog): + caplog.set_level(logging.DEBUG) + res = generate_test_tt2_file( + IDS_FILE.format("incoming_shared_line"), + MSG_FILE.format("incoming_shared_line", "_responder00"), + ) + + assert check_filecontent( + TT2_FILE.format("incoming_shared_line", "_responder00"), + res.out_file, + ) + assert res.returncode == 0 + + res = generate_test_tt2_file( + IDS_FILE.format("incoming_shared_line"), + MSG_FILE.format("incoming_shared_line", "_responder01"), + ) + + assert check_filecontent( + TT2_FILE.format("incoming_shared_line", "_responder01"), + res.out_file, + ) + assert res.returncode == 0 + + res = generate_test_tt2_file( + IDS_FILE.format("incoming_shared_line"), + MSG_FILE.format("incoming_shared_line", "_responder02"), + ) + + assert check_filecontent( + TT2_FILE.format("incoming_shared_line", "_responder02"), + res.out_file, + ) + assert res.returncode == 0 + + res = generate_test_tt2_file( + IDS_FILE.format("incoming_shared_line"), + MSG_FILE.format("incoming_shared_line", "_responder03"), + ) + + assert check_filecontent( + TT2_FILE.format("incoming_shared_line", "_responder03"), + res.out_file, + ) + assert res.returncode == 0