On 01/12/2010 06:35 AM, Daniel-Constantin Mierla wrote:
Hello,
On 1/11/10 6:55 PM, Geoffrey Mina wrote:
this was from a regular route[] block. I ended up
finding an old
thread which pointed me in the right direction.
I am currently using this to retrieve the destination IP POST
dispatcher lookup:
$var(destIP) = $(ru{s.select,1,:}{s.select,1,@});
It seems to be working well. Anything I should be aware of while
using this technique?
actually ds_next_dst() populates the dst uri, which is accessible via
$du. Make sure ds_append_branch parameter is set to 0:
http://kamailio.org/docs/modules/3.0.x/modules_k/dispatcher.html#id2543896
Then you call append_branch() after doing your IP check.
If you do ds_next domain() then you get the new address in r-uri
(therefore $ru).
To get access to dest uri domain, simply use: $dd.
Your expression with transformations will give you the ip along with
protocol and uri parameters, if they are present in r-uri.
Oh, so that's the difference between ds_next_dst() and ds_next_domain()?
I never did figure that out and always used ds_next_domain(). Thanks
Daniel!
So, Kamailio operates on the dst_uri in the same way that a UA uses an
'outbound proxy' setting - i.e. relays a call to RURI sip:user1@domain
through proxy x.x.x.x?
--
Alex Balashov - Principal
Evariste Systems
Web :
http://www.evaristesys.com/
Tel : (+1) (678) 954-0670
Direct : (+1) (678) 954-0671