I was using this module in version 3.1.0. The thing is that I used the provisioning python scripts (ser_domain, ser_attrs) to create my domains and their attributes (see : <a href="http://www.mail-archive.com/sr-users@lists.sip-router.org/msg12415.html" target="_blank">http://www.mail-archive.com/sr-users@lists.sip-router.org/msg12415.html</a>).<br>
<br>The default value for the flag field when creating a domain was 37, which according to kamailio-3.1.0/lib/python2.4/site-packages/serctl/flag.py equals to LOAD_SER | CANON | FOR_SERWEB :<br>LOAD_SER = 1L << 0 # The row should be loaded by SER <br>
DISABLED = 1L << 1 # The row is disabled<br>CANON = 1L << 2 # Canonical entry (domain or uri)<br>IS_TO = 1L << 3 # The URI can be used in To<br>IS_FROM = 1L << 4 # The URI can be used in From<br>
FOR_SERWEB = 1L << 5 # Credentials instance can be used by serweb<br> <br>As kamctl does not handle the uid_domain and uid_domain_attrs tables, I must rely on MySQL default value (0), set in utils/kamctl/mysql/uid_domain-create.sql.<br>
<br>And 0 for the flag field will make lookup_domain fail in uid_domain if caching is used. So, 37 seems to be the right default value to provision (the flags from the former python script are all reflected in lib/srdb2/db.h).<br>
<br>I have written a patch that adds uid_domain commands to kamctl with the default values from 3.1.0, attached to this message. Will work on something for uid_domain_attrs too if needed.<br><br>Cheers,<br><br>Philippe<br>
<br><div class="gmail_quote">2013/1/24 Daniel-Constantin Mierla <span dir="ltr"><<a 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">
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<div><div><br>
<br>
<div>On 1/24/13 4:27 PM, Philippe Sultan
wrote:<br>
</div>
<blockquote 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 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 href="mailto:sr-users@lists.sip-router.org" target="_blank">sr-users@lists.sip-router.org</a>
<a 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 href="http://www.asipto.com" target="_blank">http://www.asipto.com</a>
<a href="http://twitter.com/#%21/miconda" target="_blank">http://twitter.com/#!/miconda</a> - <a 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 href="http://conference.kamailio.com" target="_blank">http://conference.kamailio.com</a> -</pre>
</blockquote>
<br>
<pre cols="72">--
Daniel-Constantin Mierla - <a href="http://www.asipto.com" target="_blank">http://www.asipto.com</a>
<a href="http://twitter.com/#%21/miconda" target="_blank">http://twitter.com/#!/miconda</a> - <a 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 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 href="mailto:sr-users@lists.sip-router.org" target="_blank">sr-users@lists.sip-router.org</a><br>
<a 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></fieldset>
<br>
<pre>_______________________________________________
SIP Express Router (SER) and Kamailio (OpenSER) - sr-users mailing list
<a href="mailto:sr-users@lists.sip-router.org" target="_blank">sr-users@lists.sip-router.org</a>
<a 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 href="http://www.asipto.com" target="_blank">http://www.asipto.com</a>
<a href="http://twitter.com/#!/miconda" target="_blank">http://twitter.com/#!/miconda</a> - <a 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 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 href="mailto:sr-users@lists.sip-router.org" target="_blank">sr-users@lists.sip-router.org</a><br>
<a 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