⭐ 欢迎来到虫虫下载站! | 📦 资源下载 📁 资源专辑 ℹ️ 关于我们
⭐ 虫虫下载站

📄 alg.cfg

📁 用来作为linux中SIP SERVER,完成VOIP网络电话中服务器的功能
💻 CFG
字号:
# $Id: alg.cfg,v 1.3 2004/03/13 19:57:11 sobomax Exp $## Simple application level gateway config script.## Assumes that SER/rtpproxy run on a machine, which connected to# two non-routable letworks: 192.168.0.0/24 and 192.168.1.1/24.## Correspondingly, this machine has two IP addresses: 192.168.0.1# and 192.168.1.1.## 192.168.0.0/24 - "internal" network# 192.168.1.0/24 - "external" network## rtpproxy started with `-l 192.168.0.1/192.168.1.1' option.## ------------------ module loading ----------------------------------loadmodule "/usr/local/lib/ser/modules/sl.so"loadmodule "/usr/local/lib/ser/modules/tm.so"loadmodule "/usr/local/lib/ser/modules/rr.so"loadmodule "/usr/local/lib/ser/modules/maxfwd.so"loadmodule "/usr/local/lib/ser/modules/usrloc.so"loadmodule "/usr/local/lib/ser/modules/registrar.so"loadmodule "/usr/local/lib/ser/modules/nathelper.so"# ----------------- setting module-specific parameters ---------------# -- nathelper params --modparam("nathelper", "natping_interval", 15)# ------------------ main fun below ----------------------------------route {	# initial sanity checks -- messages with	# max_forwars == 0, or excessively long requests,	# or those that don't addressed to us	if (!mf_process_maxfwd_header("10")) {		sl_send_reply("483", "Too Many Hops");		break;	};	if (msg:len > max_len) {		sl_send_reply("513", "Message too big");		break;	};	if (!(uri == myself) && method == "INVITE") {		sl_send_reply("403", "Call cannot be served here");		break;	};	if (method == "REGISTER") {		if (dst_ip == 192.168.0.1) {			save("location-internal");		} else if (dst_ip == 192.168.1.1) {			save("location-external");		} else {			sl_send_reply("403", "Call cannot be served here");		};		break;	};	if (method == "INVITE") {		if (lookup("location-internal")) {			if (dst_ip == 192.168.0.1)				if (force_rtp_proxy("FAII"))					t_on_reply("1");			if (dst_ip == 192.168.1.1)				if (force_rtp_proxy("FAEI"))					t_on_reply("1");		} else if (lookup("location-external")) {			if (dst_ip == 192.168.0.1)				if (force_rtp_proxy("FAIE"))					t_on_reply("1");			if (dst_ip == 192.168.1.1)				if (force_rtp_proxy("FAEE"))					t_on_reply("1");		} else {			sl_send_reply("403", "Call cannot be served here");			break;		};	}	if (method == "BYE" || method == "CANCEL")		unforce_rtp_proxy();	# Do strict routing if pre-loaded route headers present	if (loose_route()) {		t_relay();		break;	};	if (method == "INVITE")		record_route();        if (!t_relay())        	sl_reply_error();}onreply_route[1] {	if (!(status=~"183" || status=~"200"))		break;	force_rtp_proxy("FA");}

⌨️ 快捷键说明

复制代码 Ctrl + C
搜索代码 Ctrl + F
全屏模式 F11
切换主题 Ctrl + Shift + D
显示快捷键 ?
增大字号 Ctrl + =
减小字号 Ctrl + -