[OpenSIPS-Users] Routing Based on $si and $Ri

Trevor Steyn trevor at webon.co.za
Tue Aug 4 20:32:11 CEST 2015


Hi All,

I would like to be able to route calls based on Source IP and
Destination IP (always one of opensips IPs), As usual there are many
ways to skin a cat,
My first thought was to have a table such as the address table but
modify the IP field to a concatenation of $si and $RI

so you would have a table like this


*************************** 1. row ***************************
          id: 6
         grp: 1
          ip: 196.2.97.165_41.213.100.100
        mask: 32
        port: 0
       proto: udp
     pattern:
context_info: Route=2;Forced_Socket=41.213.100.200

So in the route script i would do something like this

/check_cource_address("1",$si+"_"+$Ri) /

Obviously i cannot just do this with the permissions module as it wont
accept this in the IP field as it expects a valid IP,
So before i go down that road i was wondering if anyone knows an out of
the box way i can do this without impacting performance, I could easily
use avp_ops for this but as far as i can see  it does a db query for
every transaction, this is not something that needs to be called for
every new sip transaction it should be loaded into memory at startup.

Your thoughts would be appreciated I would just like to be pointed in
the right (Best possible way to do this) direction.

Regards
Trevor Steyn



-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.opensips.org/pipermail/users/attachments/20150804/164c0824/attachment-0001.htm>


More information about the Users mailing list