|
@@ -258,6 +258,7 @@ flags
|
|
|
FLAG_SERWEB_RSVD2 : 10, # bit reserved for use with serweb
|
|
|
FLAG_SESSIONTIMER : 11, # indicates that the UAC supports Session Timer
|
|
|
FLAG_RR_DONE : 12; # the request got already one RR header
|
|
|
+ FLAG_RTP_PROXY : 13; # the RTP proxy is turned on
|
|
|
|
|
|
avpflags
|
|
|
dialog_cookie; # handled by rr module
|
|
@@ -629,17 +630,17 @@ route[RTPPROXY]
|
|
|
}
|
|
|
|
|
|
# if the message terminates a dialog turn RTP proxy off
|
|
|
- if ((method=="BYE" || method=="CANCEL") ||
|
|
|
- isflagset(FLAG_FAILUREROUTE)) {
|
|
|
+ if (method=="BYE" || method=="CANCEL") {
|
|
|
unforce_rtp_proxy();
|
|
|
append_hf("P-RTP-Proxy: UNFORCED\r\n");
|
|
|
break;
|
|
|
}
|
|
|
|
|
|
# turn the RTP proxy on for INVITEs and UPDATEs
|
|
|
- if ((method=="INVITE" || method == "UPDATE") && @msg.body != "") {
|
|
|
+ if (((method=="INVITE" || method == "UPDATE") && @msg.body != "") && !isflagset(FLAG_RTP_PROXY)) {
|
|
|
force_rtp_proxy('r');
|
|
|
append_hf("P-RTP-Proxy: YES\r\n");
|
|
|
+ setflag(FLAG_RTP_PROXY);
|
|
|
}
|
|
|
}
|
|
|
|
|
@@ -1190,7 +1191,7 @@ onreply_route[REPLY_ROUTE]
|
|
|
|
|
|
# if a NAT is involved and this is the final positive reply
|
|
|
# which contains a body, start to use the RTP proxy
|
|
|
- if (isflagset(FLAG_NAT) &&
|
|
|
+ if (isflagset(FLAG_RTP_PROXY) &&
|
|
|
status=~"(18[03])|(2[0-9][0-9])" &&
|
|
|
@msg.body != "") {
|
|
|
force_rtp_proxy('r');
|