Hello
Is there a way to find the IP address that the request will be sent to using kamailio.cfg ? For example if extension is behind NAT, after lookup() I have in $rd the IP in the contact column of location table, not the actual IP in the received column. I couldn't find a pseudovar for this.
Thanks, Catalina
Hello,
On 27.07.2009 15:14 Uhr, catalina oancea wrote:
Hello
Is there a way to find the IP address that the request will be sent to using kamailio.cfg ? For example if extension is behind NAT, after lookup() I have in $rd the IP in the contact column of location table, not the actual IP in the received column. I couldn't find a pseudovar for this.
check dst uri: $du
Next version using the sip router core provides more info about destination via send route.
Cheers, Daniel
Thanks a lot! That works. I had seen it earlier but I ignored it cause sometimes it is null and I needed a pv to work for all cases. So I am now making an if, like this:
if ($du!=null) $var(destIP)=$(du{s.select,1,:}); else $var(destIP)=$rd;
...then I use $var(destIP)
2009/7/27 Daniel-Constantin Mierla miconda@gmail.com:
Hello,
On 27.07.2009 15:14 Uhr, catalina oancea wrote:
Hello
Is there a way to find the IP address that the request will be sent to using kamailio.cfg ? For example if extension is behind NAT, after lookup() I have in $rd the IP in the contact column of location table, not the actual IP in the received column. I couldn't find a pseudovar for this.
check dst uri: $du
Next version using the sip router core provides more info about destination via send route.
Cheers, Daniel
-- Daniel-Constantin Mierla
- SIP Router Bootcamp
- Kamailio (OpenSER) and Asterisk Training
- Berlin, Germany, Sep 1-4, 2009
- http://www.asipto.com/index.php/sip-router-bootcamp/
On 27.07.2009 15:44 Uhr, catalina oancea wrote:
Thanks a lot! That works. I had seen it earlier but I ignored it cause sometimes it is null and I needed a pv to work for all cases. So I am now making an if, like this:
if ($du!=null) $var(destIP)=$(du{s.select,1,:}); else $var(destIP)=$rd; ...then I use $var(destIP)
probably a new PV to hold next destination uri would be good, to hide above coding in the config. IIRC, some discussion about have been in the past, but no actions.
Cheers, Daniel
2009/7/27 Daniel-Constantin Mierla miconda@gmail.com:
Hello,
On 27.07.2009 15:14 Uhr, catalina oancea wrote:
Hello
Is there a way to find the IP address that the request will be sent to using kamailio.cfg ? For example if extension is behind NAT, after lookup() I have in $rd the IP in the contact column of location table, not the actual IP in the received column. I couldn't find a pseudovar for this.
check dst uri: $du
Next version using the sip router core provides more info about destination via send route.
Cheers, Daniel
-- Daniel-Constantin Mierla
- SIP Router Bootcamp
- Kamailio (OpenSER) and Asterisk Training
- Berlin, Germany, Sep 1-4, 2009
- http://www.asipto.com/index.php/sip-router-bootcamp/
Kamailio (OpenSER) - Users mailing list Users@lists.kamailio.org http://lists.kamailio.org/cgi-bin/mailman/listinfo/users http://lists.openser-project.org/cgi-bin/mailman/listinfo/users
IMO fix_nated_register() should be used always, and then DURI is always populated after lookup()
@catalina: use $du in branch_route to the get the destination of all branches
regards klaus
Daniel-Constantin Mierla schrieb:
On 27.07.2009 15:44 Uhr, catalina oancea wrote:
Thanks a lot! That works. I had seen it earlier but I ignored it cause sometimes it is null and I needed a pv to work for all cases. So I am now making an if, like this:
if ($du!=null) $var(destIP)=$(du{s.select,1,:}); else $var(destIP)=$rd; ...then I use $var(destIP)
probably a new PV to hold next destination uri would be good, to hide above coding in the config. IIRC, some discussion about have been in the past, but no actions.
Cheers, Daniel
2009/7/27 Daniel-Constantin Mierla miconda@gmail.com:
Hello,
On 27.07.2009 15:14 Uhr, catalina oancea wrote:
Hello
Is there a way to find the IP address that the request will be sent to using kamailio.cfg ? For example if extension is behind NAT, after lookup() I have in $rd the IP in the contact column of location table, not the actual IP in the received column. I couldn't find a pseudovar for this.
check dst uri: $du
Next version using the sip router core provides more info about destination via send route.
Cheers, Daniel
-- Daniel-Constantin Mierla
- SIP Router Bootcamp
- Kamailio (OpenSER) and Asterisk Training
- Berlin, Germany, Sep 1-4, 2009
- http://www.asipto.com/index.php/sip-router-bootcamp/
Kamailio (OpenSER) - Users mailing list Users@lists.kamailio.org http://lists.kamailio.org/cgi-bin/mailman/listinfo/users http://lists.openser-project.org/cgi-bin/mailman/listinfo/users
On 27.07.2009 19:13 Uhr, Klaus Darilion wrote:
IMO fix_nated_register() should be used always, and then DURI is always populated after lookup()
duri might be populated by other modules as well. If you needed just after lookup is one story, but getting the next hop address in various cases require the check in the config file for $du and if null fallback to $ru.
Cheers, Daniel
@catalina: use $du in branch_route to the get the destination of all branches
regards klaus
Daniel-Constantin Mierla schrieb:
On 27.07.2009 15:44 Uhr, catalina oancea wrote:
Thanks a lot! That works. I had seen it earlier but I ignored it cause sometimes it is null and I needed a pv to work for all cases. So I am now making an if, like this:
if ($du!=null) $var(destIP)=$(du{s.select,1,:}); else $var(destIP)=$rd; ...then I use $var(destIP)
probably a new PV to hold next destination uri would be good, to hide above coding in the config. IIRC, some discussion about have been in the past, but no actions.
Cheers, Daniel
2009/7/27 Daniel-Constantin Mierla miconda@gmail.com:
Hello,
On 27.07.2009 15:14 Uhr, catalina oancea wrote:
Hello
Is there a way to find the IP address that the request will be sent to using kamailio.cfg ? For example if extension is behind NAT, after lookup() I have in $rd the IP in the contact column of location table, not the actual IP in the received column. I couldn't find a pseudovar for this.
check dst uri: $du
Next version using the sip router core provides more info about destination via send route.
Cheers, Daniel
-- Daniel-Constantin Mierla
- SIP Router Bootcamp
- Kamailio (OpenSER) and Asterisk Training
- Berlin, Germany, Sep 1-4, 2009
- http://www.asipto.com/index.php/sip-router-bootcamp/
Kamailio (OpenSER) - Users mailing list Users@lists.kamailio.org http://lists.kamailio.org/cgi-bin/mailman/listinfo/users http://lists.openser-project.org/cgi-bin/mailman/listinfo/users
Kamailio (OpenSER) - Users mailing list Users@lists.kamailio.org http://lists.kamailio.org/cgi-bin/mailman/listinfo/users http://lists.openser-project.org/cgi-bin/mailman/listinfo/users