Skip to Content.
Sympa Menu

wg-pic - Re: [wg-pic] ser.cfg?

Subject: Presence and IntComm WG

List archive

Re: [wg-pic] ser.cfg?


Chronological Thread 
  • From: Steve Blair <>
  • To:
  • Subject: Re: [wg-pic] ser.cfg?
  • Date: Wed, 23 Mar 2005 07:06:08 -0500


Thanks Jamey. I wasn't sure which file was the most current.

-Steve

Jamey Hicks wrote:

Steve Blair wrote:


Candace:

I'll leave this to Jamie because he knows where all the files reside. If he doesn't
get back to you let me know and I'll look for them.

Sorry, have not had a chance to check email all day. The config file is in /etc/ser/ser.cfg and attached.

Jamey

------------------------------------------------------------------------

#
# $Id: ser.cfg,v 1.5 2003/07/23 13:31:22 bavery Exp $
#
# simple quick-start config script
#

# ----------- global configuration parameters ------------------------

debug=3 # debug level (cmd line: -dddddddddd)
fork=yes
log_stderror=yes # (cmd line: -E)
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"
fifo_mode=0666
fifo_db_url="mysql://ser:heslo@localhost/ser"

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

# Uncomment this if you want to use SQL database
loadmodule "/usr/local/lib/ser/modules/mysql.so"

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/exec.so"
loadmodule "/usr/local/lib/ser/modules/pa.so"
loadmodule "/usr/local/lib/ser/modules/uri_db.so"
loadmodule "/usr/local/lib/ser/modules/domain.so"
loadmodule "/usr/local/lib/ser/modules/mediaproxy.so"
loadmodule "/usr/local/lib/ser/modules/msilo.so"

# Uncomment this if you want digest authentication
# mysql.so must be loaded !
loadmodule "/usr/local/lib/ser/modules/auth.so"
loadmodule "/usr/local/lib/ser/modules/auth_db.so"
# loadmodule "/usr/local/lib/ser/modules/acc.so"

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

# -- registrar params --
modparam("registrar", "default_expires", 600)
modparam("registrar", "min_expires", 300)
modparam("registrar", "max_expires", 600)
modparam("registrar", "use_domain", 1) ## for domain hijacking

# -- usrloc params --

# Uncomment this if you want to use SQL database # for persistent storage and comment the previous line
# modparam("usrloc", "db_mode", 2) ## write back
modparam("usrloc", "db_mode", 1) ## write through
modparam("usrloc", "use_domain", 1) ## for domain hijacking
modparam("usrloc", "db_url",
"mysql://ser:heslo@localhost/ser")

# -- pa params --
modparam("pa", "use_db", 1)
modparam("pa", "db_url",
"mysql://ser:heslo@localhost/ser")
modparam("pa", "use_place_table", 1)
modparam("pa", "callback_update_db", 1)
modparam("pa", "new_tuple_on_publish", 0)
modparam("pa", "new_watcher_pending", 0)

# -- auth params --
# Uncomment if you are using auth module
#
modparam("auth_db", "calculate_ha1", yes)
modparam("auth_db", "password_column", "password")
modparam("auth_db", "use_domain", 1) ## for domain hijacking

#
# uri_db params
#
modparam("uri_db", "use_domain", 1)

#
# -- msilo parms --
#
modparam("msilo", "db_url",
"mysql://ser:heslo@localhost/ser")
#modparam("msilo", "db_table", "silo")
modparam("msilo", "registrar",
"sip:")
##modparam("msilo", "use_contact", 0)

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

# main routing logic
alias="pals.internet2.edu"
#alias="internet2.edu"

route{
log(1,"Initial route entry begin\n");
# initial sanity checks -- messages with
# max_forwars==0, or excessively long requests
if (!mf_process_maxfwd_header("10")) {
log(1,"Too many hops\n");
exec_msg("cat >> /tmp/toomanyhops.log");
sl_send_reply("483","Too Many Hops");
break;
};

# uncomment this to reflect all the requests to the file cow.dat
## exec_msg ("printenv SRCIP >> /tmp/ser.log; cat >> /tmp/ser.log");

if (client_nat_test("7")) {
log(1, "UA appears to be behind NAT, fixing contact\n");
fix_contact();
};

exec_msg ("printenv SRCIP >> /tmp/sip.log; cat >> /tmp/sip.log");

# 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 (method == REGISTER && does_to_uri_exist())
|| (method == MESSAGE && does_to_uri_exist())
|| does_uri_exist()) {
log(2, "uri is a subscriber\n");
exec_msg ("cat >> /tmp/subscriber.log");

if (method=="XPUBLISH") {
if (!t_newtran()) {
log(1, "newtran error\n");
sl_reply_error();
};
exec_msg ("printenv SRCIP >> /tmp/publish.log; cat >>
/tmp/publish.log");
handle_publish("registrar");
log(1,"handled publish\n");
break;
};

if (method=="XSUBSCRIBE") {
if (!t_newtran()) {
log(1, "newtran error\n");
sl_reply_error();
};
exec_msg ("printenv SRCIP >> /tmp/subscribe.log; cat >>
/tmp/subscribe.log");
log(1, "handling subscription\n");
handle_subscription("registrar");
log(1,"handled subscribe\n");
break;
};

if (method=="REGISTER") {

# Uncomment this if you want to use digest authentication
if ((!www_authorize("", "subscriber"))){
exec_msg ("printenv SRCIP >> /tmp/preauthregister.log; cat >>
/tmp/preauthregister.log");
log(1,"bad auth\n");
# if (!((uri ==
"sip:")
# |(uri ==
"sip:")
# |(uri ==
"sip:")
# |(uri ==
"")
# |(src_ip == 192.58.208.219))) {
# log(1,"found ip :>\n");
www_challenge("", "0");
break;
# };
};

log(1,"Got REGISTER saving location\n");
exec_msg ("printenv SRCIP >> /tmp/register.log; cat >> /tmp/register.log");
save("location");
log("REGISTER received -> dumping messages with
MSILO\n"); ##added by joe
# MSILO - dumping user's offline messages - added by joe
if (m_dump())
{
log("MSILO: offline messages dumped - if they
were\n");
}else{
log("MSILO: no offline messages dumped\n");
};
## pa_handle_registration("registrar");
break;
};
if (method=="XMESSAGE") {
exec_msg ("cat >> /tmp/message.log");
if(!lookup("location")) {
if (! t_newtran())
{
sl_reply_error();
break;
};
log("MESSAGE received -> storing using MSILO\n");
# MSILO - storing as offline message
if (m_store("0"))
{
log("MSILO: offline message stored\n");
if (!t_reply("202", "Accepted")) {
sl_reply_error();
};
}else{
log("MSILO: offline message NOT stored\n");
if (!t_reply("503", "Service Unavailable")) {
sl_reply_error();
};
};
break;
};
};

# resolve aliases first!
if (!lookup("aliases")) {
log(1, "Could not lookup aliases\n");
} else {
log(1, "Managed to lookup aliases\n");
};

# native SIP destinations are handled using our USRLOC DB
if (!lookup("location")) {
log(1,"Could not lookup location -- returning 404 not
found\n");
# just return 404
sl_send_reply("404", "Not Found");
break;
exec_msg ("cat >> /tmp/notfound.log");
} else {
log(1, "Managed to lookup location\n");
};
} else {
exec_msg ("cat >> /tmp/notme.log");
log(1, "notme\n");
# resolve aliases first!
if (!lookup("aliases")) {
log(1, "Could not lookup aliases\n");
} else {
log(1, "Managed to lookup aliases\n");
};

if
(uri=~"sip:")
{
log(1, "rewriteuri wg-pic\n");

rewriteuri("sip:");
exec_msg ("cat >> /tmp/rewriteuri.log");
}
if
(uri=~"sip:")
{
## was asia

rewriteuri("sip:");
}
if
(uri=~"sip:")
{

rewriteuri("sip:");
}
if
(uri=~"sip:")
{
log(1, "rewriteuri
\n");

rewriteuri("sip:");
}
if
(uri=~"sip:")
{
log(1, "rewriteuri
\n");

rewriteuri("sip:");
}
if
(uri=~"sip:")
{

rewriteuri("sip:");
}

if
(uri=~"^sip:[0-9][0-9][0-9][0-9][0-9][0-9][0-9][0-9][0-9][0-9]@"){
if ((!www_authorize("", "subscriber"))){
log(1,"bad auth for pstn call\n");
www_challenge("", "0");
break;
};
## rewritehostport("hpl.hp.com");
## exec_msg ("cat >> /tmp/pstn.log");
}
}
# forward to current uri now
if (!t_relay()) {
sl_reply_error();
};

}
failure_route[1] { ## function added by joe for msilo
# forwarding failed -- check if the request was a MESSAGE if (!method=="MESSAGE")
{
break;
};

log(1,"MSILO: the downstream UA does not support MESSAGE requests
...\n");
# we have changed the R-URI with the contact address -- ignore it now
if (m_store("1"))
{
log("MSILO: offline message stored\n");
t_reply("202", "Accepted"); }else{
log("MSILO: offline message NOT stored\n");
t_reply("503", "Service Unavailable");
};
}




--
ISC Network Engineering
The University of Pennsylvania
3401 Walnut Street, Suite 221A
Philadelphia, PA 19104

voice: 215-573-8396
215-746-8001

fax: 215-898-9348
sip:




Archive powered by MHonArc 2.6.16.

Top of Page