[OpenSIPS-Users] LCR Route Prefixes -> Gateways (From Scratch)

Nick Cameo symack at gmail.com
Sat Aug 24 01:36:09 CEST 2013


Hello Камиль

Thank you so much for your response. Basically, what I have done is created
a table `dr_rates`:

+--------+----------------------------------------+--------+--------------+----------+------------------+-------------+----------+
| rateid | destination                         | cc     | prefix      |
listrate | retailrate     | currency | carrier |
+--------+----------------------------------------+--------+--------------+----------+------------------+--------------+---------+
|   5839 | Canada 416 Metro Toronto | 1      |        1416 |   0.0028 |
 0.00364 | USD        | TN1 |
+--------+----------------------------------------+--------+--------------+----------+------------------+--------------+---------+

And in `dr_rules`

+---------+-----------+--------+---------+--------------+---------+--------+-------------+------------------------------------------------------+
| ruleid  | groupid | prefix | timerec | priority | routeid | gwlist |
attrs    | description                                        |
+---------+-----------+--------+---------+--------------+---------+--------+-------------+-------------------------------------------------------+
|   5839 | 0         | 1416   |           |        1     | 0       |
 | yes          |   Route for Canada 416 Metro Toronto |
+---------+-----------+--------+---------+--------------+---------+--------+-------------+-------------------------------------------------------+


​For scalability reasons as mentioned with Muhammad, we would like on every
call to fire a perl script that would
query the database, and pull all the prefix for the dialled number order by
price ascending. I don't know much about
prefixes and types of tricks carrier like to play longest vs. shortest
matching etc however, what I am thinking about is:


1) Pull up all records for the dialed CC
2) If CC is 1 digit substring the first four digits of prefix
2) If CC is 2 digits substring the first five digits of prefix
2) If CC is 3 digits substring the first six digits digits of prefix



More information about the Users mailing list