All,
I am trying to configure SER to work as SIP proxy (not registar and
not redirect). I tried to modify simple ser.cfg which comes with SER
by adding one line in route[0]:
rewritehostport("192.168.1.2:5060");
This unfortunately doesn't work. The message to my SIP server
192.168.1.2 are indeed forwarded. But message comming back from
192.168.1.2 are looped by my SIP proxy (192.168.1.3) back to SIP
server (192.168.1.2).
Can someone help me? Or send a working cfg for SIP proxy, I cannot find any.
This is my complete ser.cfg:
#
# $Id: ser.cfg,v 1.25.2.1 2005/02/18 14:30:44 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)
/* 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"
# ------------------ module loading ----------------------------------
# Uncomment this if you want to use SQL database
#loadmodule "//lib/ser/modules/mysql.so"
loadmodule "//lib/ser/modules/sl.so"
loadmodule "//lib/ser/modules/tm.so"
loadmodule "//lib/ser/modules/rr.so"
loadmodule "//lib/ser/modules/maxfwd.so"
loadmodule "//lib/ser/modules/usrloc.so"
loadmodule "//lib/ser/modules/registrar.so"
loadmodule "//lib/ser/modules/textops.so"
# Uncomment this if you want digest authentication
# mysql.so must be loaded !
#loadmodule "//lib/ser/modules/auth.so"
#loadmodule "//lib/ser/modules/auth_db.so"
# ----------------- setting module-specific parameters ---------------
# -- usrloc params --
modparam("usrloc", "db_mode", 0)
# Uncomment this if you want to use SQL database
# for persistent storage and comment the previous line
#modparam("usrloc", "db_mode", 2)
# -- auth params --
# Uncomment if you are using auth module
#
#modparam("auth_db", "calculate_ha1", yes)
#
# If you set "calculate_ha1" parameter to yes (which true in this config),
# uncomment also the following parameter)
#
#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)
# ------------------------- 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 >= 2048 ) {
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();
# subsequent messages withing a dialog should take the
# path determined by record-routing
if (loose_route()) {
# mark routing logic in request
append_hf("P-hint: rr-enforced\r\n");
route(1);
break;
};
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=="REGISTER") {
# Uncomment this if you want to use digest authentication
# if (!www_authorize("iptel.org", "subscriber")) {
# www_challenge("iptel.org", "0");
# break;
# };
save("location");
break;
};
lookup("aliases");
if (!uri==myself) {
append_hf("P-hint: outbound alias\r\n");
route(1);
break;
};
# native SIP destinations are handled using our USRLOC DB
if (!lookup("location")) {
sl_send_reply("404", "Not Found");
break;
};
};
append_hf("P-hint: usrloc applied\r\n");
route(1);
}
route[1]
{
# send it out now; use stateful forwarding as it works reliably
# even for UDP2TCP
# Dzus
rewritehostport("192.168.1.2:5060");
if (!t_relay()) {
sl_reply_error();
};
}
----------------------------------------------------------------
This message was sent using IMP, the Internet Messaging Program.
Hi, I've configured:
modparam("auth_db", "calculate_ha1", 0)
modparam("auth_db", "password_column", "ha1") # Default value
modparam("auth_db", "password_column_2", "ha1b") # Default value
Twinkle softphone uses digest with "username=user@domain" so OpenSer verifies
the hash with the "ha1b" column and it works well, it's authenticated.
But Linksys PAP2 uses digest with just "username=user" so OpenSer uses "ha1"
column. I don't know why but it fails.
Of course both can authenticate perfectly using
modparam("auth_db", "calculate_ha1", 1)
modparam("auth_db", "password_column", "password")
Both users are generated with "openserctl add" command. Any idea why it fails
with Linksys PAP2?
I use OpenSer 1.2.1 of Debian testing.
Thanks.
--
Iñaki Baz Castillo
ibc(a)in.ilimit.es
Hi,
OpenSER trunk has a new logging design, covering new functionalities
(for end-user), more simplicity (for developers), better log format, etc.
End-user functionalities
=========================
1) configurable debug level at runtime - so far we had static debug
level, but now, there is a MI function to change it at runtime. If you
want to have or not a configurable debug level, there is a compile
option named CHANGEABLE_DEBUG_LEVEL (see Makefile.defs). By default is
on, but, if there are performance concerns, you can turn it off.
The MI function is called "debug":
# display the current debug level
openserctl fifo debug
# set a new debug level (L_ERR)
openserctl fifo debug -1
The function changes the global debug level, so all processes and all
code will be affected.
2) script function for changing the debug level - this functions allows
you to change the debug level from script, only for a specific script
block. Only the debug level of the current process will be changed. This
is very helpful if you are tracing and debugging only a specific piece
of code.
The script function is:
setdebug(4); # set debug level for debug
setdebug(); # reset the debug level to the global one
Ex:
debug= -1 # err only
.....
{
......
setdebug(4);
uac_replace_from(....);
setdebug();
.......
}
The function change the debug level of the current process and changing
the global debug level (MI function) does not affect it, so be careful
and reset the pre process debug level when you are done.
More simplicity
=================
The logging function used in code was replaced with a new set of
functions, more simple and flexible:
LOG / DBG were replaced with:
LM_ALERT( ...)
LM_CRIT( ...)
LM_ERR( ...)
LM_WARN( ...)
LM_NOTICE( ...)
LM_INFO( ...)
LM_DBG( ...)
Prototype is LM_XXX( "FMT", .....);
The functions will automatically add to the logged message the log
level, the module name, function name, process pid and time stamp, so
you do not have to care about it from the code.
Better log format
==================
Even if you use syslog or stderr logging, the log message will contain
information about log level, the module name, function name, process pid
and time stamp.
For syslog, the log level is mapped over the syslog levels, so no text
will be used - you can configure syslog to use different files for each
log level. Also time and pid are not pushed from openser as this info is
automatically logged by syslog.
For stderr logging, openser take care and appends the log level as text,
time and pid (as text).
Ex:
Jul 23 19:52:19 [0] INFO:sl:mod_init: Initializing StateLess engine
So, either you are using syslog, either stderr, you will still get the
same information logged.
We still need to migrate all the log messages from script from the old
to the new set of functions, so, for the moment, not all logs will be
"nice" formatted.
Regards,
Bogdan
Good Morning everybody,
I hope you had a pleasant week-end!
I'm trying to set up an infrastructure for prepaid calls for my school
working with OpenSER + Freeradius + CDRTool
OpenSER is working well with FreeRadius, but I have followed the CDRTool
installation tutorial and now Freeradius doesn't work anymore...
Both OpenSER and freeradius data is stored in an mysql database, but
when I was installing CDRTool, I had to modify their database following
http://cdrtool.ag-projects.com/doc/INSTALL.txt
Is there someone who succeed in setting up this installation...
Any Help or just any hope to succeed?
PS: I'm using OpenSER 1.2.1-1 compiled by hand, Freeradius 1.1.3-3 and
cdrtool_5.2.1_all.deb
Marc
Hi all,
just wanted to let you know that we have released our visual SIP monitoring tool as OSS (GPL'd).
You can take a look on what it does (and how) on http://www.wesip.com/mediawiki/index.php/SipSpy
basically, SipSpy is composed of 2 softwares: an agent and a manager.
You run the agent in all the nodes where you want to monitor SIP traffic,
and the manager (User Interface) in your computer. THen the manager (SipSpy) connects
to each of the agents through TCP, and they report any SIP packet that matches a
given regexp to the manager.
MOre or less its like having a couple of ngreps running on different hosts, but reporting
the seen SIP packets to a nice graphical User Interface, so that you can see what's happening
in all the nodes in real time from your desktop.
ngrep is tough for starters !
Elias
Hi all,
Anyone know how can I transfer an incoming call from SER to an
Asterisk ?
The sip uri wich comes from SER is like : sip:enum@domain.tld
But on Asterisk enum will not be necessary the extension.
IT seems that with a single rewritehostport to Asterisk, it doesn't run.
Thanks for your support
Adrien
Hi,
I'm currently using openser-devel release 2497 and I'm facing what I think is a bug. I'm using a remote mysql server. My openser.cfg file contains the following lines :
loadmodule "/usr/local/lib/openser/modules/mysql.so"
loadmodule "/usr/local/lib/openser/modules/usrloc.so"
loadmodule "/usr/local/lib/openser/modules/auth.so"
loadmodule "/usr/local/lib/openser/modules/auth_db.so"
loadmodule "/usr/local/lib/openser/modules/uri_db.so"
modparam("usrloc", "db_mode", 2)
modparam("auth_db", "calculate_ha1", 1)
modparam("auth_db", "password_column", "password")
modparam("auth_db", "user_column", "username")
modparam("auth_db", "domain_column", "domain")
modparam("usrloc|auth_db","db_url","mysql://foo:bar@192.168.1.62:3306/openser")
When starting openser, I get these lines in the logs :
openser[30331]: INFO: statistics manager successfully initialized
openser[30331]: StateLess module - initializing
openser[30331]: TM - initializing...
openser[30331]: maxfwd:initializing
openser[30331]: INFO:ul_init_locks: locks array size 512
openser[30331]: TextOPS - initializing
openser[30331]: new_connection: Can't connect to local MySQL server through socket '/var/lib/mysql/mysql.sock' (2)
openser[30331]: ERROR: uridb_db_ver: unable to open database connection
openser[30331]: ERROR: uri_db:mod_init(): Error while querying table version
openser[30331]: init_mod(): Error while initializing module uri_db
openser[30331]: INFO:mi_fifo:mi_destroy: process hasn't been created -> nothing to kill
I tried to launch a local mysql and as far as I can see, openser only connects to the local server, it doesn't do any requests. So is there a bug or am I missing something ?
--
Julien REVERET
OSIATIS - LIFO https://www.lifo-osiatis.com
Hi,
recently moved from SER > OpenSER 1.2.0, but after some time when the
server is running OpenSER starts to respond with:
"SIP/2.0 473 Filtered destination (473/TM)." to my INVITEs.
I don't have any blacklists/accesslist configured (the config is from
SER which doesn't support that), why am I seeing this problem?
Br,
/Tobias