From aa4a79fdd1c98e3c80225aeddd1d9be3fa6eb816 Mon Sep 17 00:00:00 2001 From: Razvan Crainea Date: Tue, 23 Jan 2024 12:40:32 +0200 Subject: [PATCH] add parking late-bye tests --- README.md | 8 + b2b/26.parking-late-bye-delay/defines.yml | 4 + b2b/26.parking-late-bye-delay/opensips.cfg | 113 +++++++++++ b2b/26.parking-late-bye-delay/scenario.yml | 46 +++++ b2b/26.parking-late-bye-delay/scripts/uac.xml | 191 ++++++++++++++++++ .../scripts/uac_pickup.xml | 125 ++++++++++++ b2b/26.parking-late-bye-delay/scripts/uas.xml | 155 ++++++++++++++ b2b/26.parking-late-bye/defines.yml | 4 + b2b/26.parking-late-bye/opensips.cfg | 112 ++++++++++ b2b/26.parking-late-bye/scenario.yml | 46 +++++ b2b/26.parking-late-bye/scripts/uac.xml | 191 ++++++++++++++++++ .../scripts/uac_pickup.xml | 125 ++++++++++++ b2b/26.parking-late-bye/scripts/uas.xml | 155 ++++++++++++++ b2b/26.parking/scripts/uac.xml | 6 +- b2b/26.parking/scripts/uac_pickup.xml | 4 +- 15 files changed, 1280 insertions(+), 5 deletions(-) create mode 100644 b2b/26.parking-late-bye-delay/defines.yml create mode 100644 b2b/26.parking-late-bye-delay/opensips.cfg create mode 100644 b2b/26.parking-late-bye-delay/scenario.yml create mode 100644 b2b/26.parking-late-bye-delay/scripts/uac.xml create mode 100644 b2b/26.parking-late-bye-delay/scripts/uac_pickup.xml create mode 100644 b2b/26.parking-late-bye-delay/scripts/uas.xml create mode 100644 b2b/26.parking-late-bye/defines.yml create mode 100644 b2b/26.parking-late-bye/opensips.cfg create mode 100644 b2b/26.parking-late-bye/scenario.yml create mode 100644 b2b/26.parking-late-bye/scripts/uac.xml create mode 100644 b2b/26.parking-late-bye/scripts/uac_pickup.xml create mode 100644 b2b/26.parking-late-bye/scripts/uas.xml diff --git a/README.md b/README.md index 2e7a8b6..5d20df5 100644 --- a/README.md +++ b/README.md @@ -352,6 +352,14 @@ Runs the internal topology hiding scenario. Runs a simple parking scenario where a call is sent to a media server then picked up by the called entity later. +#### 26.parking-late-bye +Run the same as [26.parking](#26parking) scenario, but delays the bye towards +the initial entity until the pickup is established. + +#### 26.parking-late-bye-delay +Run the same as [26.parking-late-bye](#26parking-late-bye) scenario, but +delays the BYE being sent with a configured value. + #### 27.top-hiding-reject Run the same as [25.top-hiding](#25top-hiding) scenario, but send re-INVITEs which are rejected. diff --git a/b2b/26.parking-late-bye-delay/defines.yml b/b2b/26.parking-late-bye-delay/defines.yml new file mode 100644 index 0000000..44abab0 --- /dev/null +++ b/b2b/26.parking-late-bye-delay/defines.yml @@ -0,0 +1,4 @@ +--- +media_ip: 192.168.52.5 +media_port: 5060 +uac_pickup_port: 5044 \ No newline at end of file diff --git a/b2b/26.parking-late-bye-delay/opensips.cfg b/b2b/26.parking-late-bye-delay/opensips.cfg new file mode 100644 index 0000000..b512cf5 --- /dev/null +++ b/b2b/26.parking-late-bye-delay/opensips.cfg @@ -0,0 +1,113 @@ +# +# OpenSIPS residential configuration script +# by OpenSIPS Solutions +# +# This script was generated via "make menuconfig", from +# the "Residential" scenario. +# You can enable / disable more features / functionalities by +# re-generating the scenario with different options.# +# +# Please refer to the Core CookBook at: +# https://opensips.org/Resources/DocsCookbooks +# for a explanation of possible statements, functions and parameters. +# + + +####### Global Parameters ######### +###################################################################### +/* uncomment the following lines to enable debugging */ +#debug_mode=yes + +log_level=4 +xlog_level=4 +log_stderror=yes + +udp_workers=4 + +####### Modules Section ######## + +#set module path +mpath="/usr/lib/x86_64-linux-gnu/opensips/modules/" + +#### SIGNALING module +loadmodule "signaling.so" + +#### StateLess module +loadmodule "sl.so" + +#### Transaction Module +loadmodule "tm.so" +modparam("tm", "fr_timeout", 5) +modparam("tm", "fr_inv_timeout", 30) +modparam("tm", "restart_fr_on_each_reply", 0) +modparam("tm", "onreply_avp_mode", 1) + +#### SIP MSG OPerationS module +loadmodule "sipmsgops.so" + +#### MAX ForWarD module +loadmodule "maxfwd.so" + +#### Record Route Module +loadmodule "rr.so" +/* do not append from tag to the RR (no need for this script) */ +modparam("rr", "append_fromtag", 0) + +#### B2B modules +loadmodule "b2b_entities.so" +loadmodule "b2b_logic.so" +modparam("b2b_logic", "script_req_route", "b2b_logic_request") +modparam("b2b_logic", "old_entity_term_delay", 2) + +loadmodule "cachedb_local.so" + +loadmodule "proto_udp.so" + +####### Routing Logic ######## + +# main request routing logic + +route { + + if (!mf_process_maxfwd_header(10)) { + send_reply(483,"Too Many Hops"); + exit; + } + + if (has_totag()) { + send_reply(481, "Call/Transaction Does Not Exist"); + exit; + } + + # accept just INVITE requests + if (!is_method("INVITE")) { + send_reply(503, "Service Unavailable"); + exit; + } + + if ($rU == "pickup") { + cache_fetch("local", "$fU", $var(b2bl_key)); + cache_remove("local", "$fU"); + + if ($var(b2bl_key) != NULL) + b2b_bridge_request($var(b2bl_key), 0,, "late_bye"); + else + send_reply(481, "Call/Transaction Does Not Exist"); + + exit; + } + + b2b_server_new("caller"); + + b2b_client_new("media", "sip:parking_media@192.168.52.5"); + + b2b_init_request("parking"); + + cache_store("local", "$tU", "$b2b_logic.key"); + + exit; +} + +route[b2b_logic_request] { + b2b_pass_request(); +} diff --git a/b2b/26.parking-late-bye-delay/scenario.yml b/b2b/26.parking-late-bye-delay/scenario.yml new file mode 100644 index 0000000..9731947 --- /dev/null +++ b/b2b/26.parking-late-bye-delay/scenario.yml @@ -0,0 +1,46 @@ +--- +timeout: 35 + +tasks: + - name: OpenSIPS + type: opensips + + - name: SIPP Media + type: uas-sipp + config_file: scripts/uas.xml + require: OpenSIPS + ip: {{ media_ip }} + port: {{ media_port }} + + - name: SIPP UAC + type: uac-sipp + duration: 1 + service: {{ username }} + config_file: scripts/uac.xml + proxy: {{ opensips_ip }}:{{ opensips_port }} + caller: caller + require: + - started: + task: SIPP Media + wait: 0.5 + - after: + task: OpenSIPS + wait: 0.5 + + - name: SIPP UAC Pickup + type: uac-sipp + port: {{uac_pickup_port}} + service: pickup + config_file: scripts/uac_pickup.xml + proxy: {{ opensips_ip }}:{{ opensips_port }} + caller: {{ username }} + require: + - started: + task: SIPP UAC + wait: 2 + - started: + task: SIPP Media + wait: 0.5 + - after: + task: OpenSIPS + wait: 0.5 diff --git a/b2b/26.parking-late-bye-delay/scripts/uac.xml b/b2b/26.parking-late-bye-delay/scripts/uac.xml new file mode 100644 index 0000000..1c3e3b4 --- /dev/null +++ b/b2b/26.parking-late-bye-delay/scripts/uac.xml @@ -0,0 +1,191 @@ + + + + + + + + + + + + + + ;tag=[call_number] + To: + Call-ID: parking-late-bye-delay:///[call_id] + CSeq: 1 INVITE + Contact: + 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 0 + a=rtpmap:0 PCMU/8000 + + ]]> + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + ;tag=[call_number] + To: [peer_tag_param] + [routes] + CSeq: 1 ACK + Contact: + Call-ID: parking-late-bye-delay:///[call_id] + Max-Forwards: 70 + Subject: Performance Test + User-Agent: sipp + Content-Length: 0 + + ]]> + + + + + + + + + + + + + + + + + + + + + + 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 0 + a=rtpmap:0 PCMU/8000 + + ]]> + + + + + + + + + + + + + + + + + + + + + + + + + + + + + Call-ID: parking-late-bye-delay:///[call_id] + Max-Forwards: 70 + User-Agent: sipp + Content-Length: 0 + + ]]> + + + + + + + + + + + + + + + + + + + + + + + + + + + diff --git a/b2b/26.parking-late-bye-delay/scripts/uac_pickup.xml b/b2b/26.parking-late-bye-delay/scripts/uac_pickup.xml new file mode 100644 index 0000000..b05121f --- /dev/null +++ b/b2b/26.parking-late-bye-delay/scripts/uac_pickup.xml @@ -0,0 +1,125 @@ + + + + + + + + + + + + + + ;tag=[call_number] + To: + Call-ID: parking-late-bye-delay:///[call_id] + CSeq: 1 INVITE + Contact: + 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 0 + a=rtpmap:0 PCMU/8000 + + ]]> + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + ;tag=[call_number] + To: [peer_tag_param] + [routes] + CSeq: 1 ACK + Contact: + Call-ID: parking-late-bye-delay:///[call_id] + Max-Forwards: 70 + Subject: Performance Test + User-Agent: sipp + Content-Length: 0 + + ]]> + + + + + + + + + + + + + + + + + + + + + + Content-Length: 0 + ]]> + + + + + + + + + + + + diff --git a/b2b/26.parking-late-bye-delay/scripts/uas.xml b/b2b/26.parking-late-bye-delay/scripts/uas.xml new file mode 100644 index 0000000..c2929dc --- /dev/null +++ b/b2b/26.parking-late-bye-delay/scripts/uas.xml @@ -0,0 +1,155 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + Content-Length: 0 + + ]]> + + + + + + + + + + + + + + + + + + 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 0 + a=rtpmap:0 PCMU/8000 + + ]]> + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + Content-Length: 0 + ]]> + + + + + + + + + + + diff --git a/b2b/26.parking-late-bye/defines.yml b/b2b/26.parking-late-bye/defines.yml new file mode 100644 index 0000000..44abab0 --- /dev/null +++ b/b2b/26.parking-late-bye/defines.yml @@ -0,0 +1,4 @@ +--- +media_ip: 192.168.52.5 +media_port: 5060 +uac_pickup_port: 5044 \ No newline at end of file diff --git a/b2b/26.parking-late-bye/opensips.cfg b/b2b/26.parking-late-bye/opensips.cfg new file mode 100644 index 0000000..9ac242f --- /dev/null +++ b/b2b/26.parking-late-bye/opensips.cfg @@ -0,0 +1,112 @@ +# +# OpenSIPS residential configuration script +# by OpenSIPS Solutions +# +# This script was generated via "make menuconfig", from +# the "Residential" scenario. +# You can enable / disable more features / functionalities by +# re-generating the scenario with different options.# +# +# Please refer to the Core CookBook at: +# https://opensips.org/Resources/DocsCookbooks +# for a explanation of possible statements, functions and parameters. +# + + +####### Global Parameters ######### +###################################################################### +/* uncomment the following lines to enable debugging */ +#debug_mode=yes + +log_level=4 +xlog_level=4 +log_stderror=yes + +udp_workers=4 + +####### Modules Section ######## + +#set module path +mpath="/usr/lib/x86_64-linux-gnu/opensips/modules/" + +#### SIGNALING module +loadmodule "signaling.so" + +#### StateLess module +loadmodule "sl.so" + +#### Transaction Module +loadmodule "tm.so" +modparam("tm", "fr_timeout", 5) +modparam("tm", "fr_inv_timeout", 30) +modparam("tm", "restart_fr_on_each_reply", 0) +modparam("tm", "onreply_avp_mode", 1) + +#### SIP MSG OPerationS module +loadmodule "sipmsgops.so" + +#### MAX ForWarD module +loadmodule "maxfwd.so" + +#### Record Route Module +loadmodule "rr.so" +/* do not append from tag to the RR (no need for this script) */ +modparam("rr", "append_fromtag", 0) + +#### B2B modules +loadmodule "b2b_entities.so" +loadmodule "b2b_logic.so" +modparam("b2b_logic", "script_req_route", "b2b_logic_request") + +loadmodule "cachedb_local.so" + +loadmodule "proto_udp.so" + +####### Routing Logic ######## + +# main request routing logic + +route { + + if (!mf_process_maxfwd_header(10)) { + send_reply(483,"Too Many Hops"); + exit; + } + + if (has_totag()) { + send_reply(481, "Call/Transaction Does Not Exist"); + exit; + } + + # accept just INVITE requests + if (!is_method("INVITE")) { + send_reply(503, "Service Unavailable"); + exit; + } + + if ($rU == "pickup") { + cache_fetch("local", "$fU", $var(b2bl_key)); + cache_remove("local", "$fU"); + + if ($var(b2bl_key) != NULL) + b2b_bridge_request($var(b2bl_key), 0,, "late_bye"); + else + send_reply(481, "Call/Transaction Does Not Exist"); + + exit; + } + + b2b_server_new("caller"); + + b2b_client_new("media", "sip:parking_media@192.168.52.5"); + + b2b_init_request("parking"); + + cache_store("local", "$tU", "$b2b_logic.key"); + + exit; +} + +route[b2b_logic_request] { + b2b_pass_request(); +} diff --git a/b2b/26.parking-late-bye/scenario.yml b/b2b/26.parking-late-bye/scenario.yml new file mode 100644 index 0000000..9731947 --- /dev/null +++ b/b2b/26.parking-late-bye/scenario.yml @@ -0,0 +1,46 @@ +--- +timeout: 35 + +tasks: + - name: OpenSIPS + type: opensips + + - name: SIPP Media + type: uas-sipp + config_file: scripts/uas.xml + require: OpenSIPS + ip: {{ media_ip }} + port: {{ media_port }} + + - name: SIPP UAC + type: uac-sipp + duration: 1 + service: {{ username }} + config_file: scripts/uac.xml + proxy: {{ opensips_ip }}:{{ opensips_port }} + caller: caller + require: + - started: + task: SIPP Media + wait: 0.5 + - after: + task: OpenSIPS + wait: 0.5 + + - name: SIPP UAC Pickup + type: uac-sipp + port: {{uac_pickup_port}} + service: pickup + config_file: scripts/uac_pickup.xml + proxy: {{ opensips_ip }}:{{ opensips_port }} + caller: {{ username }} + require: + - started: + task: SIPP UAC + wait: 2 + - started: + task: SIPP Media + wait: 0.5 + - after: + task: OpenSIPS + wait: 0.5 diff --git a/b2b/26.parking-late-bye/scripts/uac.xml b/b2b/26.parking-late-bye/scripts/uac.xml new file mode 100644 index 0000000..9584bfb --- /dev/null +++ b/b2b/26.parking-late-bye/scripts/uac.xml @@ -0,0 +1,191 @@ + + + + + + + + + + + + + + ;tag=[call_number] + To: + Call-ID: parking-late-bye:///[call_id] + CSeq: 1 INVITE + Contact: + 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 0 + a=rtpmap:0 PCMU/8000 + + ]]> + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + ;tag=[call_number] + To: [peer_tag_param] + [routes] + CSeq: 1 ACK + Contact: + Call-ID: parking-late-bye:///[call_id] + Max-Forwards: 70 + Subject: Performance Test + User-Agent: sipp + Content-Length: 0 + + ]]> + + + + + + + + + + + + + + + + + + + + + + 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 0 + a=rtpmap:0 PCMU/8000 + + ]]> + + + + + + + + + + + + + + + + + + + + + + + + + + + + + Call-ID: parking-late-bye:///[call_id] + Max-Forwards: 70 + User-Agent: sipp + Content-Length: 0 + + ]]> + + + + + + + + + + + + + + + + + + + + + + + + + + + diff --git a/b2b/26.parking-late-bye/scripts/uac_pickup.xml b/b2b/26.parking-late-bye/scripts/uac_pickup.xml new file mode 100644 index 0000000..e8d0c5b --- /dev/null +++ b/b2b/26.parking-late-bye/scripts/uac_pickup.xml @@ -0,0 +1,125 @@ + + + + + + + + + + + + + + ;tag=[call_number] + To: + Call-ID: parking-late-bye:///[call_id] + CSeq: 1 INVITE + Contact: + 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 0 + a=rtpmap:0 PCMU/8000 + + ]]> + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + ;tag=[call_number] + To: [peer_tag_param] + [routes] + CSeq: 1 ACK + Contact: + Call-ID: parking-late-bye:///[call_id] + Max-Forwards: 70 + Subject: Performance Test + User-Agent: sipp + Content-Length: 0 + + ]]> + + + + + + + + + + + + + + + + + + + + + + Content-Length: 0 + ]]> + + + + + + + + + + + + diff --git a/b2b/26.parking-late-bye/scripts/uas.xml b/b2b/26.parking-late-bye/scripts/uas.xml new file mode 100644 index 0000000..c2929dc --- /dev/null +++ b/b2b/26.parking-late-bye/scripts/uas.xml @@ -0,0 +1,155 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + Content-Length: 0 + + ]]> + + + + + + + + + + + + + + + + + + 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 0 + a=rtpmap:0 PCMU/8000 + + ]]> + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + Content-Length: 0 + ]]> + + + + + + + + + + + diff --git a/b2b/26.parking/scripts/uac.xml b/b2b/26.parking/scripts/uac.xml index 15477e8..97a28fb 100644 --- a/b2b/26.parking/scripts/uac.xml +++ b/b2b/26.parking/scripts/uac.xml @@ -18,7 +18,7 @@ Max-Forwards: 70 From: ;tag=[call_number] To: - Call-ID: [call_id] + Call-ID: parking:///[call_id] CSeq: 1 INVITE Contact: Content-Type: application/sdp @@ -72,7 +72,7 @@ [routes] CSeq: 1 ACK Contact: - Call-ID: [call_id] + Call-ID: parking:///[call_id] Max-Forwards: 70 Subject: Performance Test User-Agent: sipp @@ -156,7 +156,7 @@ [routes] CSeq: 2 BYE Contact: - Call-ID: [call_id] + Call-ID: parking:///[call_id] Max-Forwards: 70 User-Agent: sipp Content-Length: 0 diff --git a/b2b/26.parking/scripts/uac_pickup.xml b/b2b/26.parking/scripts/uac_pickup.xml index 4c9add6..f0d67eb 100644 --- a/b2b/26.parking/scripts/uac_pickup.xml +++ b/b2b/26.parking/scripts/uac_pickup.xml @@ -18,7 +18,7 @@ Max-Forwards: 70 From: ;tag=[call_number] To: - Call-ID: [call_id] + Call-ID: parking:///[call_id] CSeq: 1 INVITE Contact: Content-Type: application/sdp @@ -72,7 +72,7 @@ [routes] CSeq: 1 ACK Contact: - Call-ID: [call_id] + Call-ID: parking:///[call_id] Max-Forwards: 70 Subject: Performance Test User-Agent: sipp