您的位置:首页 > 服装鞋帽 > 休闲装 > Opensips安装声名

Opensips安装声名

luyued 发布于 2011-04-15 08:41   浏览 N 次  

运用de情况:

(其他版本也能够,安装时关于新手,建义软件包全数安装,制止前期有很多若干器械都没有。制止补安装时会泛起连锁的题目问题,这个很省事)

VMware虚拟情况下的Red hat enterprise linux

版本:

Opensips-1.4.3(民方网站http://www.opensips.org/)

前期预备:

LINUX基本指令的熟习

Mysql:我们选用的数据库,运用系统自带的mysql就能够,属意安装系统时选上mysql安装包。

mysql一些指令:

show databases;

show tables;

use opensips;

select * from subscribers;

drop;

create;

and so on;

Opensips的安装:

1、 民方网站http://www.opensips.org/的download中下载opensips软件包

2、 编译:

3、安装之前更改makefile:

tar zxvf opensips-1.4.3-tls_src.tar.gz

cd opensips-1.4.3-tls

4、 安装

删除Makefile中的exclude_modules 的db-mysql ,为了使opensips支持mysql。

make all

默许安装途径/usr/local下

make install

5、 建立opensips的数据库

## database type: MYSQL, PGSQL, ORACLE, DB_BERKELEY, or DBTEXT, by default none is loaded

vi /usr/local/opensips/etc/opensips/opensipsctlrc 把mysql的相关的注释往掉

# If you want to setup a database with opensipsdbctl, you must at least specify

DBENGINE=MYSQL

# this parameter.

## database host

## database name (for ORACLE this is TNS name)

DBHOST=localhost

DBNAME=opensips

DB_PATH="/usr/local/etc/opensips/dbtext"

# database path used by dbtext or db_berkeley

## database read/write user

DBRWUSER=opensips

## database read only user

DBROUSER=opensipsro

DBRWPW="opensipsrw"

## password for database read/write user

DBROPW=opensipsro

## password for database read only user

# user name column

USERCOL="username"

DBROOTUSER="root"

## database super user (for ORACLE this is 'scheme-creator' user)


实施opensips/sbin/下的opensipsdbctl

./opensipsdbctl create (天生opensips数据库)

5.opensips的运转

opensips/sbin/下的opensipsctl start来启动opensips

ps -efw opensips 搜检应当曾经运转了。

opensips/sbin/下的opensipsctl stop来终止opensips

到此完成了opensips的安装。

Opensips.cfg文档的配置

1、 实现注册,认证功用

debug=4

fork=yes

log_stderror=yes # (cmd line: -E)

port=5060

children=4

dns=no

rev_dns=no

# ------------------ module loading ----------------------------------

#set module path

mpath="/usr/local/lib/opensips/modules/"

loadmodule "sl.so"

loadmodule "tm.so"

loadmodule "db_mysql.so"

loadmodule "rr.so"

loadmodule "maxfwd.so"

loadmodule "usrloc.so"

loadmodule "registrar.so"

loadmodule "textops.so"

loadmodule "uri_db.so"

loadmodule "mi_fifo.so"

loadmodule "auth.so"

# ----------------- setting module-specific parameters ---------------

loadmodule "auth_db.so"

# -- mi_fifo params --

# -- usrloc params --

modparam("mi_fifo","fifo_name","/tmp/opensips_fifo")

# modparam("usrloc", "db_mode", 0)

# for persistent storage and comment the previous line

# Uncomment this if you want to use SQL database

modparam("usrloc", "db_mode", 2)

modparam("auth_db", "calculate_ha1", yes)

modparam("rr", "enable_full_lr", 1)

modparam("auth_db", "password_column", "password")

# ------------------------- request routing logic -------------------

# main routing logic

route{

# max_forwards==0, or excessively long requests

sl_send_reply("483","Too Many Hops");

if (!mf_process_maxfwd_header("10"))

# initial sanity checks -- messages with

{

exit;

};

if (msg:len > max_len )

{

if (method!="REGISTER")

sl_send_reply("513", "Message too big");

exit;

};

早乙女露依合集

{

record_route();

}

if (loose_route())

append_hf("P-hint: rr-enforced\r\n");

# mark routing logic in request

{

route(1);

exit;

};

if (uri!=myimmolation)

{

append_hf("P-hint: outbound\r\n");

# if you have some interdomain connections via TLS

# if(uri=~"@tls_domain1.net") {

# t_relay("tls:domain1.net");

#} else if(uri=~"@tls_domain2.net") {

# exit;

# t_relay("tls:domain2.net");

# if the request is for other domain use UsrLoc

# exit;

#}

route(1);

exit;

};

# (in case, it does not work, use the following command

# with proper names and addresses in it)

if (uri==myimmolation)

# Uncomment this if you want to use digest authentication

# if (!www_authorize("","subscriber")) {

if (method=="REGISTER")

{

{

# www_challenge("", "0");

#route(2);

save("location");

# exit;

#};

exit;

};

#---------added from book

if (!proxy_authorize("","subscriber"))

consume_credentials();

proxy_challenge("","0");

{

exit;

};

#---------add end

append_hf("P-hint: outbound alias\r\n");

lookup("aliases");

if (uri!=myimmolation)

{

route(1);

exit;

};

# native SIP destinations are handled using our USRLOC DB

sl_send_reply("404", "User Not Found");

if (!lookup("location"))

{

exit;

};

append_hf("P-hint: usrloc applied\r\n");

};

route(1);

}

# send it out now; use stateful forwarding as it works

route[1] {

# reliably even for UDP2TCP

sl_reply_error();

if (!t_relay()) {

#route[2] {

};

#exit;

}

# ------------------------------------------------------------------------

#sl_reply_error();

# REGISTER Message Handler

# ------------------------------------------------------------------------

#if (!save("location")) {

#};

#}

为实现注册和认证功用,除配置好opensips.cfg,还需改动opensipsctl中的一些地方,纪录如下:

## path to FIFO file

默许文档中为:

OSIPS_FIFO="FIFO" (途径错误)

OSIPS_FIFO="/tmp/opensips_fifo"

改为:

运转:

Service mysqld start

1、运转mysql:

opensipsctl restart

2、开启opensips:

3、configure two users accounts.(花样:opensipsctl add user password)

opensipsctl add 1001 1001

opensipsctl add 1002 1002

注:opensipsctl rm -------remove users

opensipsctl passwd-----change a password

4、 用已有效户和密码注册两个sip softphone(我用的X-lite和eyebeam)

5、 搜检可否注册胜利

opensipsctl ul show

6、 搜检可否在线

opensipsctl online

注:两个sip softphone注册必需运用数据库中已有的用户名和密码,否则将不能经由历程认证。

7、make a call from one phone to the other。

Powered byZoundry Raven

小学健美操爱好小组活动计划

夫妻俩对暗号 逮住“借钱”骗子

图文资讯
广告赞助商