Thank you Daniel, your answer helped a lot.<br><br>With :<br>#!KAMAILIO<br>loadmodule &quot;pv.so&quot;<br>$avp(fd.did)<br><br>Everything works fine, but only if I turn off caching with :<br>modparam(&quot;uid_domain&quot;, &quot;db_mode&quot;, 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 &amp; SRDB_DISABLED) goto skip;<br>                /* Skip entries that are for serweb/ser-ctl only */<br>                if (!(flags &amp; 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">&lt;<a href="mailto:miconda@gmail.com" target="_blank">miconda@gmail.com</a>&gt;</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&#39;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&#39;s the excerpt of the script (I replaced the selects
            with &#39;@&#39; by &#39;$sel()&#39;, and added a dump_attrs()) :<br>
                    xlog(&quot;L_INFO&quot;, &quot;from.uri.host :
            $sel(from.uri.host)\n&quot;);<br>
                    xlog(&quot;L_INFO&quot;, &quot;ruri.host : $sel(ruri.host)\n&quot;);<br>
            <br>
                    lookup_domain(&quot;$fd&quot;, &quot;$sel(from.uri.host)&quot;);<br>
                    lookup_domain(&quot;$td&quot;, &quot;$sel(ruri.host)&quot;);<br>
            <br>
                    xlog(&quot;L_INFO&quot;, &quot;fd : $avp(fd.did)\n&quot;);<br>
            <br>
                    dump_attrs();<br>
            <br>
                    if (strempty($avp(fd.did)) &amp;&amp;
            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(&quot;403&quot;, &quot;Relaying Forbidden&quot;);<br>
                            drop;<br>
                    }<br>
            <br>
            And as a result :<br>
            0(22008) INFO: &lt;script&gt;: from.uri.host :
            ext.test.r3load.voip<br>
             0(22008) INFO: &lt;script&gt;: ruri.host :
            ext.test.r3load.voip<br>
             0(22008) INFO: &lt;script&gt;: fd : &lt;null&gt;<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/#!/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