[Devel] [PATCH] mediaproxy module and src-ip AVP

Klaus Darilion klaus.mailinglists at pernau.at
Wed Apr 26 19:28:38 CEST 2006


Andreas Granig wrote:
> Hi,
> 
> I ran into a problem with mediaproxy and a load-balanced system setup. 
> use_media_proxy() on a backend-proxy passes the src-ip of the request, 
> which is the address of the load-balancer, to the proxy dispatcher, so 
> media relaying then does not work.

Why does the mediaproxy need to know the src-ip. Shouldn't it just send 
back symmetrically? And for asymmetrical operation use the IP from the SDP?

regards
klaus


> 
> Thus I've written a small patch for the mediaproxy module which allows 
> you to write an IP address to an AVP which is then used as src-ip by 
> use_media_proxy().  If the AVP isn't set, the IP gathered by the 
> transport layer is used.
> 
> Here's an example of its usage.
> 
> On the load-balancer:
> 
> route[0] {
>   ...
>   if( /* request is from UAC */) {
>     append_hf("P-Src-Ip: $si\r\n");
>   }
>   ...
> }
> reply_route[1] {
>   ...
>   if( /* response is from UAC */) {
>     append_hf("P-Src-Ip: $si\r\n");
>   }
>   ...
> }
> 
> 
> And on the backend-proxy controlling the mediaproxy:
> 
> ...
> modparam("mediaproxy", "src_ip_avp", "i:100")
> ...
> 
> route[0] {
>   ...
>   route(1);
>   use_media_proxy();
>   ...
> }
> 
> route[1] {
>   avp_delete("$avp(i:100)");
>   if(is_present_hf("P-Src-Ip")) {
>     avp_write("$hdr(P-Src-Ip)", "$avp(i:100)");
>     remove_hf("P-Src-Ip");
>   }
> }
> 
> reply_route[1] {
>   ...
>   route(1);
>   use_media_proxy();
>   ...
> }
> 
> 
> If this feature is also helpful for others, I'll post it on the 
> sourceforge tracker.
> 
> Cheers,
> Andy
> 
> 
> ------------------------------------------------------------------------
> 
> _______________________________________________
> Devel mailing list
> Devel at openser.org
> http://openser.org/cgi-bin/mailman/listinfo/devel




More information about the Devel mailing list