<html>
<head>
<meta http-equiv="Content-Type" content="text/html; charset=UTF-8">
</head>
<body>
<div class="moz-cite-prefix">Hello,</div>
<div class="moz-cite-prefix"><br>
</div>
<div class="moz-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="moz-cite-prefix"><br>
</div>
<div class="moz-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>
</div>
<div class="moz-cite-prefix"><br>
</div>
<div class="moz-cite-prefix">Cheers,<br>
Daniel<br>
</div>
<div class="moz-cite-prefix"><br>
</div>
<div class="moz-cite-prefix"><br>
</div>
<div class="moz-cite-prefix">On 14.10.20 14:27, sai Sudheer wrote:<br>
</div>
<blockquote type="cite"
cite="mid:1512162354.532122.1602678466252@mail.yahoo.com">
<meta http-equiv="content-type" content="text/html; charset=UTF-8">
<div class="yahoo-style-wrap" style="font-family:Helvetica Neue,
Helvetica, Arial, sans-serif;font-size:13px;">
<div dir="ltr" data-setdir="false">Hii,</div>
<div dir="ltr" data-setdir="false">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" data-setdir="false">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" data-setdir="false">Not sure how to defined it,
or i dont know what did i miss. Please help.</div>
<div><br>
</div>
<div dir="ltr" data-setdir="false">#### CONFIG ##########</div>
<div dir="ltr" data-setdir="false">
<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>
</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>
</div>
<div dir="ltr" data-setdir="false">########## DB####</div>
<div>MariaDB [kamailio]> select * from new_prefix_route;</div>
<div>Empty set (0.00 sec)</div>
<div><br>
</div>
<div>MariaDB [kamailio]> exit;</div>
<div>##########</div>
<div><br>
</div>
<div><br>
</div>
<div>Kamailio looks good untill here, no errors.. </div>
<div><br>
</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>
</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>
</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" data-setdir="false"><br>
</div>
<div dir="ltr" data-setdir="false"><br>
</div>
<div dir="ltr" data-setdir="false">Please help.</div>
</div>
<br>
<fieldset class="mimeAttachmentHeader"></fieldset>
<pre class="moz-quote-pre" wrap="">_______________________________________________
Kamailio (SER) - Development Mailing List
<a class="moz-txt-link-abbreviated" href="mailto:sr-dev@lists.kamailio.org">sr-dev@lists.kamailio.org</a>
<a class="moz-txt-link-freetext" href="https://lists.kamailio.org/cgi-bin/mailman/listinfo/sr-dev">https://lists.kamailio.org/cgi-bin/mailman/listinfo/sr-dev</a>
</pre>
</blockquote>
<p><br>
</p>
<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>
Funding: <a class="moz-txt-link-freetext" href="https://www.paypal.me/dcmierla">https://www.paypal.me/dcmierla</a></pre>
</body>
</html>