Is there a way to use regex or Asterisk style numerical patterns in alias_db or any other db routing modules? Compressing a block of a hundred DID numbers to one entry would be really nice.
There is not, but there are numerous other modules that provide for that sort of thing, such as pdt, drouting, and lcr.
Of course, it's only useful if your DID block falls on decimal boundaries. :-)
Pete Ashdown pashdown@xmission.com wrote:
Is there a way to use regex or Asterisk style numerical patterns in alias_db or any other db routing modules? Compressing a block of a hundred DID numbers to one entry would be really nice.
SIP Express Router (SER) and Kamailio (OpenSER) - sr-users mailing list sr-users@lists.sip-router.org http://lists.sip-router.org/cgi-bin/mailman/listinfo/sr-users
-- Sent from my mobile, and thus lacking in the refinement one might expect from a fully fledged keyboard.
Alex Balashov - Principal Evariste Systems LLC 235 E Ponce de Leon Ave Suite 106 Decatur, GA 30030 United States Tel: +1-678-954-0671 Web: http://www.evaristesys.com/, http://www.alexbalashov.com
On 01/21/2014 10:09 PM, Alex Balashov wrote:
There is not, but there are numerous other modules that provide for that sort of thing, such as pdt, drouting, and lcr.
Of course, it's only useful if your DID block falls on decimal boundaries. :-)
Thank you Alex.
Could someone point me to some LCR help resources? A couple of questions come up after reading the module page, and I'm having trouble finding specifics.
1) Do I have to put the full authenticated URI in for each gw, or is there a better place to store this information? 2) How do I populate the rest of the LCR database? It appears that using "kamctl lcr" has been depreciated. Am I supposed to use Siremis? Is there any way to do this via shell? Does anyone have any scripts that digest csv rate decks from trunkers into the db for creation and update? 3) Is the number_prefix column PCRE friendly? I note mod_lcr's use of libpcre.
Pete Ashdown writes:
- How do I populate the rest of the LCR database? It appears that
using "kamctl lcr" has been depreciated. Am I supposed to use Siremis? Is there any way to do this via shell? Does anyone have any scripts that digest csv rate decks from trunkers into the db for creation and update?
you need to populate lcr tables manually unless you find a tool to do it for you.
- Is the number_prefix column PCRE friendly? I note mod_lcr's use of
libpcre.
prefix column cannot hold a regular expression. lcr routing is based on longest match, which cannot be efficiently implemented using regular expressions.
-- juha
On Wednesday 22 January 2014 23:19:09 Juha Heinanen wrote:
prefix column cannot hold a regular expression. lcr routing is based on longest match, which cannot be efficiently implemented using regular expressions.
If lcr is based on longest prefix, Pete could just use a little logic to implement longest match with alias_db_lookup (his original question). I store either a full number, a 10 number block or 100 block (by leaving off the last 1 or 2 digits) and do the following:
$avp(callednumber)=$rU; if(!alias_db_lookup("dbaliases")) { strip_tail(1); if(!alias_db_lookup("dbaliases")) { strip_tail(1); if(!alias_db_lookup("dbaliases")) { $rU=$avp(callednumber); } } }
If you give bigger numberblocks to endusers just add a level (of make a decent loop that checks the remaining length of $rU).
On 01/22/2014 03:19 PM, Juha Heinanen wrote:
Pete Ashdown writes:
- How do I populate the rest of the LCR database? It appears that
using "kamctl lcr" has been depreciated. Am I supposed to use Siremis? Is there any way to do this via shell? Does anyone have any scripts that digest csv rate decks from trunkers into the db for creation and update?
you need to populate lcr tables manually unless you find a tool to do it for you.
Thank you Juha. I'm muddling through this. One thing that is puzzling to me is that LCR entries are ranked by weight and priority, both integers. When I have a rate deck of costs like .003211 per minute per prefix, translating thousands of those to integers between 0 & 255 seems obtuse and inflexible. I would presume that "least cost routing" would have a column for "cost". Am I seeing this wrong or using the wrong module?
Pete Ashdown writes:
Thank you Juha. I'm muddling through this. One thing that is puzzling to me is that LCR entries are ranked by weight and priority, both integers. When I have a rate deck of costs like .003211 per minute per prefix, translating thousands of those to integers between 0 & 255 seems obtuse and inflexible. I would presume that "least cost routing" would have a column for "cost". Am I seeing this wrong or using the wrong module?
it is wrong module if you are not able to scale your costs to integer priorities.
-- juha