[OpenSIPS-Users] drouting questions: tech-prefixes, SRV lookup

Bogdan-Andrei Iancu bogdan at voice-system.ro
Thu Nov 12 13:26:12 CET 2009


Hi Andrew,

Andrew Pogrebennyk wrote:
> Hi,
> I'm going to try switching from lcr to drouting so I've got two 
> questions. Firstly, I'm a bit puzzled with what to do with tech 
> prefixes. I know I can't define a prefix which contains special 
> characters as # or *. I understand why it is done so,
theoretically can be done for non digit chars, but it will increase the 
complexity and memory consumption and decrease the performance.

and if you what  to do prefix based routing, in 99% of the case, a 
prefix is a numerical  string.

>  but in real world 
> the numeric part of the tech prefix happens to overlap with some 
> destination and sometimes this is beyond your control. I'm thinking of 
> some workaround, such as using s.substr or s.select and putting the 
> result in ruri_avp. Anyone tried to put it to work?
>   
what we do is (before calling do_routing) to run a subst over the RURI 
to replace the potential * and # with 0 (for example) -> then we can 
push the call in DR.

BTW, note that # is an illegal char in a SIP userame part :).
> Another thing, I've noticed that in the dr_gateways table 'address' 
> column is varchar.  Could this be used to put the DNS/SRV domain name 
> there for SRV lookup? As far as I can see the drouting does not cache 
> the IP addresses for destination at startup so I will get the domain 
> name in the R-URI and OpenSIPS will be perfectly able to resolve it, but 
> anyway I'd like to confirm this. Thanks.
>   
The DR module is simply placing the "address" value into the domain part 
of the RURI, without interpreting it. Only when you hit t_relay(), the 
DNS is done.

So, short answer, yes the SRV will work.


Regards,
Bogdan






More information about the Users mailing list