Hi all,
i have found some probs with the radius_auth module in ser.
the ane in the function authorize() in file authorize.c :
when calling the function check_nonce this function returns always that the
two nonce's (given and new generated one are not the same. But if we compare
the two nonce's manually both are the same. I replaced the memcmp function
with the strcmp funtion,but nothings changes. So there is may a missing \0
at the end of the strings.
Next problem is in the function check_response:
On Solaris we have no freeradiusd ,so I replaced it through
radius_authorize(...).
If the function radius_authorize is called, the radiusmessage will be
created through calling the function rc_avpair_add(...). All is fine if it
will be standard radius-attributes. when the first sip-specific attribute is
comming the rc_avpair_add funtions returns -1. I followed this problem and
find out that in the radiusclient-lib. in function
rc_avpair_assign(avpair.c)/rc_avpair_new(avpair.c) only attributes of the
types PW_TYPE_STRING, PW_TYPE_DATE, PW_TYPE_INTEGER, PW_TYPE_IPADDR are
reccognised. If a PW_SIP_USER_ID attribute or other specific Sip attributes
will be added to the radiusmessage, this function returns with error message
"UNKNOWN ATTIBUTE TYPE" and no radius-authentification is done....
....
RADIUS: rc_avpair_new MALLOC erfolgreich
RADIUS: rc_avpair_assign type=0
RADIUS rc_avpair_assign result=0
RADIUS: rc_avpair_new unknown attribute 110
RADIUS: VALUEPAIR insert fehgeschlagen.!!!
check_cred(): returnvalue of radius_authorize()=-1
....
One possibility is that, I add the PW_SIP_* attributes to the radiusclient
and look, if it run.
The next Problem may be, that the radius server does not understand the sip
specific attributes, if we not use freeradius.
Gruß Bjoern
Hi all,
ich added following lines in avpair.c function rc_avpair_assign before "case
PW_TYPE_STRING:":
case PW_SIP_USER_ID:
case PW_SIP_USER_REALM:
case PW_SIP_USER_NONCE:
case PW_SIP_USER_METHOD:
case PW_SIP_USER_DIGEST_URI:
case PW_SIP_USER_NONCE_COUNT:
case PW_SIP_USER_QOP:
case PW_SIP_USER_OPAQUE:
case PW_SIP_USER_RESPONSE:
case PW_SIP_USER_CNONCE:
case PW_TYPE_STRING:
this should help to build the radius-message.
Bjoern
Hi,
I've been working on a problem which I thought was a postgres driver problem,
but now I'm not so sure.
I put a bunch of debug statements in the driver functions. I've grepped
the debugs for db_init|db_close|connect_db|disconnect_db and
here is what I have:
-----------cut------------
Mar 1 23:59:49 rave ser[1803]: db_init(): sql://USER:PASSWORD@humpty.august.net:5432/THEDBNAME
Mar 1 23:59:49 rave ser[1803]: connect_db(): here we go
Mar 1 23:59:49 rave ser[1803]: connect_db(): we are connected /tmp/debug.1803.out
Mar 1 23:59:49 rave ser[1804]: db_close(): disconnect_db()
Mar 1 23:59:49 rave ser[1804]: disconnect_db(): entry
Mar 1 23:59:49 rave ser[1804]: disconnect_db(): PQfinish()
Mar 1 23:59:49 rave ser[1804]: db_close(): free self
Mar 1 23:59:49 rave ser[1804]: db_init(): sql://USER:PASSWORD@humpty.august.net:5432/THEDBNAME
Mar 1 23:59:49 rave ser[1804]: connect_db(): here we go
Mar 1 23:59:49 rave ser[1805]: db_close(): disconnect_db()
Mar 1 23:59:49 rave ser[1805]: disconnect_db(): entry
Mar 1 23:59:49 rave ser[1805]: disconnect_db(): PQfinish()
Mar 1 23:59:49 rave ser[1805]: db_close(): free self
Mar 1 23:59:49 rave ser[1805]: db_init(): sql://USER:PASSWORD@humpty.august.net:5432/THEDBNAME
Mar 1 23:59:49 rave ser[1805]: connect_db(): here we go
Mar 1 23:59:49 rave ser[1806]: db_close(): disconnect_db()
Mar 1 23:59:49 rave ser[1806]: disconnect_db(): entry
Mar 1 23:59:49 rave ser[1806]: disconnect_db(): PQfinish()
Mar 1 23:59:49 rave ser[1806]: db_close(): free self
Mar 1 23:59:49 rave ser[1804]: connect_db(): we are connected /tmp/debug.1804.out
Mar 1 23:59:49 rave ser[1806]: db_init(): sql://USER:PASSWORD@humpty.august.net:5432/THEDBNAME
Mar 1 23:59:49 rave ser[1804]: db_init(): sql://USER:PASSWORD@humpty.august.net:5432/THEDBNAME
Mar 1 23:59:49 rave ser[1806]: connect_db(): here we go
Mar 1 23:59:49 rave ser[1804]: connect_db(): here we go
Mar 1 23:59:49 rave ser[1805]: connect_db(): we are connected /tmp/debug.1805.out
Mar 1 23:59:49 rave ser[1805]: db_init(): sql://USER:PASSWORD@humpty.august.net:5432/THEDBNAME
Mar 1 23:59:49 rave ser[1805]: connect_db(): here we go
Mar 1 23:59:49 rave ser[1804]: connect_db(): we are connected /tmp/debug.1804.out
Mar 1 23:59:50 rave ser[1805]: connect_db(): we are connected /tmp/debug.1805.out
Mar 1 23:59:50 rave ser[1806]: connect_db(): we are connected /tmp/debug.1806.out
Mar 1 23:59:50 rave ser[1806]: db_init(): sql://USER:PASSWORD@humpty.august.net:5432/THEDBNAME
Mar 1 23:59:50 rave ser[1806]: connect_db(): here we go
Mar 1 23:59:50 rave ser[1806]: connect_db(): we are connected /tmp/debug.1806.out
Mar 2 00:00:50 rave ser[1807]: begin_transaction(): BEGIN error server closed the connection unexpectedly ^IThis probably means the server terminated abnormally ^Ibefore or while processing the request.
-----------------cut--------------
The current processes that are running are:
[root@rave sip_router]# ps -ax | grep ser
30060 ? S 0:00 /bin/sh bin/safe_mysqld --user=mysql
1803 ? S 0:00 ser -f /usr/local/etc/ser/serpost.cfg
1804 ? S 0:00 ser -f /usr/local/etc/ser/serpost.cfg
1805 ? S 0:00 ser -f /usr/local/etc/ser/serpost.cfg
1806 ? S 0:00 ser -f /usr/local/etc/ser/serpost.cfg
1807 ? S 0:00 ser -f /usr/local/etc/ser/serpost.cfg
1808 ? S 0:00 ser -f /usr/local/etc/ser/serpost.cfg
-----------------cut------------------
Here is the top of my ser.cfg file:
----------------
debug=2 # debug level (cmd line: -dddddddddd)
fork=yes
log_stderror=no # (cmd line: -E)
check_via=no # (cmd. line: -v)
dns=no # (cmd. line: -r)
rev_dns=no # (cmd. line: -R)
listen=216.87.144.203
port=5060
children=2
fifo="/tmp/ser_fifo"
alias="augustvoice.net"
loadmodule "/usr/local/lib/ser/modules/sl.so"
loadmodule "/usr/local/lib/ser/modules/tm.so"
loadmodule "/usr/local/lib/ser/modules/acc.so"
loadmodule "/usr/local/lib/ser/modules/rr.so"
loadmodule "/usr/local/lib/ser/modules/maxfwd.so"
loadmodule "/usr/local/lib/ser/modules/postgres.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/auth.so"
loadmodule "/usr/local/lib/ser/modules/textops.so"
modparam("usrloc","db_mode",2)
modparam("usrloc","db_url",
"sql://USER:PASSWORD@humpty.august.net:5432/THEDBNAME")
modparam("tm","retr_timer1p1", 2) # increase retry timeout
modparam("tm","retr_timer1p2", 3) # increase retry timeout
modparam("tm","retr_timer1p3", 6) # increase retry timeout
modparam("acc", "log_level", 1)
modparam("acc", "acc_flag", 1 )
modparam("acc", "report_ack", 0 )
modparam("auth","db_url",
"sql://USER:PASSWORD@humpty.august.net:5432/THEDBNAME")
#
# this is the main routing block for augustvoice.net
# this block can handle any routing request, local or foreign
#
route
{
#
...
---------------------------
A couple of questions:
1) I state 'children=2', but I see 6 'processes'. I think linux does
threads with processes, so am I seeing 2 'processes' with 3 threads per
process???
2) the debug output has the process ID and the action being
performed. Either it is way out of order, or the postgres
db driver is being asked to do things out of order.
3) Why is there all of the db_init(), db_close() stuff?? All of this
stuff happens in the first second on startup. Surely that many opens
and closes aren't really needed are they?
4) select statements seem to happen in one thread, and insert/delete statements
seem to happen in another thread. What is that about?
---greg
Greg Fausak
Hi,
Context: I am currently writing a module that allows me to connect to a
policy server -- not unlike CPL. It essentially routes the message out to
the server and then receives a response. I get the message out ok, and will
receive a complete sip message back. The module main function is called in
the ser.cfg.
Here are my questions:
1) how do I get a message that I have received -- say in char *msg_buf -- to
be the message that is used for further routing? The policy server might
have changed any header fields or even created a (or several) completely new
message(s).
2) can the module send back intermediate messages, such as 1xx info, while
it is still continuing its work? This is to provide the user with feedback
should things take while ...
3) I also want the module to react to SIP response messages (4xx and so). I
assumed providing a response_function would do this, but apparently not (I
had a simple one which was just LOGging some text to the system log, but it
never did create any entries). So how can I do this?
thanks,
Stephan
--
Dr Stephan Reiff-Marganiec
Research Fellow
Department of Computing Science; University of Stirling
email: srm(a)cs.stir.ac.uk tel: 01786 46 7448
--
The University of Stirling is a university established in Scotland by
charter at Stirling, FK9 4LA. Privileged/Confidential Information may
be contained in this message. If you are not the addressee indicated
in this message (or responsible for delivery of the message to such
person), you may not disclose, copy or deliver this message to anyone
and any action taken or omitted to be taken in reliance on it, is
prohibited and may be unlawful. In such case, you should destroy this
message and kindly notify the sender by reply email. Please advise
immediately if you or your employer do not consent to Internet email
for messages of this kind. Opinions, conclusions and other
information in this message that do not relate to the official
business of the University of Stirling shall be understood as neither
given nor endorsed by it.
Is pkg_malloc some sort of memory management thing?
I mean, do I have to clean up, or does something come in and clean
up behind me?
Is there a parent/child memory mallocator available? It
would make freeing easier. A single free of the parent
rather than keeping track myself.
I just don't want to be the source of a memory leak.
---greg
thx for the help so far, but the adventure continues:
compiled latest ser from CVS on sol8 from scratch..
and still using the same ser.cfg
but can't start ser anymore, that's what the log shows:
0(15264) loading module /usr/local/lib/ser/modules/mysql.so
0(15264) loading module /usr/local/lib/ser/modules/sl.so
0(15264) loading module /usr/local/lib/ser/modules/tm.so
0(15264) loading module /usr/local/lib/ser/modules/rr.so
0(15264) loading module /usr/local/lib/ser/modules/maxfwd.so
0(15264) loading module /usr/local/lib/ser/modules/usrloc.so
0(15264) loading module /usr/local/lib/ser/modules/registrar.so
0(15264) loading module /usr/local/lib/ser/modules/auth.so
0(15264) find_param_export: found <db_mode> in module usrloc [/usr/local/lib/ser/modules/usrloc.so]
0(15264) find_param_export: found <calculate_ha1> in module auth [/usr/local/lib/ser/modules/auth.so]
0(15264) find_param_export: found <password_column> in module auth [/usr/local/lib/ser/modules/auth.so]
0(15264) find_export: found <mf_process_maxfwd_header> in module maxfwd_module [/usr/local/lib/ser/modules/maxfwd.so]
0(15264) find_export: found <sl_send_reply> in module sl_module [/usr/local/lib/ser/modules/sl.so]
0(15264) find_export: found <sl_send_reply> in module sl_module [/usr/local/lib/ser/modules/sl.so]
0(15264) find_export: <rewriteFromRoute> not found
0(15264) parse error (79,19-20): unknown command, missing loadmodule?
0(15264) find_export: found <www_authorize> in module auth [/usr/local/lib/ser/modules/auth.so]
0(15264) find_export: found <www_challenge> in module auth [/usr/local/lib/ser/modules/auth.so]
0(15264) find_export: found <save> in module registrar [/usr/local/lib/ser/modules/registrar.so]
0(15264) find_export: found <lookup> in module registrar [/usr/local/lib/ser/modules/registrar.so]
0(15264) find_export: found <sl_send_reply> in module sl_module [/usr/local/lib/ser/modules/sl.so]
0(15264) find_export: found <t_relay> in module tm [/usr/local/lib/ser/modules/tm.so]
0(15264) find_export: found <sl_reply_error> in module sl_module [/usr/local/lib/ser/modules/sl.so]
ERROR: bad config file (1 errors)
0(15264) INFO: signal 15 received
0(15264) Memory status (pkg):
0(15264) qm_status (72d38):
0(15264) heap size= 1022872
0(15264) used= 0, used+overhead=25704, free=997168
0(15264) max used (+overhead)= 25704
0(15264) dumping all allocked. fragments:
0(15264) dumping free list stats :
0(15264) hash= 521. fragments no.: 1
0(15264) -----------------------------
anyone a pointer to what i have missed?
tia again
-k