-
Notifications
You must be signed in to change notification settings - Fork 7
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Add new b2b tests for some corner case scenarios
(cherry picked from commit a5c473d)
- Loading branch information
1 parent
f4e4145
commit 897825d
Showing
21 changed files
with
3,115 additions
and
0 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,88 @@ | ||
# | ||
# OpenSIPS residential configuration script | ||
# by OpenSIPS Solutions <[email protected]> | ||
# | ||
# 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" | ||
|
||
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; | ||
} | ||
|
||
# initialize the internal topology hiding scenario | ||
b2b_init_request("top hiding"); | ||
|
||
exit; | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,22 @@ | ||
--- | ||
timeout: 20 | ||
|
||
tasks: | ||
- name: OpenSIPS | ||
type: opensips | ||
|
||
- name: SIPP UAS | ||
type: uas-sipp | ||
config_file: scripts/uas.xml | ||
duration: 3000 | ||
require: OpenSIPS | ||
|
||
- name: SIPP UAC | ||
type: uac-sipp | ||
config_file: scripts/uac.xml | ||
username: {{ username }} | ||
remote: {{ uas_ip }}:{{ uas_port }} | ||
require: | ||
started: | ||
task: SIPP UAS | ||
wait: 0.5 |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,151 @@ | ||
<?xml version="1.0" encoding="ISO-8859-1" ?> | ||
<!DOCTYPE scenario SYSTEM "sipp.dtd"> | ||
|
||
<scenario name="Basic Sipstone UAC"> | ||
|
||
<nop> | ||
<action> | ||
<assignstr assign_to="domain" value="[domain]"/> | ||
</action> | ||
</nop> | ||
<!-- In client mode (sipp placing calls), the Call-ID MUST be --> | ||
<!-- generated by sipp. To do so, use [call_id] keyword. --> | ||
<send retrans="500" id="1"> | ||
<![CDATA[ | ||
INVITE sip:[service]@[remote_ip]:[remote_port] SIP/2.0 | ||
Via: SIP/2.0/[transport] [local_ip]:[local_port];branch=[branch] | ||
Max-Forwards: 70 | ||
From: <sip:[caller]@[local_ip]:[local_port]>;tag=[call_number] | ||
To: <sip:[service]@[remote_ip]:[remote_port]> | ||
Call-ID: [call_id] | ||
CSeq: 1 INVITE | ||
Contact: <sip:[local_ip]:[local_port]> | ||
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 | ||
]]> | ||
</send> | ||
|
||
<recv response="100" | ||
optional="true"> | ||
</recv> | ||
|
||
<recv response="180" optional="true"> | ||
</recv> | ||
|
||
<!-- By adding rrs="true" (Record Route Sets), the route sets --> | ||
<!-- are saved and used for following messages sent. Useful to test --> | ||
<!-- against stateful SIP proxies/B2BUAs. --> | ||
<recv response="200" rtd="true" rrs="true"> | ||
<action> | ||
<!-- there should only be one Via --> | ||
<ereg regexp=".+" search_in="hdr" header="Via:" check_it="true" assign_to="dummy"/> | ||
<ereg regexp="," search_in="hdr" header="Via:" check_it_inverse="true" assign_to="dummy"/> | ||
<ereg regexp=".+" search_in="hdr" header="Via:" occurence="2" check_it_inverse="true" assign_to="dummy"/> | ||
<!-- there should only be no Route or Record-Route headers --> | ||
<ereg regexp=".+" search_in="hdr" header="Route:" check_it_inverse="true" assign_to="dummy"/> | ||
<!-- check the contact is the proxy --> | ||
<ereg regexp="<sip:([^;@]*)>" search_in="hdr" check_it="true" header="Contact:" assign_to="dummy,contact" /> | ||
<strcmp assign_to="result" variable="contact" variable2="domain"/> | ||
<ereg regexp="." search_in="var" check_it_inverse="true" variable="result" assign_to="dummy"/> | ||
<!-- check the tag contains B2B --> | ||
<ereg regexp="[:space:]*<sip:([^>]*)>;tag=B2B." search_in="hdr" check_it="true" header="To:" assign_to="dummy,dummy" /> | ||
|
||
</action> | ||
</recv> | ||
|
||
<!-- Packet lost can be simulated in any send/recv message by --> | ||
<!-- by adding the 'lost = "10"'. Value can be [1-100] percent. --> | ||
<send> | ||
<![CDATA[ | ||
ACK [next_url] SIP/2.0 | ||
Via: SIP/2.0/[transport] [local_ip]:[local_port];branch=[branch] | ||
From: <sip:[caller]@[local_ip]:[local_port]>;tag=[call_number] | ||
To: <sip:[service]@[remote_ip]:[remote_port]>[peer_tag_param] | ||
[routes] | ||
CSeq: 1 ACK | ||
Contact: <sip:[local_ip]:[local_port]> | ||
Call-ID: [call_id] | ||
Max-Forwards: 70 | ||
Subject: Performance Test | ||
User-Agent: sipp | ||
Content-Length: 0 | ||
]]> | ||
</send> | ||
|
||
<recv request="INVITE" crlf="true" rrs="true"> | ||
</recv> | ||
|
||
<pause milliseconds="200"/> | ||
|
||
<send retrans="500"> | ||
<![CDATA[ | ||
SIP/2.0 488 Not Acceptable Here | ||
[last_Via:] | ||
[last_From:] | ||
[last_To:] | ||
[last_Call-ID:] | ||
[last_CSeq:] | ||
[last_Record-Route:] | ||
Contact: <sip:[local_ip]:[local_port]> | ||
]]> | ||
</send> | ||
|
||
<recv request="ACK" crlf="true" rrs="true"> | ||
</recv> | ||
|
||
<recv request="BYE" crlf="true" rrs="true"> | ||
<action> | ||
<!-- there should only be one Via --> | ||
<ereg regexp=".+" search_in="hdr" header="Via:" check_it="true" assign_to="dummy"/> | ||
<ereg regexp="," search_in="hdr" header="Via:" check_it_inverse="true" assign_to="dummy"/> | ||
<ereg regexp=".+" search_in="hdr" header="Via:" occurence="2" check_it_inverse="true" assign_to="dummy"/> | ||
<!-- there should only be no Route or Record-Route headers --> | ||
<ereg regexp=".+" search_in="hdr" header="Route:" check_it_inverse="true" assign_to="dummy"/> | ||
<!-- check the contact is the proxy --> | ||
<ereg regexp="<sip:([^;@]*)>" search_in="hdr" check_it="true" header="Contact:" assign_to="dummy,contact" /> | ||
<strcmp assign_to="result" variable="contact" variable2="domain"/> | ||
<ereg regexp="." search_in="var" check_it_inverse="true" variable="result" assign_to="dummy"/> | ||
<!-- check the From tag contains B2B --> | ||
<ereg regexp="[:space:]*<sip:([^>]*)>;tag=B2B." search_in="hdr" check_it="true" header="From:" assign_to="dummy,dummy" /> | ||
</action> | ||
</recv> | ||
|
||
<send retrans="500"> | ||
<![CDATA[ | ||
SIP/2.0 200 OK | ||
[last_Via:] | ||
[last_From:] | ||
[last_To:] | ||
[last_Call-ID:] | ||
[last_CSeq:] | ||
[last_Record-Route:] | ||
Contact: <sip:[local_ip]:[local_port]> | ||
Content-Length: 0 | ||
]]> | ||
</send> | ||
|
||
<!-- definition of the response time repartition table (unit is ms) --> | ||
<ResponseTimeRepartition value="500, 1000, 1500, 2000"/> | ||
|
||
<!-- definition of the call length repartition table (unit is ms) --> | ||
<CallLengthRepartition value="500"/> | ||
|
||
<Global variables="caller" /> | ||
<Reference variables="dummy,contact,result,domain,caller"/> | ||
|
||
</scenario> |
Oops, something went wrong.