<html>
  <head>
    <meta http-equiv="Content-Type" content="text/html; charset=UTF-8">
  </head>
  <body text="#000000" bgcolor="#FFFFFF">
    <p>Hello,</p>
    <p>use:</p>
    <p><font face="monospace, monospace">#!substdef
        "!DBURL!mysql://user:password@localhost/dbname!"</font></p>
    <p><font face="monospace, monospace">The define is replacing only
        standalone tokens, not inside string values, like you have for
        sqlcon.</font></p>
    <p><font face="monospace, monospace">More docs about should be in
        core cookbook from wiki.<br>
      </font></p>
    <p><font face="monospace, monospace">Cheers,<br>
        Daniel<br>
      </font></p>
    <div class="moz-cite-prefix">On 11.05.19 02:05, David Villasmil
      wrote:<br>
    </div>
    <blockquote type="cite"
cite="mid:CAFGRPVp0662HjkHTkKCS1hC+pAZ-9Y4n5PCQGstipiHncZ_WVQ@mail.gmail.com">
      <meta http-equiv="content-type" content="text/html; charset=UTF-8">
      <div dir="ltr">yes that works.
        <div><br>
        </div>
        <div>My problem is not with sqlops.</div>
        <div><br>
        </div>
        <div>My problem is with the DEFINE.</div>
        <div><br>
        </div>
        <div>If I define:</div>
        <div><br>
        </div>
        <div>#!define DBURL "mysql://user:password@localhost/dbname"</div>
        <div><br>
        </div>
        <div>and later:</div>
        <div><br>
        </div>
        <div><span style="font-family:monospace,monospace">modparam("domain",
            "db_url", DBURL)</span><br>
        </div>
        <div><span style="font-family:monospace,monospace"><br>
          </span></div>
        <div><span style="font-family:monospace,monospace">and then:</span></div>
        <div><span style="font-family:monospace,monospace"><br>
          </span></div>
        <div>modparam("sqlops","sqlcon","cb=>mysql://user:password@localhost/dbname")<span
            style="font-family:monospace,monospace"><br>
          </span></div>
        <div><br>
        </div>
        <div>Everything works properly.</div>
        <div><br>
        </div>
        <div><br>
        </div>
        <div>My problem is how to use that DEFINE on ALL instances where
          i need to use it.</div>
        <div>i.e.</div>
        <div><br>
        </div>
        <div>
          <div><font face="monospace, monospace">#!define DBURL
              "mysql://user:password@localhost/dbname"</font></div>
          <div><font face="monospace, monospace">modparam("domain",
              "db_url", DBURL)<br>
            </font></div>
          <div><font face="monospace, monospace">modparam("sqlops","sqlcon","cb=>mysql://user:password@localhost/dbname")<br>
            </font></div>
          <br class="gmail-Apple-interchange-newline">
        </div>
        <div>works, but;</div>
        <div><br>
        </div>
        <div>
          <div><font face="monospace, monospace">#!define DBURL ©</font></div>
          <div><font face="monospace, monospace">modparam("domain",
              "db_url", DBURL)<br>
            </font></div>
          <div><font face="monospace, monospace">modparam("sqlops","sqlcon","cb=>DBURL")<br>
            </font></div>
          <br class="gmail-Apple-interchange-newline">
        </div>
        <div>does NOT, since</div>
        <div>DBURL translates <span
            style="font-family:monospace,monospace">"mysql://user:password@</span><span
            style="font-family:monospace,monospace">localhost/dbname"
            (quotes included)</span></div>
        <div><span style="font-family:monospace,monospace"><br>
          </span></div>
        <div><span style="font-family:monospace,monospace">so </span></div>
        <div><span style="font-family:monospace,monospace">modparam("sqlops","sqlcon","</span><span
            style="font-family:monospace,monospace">cb=>DBURL</span><span
            style="font-family:monospace,monospace">")</span><span
            style="font-family:monospace,monospace"><br>
          </span></div>
        <div><span style="font-family:monospace,monospace">translates
            into</span></div>
        <div><span style="font-family:monospace,monospace">modparam("sqlops","sqlcon","</span><span
            style="font-family:monospace,monospace">cb=></span><span
            style="font-family:monospace,monospace">"mysql://user:password@</span><span
            style="font-family:monospace,monospace">localhost/dbname"</span><span
            style="font-family:monospace,monospace">")</span></div>
        <div><span style="font-family:monospace,monospace"><br>
          </span></div>
        <div><span style="font-family:monospace,monospace">and that, of
            course, fails.</span></div>
        <div><span style="font-family:monospace,monospace"><br>
          </span></div>
        <div><span style="font-family:monospace,monospace"><br>
          </span></div>
        <div><br>
        </div>
        <div><br clear="all">
          <div>
            <div dir="ltr" class="gmail_signature"
              data-smartmail="gmail_signature">
              <div dir="ltr">
                <div>Regards,</div>
                <div><br>
                </div>
                David Villasmil
                <div>email: <a
                    href="mailto:david.villasmil.work@gmail.com"
                    target="_blank" moz-do-not-send="true">david.villasmil.work@gmail.com</a></div>
                <div>phone: +34669448337</div>
              </div>
            </div>
          </div>
          <br>
        </div>
      </div>
      <br>
      <div class="gmail_quote">
        <div dir="ltr" class="gmail_attr">On Sat, May 11, 2019 at 12:59
          AM Sergiu Pojoga <<a href="mailto:pojogas@gmail.com"
            moz-do-not-send="true">pojogas@gmail.com</a>> wrote:<br>
        </div>
        <blockquote class="gmail_quote" style="margin:0px 0px 0px
          0.8ex;border-left:1px solid rgb(204,204,204);padding-left:1ex">
          <div dir="ltr">
            <div dir="ltr">does is work like below? That's how mine is
              set, probably for the same reason.
              <div><br>
              </div>
              <div>modparam("sqlops","sqlcon","cb=>mysql://user:password@localhost/dbname")<br>
              </div>
            </div>
          </div>
          <br>
          <div class="gmail_quote">
            <div dir="ltr" class="gmail_attr">On Fri, May 10, 2019 at
              7:47 PM David Villasmil <<a
                href="mailto:david.villasmil.work@gmail.com"
                target="_blank" moz-do-not-send="true">david.villasmil.work@gmail.com</a>>
              wrote:<br>
            </div>
            <blockquote class="gmail_quote" style="margin:0px 0px 0px
              0.8ex;border-left:1px solid
              rgb(204,204,204);padding-left:1ex">
              <div dir="ltr">
                <div dir="ltr">No, 
                  <div><br>
                  </div>
                  <div>DBURL translates into </div>
                  <div><br>
                  </div>
                  <div><font face="monospace, monospace">"mysql://user:admin@dbuser/dbname"</font></div>
                  <div><br>
                  </div>
                  <div>so in sqlops:</div>
                  <div><font face="monospace, monospace" color="#000000"><br>
                    </font></div>
                  <div><font face="monospace, monospace" color="#000000">modparam("sqlops","sqlcon","cb=>DBURL")  <br>
                      <br
class="gmail-m_8999421816691597067gmail-m_8656473738726116412gmail-Apple-interchange-newline">
                    </font></div>
                  <div><font face="monospace, monospace" color="#000000">translates
                      into:</font></div>
                  <div><font face="monospace, monospace" color="#000000"><br>
                    </font></div>
                  <div><font face="monospace, monospace" color="#000000">modparam("sqlops","sqlcon","cb=>"mysql://user:admin@dbuser/dbname"")  <br>
                    </font><br
class="gmail-m_8999421816691597067gmail-m_8656473738726116412gmail-Apple-interchange-newline">
                  </div>
                  <div>that works great on </div>
                  <div><br>
                  </div>
                  <div><font face="monospace, monospace">modparam("domain",
                      "db_url", DBURL)<br>
                    </font></div>
                  <div><font face="monospace, monospace"><br>
                    </font></div>
                  <div><font face="monospace, monospace">because it
                      translates into:</font></div>
                  <div><font face="monospace, monospace"><br>
                    </font></div>
                  <div><span style="font-family:monospace,monospace">modparam("domain",
                      "db_url", </span><span
                      style="font-family:monospace,monospace">"mysql://user:admin@dbuser/dbname"</span><span
                      style="font-family:monospace,monospace">)</span><font
                      face="monospace, monospace"><br>
                    </font></div>
                  <div><br>
                  </div>
                  <div><br>
                  </div>
                  <div><br>
                  </div>
                  <div>But not on the sqlops case</div>
                  <div><br clear="all">
                    <div>
                      <div dir="ltr"
class="gmail-m_8999421816691597067gmail-m_8656473738726116412gmail_signature">
                        <div dir="ltr">
                          <div>Regards,</div>
                          <div><br>
                          </div>
                          David Villasmil
                          <div>email: <a
                              href="mailto:david.villasmil.work@gmail.com"
                              target="_blank" moz-do-not-send="true">david.villasmil.work@gmail.com</a></div>
                          <div>phone: +34669448337</div>
                        </div>
                      </div>
                    </div>
                    <br>
                  </div>
                </div>
              </div>
              <br>
              <div class="gmail_quote">
                <div dir="ltr" class="gmail_attr">On Sat, May 11, 2019
                  at 12:32 AM Sergiu Pojoga <<a
                    href="mailto:pojogas@gmail.com" target="_blank"
                    moz-do-not-send="true">pojogas@gmail.com</a>>
                  wrote:<br>
                </div>
                <blockquote class="gmail_quote" style="margin:0px 0px
                  0px 0.8ex;border-left:1px solid
                  rgb(204,204,204);padding-left:1ex">
                  <div dir="ltr">
                    <div dir="ltr">You've got a typo<br>
                    </div>
                    <div dir="ltr"><br>
                    </div>
                    <div dir="ltr"><span
                        style="font-family:monospace,monospace">modparam("sqlops","sqlcon","</span><span
                        style="font-family:monospace,monospace">cb=>DBURL")</span>  <br>
                    </div>
                  </div>
                  <br>
                  <div class="gmail_quote">
                    <div dir="ltr" class="gmail_attr">On Fri, May 10,
                      2019 at 7:02 PM David Villasmil <<a
                        href="mailto:david.villasmil.work@gmail.com"
                        target="_blank" moz-do-not-send="true">david.villasmil.work@gmail.com</a>>
                      wrote:<br>
                    </div>
                    <blockquote class="gmail_quote" style="margin:0px
                      0px 0px 0.8ex;border-left:1px solid
                      rgb(204,204,204);padding-left:1ex">
                      <div dir="ltr">
                        <div dir="ltr">Hello guys,
                          <div><br>
                          </div>
                          <div>So, i'm defining:</div>
                          <div><font face="monospace, monospace"><br>
                            </font></div>
                          <div><font face="monospace, monospace">DBURL
                              "mysql://user:password@dbhost/dbname"</font></div>
                          <div><br>
                          </div>
                          <div>and later on...</div>
                          <div><font face="monospace, monospace"><br>
                            </font></div>
                          <div><font face="monospace, monospace">modparam("sqlops","sqlcon","cb=>"DBURL)</font><br>
                          </div>
                          <div><br>
                          </div>
                          <div>and this fails miserably..</div>
                          <div><br>
                          </div>
                          <div>What do do on this case?</div>
                          <div><br>
                          </div>
                          <div><br>
                          </div>
                          <div>Thanks all!</div>
                          <div><br clear="all">
                            <div>
                              <div dir="ltr"
class="gmail-m_8999421816691597067gmail-m_8656473738726116412gmail-m_8802530709471158215gmail-m_5431859416023029500m_-8960971401531193641gmail_signature">
                                <div dir="ltr">
                                  <div>Regards,</div>
                                  <div><br>
                                  </div>
                                  David Villasmil
                                  <div>email: <a
                                      href="mailto:david.villasmil.work@gmail.com"
                                      target="_blank"
                                      moz-do-not-send="true">david.villasmil.work@gmail.com</a></div>
                                  <div>phone: +34669448337</div>
                                </div>
                              </div>
                            </div>
                          </div>
                        </div>
                      </div>
                      _______________________________________________<br>
                      Kamailio (SER) - Users Mailing List<br>
                      <a href="mailto:sr-users@lists.kamailio.org"
                        target="_blank" moz-do-not-send="true">sr-users@lists.kamailio.org</a><br>
                      <a
                        href="https://lists.kamailio.org/cgi-bin/mailman/listinfo/sr-users"
                        rel="noreferrer" target="_blank"
                        moz-do-not-send="true">https://lists.kamailio.org/cgi-bin/mailman/listinfo/sr-users</a><br>
                    </blockquote>
                  </div>
                  _______________________________________________<br>
                  Kamailio (SER) - Users Mailing List<br>
                  <a href="mailto:sr-users@lists.kamailio.org"
                    target="_blank" moz-do-not-send="true">sr-users@lists.kamailio.org</a><br>
                  <a
                    href="https://lists.kamailio.org/cgi-bin/mailman/listinfo/sr-users"
                    rel="noreferrer" target="_blank"
                    moz-do-not-send="true">https://lists.kamailio.org/cgi-bin/mailman/listinfo/sr-users</a><br>
                </blockquote>
              </div>
              _______________________________________________<br>
              Kamailio (SER) - Users Mailing List<br>
              <a href="mailto:sr-users@lists.kamailio.org"
                target="_blank" moz-do-not-send="true">sr-users@lists.kamailio.org</a><br>
              <a
                href="https://lists.kamailio.org/cgi-bin/mailman/listinfo/sr-users"
                rel="noreferrer" target="_blank" moz-do-not-send="true">https://lists.kamailio.org/cgi-bin/mailman/listinfo/sr-users</a><br>
            </blockquote>
          </div>
          _______________________________________________<br>
          Kamailio (SER) - Users Mailing List<br>
          <a href="mailto:sr-users@lists.kamailio.org" target="_blank"
            moz-do-not-send="true">sr-users@lists.kamailio.org</a><br>
          <a
            href="https://lists.kamailio.org/cgi-bin/mailman/listinfo/sr-users"
            rel="noreferrer" target="_blank" moz-do-not-send="true">https://lists.kamailio.org/cgi-bin/mailman/listinfo/sr-users</a><br>
        </blockquote>
      </div>
      <br>
      <fieldset class="mimeAttachmentHeader"></fieldset>
      <pre class="moz-quote-pre" wrap="">_______________________________________________
Kamailio (SER) - Users Mailing List
<a class="moz-txt-link-abbreviated" href="mailto:sr-users@lists.kamailio.org">sr-users@lists.kamailio.org</a>
<a class="moz-txt-link-freetext" href="https://lists.kamailio.org/cgi-bin/mailman/listinfo/sr-users">https://lists.kamailio.org/cgi-bin/mailman/listinfo/sr-users</a>
</pre>
    </blockquote>
    <pre class="moz-signature" cols="72">-- 
Daniel-Constantin Mierla -- <a class="moz-txt-link-abbreviated" href="http://www.asipto.com">www.asipto.com</a>
<a class="moz-txt-link-abbreviated" href="http://www.twitter.com/miconda">www.twitter.com/miconda</a> -- <a class="moz-txt-link-abbreviated" href="http://www.linkedin.com/in/miconda">www.linkedin.com/in/miconda</a></pre>
  </body>
</html>