irontec / itsbc

Irontec Tiny SBC. OpenSIPS & RTPEngine based micro SBC with Web Administration
GNU General Public License v3.0
35 stars 27 forks source link

Network validation bugged since in-script-route implementation #2

Open zetagor opened 6 years ago

zetagor commented 6 years ago

Latest changes (prior to Github, our Gitlab) makes IP validation breaks in sequential rule validation. Just prior to fly to the open we have moved IP/Net validation from the SQL Query (it's already very ugly) to a custom route (witch is working, it really works). But the problem is we just get one route and we don't loop each one to validate network ...

We need to think better, then implement less ;)

cruzccl commented 6 years ago

My 2 cents:

Routing criterias:

Those 4 and metric should conform a database unique.

OpenSIPS logic should perform a search with those 4 criterias, order then by metric, and evaluate Origin network until one matches.

When one matches, it should send the request to next hop (or to registrar server) using the outgoing interface defined in the rule.

Steps:

  1. Make domain, incoming ip, incoming port, incoming transport and metric a database unique.
  2. Rewrite opensips script to iterate through rules until one fulfills origin network filter.