-
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.
b2b: add refer notify cancelled scenarios
- Loading branch information
1 parent
af9855e
commit 2f709d2
Showing
25 changed files
with
2,880 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,3 @@ | ||
--- | ||
transfer_ip: 192.168.52.5 | ||
transfer_port: 5065 |
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,113 @@ | ||
# | ||
# 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", 3) | ||
modparam("tm", "fr_inv_timeout", 5) | ||
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 "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; | ||
} | ||
|
||
# create the server entity | ||
b2b_server_new("caller"); | ||
# create the initial client entity, to connect the caller with the callee | ||
b2b_client_new("callee", $ru); | ||
|
||
# initialize B2B session for the "refer" scenario | ||
b2b_init_request("refer"); | ||
|
||
exit; | ||
} | ||
|
||
route[b2b_logic_request] { | ||
if ($rm != "REFER") { | ||
# for requests other than REFER, no special actions needs to be done, | ||
# just pass the request to the peer | ||
b2b_pass_request(); | ||
exit; | ||
} | ||
|
||
# end dialog with the referrer | ||
b2b_send_reply(202, "Accepted"); | ||
|
||
# create the client entity corresponding to | ||
# the user specified in the 'Refer-To' header | ||
b2b_client_new("referee", $hdr(Refer-To)); | ||
|
||
# bridge the referrer's peer with the referee | ||
b2b_bridge("peer", "referee", ,"notify, no-late-sdp, rollback-failed"); | ||
} |
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,37 @@ | ||
--- | ||
timeout: 20 | ||
|
||
tasks: | ||
- name: OpenSIPS | ||
type: opensips | ||
|
||
- name: SIPP UAS | ||
type: uas-sipp | ||
config_file: scripts/uas.xml | ||
require: OpenSIPS | ||
|
||
- name: SIPP UAC | ||
type: uac-sipp | ||
config_file: scripts/uac.xml | ||
duration: 2000 # before and after transfer | ||
username: {{ username }} | ||
remote: {{ uas_ip }}:{{ uas_port }} | ||
require: | ||
started: | ||
task: SIPP UAS | ||
wait: 0.5 | ||
keys: | ||
transfer: sip:transfer@{{ transfer_ip }}:{{ transfer_port }} | ||
|
||
- name: SIPP Transfer | ||
type: uas-sipp | ||
config_file: scripts/transfer.xml | ||
ip: {{ transfer_ip }} | ||
port: {{ transfer_port }} | ||
require: | ||
- started: | ||
task: SIPP UAC | ||
wait: 0.5 | ||
- after: | ||
task: OpenSIPS | ||
wait: 0.5 |
157 changes: 157 additions & 0 deletions
157
b2b/31.refer-unattended-uac-notify-cancel/scripts/transfer.xml
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,157 @@ | ||
<?xml version="1.0" encoding="ISO-8859-1" ?> | ||
<!DOCTYPE scenario SYSTEM "sipp.dtd"> | ||
|
||
<!-- This program is free software; you can redistribute it and/or --> | ||
<!-- modify it under the terms of the GNU General Public License as --> | ||
<!-- published by the Free Software Foundation; either version 2 of the --> | ||
<!-- License, or (at your option) any later version. --> | ||
<!-- --> | ||
<!-- This program is distributed in the hope that it will be useful, --> | ||
<!-- but WITHOUT ANY WARRANTY; without even the implied warranty of --> | ||
<!-- MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the --> | ||
<!-- GNU General Public License for more details. --> | ||
<!-- --> | ||
<!-- You should have received a copy of the GNU General Public License --> | ||
<!-- along with this program; if not, write to the --> | ||
<!-- Free Software Foundation, Inc., --> | ||
<!-- 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA --> | ||
<!-- --> | ||
<!-- Sipp default 'uas' scenario. --> | ||
<!-- --> | ||
|
||
<scenario name="Basic UAS responder"> | ||
<nop> | ||
<action> | ||
<assignstr assign_to="domain" value="[domain]"/> | ||
</action> | ||
</nop> | ||
<!-- 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 request="INVITE" 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"/> | ||
<ereg regexp="[:space:]*B2B." search_in="hdr" check_it="true" header="Call-ID:" assign_to="dummy" /> | ||
<ereg regexp=".*" search_in="hdr" header="Via" assign_to="remote_via"/> | ||
<ereg regexp=".*" search_in="hdr" header="CSeq" assign_to="remote_cseq"/> | ||
</action> | ||
</recv> | ||
|
||
<send> | ||
<![CDATA[ | ||
SIP/2.0 100 Trying | ||
[last_Via:] | ||
[last_From:] | ||
[last_To:];tag=[service].[call_number] | ||
[last_Call-ID:] | ||
[last_CSeq:] | ||
Contact: <sip:[local_ip]:[local_port]> | ||
Content-Length: 0 | ||
]]> | ||
</send> | ||
|
||
<pause milliseconds="100"/> | ||
|
||
<send> | ||
<![CDATA[ | ||
SIP/2.0 180 Ringing | ||
[last_Via:] | ||
[last_From:] | ||
[last_To:];tag=[service].[call_number] | ||
[last_Call-ID:] | ||
[last_CSeq:] | ||
Contact: <sip:[local_ip]:[local_port]> | ||
Content-Length: 0 | ||
]]> | ||
</send> | ||
|
||
<recv request="CANCEL" | ||
rtd="true" | ||
crlf="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"/> | ||
<ereg regexp="[:space:]*B2B." search_in="hdr" check_it="true" header="Call-ID:" assign_to="dummy" /> | ||
</action> | ||
</recv> | ||
|
||
|
||
<send> | ||
<![CDATA[ | ||
SIP/2.0 200 OK | ||
[last_Via:] | ||
[last_From:] | ||
[last_To:];tag=[service].[call_number] | ||
[last_Call-ID:] | ||
[last_CSeq:] | ||
Contact: <sip:[local_ip]:[local_port]> | ||
Content-Length: 0 | ||
]]> | ||
</send> | ||
|
||
<send> | ||
<![CDATA[ | ||
SIP/2.0 487 Request Terimnated | ||
Via[$remote_via] | ||
[last_From:] | ||
[last_To:];tag=[service].[call_number] | ||
[last_Call-ID:] | ||
CSeq[$remote_cseq] | ||
Contact: <sip:[local_ip]:[local_port]> | ||
Content-Length: 0 | ||
]]> | ||
</send> | ||
|
||
|
||
<recv request="ACK" | ||
rtd="true" | ||
crlf="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"/> | ||
<ereg regexp="[:space:]*B2B." search_in="hdr" check_it="true" header="Call-ID:" assign_to="dummy" /> | ||
</action> | ||
</recv> | ||
<!-- Keep the call open for a while in case the 200 is lost to be --> | ||
<!-- able to retransmit it if we receive the BYE again. --> | ||
|
||
<!-- <pause milliseconds="10"/> --> | ||
|
||
<!-- Pause 8 seconds, which is approximately the duration of the --> | ||
<!-- PCAP file --> | ||
<!-- <pause milliseconds="8000"/> --> | ||
|
||
<!-- definition of the response time repartition table (unit is ms) --> | ||
<ResponseTimeRepartition value="200, 500"/> | ||
|
||
<!-- definition of the call length repartition table (unit is ms) --> | ||
<CallLengthRepartition value="500, 1000, 2000, 3000"/> | ||
|
||
<Reference variables="dummy,domain,contact,result"/> | ||
|
||
</scenario> |
Oops, something went wrong.