<html>
<head>
<meta content="text/html; charset=ISO-8859-1"
http-equiv="Content-Type">
</head>
<body bgcolor="#FFFFFF" text="#000000">
Hello,<br>
<br>
try to keep the mailing list cc-ed -- others may be able to help you
faster or this discussion will be helpful for different people.<br>
<br>
The username_spec and password_spec were removed indeed, the first
was useless since the username was taken from auth header and the
second became parameter to pv_www_authenticate, see:<br>
<br>
<a class="moz-txt-link-freetext" href="http://kamailio.org/docs/modules/3.1.x/modules/auth.html#pv_www_authenticate">http://kamailio.org/docs/modules/3.1.x/modules/auth.html#pv_www_authenticate</a><br>
<br>
You simply have to use something like:<br>
<br>
<meta http-equiv="content-type" content="text/html;
charset=ISO-8859-1">
<pre class="programlisting">if (!pv_www_authenticate("$td", "$var(password)", "0")) {
        www_challenge("$td", "0");
exit;
}</pre>
Cheers,<br>
Daniel<br>
<br>
On 9/10/11 12:51 PM, Khoa Phuong Viet Ngo wrote:
<blockquote
cite="mid:CAD1mJ4YfZiHRAOK1Gt09riTz-tX=m19DqoOepr9mYr=SrCPZ0A@mail.gmail.com"
type="cite">Hi Daniel,<br>
<br>
Thanks Daniel for your answer.<br>
<br>
It's very helpful for me :).<br>
<br>
Actually i tried with using kamailio 3.1.4 (lastest kamailio) but
i got the problem with auth module and parameter with auth module.<br>
Because some parameters at auth module have changed.<br>
<a moz-do-not-send="true"
href="http://kamailio.org/docs/modules/stable/modules/auth.html">http://kamailio.org/docs/modules/stable/modules/auth.html</a>
[3.1.4]<br>
<br>
But in 3.0.4 kamailio, i am using auth module with these parameter
and it had error with new kamailio (3.1.4) . :(<br>
<br>
kamailio.cfg<br>
<br>
########################################################<br>
loadmodule auth.so<br>
<br>
# ----- auth params -----<br>
<span style="background-color: rgb(255, 255, 102);">modparam("auth",
"username_spec", "$var(username)")</span><br
style="background-color: rgb(255, 255, 102);">
<span style="background-color: rgb(255, 255, 102);">modparam("auth",
"password_spec", "$var(password)")</span><br
style="background-color: rgb(255, 255, 102);">
<span style="background-color: rgb(255, 255, 102);">modparam("auth",
"calculate_ha1", 1)</span><br>
<br>
route[AUTH] {<br>
$var(utype) = 0;<br>
#!ifdef WITH_AUTH<br>
if (is_method("REGISTER"))<br>
{<br>
if(is_present_hf("Authorization"))<br>
{<br>
# authenticate the REGISTER requests (uncomment to
enable auth)<br>
if(!route(GETPASSWD))<br>
{<br>
www_challenge("", "0");<br>
exit;<br>
}<br>
<span style="background-color: rgb(255, 153, 102);">
if(!pv_www_authorize(""))</span><br>
{<br>
<span style="background-color: rgb(255, 153, 102);">
www_challenge(""/*realm*/,"0"/*qop*/);</span><br>
exit;<br>
}<br>
} else {<br>
www_challenge("", "0");<br>
exit;<br>
}<br>
} else {<br>
$var(srcgrp) = allow_source_address_group();<br>
if ($var(srcgrp) > 0) {<br>
# src ip allowed<br>
$var(utype) = 1;<br>
if($var(srcgrp)!=100)<br>
{<br>
$rd = $Ri;<br>
$fs = "udp:" + $Ri + ":5062";<br>
}<br>
return 1;<br>
}<br>
# authenticate if from local subscriber (uncomment to
enable auth)<br>
if (from_uri==myself)<br>
{<br>
if(is_present_hf("Proxy-Authorization"))<br>
{<br>
# authenticate the non-REGISTER requests
(uncomment to enable auth)<br>
if(!route(GETPASSWD))<br>
{<br>
proxy_challenge("", "0");<br>
exit;<br>
}<br>
if(!pv_proxy_authorize(""))<br>
{<br>
proxy_challenge(""/*realm*/,"0"/*qop*/);<br>
exit;<br>
}<br>
} else {<br>
proxy_challenge("", "0");<br>
exit;<br>
}<br>
$var(utype) = 2;<br>
consume_credentials();<br>
# caller authenticated<br>
}<br>
}<br>
#!endif<br>
return;<br>
}<br>
<br>
#####################################################<br>
<br>
Error logs:<br>
<br>
Sep 6 19:37:01 CorePBX kamailio: ERROR: <core>
[modparam.c:150]: set_mod_param_regex: parameter
<username_spec> not found in module <auth> <br>
Sep 6 19:37:01 CorePBX kamailio: : <core> [cfg.y:3419]:
parse error in config file /usr/local/etc/kamailio/kamailio.cfg,
line 260, column 51: Can't set module parameter <br>
Sep 6 19:37:01 CorePBX kamailio: ERROR: <core>
[modparam.c:150]: set_mod_param_regex: parameter
<password_spec> not found in module <auth> <br>
Sep 6 19:37:01 CorePBX kamailio: : <core> [cfg.y:3419]:
parse error in config file /usr/local/etc/kamailio/kamailio.cfg,
line 261, column 51: Can't set module parameter <br>
Sep 6 19:37:01 CorePBX kamailio: ERROR: <core>
[modparam.c:150]: set_mod_param_regex: parameter
<calculate_ha1> not found in module <auth> <br>
Sep 6 19:37:01 CorePBX kamailio: : <core> [cfg.y:3419]:
parse error in config file /usr/local/etc/kamailio/kamailio.cfg,
line 262, column 36: Can't set module parameter <br>
Sep 6 19:37:01 CorePBX kamailio: : <core> [cfg.y:3419]:
parse error in config file /usr/local/etc/kamailio/kamailio.cfg,
line 562, column 27: unknown command, missing loadmodule? <br>
Sep 6 19:37:01 CorePBX kamailio: : <core> [cfg.y:3419]:
parse error in config file /usr/local/etc/kamailio/kamailio.cfg,
line 594, column 30: unknown command, missing loadmodule? <br>
Sep 6 19:37:39 CorePBX kamailio: ERROR: <core>
[modparam.c:150]: set_mod_param_regex: parameter
<username_spec> not found in module <auth> <br>
Sep 6 19:37:39 CorePBX kamailio: : <core> [cfg.y:3419]:
parse error in config file /usr/local/etc/kamailio/kamailio.cfg,
line 260, column 51: Can't set module parameter <br>
Sep 6 19:37:39 CorePBX kamailio: ERROR: <core>
[modparam.c:150]: set_mod_param_regex: parameter
<password_spec> not found in module <auth> <br>
Sep 6 19:37:39 CorePBX kamailio: : <core> [cfg.y:3419]:
parse error in config file /usr/local/etc/kamailio/kamailio.cfg,
line 261, column 51: Can't set module parameter <br>
Sep 6 19:37:39 CorePBX kamailio: ERROR: <core>
[modparam.c:150]: set_mod_param_regex: parameter
<calculate_ha1> not found in module <auth> <br>
<br>
########################################################<br>
<br>
I <span class="il">appreciate</span> all your help on this case.<br>
<br>
Thanks Daniel,<br>
KhoaNVP<br>
<br>
<br>
<br>
<br>
<div class="gmail_quote">On Sat, Sep 10, 2011 at 1:58 PM,
Daniel-Constantin Mierla <span dir="ltr"><<a
moz-do-not-send="true" href="mailto:miconda@gmail.com">miconda@gmail.com</a>></span>
wrote:<br>
<blockquote class="gmail_quote" style="margin:0 0 0
.8ex;border-left:1px #ccc solid;padding-left:1ex;">Hello,<br>
<br>
it seems like a buffer overflow happened previously, since the
crash is in malloc. Do you get any error messages is syslog?
Can you recompile with QM_DBG_MALLOC like explained in the
next link and try again watching the syslog messages?<br>
<a moz-do-not-send="true"
href="http://www.kamailio.org/dokuwiki/doku.php/troubleshooting:memory"
target="_blank">http://www.kamailio.org/dokuwiki/doku.php/troubleshooting:memory</a><br>
<br>
On another hand, 3.0.4 is quite old, why are not using 3.1.4,
it is far more updated than 3.0 series -- we are just to
release first in 3.2 series. Upgrading from 3.0 to 3.1 is
rather trivial.<br>
<br>
Cheers,<br>
Daniel<br>
<br>
<br>
On 9/9/11 8:38 PM, KhoaNVP wrote:<br>
<blockquote class="gmail_quote" style="margin:0 0 0
.8ex;border-left:1px #ccc solid;padding-left:1ex">
Hi everyone,<br>
<br>
I hope you can help me with this issues.<br>
I'm working with kamailio 3.0.4 and when i implement the
call via kamailio<br>
after 1-->3 mins , kamailio is crashed.<br>
<br>
It's my debug from core log.<br>
<br>
Core was generated by `kamailio -E -ddd'.<br>
Program terminated with signal 11, Segmentation fault.<br>
#0 fm_malloc (qm=0x88c860, size=<value optimized
out>) at<br>
mem/f_malloc.c:382<br>
382 *f=frag->u.nxt_free;<br>
(gdb) qt<br>
Undefined command: "qt". Try "help".<br>
(gdb) bt<br>
#0 fm_malloc (qm=0x88c860, size=<value optimized
out>) at<br>
mem/f_malloc.c:382<br>
#1 0x000000000041fd27 in dup_lump_list_r (l=0x9275f8,
dir=LD_AFTER,<br>
error=0x7fff23bd661c) at data_lump.c:453<br>
#2 0x000000000041ffa9 in dup_lump_list_r (l=0x927640,
dir=LD_AFTER,<br>
error=0x7fff23bd666c) at data_lump.c:476<br>
#3 0x000000000041ff6d in dup_lump_list_r (l=0x926db0,
dir=<value optimized<br>
out>, error=0x7fff23bd66b4) at data_lump.c:465<br>
#4 0x0000000000420058 in dup_lump_list (l=0x88c860) at
data_lump.c:508<br>
#5 0x00002b8b2efb858d in prepare_new_uac (t=0x2b8b3218ffa8,
i_req=0x926ef0,<br>
branch=0, uri=0x927150, path=0x9274d0, next_hop=<value
optimized out>,<br>
fsocket=0x0, snd_flags=0 '\000', fproto=0, flags=0) at
t_fwd.c:242<br>
#6 0x00002b8b2efb94c7 in add_uac (t=0x2b8b3218ffa8,
request=0x926ef0,<br>
uri=0x927150, next_hop=0x7, path=0x9274d0, proxy=0x0,
fsocket=0x0,<br>
snd_flags=0 '\000', proto=0, flags=0) at t_fwd.c:679<br>
#7 0x00002b8b2efbce7a in t_forward_nonack
(t=0x2b8b3218ffa8,<br>
p_msg=0x926ef0, proxy=0x0, proto=0) at t_fwd.c:1340<br>
#8 0x00002b8b2efb4996 in t_relay_to (p_msg=0x926ef0,
proxy=0x0, proto=0,<br>
replicate=0) at t_funcs.c:358<br>
#9 0x0000000000413489 in do_action (h=0x7fff23bd71e0,
a=0x8be788,<br>
msg=0x926ef0) at action.c:860<br>
#10 0x0000000000415e03 in run_actions (h=0x7fff23bd71e0,
a=0x8be788,<br>
msg=0x926ef0) at action.c:1315<br>
#11 0x00000000004161e7 in run_actions_safe
(h=0x7fff23bd8bb0, a=0x38,<br>
msg=0x88ca08) at action.c:1370<br>
#12 0x000000000049696b in rval_get_int (h=0x7fff23bd8bb0,
msg=0x88ca08,<br>
i=0x7fff23bd75dc, rv=0x7, cache=0x7) at rvalue.c:897<br>
#13 0x000000000049b7fc in rval_expr_eval_int
(h=0x7fff23bd8bb0,<br>
msg=0x926ef0, res=0x7fff23bd75dc, rve=0x8be878) at
rvalue.c:1841<br>
#14 0x000000000049b8ad in rval_expr_eval_int
(h=0x7fff23bd8bb0,<br>
msg=0x926ef0, res=0x7fff23bd79d8, rve=0x8bef48) at
rvalue.c:1848<br>
#15 0x0000000000411d49 in do_action (h=0x7fff23bd8bb0,
a=0x8bf798,<br>
msg=0x926ef0) at action.c:834<br>
#16 0x0000000000415e03 in run_actions (h=0x7fff23bd8bb0,
a=0x8be608,<br>
msg=0x926ef0) at action.c:1315<br>
#17 0x0000000000413084 in do_action (h=0x7fff23bd8bb0,
a=0x8f6060,<br>
msg=0x926ef0) at action.c:479<br>
#18 0x0000000000415e03 in run_actions (h=0x7fff23bd8bb0,
a=0x8f6060,<br>
msg=0x926ef0) at action.c:1315<br>
#19 0x0000000000411dab in do_action (h=0x7fff23bd8bb0,
a=0x8f62d0,<br>
msg=0x926ef0) at action.c:853<br>
#20 0x0000000000415e03 in run_actions (h=0x7fff23bd8bb0,
a=0x8f62d0,<br>
msg=0x926ef0) at action.c:1315<br>
#21 0x0000000000413084 in do_action (h=0x7fff23bd8bb0,
a=0x8bd698,<br>
msg=0x926ef0) at action.c:479<br>
#22 0x0000000000415e03 in run_actions (h=0x7fff23bd8bb0,
a=0x8bd398,<br>
msg=0x926ef0) at action.c:1315<br>
#23 0x0000000000411dab in do_action (h=0x7fff23bd8bb0,
a=0x8bd788,<br>
msg=0x926ef0) at action.c:853<br>
#24 0x0000000000415e03 in run_actions (h=0x7fff23bd8bb0,
a=0x8a1340,<br>
msg=0x926ef0) at action.c:1315<br>
#25 0x0000000000416174 in run_top_route (a=0x8a1340,
msg=0x926ef0, c=<value<br>
optimized out>) at action.c:1391<br>
#26 0x000000000048009c in receive_msg (buf=0x57e779 "DEBUG",
len=<value<br>
optimized out>, rcv_info=0x7fff23bd8e20) at receive.c:196<br>
#27 0x000000000050698b in udp_rcv_loop () at
udp_server.c:520<br>
#28 0x0000000000455e2f in main_loop () at main.c:1447<br>
#29 0x0000000000456f32 in main (argc=<value optimized
out>,<br>
argv=0x7fff23bd90e8) at main.c:2251<br>
(gdb)<br>
<br>
<br>
Thanks with all the help,<br>
Khoa<br>
</blockquote>
<font color="#888888">
<br>
-- <br>
Daniel-Constantin Mierla -- <a moz-do-not-send="true"
href="http://www.asipto.com" target="_blank">http://www.asipto.com</a><br>
Kamailio Advanced Training, Oct 10-13, Berlin: <a
moz-do-not-send="true" href="http://asipto.com/u/kat"
target="_blank">http://asipto.com/u/kat</a><br>
<a moz-do-not-send="true"
href="http://linkedin.com/in/miconda" target="_blank">http://linkedin.com/in/miconda</a>
-- <a moz-do-not-send="true"
href="http://twitter.com/miconda" target="_blank">http://twitter.com/miconda</a><br>
<br>
</font></blockquote>
</div>
<br>
</blockquote>
<br>
<pre class="moz-signature" cols="72">--
Daniel-Constantin Mierla -- <a class="moz-txt-link-freetext" href="http://www.asipto.com">http://www.asipto.com</a>
Kamailio Advanced Training, Oct 10-13, Berlin: <a class="moz-txt-link-freetext" href="http://asipto.com/u/kat">http://asipto.com/u/kat</a>
<a class="moz-txt-link-freetext" href="http://linkedin.com/in/miconda">http://linkedin.com/in/miconda</a> -- <a class="moz-txt-link-freetext" href="http://twitter.com/miconda">http://twitter.com/miconda</a></pre>
</body>
</html>