<html><head></head><body><div class="ydpecbae459yahoo-style-wrap" style="font-family: Helvetica Neue, Helvetica, Arial, sans-serif; font-size: 13px;"><div></div>
        <div dir="ltr" data-setdir="false">Hi..</div><div dir="ltr" data-setdir="false">Appologies.. New to this community.</div><div dir="ltr" data-setdir="false"><br></div><div dir="ltr" data-setdir="false">Now i understood that that pstn_route applies to a block but not the routing. Thanks for that information.</div><div dir="ltr" data-setdir="false">I will have a look on the pdt, mtree/lcr modules.. <br></div><div dir="ltr" data-setdir="false"><br></div><div dir="ltr" data-setdir="false">regards.<br></div><div><br></div>
        
        </div><div id="ydpd382f53fyahoo_quoted_3566930069" class="ydpd382f53fyahoo_quoted">
            <div style="font-family:'Helvetica Neue', Helvetica, Arial, sans-serif;font-size:13px;color:#26282a;">
                
                <div>
                    On Wednesday, 14 October, 2020, 1:46:48 pm GMT+1, Daniel-Constantin Mierla <miconda@gmail.com> wrote:
                </div>
                <div><br></div>
                <div><br></div>
                <div><div id="ydpd382f53fyiv7185013813"><div>
    <div class="ydpd382f53fyiv7185013813moz-cite-prefix">Hello,</div>
    <div class="ydpd382f53fyiv7185013813moz-cite-prefix"><br clear="none">
    </div>
    <div class="ydpd382f53fyiv7185013813moz-cite-prefix">do not send emails to both sr-dev and
      sr-users mailing lists when you have questions about using
      Kamailio, sr-dev is only for discussing about code development for
      project or what is only in development branch (not part of a
      stable release). I removed sr-dev from recipients.</div>
    <div class="ydpd382f53fyiv7185013813moz-cite-prefix"><br clear="none">
    </div>
    <div class="ydpd382f53fyiv7185013813moz-cite-prefix">I think you haven't understood what
      prefix_route module does: it execute route blocks from
      configuration file, it does not set the destination address based
      on a prefix. For that look at pdt module for a simple solution.
      Other modules such as mtree or lcr could be alternatives, but from
      simplicity point of view, pdt is better fr this case imo.<br clear="none">
    </div>
    <div class="ydpd382f53fyiv7185013813moz-cite-prefix"><br clear="none">
    </div>
    <div class="ydpd382f53fyiv7185013813moz-cite-prefix">Cheers,<br clear="none">
      Daniel<br clear="none">
    </div>
    <div class="ydpd382f53fyiv7185013813moz-cite-prefix"><br clear="none">
    </div>
    <div class="ydpd382f53fyiv7185013813moz-cite-prefix"><br clear="none">
    </div>
    <div class="ydpd382f53fyiv7185013813yqt3037179895" id="ydpd382f53fyiv7185013813yqt05447"><div class="ydpd382f53fyiv7185013813moz-cite-prefix">On 14.10.20 14:27, sai Sudheer wrote:<br clear="none">
    </div>
    <blockquote type="cite">
      </blockquote></div></div><div class="ydpd382f53fyiv7185013813yqt3037179895" id="ydpd382f53fyiv7185013813yqt05492"><div><div class="ydpd382f53fyiv7185013813yahoo-style-wrap" style="font-family:Helvetica Neue, Helvetica, Arial, sans-serif;font-size:13px;">
        <div dir="ltr">Hii,</div>
        <div dir="ltr">I am trying to use pstn_route
          module for the first time, and i want to route the invite to
          specific pstn server based on its prefix.</div>
        <div dir="ltr">I have loaded the module
          & setup the DB, and it's giving error saying route name
          (from DB) is not defined after adding the a prefix into DB
          table., and there were no errors when DB table is empty.</div>
        <div dir="ltr">Not sure how to defined it,
          or i dont know what did i miss. Please help.</div>
        <div><br clear="none">
        </div>
        <div dir="ltr">#### CONFIG ##########</div>
        <div dir="ltr">
          <div>
            <div>loadmodule "prefix_route.so"</div>
            <div>modparam("prefix_route", "db_url",
              "mysql://xxxxx:xxxxx@localhost/kamailioDB")</div>
            <div>modparam("prefix_route", "db_table",
              "new_prefix_route")</div>
            <div><br clear="none">
            </div>
            <div>#PSTN Routing table contains</div>
            <div>         if (!prefix_route("+44")) {</div>
            <div>              xlog("L_INFO", "+44 prefix didnt match
              with prefix_route DB\n");</div>
            <div>         }</div>
            <div><br clear="none">
            </div>
            <div dir="ltr">########## DB####</div>
            <div>MariaDB [kamailio]> select * from new_prefix_route;</div>
            <div>Empty set (0.00 sec)</div>
            <div><br clear="none">
            </div>
            <div>MariaDB [kamailio]> exit;</div>
            <div>##########</div>
            <div><br clear="none">
            </div>
            <div><br clear="none">
            </div>
            <div>Kamailio looks good untill here, no errors.. </div>
            <div><br clear="none">
            </div>
            <div># Now i have added a prefix into sql DB</div>
            <div>INSERT INTO new_prefix_route VALUES ("+44",
              "10.10.1.1:5060", "route for this prefix");</div>
            <div>###########</div>
            <div>Error log after adding a prefix into new_prefix_route
              table & restart of kamailio</div>
            <div><br clear="none">
            </div>
            <div> 0(5802) CRITICAL: prefix_route [prefix_route.c:72]:
              add_route(): route name '10.10.1.1:5060' is not defined</div>
            <div> 0(5802) NOTICE: prefix_route [prefix_route.c:170]:
              pr_db_load(): Total prefix routes loaded: 1</div>
            <div> 0(5802) ERROR: prefix_route [prefix_route.c:174]:
              pr_db_load(): error flushing tree</div>
            <div> 0(5802) CRITICAL: prefix_route [prefix_route.c:212]:
              mod_init(): db load failed</div>
            <div><br clear="none">
            </div>
          </div>
          I have tried a "name" instead of IP (though i dont know how to
          convert that "name" into a IP:Port), But i am still getting
          same error using "name" instead of IP:port @ route field in
          DB.</div>
        <div dir="ltr"><br clear="none">
        </div>
        <div dir="ltr"><br clear="none">
        </div>
        <div dir="ltr">Please help.</div>
      </div>
      <br clear="none">
      <fieldset class="ydpd382f53fyiv7185013813mimeAttachmentHeader"></fieldset>
      <pre class="ydpd382f53fyiv7185013813moz-quote-pre">_______________________________________________
Kamailio (SER) - Development Mailing List
<a shape="rect" class="ydpd382f53fyiv7185013813moz-txt-link-abbreviated" href="mailto:sr-dev@lists.kamailio.org" rel="nofollow" target="_blank">sr-dev@lists.kamailio.org</a>
<a shape="rect" class="ydpd382f53fyiv7185013813moz-txt-link-freetext" href="https://lists.kamailio.org/cgi-bin/mailman/listinfo/sr-dev" rel="nofollow" target="_blank">https://lists.kamailio.org/cgi-bin/mailman/listinfo/sr-dev</a>
</pre>
    
    <p><br clear="none">
    </p>
    <pre class="ydpd382f53fyiv7185013813moz-signature">-- 
Daniel-Constantin Mierla -- <a shape="rect" class="ydpd382f53fyiv7185013813moz-txt-link-abbreviated" href="http://www.asipto.com" rel="nofollow" target="_blank">www.asipto.com</a>
<a shape="rect" class="ydpd382f53fyiv7185013813moz-txt-link-abbreviated" href="http://www.twitter.com/miconda" rel="nofollow" target="_blank">www.twitter.com/miconda</a> -- <a shape="rect" class="ydpd382f53fyiv7185013813moz-txt-link-abbreviated" href="http://www.linkedin.com/in/miconda" rel="nofollow" target="_blank">www.linkedin.com/in/miconda</a>
Funding: <a shape="rect" class="ydpd382f53fyiv7185013813moz-txt-link-freetext" href="https://www.paypal.me/dcmierla" rel="nofollow" target="_blank">https://www.paypal.me/dcmierla</a></pre>
  </div></div></div></div>
            </div>
        </div></body></html>