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.