wget http: // opensips.org / pub / opensips / 1.11.2 / src / opensips-1.11.2_src.tar.gz
tar xcf opensips-1.11.2_src.tar.gz
cd opensips-1.11.2-tls /
make menuconfig
tar xcf opensips-1.11.2_src.tar.gz
cd opensips-1.11.2-tls /
make menuconfig
cd / etc / opensips
osipsconfig
osipsconfig
mv opensips_residential_2014- 7 - 10 _16: 19: 22 .cfg opensips.cfg
vi opensips.cfg
vi opensips.cfg
debug = 3
log_stderror = no
log_facility = LOG_LOCAL0
fork = yes
children = 4
/ * Uncomment the following lines to enable debugging * /
# Debug = 6
# Fork = no
# Log_stderror = yes
/ * Uncomment the next line to enable the auto temporary blacklisting of
not available destinations (default disabled) * /
# Disable_dns_blacklist = no
/ * Uncomment the next line to enable IPv6 lookup after IPv4 dns
lookup failures (default disabled) * /
# Dns_try_ipv6 = yes
/ * Comment the next line to enable the auto discovery of local aliases
based on revers DNS on IPs * /
auto_aliases = no
alias = xdty.org # increase alias, modify for your domain
listen = udp: domain corresponding ip address: 6060 # CUSTOMIZE ME
disable_tcp = no
listen = tcp: ip address corresponding to the domain name: 6060 # CUSTOMIZE ME
disable_tls = yes
####### Modules Section ########
#set module path
mpath = "/ lib64 / opensips / modules /" # add a slash
#### SIGNALING module
loadmodule "signaling.so"
#### StateLess module
loadmodule "sl.so"
#### Transaction Module
loadmodule "tm.so"
modparam ("tm", "fr_timer", 5)
modparam ("tm", "fr_inv_timer", 30)
modparam ("tm", "restart_fr_on_each_reply", 0)
modparam ("tm", "onreply_avp_mode", 1)
#### Record Route Module
loadmodule "rr.so"
/ * Do not append from tag to the RR (no need for this script) * /
modparam ("rr", "append_fromtag", 0)
#### MAX ForWarD module
loadmodule "maxfwd.so"
#### SIP MSG OPerationS module
loadmodule "sipmsgops.so"
#### FIFO Management Interface
loadmodule "mi_fifo.so"
modparam ("mi_fifo", "fifo_name", "/ tmp / opensips_fifo")
modparam ("mi_fifo", "fifo_mode", 0666)
#### URI module
loadmodule "uri.so"
modparam ("uri", "use_uri_table", 0)
modparam ("uri", "db_url", "mysql: // opensips: opensipsrw @ localhost / opensips") # add this line, otherwise an error
#### MYSQL module
loadmodule "db_mysql.so"
#### USeR LOCation module
loadmodule "usrloc.so"
modparam ("usrloc", "nat_bflag", "NAT")
modparam ("usrloc", "db_mode", 2)
modparam ("usrloc", "db_url",
"Mysql: // opensips: opensipsrw @ localhost / opensips") # CUSTOMIZE ME
#### REGISTRAR module
loadmodule "registrar.so"
modparam ("registrar", "tcp_persistent_flag", "TCP_PERSISTENT")
modparam ("registrar", "received_avp", "$ avp (received_nh)")
/ * Uncomment the next line not to allow more than 10 contacts per AOR * /
#modparam ("registrar", "max_contacts", 10)
#### ACCounting module
loadmodule "acc.so"
/ * What special events should be accounted? * /
modparam ("acc", "early_media", 0)
modparam ("acc", "report_cancels", 0)
/ * By default we do not adjust the direct of the sequential requests.
if you enable this parameter, be sure the enable "append_fromtag"
in "rr" module * /
modparam ("acc", "detect_direction", 0)
modparam ("acc", "failed_transaction_flag", "ACC_FAILED")
/ * Account triggers (flags) * /
modparam ("acc", "db_flag", "ACC_DO")
modparam ("acc", "db_missed_flag", "ACC_MISSED")
modparam ("acc", "db_url",
"Mysql: // opensips: opensipsrw @ localhost / opensips") # CUSTOMIZE ME
#### AUTHentication modules
loadmodule "auth.so"
loadmodule "auth_db.so"
modparam ("auth_db", "calculate_ha1", yes)
modparam ("auth_db", "password_column", "password")
modparam ("auth_db", "db_url",
"Mysql: // opensips: opensipsrw @ localhost / opensips") # CUSTOMIZE ME
modparam ("auth_db", "load_credentials", "")
#### ALIAS module
loadmodule "alias_db.so"
modparam ("alias_db", "db_url",
"Mysql: // opensips: opensipsrw @ localhost / opensips") # CUSTOMIZE ME
#### DIALOG module
loadmodule "dialog.so"
modparam ("dialog", "dlg_match_mode", 1)
modparam ("dialog", "default_timeout", 21600) # 6 hours timeout
modparam ("dialog", "db_mode", 2)
modparam ("dialog", "db_url",
"Mysql: // opensips: opensipsrw @ localhost / opensips") # CUSTOMIZE ME
#### NAT modules
loadmodule "nathelper.so"
modparam ("nathelper", "natping_interval", 10)
modparam ("nathelper", "ping_nated_only", 1)
modparam ("nathelper", "received_avp", "$ avp (received_nh)")
loadmodule "rtpproxy.so"
modparam ("rtpproxy", "rtpproxy_sock", "udp: localhost: 22222") # modify port
# Increase below this paragraph
#### MediaProxy module
loadmodule "mediaproxy.so"
modparam ("mediaproxy", "disable", 0)
modparam ("mediaproxy", "mediaproxy_socket", "/var/run/mediaproxy/dispatcher.sock")
modparam ("mediaproxy", "mediaproxy_timeout", 1000)
modparam ("mediaproxy", "signaling_ip_avp", "$ avp (nat_ip)")
modparam ("mediaproxy", "media_relay_avp", "$ avp (media_relay)")
modparam ("mediaproxy", "ice_candidate", "low-priority")
log_stderror = no
log_facility = LOG_LOCAL0
fork = yes
children = 4
/ * Uncomment the following lines to enable debugging * /
# Debug = 6
# Fork = no
# Log_stderror = yes
/ * Uncomment the next line to enable the auto temporary blacklisting of
not available destinations (default disabled) * /
# Disable_dns_blacklist = no
/ * Uncomment the next line to enable IPv6 lookup after IPv4 dns
lookup failures (default disabled) * /
# Dns_try_ipv6 = yes
/ * Comment the next line to enable the auto discovery of local aliases
based on revers DNS on IPs * /
auto_aliases = no
alias = xdty.org # increase alias, modify for your domain
listen = udp: domain corresponding ip address: 6060 # CUSTOMIZE ME
disable_tcp = no
listen = tcp: ip address corresponding to the domain name: 6060 # CUSTOMIZE ME
disable_tls = yes
####### Modules Section ########
#set module path
mpath = "/ lib64 / opensips / modules /" # add a slash
#### SIGNALING module
loadmodule "signaling.so"
#### StateLess module
loadmodule "sl.so"
#### Transaction Module
loadmodule "tm.so"
modparam ("tm", "fr_timer", 5)
modparam ("tm", "fr_inv_timer", 30)
modparam ("tm", "restart_fr_on_each_reply", 0)
modparam ("tm", "onreply_avp_mode", 1)
#### Record Route Module
loadmodule "rr.so"
/ * Do not append from tag to the RR (no need for this script) * /
modparam ("rr", "append_fromtag", 0)
#### MAX ForWarD module
loadmodule "maxfwd.so"
#### SIP MSG OPerationS module
loadmodule "sipmsgops.so"
#### FIFO Management Interface
loadmodule "mi_fifo.so"
modparam ("mi_fifo", "fifo_name", "/ tmp / opensips_fifo")
modparam ("mi_fifo", "fifo_mode", 0666)
#### URI module
loadmodule "uri.so"
modparam ("uri", "use_uri_table", 0)
modparam ("uri", "db_url", "mysql: // opensips: opensipsrw @ localhost / opensips") # add this line, otherwise an error
#### MYSQL module
loadmodule "db_mysql.so"
#### USeR LOCation module
loadmodule "usrloc.so"
modparam ("usrloc", "nat_bflag", "NAT")
modparam ("usrloc", "db_mode", 2)
modparam ("usrloc", "db_url",
"Mysql: // opensips: opensipsrw @ localhost / opensips") # CUSTOMIZE ME
#### REGISTRAR module
loadmodule "registrar.so"
modparam ("registrar", "tcp_persistent_flag", "TCP_PERSISTENT")
modparam ("registrar", "received_avp", "$ avp (received_nh)")
/ * Uncomment the next line not to allow more than 10 contacts per AOR * /
#modparam ("registrar", "max_contacts", 10)
#### ACCounting module
loadmodule "acc.so"
/ * What special events should be accounted? * /
modparam ("acc", "early_media", 0)
modparam ("acc", "report_cancels", 0)
/ * By default we do not adjust the direct of the sequential requests.
if you enable this parameter, be sure the enable "append_fromtag"
in "rr" module * /
modparam ("acc", "detect_direction", 0)
modparam ("acc", "failed_transaction_flag", "ACC_FAILED")
/ * Account triggers (flags) * /
modparam ("acc", "db_flag", "ACC_DO")
modparam ("acc", "db_missed_flag", "ACC_MISSED")
modparam ("acc", "db_url",
"Mysql: // opensips: opensipsrw @ localhost / opensips") # CUSTOMIZE ME
#### AUTHentication modules
loadmodule "auth.so"
loadmodule "auth_db.so"
modparam ("auth_db", "calculate_ha1", yes)
modparam ("auth_db", "password_column", "password")
modparam ("auth_db", "db_url",
"Mysql: // opensips: opensipsrw @ localhost / opensips") # CUSTOMIZE ME
modparam ("auth_db", "load_credentials", "")
#### ALIAS module
loadmodule "alias_db.so"
modparam ("alias_db", "db_url",
"Mysql: // opensips: opensipsrw @ localhost / opensips") # CUSTOMIZE ME
#### DIALOG module
loadmodule "dialog.so"
modparam ("dialog", "dlg_match_mode", 1)
modparam ("dialog", "default_timeout", 21600) # 6 hours timeout
modparam ("dialog", "db_mode", 2)
modparam ("dialog", "db_url",
"Mysql: // opensips: opensipsrw @ localhost / opensips") # CUSTOMIZE ME
#### NAT modules
loadmodule "nathelper.so"
modparam ("nathelper", "natping_interval", 10)
modparam ("nathelper", "ping_nated_only", 1)
modparam ("nathelper", "received_avp", "$ avp (received_nh)")
loadmodule "rtpproxy.so"
modparam ("rtpproxy", "rtpproxy_sock", "udp: localhost: 22222") # modify port
# Increase below this paragraph
#### MediaProxy module
loadmodule "mediaproxy.so"
modparam ("mediaproxy", "disable", 0)
modparam ("mediaproxy", "mediaproxy_socket", "/var/run/mediaproxy/dispatcher.sock")
modparam ("mediaproxy", "mediaproxy_timeout", 1000)
modparam ("mediaproxy", "signaling_ip_avp", "$ avp (nat_ip)")
modparam ("mediaproxy", "media_relay_avp", "$ avp (media_relay)")
modparam ("mediaproxy", "ice_candidate", "low-priority")
vi opensipsctlrc
SIP_DOMAIN = xdty.org
DBENGINE = MYSQL
DBHOST = localhost
DBNAME = opensips
DB_PATH = "/ usr / local / etc / opensips / dbtext"
DBRWUSER = opensips
DBRWPW = "opensipsrw"
DBROOTUSER = "root"
USERCOL = "username"
DBENGINE = MYSQL
DBHOST = localhost
DBNAME = opensips
DB_PATH = "/ usr / local / etc / opensips / dbtext"
DBRWUSER = opensips
DBRWPW = "opensipsrw"
DBROOTUSER = "root"
USERCOL = "username"
opensipsctl create
opensipsctl domain add xdty.org
opensipsctl add 10000 123456
opensipsctl add 10001 123456
opensipsctl domain add xdty.org
opensipsctl add 10000 123456
opensipsctl add 10001 123456
apt-get install rtpproxy
vi / etc / default / rtpproxy
vi / etc / default / rtpproxy
CONTROL_SOCK = udp: 127.0.0.1: 22222
# Additional options that are passed to the daemon.
EXTRA_OPTS = ""
LISTEN_ADDR = your domain name corresponding to the ip address
EXTRA_OPTS = "-l $ {LISTEN_ADDR}"
# Additional options that are passed to the daemon.
EXTRA_OPTS = ""
LISTEN_ADDR = your domain name corresponding to the ip address
EXTRA_OPTS = "-l $ {LISTEN_ADDR}"
killall rtpproxy
/ Etc / init.d / rtpproxy start
/ Etc / init.d / rtpproxy start
wget http: // download.ag-projects.com / agp-debian-gpg.key
apt-key add agp-debian-gpg.key
vi / etc / apt / sources.list
apt-key add agp-debian-gpg.key
vi / etc / apt / sources.list
deb http: // ag-projects.com / ubuntu precise main
deb-src http: // ag-projects.com / ubuntu precise main
deb-src http: // ag-projects.com / ubuntu precise main
apt-get update
apt-get install mediaproxy-dispatcher mediaproxy-relay mediaproxy-web-sessions
apt-get install mediaproxy-dispatcher mediaproxy-relay mediaproxy-web-sessions
cd / etc / mediaproxy / tls /
cp / usr / share / doc / mediaproxy-common / tls / *.
cd ..
vi config.ini
cp / usr / share / doc / mediaproxy-common / tls / *.
cd ..
vi config.ini
[Relay]
dispatchers = 106.186.23.149
passport = None
relay_ip = 106.186.23.149
port_range = 50000: 60000
log_level = DEBUG
stream_timeout = 90
on_hold_timeout = 7200
reconnect_delay = 10
traffic_sampling_period = 15
[Dispatcher]
socket_path = dispatcher.sock
listen = 106.186.23.149
listen_management = 106.186.23.149
management_use_tls = yes
passport = None
management_passport = None
log_level = DEBUG
relay_timeout = 5
[TLS]
certs_path = tls
verify_interval = 300
[Database]
[Radius]
[OpenSIPS]
socket_path = / var / run / opensips / socket
max_connections = 10
dispatchers = 106.186.23.149
passport = None
relay_ip = 106.186.23.149
port_range = 50000: 60000
log_level = DEBUG
stream_timeout = 90
on_hold_timeout = 7200
reconnect_delay = 10
traffic_sampling_period = 15
[Dispatcher]
socket_path = dispatcher.sock
listen = 106.186.23.149
listen_management = 106.186.23.149
management_use_tls = yes
passport = None
management_passport = None
log_level = DEBUG
relay_timeout = 5
[TLS]
certs_path = tls
verify_interval = 300
[Database]
[Radius]
[OpenSIPS]
socket_path = / var / run / opensips / socket
max_connections = 10
media-dispatcher restart
media-relay restart
media-relay restart
touch / var / log / opensips.log
chmod 777 / var / log / opensips.log
vi / etc / rsyslog.d / opensips.conf
chmod 777 / var / log / opensips.log
vi / etc / rsyslog.d / opensips.conf
local0. * / var / log / opensips.log
vi ~ / .vim / filetype.vim
au BufNewfile, BufRead / var / log / * set filetype = messages
service rsyslog restart
opensipsctl start
opensipsctl start
iptables -I INPUT -p tcp --dport 6060 -j ACCEPT
iptables -I INPUT -p udp --dport 6060 -j ACCEPT
iptables-save
iptables -I INPUT -p udp --dport 6060 -j ACCEPT
iptables-save
pear install MDB2 #mysql
pear install log
pear install log
chown www-data: www-data web -R
mysql -Dopensips -p <ocp_admin_privileges.mysql
mysql -uroot opensips
INSERT INTO ocp_admin_privileges (username, password, ha1, available_tools, permissions) values ('admin', 'admin', md5 ('admin: admin'), 'all', 'all');
mysql -uroot opensips
INSERT INTO ocp_admin_privileges (username, password, ha1, available_tools, permissions) values ('admin', 'admin', md5 ('admin: admin'), 'all', 'all');
mysql -Dopensips -p <cdrs.mysql
mysql -Dopensips -p <opensips_cdrs.mysql
mysql -Dopensips -p <opensips_cdrs.mysql
vi generate-cdrs_mysql.sh
mysql -Dopensips -p <tables.mysql
vi / etc / crontab
* / 3 * * * * root / var / www / opensips / cron_job / generate-cdrs_mysql.sh
* * * * * Root php / var / www / opensips-cp / cron_job / get_opensips_stats.php> / dev / null
vi / etc / crontab
* / 3 * * * * root / var / www / opensips / cron_job / generate-cdrs_mysql.sh
* * * * * Root php / var / www / opensips-cp / cron_job / get_opensips_stats.php> / dev / null