Hi Alex,<div><br></div><div>Kamailio seems to be completely ignoring the fact that auth and auth_db are loaded. the modules are loaded but when a call is placed it doesn't do any SQL queries (except for accounting) and the call is placed without being authenticated. </div>
<div><br></div><div>ROR: auth [challenge.c:283]: no authorized credentials found (error in scripts)</div><div><br></div><div><div>loadmodule "auth.so"</div><div>loadmodule "auth_db.so"</div><div><br></div>
<div><br></div><div><div># auth_db</div><div><br></div><div>modparam("auth_db", "db_url", "mysql://openser:xxxxxxxxx@localhost/openser")</div><div>modparam("auth_db", "calculate_ha1", 1)</div>
<div>modparam("auth_db", "password_column", "password")</div><div>modparam("auth_db", "load_credentials", "$avp(s:rpid)=rpid")</div><div><br></div><div># auth</div>
<div><br></div><div>modparam("auth", "rpid_avp", "$avp(s:rpid)")</div><div>modparam("auth", "rpid_prefix", "<sip:")</div><div>modparam("auth", "rpid_suffix","@<a href="http://xxxxxx.ie">xxxxxx.ie</a>;party=calling;id-type=subscriber;privacy=off;screen=yes>")</div>
<div><br></div><div><div>: DEBUG: <core> [sr_module.c:871]: DEBUG: init_mod: auth</div><div>: DEBUG: <core> [sr_module.c:871]: DEBUG: init_mod: auth_db</div><div>: DEBUG: <core> [sr_module.c:509]: find_export_record: found <bind_auth> in module auth [/lib/kamailio/modules_k/auth.so]</div>
<div>: DEBUG: <core> [route.c:911]: fixing proxy_authorize()</div><div>: DEBUG: <core> [route.c:911]: fixing www_authorize()</div><div>: DEBUG: <core> [route.c:911]: fixing proxy_authorize()</div><div>: DEBUG: <core> [sr_module.c:807]: DEBUG: init_mod_child (-127): auth_db</div>
<div>: DEBUG: <core> [sr_module.c:807]: DEBUG: init_mod_child (1): auth_db</div><div>: DEBUG: <core> [sr_module.c:807]: DEBUG: init_mod_child (2): auth_db</div><div>: DEBUG: <core> [sr_module.c:807]: DEBUG: init_mod_child (3): auth_db</div>
<div>: DEBUG: <core> [sr_module.c:807]: DEBUG: init_mod_child (4): auth_db</div><div>: DEBUG: <core> [sr_module.c:807]: DEBUG: init_mod_child (5): auth_db</div><div>: DEBUG: <core> [sr_module.c:807]: DEBUG: init_mod_child (6): auth_db</div>
<div>: DEBUG: <core> [sr_module.c:807]: DEBUG: init_mod_child (7): auth_db</div><div>: DEBUG: <core> [sr_module.c:807]: DEBUG: init_mod_child (8): auth_db</div><div>: DEBUG: <core> [sr_module.c:807]: DEBUG: init_mod_child (9): auth_db</div>
<div>: DEBUG: <core> [sr_module.c:807]: DEBUG: init_mod_child (-1): auth_db</div><div>: DEBUG: <core> [sr_module.c:807]: DEBUG: init_mod_child (-1): auth_db</div><div>: DEBUG: <core> [sr_module.c:807]: DEBUG: init_mod_child (10): auth_db</div>
<div>: DEBUG: <core> [sr_module.c:807]: DEBUG: init_mod_child (0): auth_db</div><div><br></div></div><div><br></div></div></div><div>I have #!kamailio at the start of the config. Am I missing something really obvious? Maybe there is much more for config compat. from 1.x.x to 3.0.x</div>
<div><br></div><div>Stephen</div><div><br></div><div><br></div><div><br><div class="gmail_quote">On 25 March 2010 22:11, Alex Balashov <span dir="ltr"><<a href="mailto:abalashov@evaristesys.com">abalashov@evaristesys.com</a>></span> wrote:<br>
<blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex;">Is the type of the 'rpid' column 'varchar'?<br>
<br>
Odd data type incompatibility or client library version incompatibility might explain it. I agree that it is bizarre.<br>
<br>
Perhaps it would behoove you to turn on query logging on MySQL and verify that the 'rpid' column is actually being selected in the query.<br>
<br>
The only other thing I can think of would relate to one of the various db_mode settings involved.<div class="im"><br>
<br>
On 03/25/2010 06:08 PM, dotnetdub wrote:<br>
<br>
</div><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex"><div class="im">
Hi Alex,<br>
<br>
I modified the script, same result. sip[8892]: INFO: <script>: [ROUTE-4<br>
->] rpid test: <null> and the rpid is not being added.<br>
<br>
Very odd..<br>
<br>
Stephen.<br>
<br>
On 25 March 2010 21:57, Alex Balashov <<a href="mailto:abalashov@evaristesys.com" target="_blank">abalashov@evaristesys.com</a><br></div><div><div></div><div class="h5">
<mailto:<a href="mailto:abalashov@evaristesys.com" target="_blank">abalashov@evaristesys.com</a>>> wrote:<br>
<br>
On 03/25/2010 05:53 PM, dotnetdub wrote:<br>
<br>
Attached:<br>
<br>
if(is_uri_host_local()) {<br>
if(!allow_trusted()) {<br>
if(!proxy_authorize("", "subscriber")) {<br>
proxy_challenge("", "1");<br>
exit;<br>
}<br>
<br>
else if(!check_from()) {<br>
sl_send_reply("403", "Forbidden");<br>
exit;<br>
}<br>
}<br>
<br>
else {<br>
sl_send_reply("403", "Forbidden");<br>
exit;<br>
}<br>
}<br>
<br>
append_rpid_hf();<br>
<br>
consume_credentials();<br>
<br>
<br>
There is no guarantee that either append_rpid_hf() or<br>
consume_credentials() runs if and only if proxy_authorize() was called.<br>
<br>
Also, it is not clear why check_from() is at a relationship of<br>
logical disjunction vis-a-vis to proxy_authorize(). While not<br>
incorrect, it obfuscates the flow.<br>
<br>
Try this and see if the problem continues:<br>
<br>
<br>
if(is_uri_host_local()) {<br>
<br>
if(!allow_trusted()) {<br>
<br>
if(!proxy_authorize("", "subscriber")) {<br>
proxy_challenge("", "1");<br>
exit;<br>
}<br>
<br>
if(!check_from()) {<br>
sl_send_reply("403", "Forbidden");<br>
exit;<br>
}<br>
<br>
append_rpid_hf();<br>
consume_credentials();<br>
}<br>
<br>
else {<br>
sl_send_reply("403", "Forbidden");<br>
exit;<br>
}<br>
}<br>
<br>
--<br>
Alex Balashov - Principal<br>
Evariste Systems LLC<br>
<br>
Tel : +1 678-954-0670<br>
Direct : +1 678-954-0671<br>
Web : <a href="http://www.evaristesys.com/" target="_blank">http://www.evaristesys.com/</a><br>
<br>
<br>
</div></div></blockquote><div><div></div><div class="h5">
<br>
<br>
-- <br>
Alex Balashov - Principal<br>
Evariste Systems LLC<br>
<br>
Tel : +1 678-954-0670<br>
Direct : +1 678-954-0671<br>
Web : <a href="http://www.evaristesys.com/" target="_blank">http://www.evaristesys.com/</a><br>
</div></div></blockquote></div><br></div>