Hello,
Here is my ser.cfg I try to send uri not in location
or aliase table .
INVITE message is not sent to gateway just 404 is
returned ?
What's wrong ?
Harry
# $Id: ser.cfg,v 1.27 2005/03/10 14:16:25 andrei Exp $
#
# simple quick-start config script
#
# ----------- global configuration parameters
------------------------
debug=3 # debug level (cmd line: -dddddddddd)
fork=yes
log_stderror=no # (cmd line: -E)
#memlog=5 # memory debug log level
#log_facility=LOG_LOCAL0 # sets the facility used for
logging (see syslog(3))
/* Uncomment these lines to enter debugging mode
#fork=no
#log_stderror=yes
*/
check_via=no # (cmd. line: -v)
dns=no # (cmd. line: -r)
rev_dns=no # (cmd. line: -R)
port=5060
children=4
fifo="/tmp/ser_fifo"
user=root
group=ser
fifo_user=root # owner of the ser fifo
fifo_group=ser
fifo_mode=0660 # fifo's permissions
#disable_core=yes #disables core dumping
#open_fd_limit=1024 # sets the open file descriptors
limit
#mhomed=yes # usefull for multihomed hosts, small
performance penalty
#disable_tcp=yes
#tcp_accept_aliases=yes # accepts the tcp alias via
option (see NEWS)
listen=80.119.10.96
alias="nxs.yi.org"
#
# ------------------ module loading
----------------------------------
loadmodule "/usr/lib/ser/modules/mysql.so"
loadmodule "/usr/lib/ser/modules/sl.so"
loadmodule "/usr/lib/ser/modules/tm.so"
loadmodule "/usr/lib/ser/modules/rr.so"
loadmodule "/usr/lib/ser/modules/maxfwd.so"
loadmodule "/usr/lib/ser/modules/usrloc.so"
loadmodule "/usr/lib/ser/modules/registrar.so"
loadmodule "/usr/lib/ser/modules/uri.so"
loadmodule "/usr/lib/ser/modules/nathelper.so"
loadmodule "/usr/lib/ser/modules/auth.so"
loadmodule "/usr/lib/ser/modules/auth_db.so"
loadmodule "/usr/lib/ser/modules/textops.so"
loadmodule "/usr/lib/ser/modules/permissions.so"
loadmodule "/usr/lib/ser/modules/group.so"
loadmodule "/usr/lib/ser/modules/domain.so"
loadmodule "/usr/lib/ser/modules/avpops.so"
# ----------------- setting module-specific parameters
---------------
# -- usrloc params--
modparam("usrloc", "db_mode", 2)
# -- autdb_params--
modparam("auth_db", "calculate_ha1", yes)
modparam("auth_db", "password_column", "password")
# -- rr params --
# add value to ;lr param to make some broken UAs happy
modparam("rr", "enable_full_lr", 1)
# -- nathelper params --
modparam("nathelper", "natping_interval", 30)
modparam("nathelper", "ping_nated_only", 1)
# -- registrar params --
modparam("registrar", "nat_flag", 6)
# -- tm params --
modparam("tm", "fr_inv_timer", 27)
modparam("tm", "fr_inv_timer_avp", "inv_timeout")
# -- permissions params --
modparam("permissions", "db_url",
"mysql://ser:heslo@localhost/ser")
modparam("permissions", "db_mode", 1)
modparam("permissions", "trusted_table", "trusted")
modparam("permissions", "default_deny_file",
"/etc/ser/permissions.deny")
modparam("permissions", "default_allow_file",
"/etc/ser/permissions.allow")
# ------------------------- request routing logic
-------------------
# main routing logic
route{
# initial sanity checks -- messages with
# max_forwards==0, or excessively long requests
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;
};
# we record-route all messages -- to make sure that
# subsequent messages will go through our proxy;
that's
# particularly good if upstream and downstream
entities
# use different transport protocol
if (!method=="REGISTER") {
record_route();
};
if (method=="ACK" || method=="BYE") {
unforce_rtp_proxy();
};
# subsequent messages withing a dialog should take
the
# path determined by record-routing
if (loose_route()) {
if (has_totag() && method=="INVITE" ||
method=="ACK") {
if (nat_uac_test("19")) {
setflag(6);
force_rport();
fix_nated_contact();
};
force_rtp_proxy("l");
};
route(1);
break;
};
# Requests to others domains
if (!uri==myself) {
# mark routing logic in request
append_hf("P-hint: outbound\r\n");
route(1);
break;
};
# if the request is for other domain use UsrLoc
# (in case, it does not work, use the following
command
# with proper names and addresses in it)
if (uri==myself) {
if (method=="CANCEL") {
route(3);
break;
} else if (method=="INVITE") {
route(3);
break;
} else if (method=="REGISTER") {
route(2);
break;
};
# native SIP destinations are handled using our
USRLOC DB
lookup("aliases");
if (!lookup("location")) {
sl_send_reply("404", "User Not Found");
break;
};
route(1);
};
}
route[1] {
###########################
# Default Message Handler #
###########################
t_on_reply("1");
# send it out now; use stateful forwarding as it
works reliably
# even for UDP2TCP
if (!t_relay()) {
if (method=="INVITE" && isflagset(6)) {
unforce_rtp_proxy();
};
sl_reply_error();
};
}
route[2] {
############################
# Register Message Handler #
############################
if (!search("^Contact:") && nat_uac_test("19")) {
setflag(6);
fix_nated_register();
force_rport();
};
if (!www_authorize("nxs.yi.org", "subscriber")) {
www_challenge("nxs.yi.org", "0");
sl_send_reply("401", "Unauthorized");
break;
};
if (!save("location")) {
sl_reply_error();
break;
};
}
route[3] {
#############################
# CANCEL and INVITE handler #
#############################
if (nat_uac_test("19")) {
setflag(6);
};
if (isflagset(6)) {
force_rport();
fix_nated_contact();
force_rtp_proxy();
};
if (!uri==myself) {
route(1);
break;
};
if (src_ip==192.168.0.50 && allow_trusted()) {
route(4);
} else if (src_ip==192.168.0.50 &&
!allow_trusted()) {
if
(!proxy_authorize("","subscriber")) {
proxy_challenge("","0");
sl_send_reply("403",
"Forbidden");
break;
};
break;
};
if (uri=~"sip:^[0-9]{2}@.*$" ||
uri=~"sip:^1013@.*$" ||uri=~"sip:^[0-9]{10}@.*$" ||
uri=~"sip:^06[0-9]{8}@.*$") {
route(5);
break;
};
if (!lookup("location")) {
sl_send_reply("404", "User Not Found");
break;
};
t_on_reply("1");
if (!t_relay()) {
if (isflagset(6)) {
unforce_rtp_proxy();
};
sl_reply_error();
};
}
route[4] {
##########################
# Incoming PSTN Handler #
##########################
if (uri=~"^[0-9]{10}@.*$") {
strip(8);
break;
};
lookup("aliases");
if (!lookup("location")) {
sl_send_reply("404", "User Not
Found");
break;
};
route(1);
}
route[5] {
##########################
# Outgoing PSTN Handler #
##########################
if (uri=~"sip:^[0-9]{2}@.*$") {
if (!is_user_in("Request-URI", "internal")) {
sl_send_reply("403", "Forbidden");
break;
};
} else if (uri=~"sip:^[0-9]{2}@.*$") {
if (!is_user_in("Request-URI",
"local")) {
sl_send_reply("403",
"Forbidden");
break;
};
} else if (uri=~"sip:^1013@.*$") {
if (!is_user_in("Request-URI",
"local")) {
sl_send_reply("403",
"Forbidden");
break;
};
} else if (uri=~"sip:^06[0-9]{8}@.*$") {
if (!is_user_in("Request-URI", "cell
phone")) {
sl_send_reply("403",
"Forbidden");
break;
};
};
rewritehostport("192.168.0.50:5040");
route(1);
}
onreply_route[1] {
if (isflagset(6) && status=~"(180) | (183) |
2[0-9][0-9]") {
force_rtp_proxy();
};
if (nat_uac_test("1")) {
fix_nated_contact();
};
}
_____________________________________________________________________________
Découvrez le nouveau Yahoo! Mail : 1 Go d'espace de stockage pour vos mails, photos et
vidéos !
Créez votre Yahoo! Mail sur
http://fr.mail.yahoo.com