来谈谈:关于opensips用户认证设置文件 opensips.cfg 利用先容
要多google,因为我不可能,也不可以给你解答所有内容,我只能告诉你一些关键点,甚至我会故意隐瞒答案,因为在寻找答案的过程中。opensips用户认证设置文件-opensips.cfgopensips.cfg设置文件,白色标志的为增加修正的部分,亲身测试!
#
#$Id:opensips.cfg97422013-02-0510:24:48Zvladut-paiu$
#
#OpenSIPSresidentialconfigurationscript
#byOpenSIPSSolutions<team@opensips-solutions.com>
#
#Thisscriptwasgeneratedvia"makemenuconfig",from
#the"Residential"scenario.
#Youcanenable/disablemorefeatures/functionalitiesby
#re-generatingthescenariowithdifferentoptions.#
#
#PleaserefertotheCoreCookBookat:
#http://www.opensips.org/Resources/DocsCookbooks
#foraexplanationofpossiblestatements,functionsandparameters.
#
#######GlobalParameters#########
debug=3
log_stderror=no
log_facility=LOG_LOCAL0
fork=yes
children=4
/*uncommentthefollowinglinestoenabledebugging*/
#debug=6
#fork=no
#log_stderror=yes
/*uncommentthenextlinetoenabletheautotemporaryblacklistingof
notavailabledestinations(defaultdisabled)*/
#disable_dns_blacklist=no
/*uncommentthenextlinetoenableIPv6lookupafterIPv4dns
lookupfailures(defaultdisabled)*/
#dns_try_ipv6=yes
/*commentthenextlinetoenabletheautodiscoveryoflocalaliases
basedonreversDNSonIPs*/
auto_aliases=no
#listen=udp:127.0.0.1:5060#CUSTOMIZEME
listen=udp:192.168.139.121:5060#CUSTOMIZEME
disable_tcp=yes
#disable_tls=yes
#######ModulesSection########
#setmodulepath
mpath="//lib/opensips/modules/"
####MySQL
loadmodule"db_mysql.so"
####SIGNALINGmodule
loadmodule"signaling.so"
####StateLessmodule
loadmodule"sl.so"
####TransactionModule
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)
####RecordRouteModule
loadmodule"rr.so"
/*donotappendfromtagtotheRR(noneedforthisscript)*/
modparam("rr","append_fromtag",0)
####MAXForWarDmodule
loadmodule"maxfwd.so"
####SIPMSGOPerationSmodule
loadmodule"sipmsgops.so"
####FIFOManagementInterface
loadmodule"mi_fifo.so"
modparam("mi_fifo","fifo_name","/tmp/opensips_fifo")
modparam("mi_fifo","fifo_mode",0666)
####URImodule
loadmodule"uri.so"
modparam("uri","use_uri_table",0)
####USeRLOCationmodule
loadmodule"usrloc.so"
modparam("usrloc","nat_bflag","NAT")
modparam("usrloc","db_url","mysql://opensips:opensipsrw@localhost/opensips")
modparam("usrloc","db_mode",2)
####REGISTRARmodule
loadmodule"registrar.so"
modparam("registrar","tcp_persistent_flag","TCP_PERSISTENT")
/*uncommentthenextlinenottoallowmorethan10contactsperAOR*/
#modparam("registrar","max_contacts",10)
####ACCountingmodule
loadmodule"acc.so"
/*whatspecialeventsshouldbeaccounted?*/
modparam("acc","early_media",0)
modparam("acc","report_cancels",0)
/*bydefaultwedonotadjustthedirectofthesequentialrequests.
ifyouenablethisparameter,besuretheenable"append_fromtag"
in"rr"module*/
modparam("acc","detect_direction",0)
modparam("acc","failed_transaction_flag","ACC_FAILED")
/*accounttriggers(flags)*/
modparam("acc","log_flag","ACC_DO")
modparam("acc","log_missed_flag","ACC_MISSED")
####Authsupport
loadmodule"auth.so"
loadmodule"auth_db.so"
modparam("auth","calculate_ha1",yes)
modparam("auth_db","db_url","mysql://opensips:opensipsrw@localhost/opensips")
modparam("auth_db","password_column","password")
#######RoutingLogic########
#mainrequestroutinglogic
route{
if(!mf_process_maxfwd_header("10")){
sl_send_reply("483","TooManyHops");
exit;
}
if(has_totag()){
#sequentialrequestwithingadialogshould
#takethepathdeterminedbyrecord-routing
if(loose_route()){
if(is_method("BYE")){
setflag(ACC_DO);#doaccounting...
setflag(ACC_FAILED);#...evenifthetransactionfails
}elseif(is_method("INVITE")){
#evenifinmostofthecasesisuseless,doRRfor
#re-INVITEsalos,assomebuggyclientsdochangerouteset
#duringthedialog.
record_route();
}
#routeitouttowhateverdestinationwassetbyloose_route()
#in$du(destinationURI).
route(relay);
}else{
if(is_method("ACK")){
if(t_check_trans()){
#nonloose-route,butstatefulACK;mustbeanACKafter
#a487ore.g.404fromupstreamserver
t_relay();
exit;
}else{
#ACKwithoutmatchingtransaction->
#ignoreanddiscard
exit;
}
}
sl_send_reply("404","Nothere");
}
exit;
}
#CANCELprocessing
if(is_method("CANCEL"))
{
if(t_check_trans())
t_relay();
exit;
}
t_check_trans();
if(!(is_method("REGISTER"))){
if(from_uri==myself)
{
}else{
#ifcallerisnotlocal,thencallednumbermustbelocal
if(!uri==myself){
send_reply("403","Relyforbidden");
exit;
}
}
}
#preloadedroutechecking
if(loose_route()){
xlog("L_ERR",
"AttempttoroutewithpreloadedRoutes[$fu/$tu/$ru/$ci]");
if(!is_method("ACK"))
sl_send_reply("403","PreloadRoutedenied");
exit;
}
#recordrouting
if(!is_method("REGISTER|MESSAGE"))
record_route();
#accountonlyINVITEs
if(is_method("INVITE")){
setflag(ACC_DO);#doaccounting
}
if(!uri==myself){
append_hf("P-hint:outbound
");
route(relay);
}
#requestsformydomain
if(is_method("PUBLISH|SUBSCRIBE"))
{
sl_send_reply("503","ServiceUnavailable");
exit;
}
if(is_method("REGISTER"))
{
#authuserusingmysqlDB
if(!www_authorize("192.168.139.121","subscriber")){
www_challenge("192.168.139.121","0");
exit;
}
#endauthuser
if(0)setflag(TCP_PERSISTENT);
if(!save("location"))
sl_reply_error();
exit;
}
if($rU==NULL){
#requestwithnoUsernameinRURI
sl_send_reply("484","AddressIncomplete");
exit;
}
#dolookupwithmethodfiltering
if(!lookup("location","m")){
t_newtran();
t_reply("404","NotFound");
exit;
}
#whenroutingviausrloc,logthemissedcallsalso
setflag(ACC_MISSED);
route(relay);
}
route{
#forINVITEsenablesomeadditionalhelperroutes
if(is_method("INVITE")){
t_on_branch("per_branch_ops");
t_on_reply("handle_nat");
#t_on_reply();
t_on_failure("missed_call");
}
if(!t_relay()){
send_reply("500","InternalError");
};
exit;
}
branch_route{
xlog("newbranchat$ru
");
}
onreply_route{
xlog("incomingreply
");
}
failure_route{
if(t_was_cancelled()){
exit;
}
#uncommentthefollowinglinesifyouwanttoblockclient
#redirectbasedon3xxreplies.
##if(t_check_status("3")){
##t_reply("404","Notfound");
##exit;
##}
}
linux系统的文件布置,etc/,opt/目录的内容等; Windows有MS-DOS?方式,在该方式下通过输入DOS命令来操作电脑;Linux与Windows类似,也有命令方式,Linux?启动后如果不执行?X-WINDOWS,就会处于命令方式下,必须发命令才能操作电脑。? 尽量不要提问纯属是扯蛋.学习Linux特别是自己一个人初学入手的时候没人教很困难.当然如果可以的话平时多去买些Linux书...对学习Linux很有帮助. 感谢老师和同学们在学习上对我的帮助。 Linux?最大的优点在于其作为服务器的强大功能,同时支持多种应用程序及开发工具,所以Linux操作系统有着广泛的应用空间。 在学习的过程中,我们用的是VM虚拟机,开始时真的不真的该怎么去做,特别是我的是命令窗口界面,别人的是图形界面,我都不知道怎么调过来。 熟悉系统的基本操作,Linux的图形界面直观,操作简便,多加上机练习就可熟悉操作,在Linux下学习办公软件等常用软件。 你需要提供精确有效的信息。Linux这并不是要求你简单的把成吨的出错代码或者数据完全转储摘录到你的提问中。 熟读Linux系统有关知识,如系统目录树,有关内容可购书阅读或搜索论坛。
页:
[1]