Discussion:
[SR-Users] How to use the ip parameter in rtpproxy_manage()
Sebastian Damm
2014-08-29 09:44:40 UTC
Permalink
Hi,

I have the following setup:

UAC ---> LB ---> Proxy ---> GW

In NAT scenarios the loadbalancer detects it, but the proxy communicates
with the RTP proxy. I want to send the original caller IP as detected by
the loadbalancer (and transported to the proxy) to the RTP proxy.

As far as I understand the documentation of the rtpproxy module, I could
call rtpproxy_manage with a second parameter, indicating which IP address
should be sent to the RTP proxy. I tried sending a pseudovariable, both
within quotes or not, or even a static string. But when I look at those
messages sent to the RTP proxy, there's always the IP from where the SIP
packet was received (the loadbalancer IP) in the request.

Previously we used the "r" parameter, sending the original IP from the SDP
to the proxy. But due to strange behavior of some UACs, we want to get rid
of that.

Do I misunderstand the second parameter?

This is what the documentation says:
* ip_address* - new SDP IP address.

Unfortunately, I couldn't find any example using this.

Best Regards,
Sebastian
Daniel-Constantin Mierla
2014-08-29 11:52:08 UTC
Permalink
Hello,

the second parameter is to give the IP to appear in sdp, instead of the
rtpproxy ip.

What you can try is to update the sdp with fix_natted_sdp() with the
source IP as seen by the LB, then do msg_apply_changes() and pass the
flag to trust the ip in sdp -- not sure it is going to work, by worth
giving a try.

Perhaps a flag to overwrite the source IP would be good.

Cheers,
Daniel
Post by Sebastian Damm
Hi,
UAC ---> LB ---> Proxy ---> GW
In NAT scenarios the loadbalancer detects it, but the proxy
communicates with the RTP proxy. I want to send the original caller IP
as detected by the loadbalancer (and transported to the proxy) to the
RTP proxy.
As far as I understand the documentation of the rtpproxy module, I
could call rtpproxy_manage with a second parameter, indicating which
IP address should be sent to the RTP proxy. I tried sending a
pseudovariable, both within quotes or not, or even a static string.
But when I look at those messages sent to the RTP proxy, there's
always the IP from where the SIP packet was received (the loadbalancer
IP) in the request.
Previously we used the "r" parameter, sending the original IP from the
SDP to the proxy. But due to strange behavior of some UACs, we want to
get rid of that.
Do I misunderstand the second parameter?
/ ip_address/ - new SDP IP address.
Unfortunately, I couldn't find any example using this.
Best Regards,
Sebastian
_______________________________________________
SIP Express Router (SER) and Kamailio (OpenSER) - sr-users mailing list
http://lists.sip-router.org/cgi-bin/mailman/listinfo/sr-users
--
Daniel-Constantin Mierla
http://twitter.com/#!/miconda - http://www.linkedin.com/in/miconda
Next Kamailio Advanced Trainings 2014 - http://www.asipto.com
Sep 22-25, Berlin, Germany ::: Oct 15-17, San Francisco, USA
Sebastian Damm
2014-08-29 14:18:31 UTC
Permalink
Hi,

okay, so I really misunderstood the IP parameter. Thanks for your solution,
from the first look it does work. Is there anything I should consider or
watch specifically when using msg_apply_changes() in the middle of
processing the request?

Best Regards,
Sebastian
Post by Daniel-Constantin Mierla
Hello,
the second parameter is to give the IP to appear in sdp, instead of the
rtpproxy ip.
What you can try is to update the sdp with fix_natted_sdp() with the
source IP as seen by the LB, then do msg_apply_changes() and pass the flag
to trust the ip in sdp -- not sure it is going to work, by worth giving a
try.
Perhaps a flag to overwrite the source IP would be good.
Cheers,
Daniel
Hi,
UAC ---> LB ---> Proxy ---> GW
In NAT scenarios the loadbalancer detects it, but the proxy communicates
with the RTP proxy. I want to send the original caller IP as detected by
the loadbalancer (and transported to the proxy) to the RTP proxy.
As far as I understand the documentation of the rtpproxy module, I could
call rtpproxy_manage with a second parameter, indicating which IP address
should be sent to the RTP proxy. I tried sending a pseudovariable, both
within quotes or not, or even a static string. But when I look at those
messages sent to the RTP proxy, there's always the IP from where the SIP
packet was received (the loadbalancer IP) in the request.
Previously we used the "r" parameter, sending the original IP from the SDP
to the proxy. But due to strange behavior of some UACs, we want to get rid
of that.
Do I misunderstand the second parameter?
* ip_address* - new SDP IP address.
Unfortunately, I couldn't find any example using this.
Best Regards,
Sebastian
Daniel-Constantin Mierla
2014-08-29 14:24:15 UTC
Permalink
Hello,

should be in request_route or reply_route (from core) only, before
creating the transaction and not after doing record_route() for requests.

Cheers,
Daniel
Post by Sebastian Damm
Hi,
okay, so I really misunderstood the IP parameter. Thanks for your
solution, from the first look it does work. Is there anything I should
consider or watch specifically when using msg_apply_changes() in the
middle of processing the request?
Best Regards,
Sebastian
On Fri, Aug 29, 2014 at 1:52 PM, Daniel-Constantin Mierla
Hello,
the second parameter is to give the IP to appear in sdp, instead
of the rtpproxy ip.
What you can try is to update the sdp with fix_natted_sdp() with
the source IP as seen by the LB, then do msg_apply_changes() and
pass the flag to trust the ip in sdp -- not sure it is going to
work, by worth giving a try.
Perhaps a flag to overwrite the source IP would be good.
Cheers,
Daniel
Post by Sebastian Damm
Hi,
UAC ---> LB ---> Proxy ---> GW
In NAT scenarios the loadbalancer detects it, but the proxy
communicates with the RTP proxy. I want to send the original
caller IP as detected by the loadbalancer (and transported to the
proxy) to the RTP proxy.
As far as I understand the documentation of the rtpproxy module,
I could call rtpproxy_manage with a second parameter, indicating
which IP address should be sent to the RTP proxy. I tried sending
a pseudovariable, both within quotes or not, or even a static
string. But when I look at those messages sent to the RTP proxy,
there's always the IP from where the SIP packet was received (the
loadbalancer IP) in the request.
Previously we used the "r" parameter, sending the original IP
from the SDP to the proxy. But due to strange behavior of some
UACs, we want to get rid of that.
Do I misunderstand the second parameter?
/ ip_address/ - new SDP IP address.
Unfortunately, I couldn't find any example using this.
Best Regards,
Sebastian
_______________________________________________
SIP Express Router (SER) and Kamailio (OpenSER) - sr-users mailing list
http://lists.sip-router.org/cgi-bin/mailman/listinfo/sr-users
--
Daniel-Constantin Mierla
http://twitter.com/#!/miconda - http://www.linkedin.com/in/miconda
Next Kamailio Advanced Trainings 2014 - http://www.asipto.com
Sep 22-25, Berlin, Germany ::: Oct 15-17, San Francisco, USA
Loading...