Forum Discussion

leozou_80567's avatar
leozou_80567
Historic F5 Account
Aug 15, 2008

any body ever used RTSP irule to change the source address of RTP server successfully

I wonder any body ever used RTSP irule to change the source address of RTP server successfully. It is very urgent case, any information about this is appreciated. Thansk!

 

 

For example, RTSP server replyed below string to client through LTM.

 

 

Transport: RTP/AVP;unicast;client_port=6972-6973;server_port=8020-8021;source=193.168.0.121

 

 

We hope the source=193.168.0.121 can be changed to an ip address in a firewall outside of LTM, instead of the RTSP virtual server ip address in LTM. For example:

 

 

Transport: RTP/AVP;unicast;client_port=6972-6973;server_port=8020-8021;source=1.1.1.1 ( 1.1.1.1 is not the ip address of RTSP virtual server in LTM)

 

 

We tested below irule with LTM 9.4.3 and found the source address can not be changed to 1.1.1.1 as expected. From the tcpdump output, we can see LTM still use RTSP virtual server as the source address in Transport header.

 

 

below is our iRule and iRule log output:

 

 

 

when RTSP_RESPONSE {

 

if { [RTSP::header exists "Transport"] } {

 

set transport [RTSP::header value "Transport"]

 

log local0. "0.1 $transport"

 

set source [string first "source=" $transport]

 

log local0. "0.2 $source"

 

if { $source > -1 } {

 

set end [string first ";" $transport $source]

 

if { $end == -1 } {

 

set end [string length $transport]

 

incr end -1

 

incr source -1

 

}

 

log local0. "111 "

 

RTSP::header replace "Transport" [string replace $transport $source $end "source=1.1.1.1;"]

 

set transport1 [RTSP::header value "Transport"]

 

log local0. "22 $transport1"

 

 

}

 

}

 

}

 

 

log output:

 

 

 

Aug 15 18:44:45 tmm tmm[1605]: Rule sh : 0.1 RTP/AVP;unicast;client_port=6970-6971;source=176.18.20.13;server_port=8020-8021

 

Aug 15 18:44:45 tmm tmm[1605]: Rule sh : 0.2 38

 

Aug 15 18:44:45 tmm tmm[1605]: Rule sh : 111

 

Aug 15 18:44:45 tmm tmm[1605]: Rule sh : 22 RTP/AVP;unicast;client_port=6970-6971;source=1.1.1.1;server_port=8020-8021

 

 

Aug 15 18:44:45 tmm tmm[1605]: Rule sh : 0.1 RTP/AVP;unicast;client_port=6972-6973;source=176.18.20.13;server_port=8020-8021

 

Aug 15 18:44:45 tmm tmm[1605]: Rule sh : 0.2 38

 

Aug 15 18:44:45 tmm tmm[1605]: Rule sh : 111

 

Aug 15 18:44:45 tmm tmm[1605]: Rule sh : 22 RTP/AVP;unicast;client_port=6972-6973;source=1.1.1.1;server_port=8020-8021