Hello,
The documentation of carrierroute says "If flags and mask are not zero, and no match to the message flags is possible, no routing will be done." Then is there any route entry which can act as default gw (like an always-match entry)?
For example this 'carrierroute' table:
+---------+--------+-------------+-------+------+------+ | carrier | domain | scan_prefix | flags | mask | +---------+--------+-------------+-------+------+------+ 1 | 1 | 1 | 156 | 500 | 0 | 2 | 1 | 1 | | 0 | 0 | 3 | 1 | 2 | | 0 | 0 | +---------+--------+-------------+-------+------+-
Here if ruri is 156xx, and there is no flag set, then the cr module does not find a match because of the non-zero value in the flag column (entry 1). But I want to route this call via carrier1 domain1 and scan_prefix empty-value entry (entry 2).
How can I set a default route entry here? Is possible with cr? Now I only find it possible via a pstn.def_gw_ip variable. Thank you,
Claudio
Hello,
Anyone knows if is it possible to use the flags column but not to void another rule (same carrier and domain id, also same scan_prefix or empty-value here)?
Thanks,
On Fri, Sep 2, 2011 at 9:52 AM, caio elcaio@gmail.com wrote:
Hello,
The documentation of carrierroute says "If flags and mask are not zero, and no match to the message flags is possible, no routing will be done." Then is there any route entry which can act as default gw (like an always-match entry)?
For example this 'carrierroute' table:
+---------+--------+-------------+-------+------+------+ | carrier | domain | scan_prefix | flags | mask | +---------+--------+-------------+-------+------+------+ 1 | 1 | 1 | 156 | 500 | 0 | 2 | 1 | 1 | | 0 | 0 | 3 | 1 | 2 | | 0 | 0 | +---------+--------+-------------+-------+------+-
Here if ruri is 156xx, and there is no flag set, then the cr module does not find a match because of the non-zero value in the flag column (entry 1). But I want to route this call via carrier1 domain1 and scan_prefix empty-value entry (entry 2).
How can I set a default route entry here? Is possible with cr? Now I only find it possible via a pstn.def_gw_ip variable. Thank you,
Claudio
On 09/02/2011 03:52 PM, caio wrote:
Hello,
Hello,
The documentation of carrierroute says "If flags and mask are not zero, and no match to the message flags is possible, no routing will be done." Then is there any route entry which can act as default gw (like an always-match entry)?
From what I see in the code and documentation, no.
For example this 'carrierroute' table:
+---------+--------+-------------+-------+------+------+ | carrier | domain | scan_prefix | flags | mask | +---------+--------+-------------+-------+------+------+ 1 | 1 | 1 | 156 | 500 | 0 | 2 | 1 | 1 | | 0 | 0 | 3 | 1 | 2 | | 0 | 0 | +---------+--------+-------------+-------+------+-
Here if ruri is 156xx, and there is no flag set, then the cr module does not find a match because of the non-zero value in the flag column (entry 1). But I want to route this call via carrier1 domain1 and scan_prefix empty-value entry (entry 2).
It seems that you can't select route 2, but you can select rule 3. For example
if(!cr_route("default", "1", "$rU", "$rU", "call_id")){ if(!cr_route("default", "2", "$rU", "$rU", "call_id")) #here rule 3 would be selected because domain is 2, not 1 send_reply("403", "Not allowed"); }
So you can have a special domain for each carrier that has no flags set and just acts like a catch all construct. Performance should not be impacted.
Hope this helps. Marius
How can I set a default route entry here? Is possible with cr? Now I only find it possible via a pstn.def_gw_ip variable. Thank you,
Claudio
if(!cr_route("default", "1", "$rU", "$rU", "call_id")){ if(!cr_route("default", "2", "$rU", "$rU", "call_id")) #here rule 3 would be selected because domain is 2, not 1 send_reply("403", "Not allowed"); }
So you can have a special domain for each carrier that has no flags set and just acts like a catch all construct. Performance should not be impacted.
Hope this helps. Marius
Hi Marius, sure, I think it helps by now... Thank you.