-
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.
Showing
7 changed files
with
787 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 @@ | ||
--- | ||
uac_ip: 192.168.52.2 | ||
|
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,121 @@ | ||
# | ||
# 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" | ||
|
||
#### Dialog module | ||
loadmodule "dialog.so" | ||
modparam("dialog", "db_mode", 0) | ||
|
||
#### 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) | ||
|
||
loadmodule "proto_udp.so" | ||
|
||
loadmodule "httpd.so" | ||
loadmodule "mi_http.so" | ||
|
||
####### Routing Logic ######## | ||
|
||
# main request routing logic | ||
|
||
route { | ||
|
||
if (!mf_process_maxfwd_header(10)) { | ||
send_reply(483,"Too Many Hops"); | ||
exit; | ||
} | ||
|
||
if (has_totag()) { | ||
|
||
# handle hop-by-hop ACK (no routing required) | ||
if (is_method("ACK") && t_check_trans()) { | ||
t_relay(); | ||
exit; | ||
} | ||
|
||
# sequential request within a dialog should | ||
# take the path determined by record-routing | ||
if (!loose_route() && !match_dialog()) { | ||
# we do record-routing for all our traffic, so we should not | ||
# receive any sequential requests without Route hdr. | ||
send_reply(404,"Not here"); | ||
exit; | ||
} | ||
|
||
# route it out to whatever destination was set by loose_route() | ||
# in $du (destination URI). | ||
t_relay(); | ||
exit; | ||
} | ||
|
||
# CANCEL processing | ||
if (is_method("CANCEL")) { | ||
if (t_check_trans()) | ||
t_relay(); | ||
exit; | ||
} | ||
|
||
# accept just INVITE requests | ||
if (!is_method("INVITE")) { | ||
send_reply(503, "Service Unavailable"); | ||
exit; | ||
} | ||
|
||
if (!create_dialog()) { | ||
send_reply(500, "Internal Server Error"); | ||
exit; | ||
} | ||
record_route(); | ||
|
||
if (!t_relay()) | ||
send_reply(500, "Internal Error"); | ||
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,43 @@ | ||
GRANT ALL PRIVILEGES ON *.* TO 'root'@'%'; | ||
CREATE DATABASE opensips; | ||
|
||
USE opensips; | ||
|
||
CREATE TABLE version ( | ||
table_name CHAR(32) NOT NULL, | ||
table_version INT UNSIGNED DEFAULT 0 NOT NULL, | ||
CONSTRAINT t_name_idx UNIQUE (table_name) | ||
) ENGINE=InnoDB; | ||
|
||
INSERT INTO version (table_name, table_version) values ('dialog','12'); | ||
CREATE TABLE dialog ( | ||
dlg_id BIGINT(10) UNSIGNED PRIMARY KEY NOT NULL, | ||
callid CHAR(255) NOT NULL, | ||
from_uri CHAR(255) NOT NULL, | ||
from_tag CHAR(64) NOT NULL, | ||
to_uri CHAR(255) NOT NULL, | ||
to_tag CHAR(64) NOT NULL, | ||
mangled_from_uri CHAR(64) DEFAULT NULL, | ||
mangled_to_uri CHAR(64) DEFAULT NULL, | ||
caller_cseq CHAR(11) NOT NULL, | ||
callee_cseq CHAR(11) NOT NULL, | ||
caller_ping_cseq INT(11) UNSIGNED NOT NULL, | ||
callee_ping_cseq INT(11) UNSIGNED NOT NULL, | ||
caller_route_set TEXT(512), | ||
callee_route_set TEXT(512), | ||
caller_contact CHAR(255), | ||
callee_contact CHAR(255), | ||
caller_sock CHAR(64) NOT NULL, | ||
callee_sock CHAR(64) NOT NULL, | ||
state INT(10) UNSIGNED NOT NULL, | ||
start_time INT(10) UNSIGNED NOT NULL, | ||
timeout INT(10) UNSIGNED NOT NULL, | ||
vars BLOB(4096) DEFAULT NULL, | ||
profiles TEXT(512) DEFAULT NULL, | ||
script_flags CHAR(255) DEFAULT NULL, | ||
module_flags INT(10) UNSIGNED DEFAULT 0 NOT NULL, | ||
flags INT(10) UNSIGNED DEFAULT 0 NOT NULL, | ||
rt_on_answer CHAR(64) DEFAULT NULL, | ||
rt_on_timeout CHAR(64) DEFAULT NULL, | ||
rt_on_hangup CHAR(64) DEFAULT NULL | ||
) ENGINE=InnoDB; |
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,33 @@ | ||
--- | ||
timeout: 10 | ||
|
||
tasks: | ||
- name: OpenSIPS | ||
type: opensips | ||
|
||
- name: SIPP UAS | ||
type: uas-sipp | ||
config_file: scripts/uas.xml | ||
duration: 2000 # duration before re-INVITE and BYE | ||
require: OpenSIPS | ||
keys: | ||
username: {{ username }} | ||
password: {{ password }} | ||
nonce: {{ nonce }} | ||
|
||
- name: SIPP UAC | ||
type: uac-sipp | ||
service: {{ username }} | ||
config_file: scripts/uac.xml | ||
remote: {{ uas_ip }}:{{ uas_port }} | ||
ip: {{ uac_ip }} | ||
caller: caller | ||
username: {{ username }} | ||
password: {{ password }} | ||
require: | ||
- started: | ||
task: SIPP UAS | ||
wait: 0.5 | ||
- after: | ||
task: OpenSIPS | ||
wait: 0.5 |
Oops, something went wrong.