<html>
<head>
<meta content="text/html; charset=ISO-8859-1"
http-equiv="Content-Type">
</head>
<body bgcolor="#FFFFFF" text="#000000">
I am not using this module and I don't know what are supposed to be
the right default values for flags. But it should be like it was in
the past. If you used with an older version 3.x, apart of renaming,
nothing was touched in the code for 4.x.<br>
<br>
Cheers,<br>
Daniel<br>
<br>
<div class="moz-cite-prefix">On 1/24/13 4:27 PM, Philippe Sultan
wrote:<br>
</div>
<blockquote
cite="mid:CACtw84ErixOb864j5zyg6W9WuWtcCK3kTUtkDSyECgh04NuRvA@mail.gmail.com"
type="cite">Thank you Daniel, your answer helped a lot.<br>
<br>
With :<br>
#!KAMAILIO<br>
loadmodule "pv.so"<br>
$avp(fd.did)<br>
<br>
Everything works fine, but only if I turn off caching with :<br>
modparam("uid_domain", "db_mode", 0)<br>
<br>
Otherwise, avps are not loaded from the db. Digging into
modules/uid_domain/domain.c, I figured out that the default flag
value 0 for records in the uid_domain table would make the
load_domains function skip the records, see (in load_domains) :<br>
/* Skip entries that are disabled/scheduled for
removal */<br>
if (flags & SRDB_DISABLED) goto skip;<br>
/* Skip entries that are for serweb/ser-ctl only
*/<br>
if (!(flags & SRDB_LOAD_SER)) goto skip;<br>
<br>
Setting the flag value to 1 does make the load_domains function
work as expected, and load the records from the db.<br>
<br>
Maybe the uid_domain-create.sql file under utils should be
modifed.<br>
<br>
Thanks again Daniel,<br>
<br>
Philippe<br>
<br>
<div class="gmail_quote">2013/1/24 Daniel-Constantin Mierla <span
dir="ltr"><<a moz-do-not-send="true"
href="mailto:miconda@gmail.com" target="_blank">miconda@gmail.com</a>></span><br>
<blockquote class="gmail_quote" style="margin:0 0 0
.8ex;border-left:1px #ccc solid;padding-left:1ex">
<div bgcolor="#FFFFFF" text="#000000"> The sript compatibility
was set to kamailio strict mode, throwing error if $xy was
not a pv. You can fetch latest master and should work like
if no pv found as $xy, then is set as avp.<br>
<br>
Even if with your version, adding #!SER as first line should
make it work with $fd.did...<br>
<br>
Cheers,<br>
Daniel
<div>
<div><br>
<br>
<div>On 1/24/13 10:58 AM, Daniel-Constantin Mierla
wrote:<br>
</div>
<blockquote type="cite"> Hi Philippe,<br>
<br>
<div>On 1/23/13 11:54 PM, Philippe Sultan wrote:<br>
</div>
<blockquote type="cite">Hey Daniel,<br>
<br>
Thanks a lot for your help.<br>
<br>
<div class="gmail_quote">
<blockquote class="gmail_quote" style="margin:0 0
0 .8ex;border-left:1px #ccc
solid;padding-left:1ex">
<div bgcolor="#FFFFFF" text="#000000"> do you
have #!SER as first line? This part should be
the same ... if pv not found, then it should
be considered avp. I will try to see what is
the issue.<br>
</div>
</blockquote>
<div><br>
I don't have #!SER<br>
</div>
</div>
</blockquote>
<br>
it should not be needed for this case, if $xyz is not
found as pv, it is considered avp.<br>
<br>
<blockquote type="cite">
<div class="gmail_quote">
<div> </div>
<blockquote class="gmail_quote" style="margin:0 0
0 .8ex;border-left:1px #ccc
solid;padding-left:1ex">
<div bgcolor="#FFFFFF" text="#000000"> Anyhow,
for the moment, if not working, load pv and
then try:<br>
- $fd and $td must stay as parameters for
lookup_domain()<br>
- for strempty() try to use $avp(fd.did) and
$avp(td.did)</div>
</blockquote>
<div><br>
I loaded pv, and modified the script
accordingly. No syntax errors anymore, but avps
are not populated from the data stored in the
db. Maybe a problem with lookup_domain?<br>
</div>
</div>
</blockquote>
<br>
the modules_s/domain was only renamed to uid_domain to
avoid conflict with the other domain module. No other
recent changes to my knowledge. Can you try to put IF
around it and see if returns true or false? Can you
check the sql queries in the server to see if they are
returning something?<br>
<br>
Cheers,<br>
Daniel<br>
<br>
<blockquote type="cite">
<div class="gmail_quote">
<div> <br>
Here's the excerpt of the script (I replaced the
selects with '@' by '$sel()', and added a
dump_attrs()) :<br>
xlog("L_INFO", "from.uri.host :
$sel(from.uri.host)\n");<br>
xlog("L_INFO", "ruri.host :
$sel(ruri.host)\n");<br>
<br>
lookup_domain("$fd",
"$sel(from.uri.host)");<br>
lookup_domain("$td", "$sel(ruri.host)");<br>
<br>
xlog("L_INFO", "fd : $avp(fd.did)\n");<br>
<br>
dump_attrs();<br>
<br>
if (strempty($avp(fd.did)) &&
strempty($avp(td.did))) {<br>
# Neither the calling nor the
called domain is local<br>
# This is a relaying attempt
which should be forbidden<br>
sl_reply("403", "Relaying
Forbidden");<br>
drop;<br>
}<br>
<br>
And as a result :<br>
0(22008) INFO: <script>: from.uri.host :
ext.test.r3load.voip<br>
0(22008) INFO: <script>: ruri.host :
ext.test.r3load.voip<br>
0(22008) INFO: <script>: fd :
<null><br>
0(22008) INFO: avp [avp.c:573]: class=GLOBAL<br>
0(22008) INFO: avp [avp.c:575]: INFO: No AVP
present<br>
0(22008) INFO: avp [avp.c:583]: track=FROM
class=DOMAIN<br>
0(22008) INFO: avp [avp.c:585]: INFO: No AVP
present<br>
0(22008) INFO: avp [avp.c:593]: track=TO
class=DOMAIN<br>
0(22008) INFO: avp [avp.c:595]: INFO: No AVP
present<br>
0(22008) INFO: avp [avp.c:603]: track=FROM
class=USER<br>
0(22008) INFO: avp [avp.c:605]: INFO: No AVP
present<br>
0(22008) INFO: avp [avp.c:613]: track=TO
class=USER<br>
0(22008) INFO: avp [avp.c:615]: INFO: No AVP
present<br>
0(22008) INFO: avp [avp.c:623]: track=FROM
class=URI<br>
0(22008) INFO: avp [avp.c:625]: INFO: No AVP
present<br>
0(22008) INFO: avp [avp.c:633]: track=TO
class=URI<br>
0(22008) INFO: avp [avp.c:635]: INFO: No AVP
present<br>
<br>
In the db :<br>
+----+----------------------+----------------------+-------+<br>
| id | did |
domain | flags |<br>
+----+----------------------+----------------------+-------+<br>
| 1 | ext.test.r3load.voip |
ext.test.r3load.voip | 0 | <br>
+----+----------------------+----------------------+-------+<br>
<br>
Thanks again!<br>
<br>
Philippe<br>
<br>
</div>
</div>
<br>
<fieldset></fieldset>
<br>
<pre>_______________________________________________
SIP Express Router (SER) and Kamailio (OpenSER) - sr-users mailing list
<a moz-do-not-send="true" href="mailto:sr-users@lists.sip-router.org" target="_blank">sr-users@lists.sip-router.org</a>
<a moz-do-not-send="true" href="http://lists.sip-router.org/cgi-bin/mailman/listinfo/sr-users" target="_blank">http://lists.sip-router.org/cgi-bin/mailman/listinfo/sr-users</a>
</pre>
</blockquote>
<br>
<pre cols="72">--
Daniel-Constantin Mierla - <a moz-do-not-send="true" href="http://www.asipto.com" target="_blank">http://www.asipto.com</a>
<a moz-do-not-send="true" href="http://twitter.com/#%21/miconda" target="_blank">http://twitter.com/#!/miconda</a> - <a moz-do-not-send="true" href="http://www.linkedin.com/in/miconda" target="_blank">http://www.linkedin.com/in/miconda</a>
Kamailio World Conference, April 16-17, 2013, Berlin
- <a moz-do-not-send="true" href="http://conference.kamailio.com" target="_blank">http://conference.kamailio.com</a> -</pre>
</blockquote>
<br>
<pre cols="72">--
Daniel-Constantin Mierla - <a moz-do-not-send="true" href="http://www.asipto.com" target="_blank">http://www.asipto.com</a>
<a moz-do-not-send="true" href="http://twitter.com/#%21/miconda" target="_blank">http://twitter.com/#!/miconda</a> - <a moz-do-not-send="true" href="http://www.linkedin.com/in/miconda" target="_blank">http://www.linkedin.com/in/miconda</a>
Kamailio World Conference, April 16-17, 2013, Berlin
- <a moz-do-not-send="true" href="http://conference.kamailio.com" target="_blank">http://conference.kamailio.com</a> -</pre>
</div>
</div>
</div>
<br>
_______________________________________________<br>
SIP Express Router (SER) and Kamailio (OpenSER) - sr-users
mailing list<br>
<a moz-do-not-send="true"
href="mailto:sr-users@lists.sip-router.org" target="_blank">sr-users@lists.sip-router.org</a><br>
<a moz-do-not-send="true"
href="http://lists.sip-router.org/cgi-bin/mailman/listinfo/sr-users"
target="_blank">http://lists.sip-router.org/cgi-bin/mailman/listinfo/sr-users</a><br>
<br>
</blockquote>
</div>
<br>
<br clear="all">
<br>
-- <br>
Philippe Sultan
<br>
<fieldset class="mimeAttachmentHeader"></fieldset>
<br>
<pre wrap="">_______________________________________________
SIP Express Router (SER) and Kamailio (OpenSER) - sr-users mailing list
<a class="moz-txt-link-abbreviated" href="mailto:sr-users@lists.sip-router.org">sr-users@lists.sip-router.org</a>
<a class="moz-txt-link-freetext" href="http://lists.sip-router.org/cgi-bin/mailman/listinfo/sr-users">http://lists.sip-router.org/cgi-bin/mailman/listinfo/sr-users</a>
</pre>
</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>
<a class="moz-txt-link-freetext" href="http://twitter.com/#!/miconda">http://twitter.com/#!/miconda</a> - <a class="moz-txt-link-freetext" href="http://www.linkedin.com/in/miconda">http://www.linkedin.com/in/miconda</a>
Kamailio World Conference, April 16-17, 2013, Berlin
- <a class="moz-txt-link-freetext" href="http://conference.kamailio.com">http://conference.kamailio.com</a> -</pre>
</body>
</html>