<html>
  <head>
    <meta content="text/html; charset=ISO-8859-1"
      http-equiv="Content-Type">
  </head>
  <body bgcolor="#FFFFFF" text="#000000">
    Hello,<br>
    <br>
    <div class="moz-cite-prefix">On 1/25/13 2:57 PM, Philippe Sultan
      wrote:<br>
    </div>
    <blockquote
cite="mid:CACtw84GKKpAbXGqSYHzhYPBWGr2FB878gkod7AJvVw3V2JO8oA@mail.gmail.com"
      type="cite">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
        moz-do-not-send="true"
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>
    </blockquote>
    the mentiond scripts should work fine if they use uid_domain and
    uid_domain_attrs tables. It might be configuration option or a small
    change -- not using them I cannot comment more.<br>
    <br>
    Anyhow, I committed your patch in master. You can send another patch
    if you want to add commands for uid_domain_attrs.<br>
    <br>
    Cheers,<br>
    Daniel<br>
    <br>
    <br>
    <blockquote
cite="mid:CACtw84GKKpAbXGqSYHzhYPBWGr2FB878gkod7AJvVw3V2JO8oA@mail.gmail.com"
      type="cite">
      <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&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; = 1L &lt;&lt; 0&nbsp; # The row should be loaded by SER
      <br>
      DISABLED&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; = 1L &lt;&lt; 1&nbsp; # The row is disabled<br>
      CANON&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; = 1L &lt;&lt; 2&nbsp; # Canonical entry (domain or uri)<br>
      IS_TO&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; = 1L &lt;&lt; 3&nbsp; # The URI can be used in To<br>
      IS_FROM&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; = 1L &lt;&lt; 4&nbsp; # The URI can be used in From<br>
      FOR_SERWEB&nbsp;&nbsp;&nbsp;&nbsp; = 1L &lt;&lt; 5&nbsp; # Credentials instance can be used
      by serweb<br>
      &nbsp;<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">&lt;<a moz-do-not-send="true"
            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"> 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>
                  &nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; /* Skip entries that are
                  disabled/scheduled for removal */<br>
                  &nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; if (flags &amp; SRDB_DISABLED) goto
                  skip;<br>
                  &nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; /* Skip entries that are for
                  serweb/ser-ctl only */<br>
                  &nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; 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
                        moz-do-not-send="true"
                        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'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>&nbsp;</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>
                                    &nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; xlog("L_INFO",
                                    "from.uri.host :
                                    $sel(from.uri.host)\n");<br>
                                    &nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; xlog("L_INFO", "ruri.host :
                                    $sel(ruri.host)\n");<br>
                                    <br>
                                    &nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; lookup_domain("$fd",
                                    "$sel(from.uri.host)");<br>
                                    &nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; lookup_domain("$td",
                                    "$sel(ruri.host)");<br>
                                    <br>
                                    &nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; xlog("L_INFO", "fd :
                                    $avp(fd.did)\n");<br>
                                    <br>
                                    &nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; dump_attrs();<br>
                                    <br>
                                    &nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; if (strempty($avp(fd.did))
                                    &amp;&amp; strempty($avp(td.did))) {<br>
                                    &nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; # Neither the
                                    calling nor the called domain is
                                    local<br>
                                    &nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; # This is a relaying
                                    attempt which should be forbidden<br>
                                    &nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; sl_reply("403",
                                    "Relaying Forbidden");<br>
                                    &nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; drop;<br>
                                    &nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; }<br>
                                    <br>
                                    And as a result :<br>
                                    0(22008) INFO: &lt;script&gt;:
                                    from.uri.host : ext.test.r3load.voip<br>
                                    &nbsp;0(22008) INFO: &lt;script&gt;:
                                    ruri.host : ext.test.r3load.voip<br>
                                    &nbsp;0(22008) INFO: &lt;script&gt;: fd :
                                    &lt;null&gt;<br>
                                    &nbsp;0(22008) INFO: avp [avp.c:573]:
                                    class=GLOBAL<br>
                                    &nbsp;0(22008) INFO: avp [avp.c:575]:
                                    INFO: No AVP present<br>
                                    &nbsp;0(22008) INFO: avp [avp.c:583]:
                                    track=FROM class=DOMAIN<br>
                                    &nbsp;0(22008) INFO: avp [avp.c:585]:
                                    INFO: No AVP present<br>
                                    &nbsp;0(22008) INFO: avp [avp.c:593]:
                                    track=TO class=DOMAIN<br>
                                    &nbsp;0(22008) INFO: avp [avp.c:595]:
                                    INFO: No AVP present<br>
                                    &nbsp;0(22008) INFO: avp [avp.c:603]:
                                    track=FROM class=USER<br>
                                    &nbsp;0(22008) INFO: avp [avp.c:605]:
                                    INFO: No AVP present<br>
                                    &nbsp;0(22008) INFO: avp [avp.c:613]:
                                    track=TO class=USER<br>
                                    &nbsp;0(22008) INFO: avp [avp.c:615]:
                                    INFO: No AVP present<br>
                                    &nbsp;0(22008) INFO: avp [avp.c:623]:
                                    track=FROM class=URI<br>
                                    &nbsp;0(22008) INFO: avp [avp.c:625]:
                                    INFO: No AVP present<br>
                                    &nbsp;0(22008) INFO: avp [avp.c:633]:
                                    track=TO class=URI<br>
                                    &nbsp;0(22008) INFO: avp [avp.c:635]:
                                    INFO: No AVP present<br>
                                    <br>
                                    In the db :<br>
+----+----------------------+----------------------+-------+<br>
                                    | id | did&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; |
                                    domain&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; | flags |<br>
+----+----------------------+----------------------+-------+<br>
                                    |&nbsp; 1 | ext.test.r3load.voip |
                                    ext.test.r3load.voip |&nbsp;&nbsp;&nbsp;&nbsp; 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></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>
              </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>