Re: patch to set rtp proxy mode via radius

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



Patch applied. Thanks!


Georgiewskiy Yuriy wrote:
> 
> Hi again, there is a patch to set rtp proxy mode in radius Access-Accept reply packet via 
> cisco VSA attribute h323-ivr-in proxy variable.
> 
> diff -ruN openh323gk/docs/radauth.txt openh323gk-new/docs/radauth.txt
> --- openh323gk/docs/radauth.txt	2005-02-05 00:00:00.000000000 +0300
> +++ openh323gk-new/docs/radauth.txt	2009-10-16 19:40:11.000000000 +0400
> @@ -278,6 +278,18 @@
> 
>   		If present, a call is sent to the IP address present in this attribute.
> 
> +	VSA: VendorId=Cisco, Cisco-AVPair, h323-ivr-in
> + 
> +		If present, it is scanned for 'proxy' variable that can contain
> +		'yes' or 'no' for enabling/disabling RTP proxy.
> +		The format of this attribute is as follows:
> + 
> +			Cisco-AVPair = "h323-ivr-in=variable:value;[variable:value;]"
> + 
> +		where the "variable" can be "proxy":
> + 
> +			Cisco-AVPair = "h323-ivr-in=proxy:<yes|no>;"
> +
>   If both Session-Timeout and h323-credit-time are present, a lesser value
>   is taken.
> 
> diff -ruN openh323gk/radauth.cxx openh323gk-new/radauth.cxx
> --- openh323gk/radauth.cxx	2009-05-25 09:10:00.000000000 +0400
> +++ openh323gk-new/radauth.cxx	2009-10-16 19:40:11.000000000 +0400
> @@ -903,7 +903,36 @@
>   			}
>   		}
>   	}
> - 
> +
> +	// process h323-ivr-in=proxy attribute
> +	if (result) {
> +		attr = response->FindVsaAttr(RadiusAttr::CiscoVendorId, 
> +			RadiusAttr::CiscoVSA_AV_Pair
> +			);
> +		while (attr != NULL) {
> +			PINDEX index;
> +			value = attr->AsCiscoString();
> +			if (value.Find("h323-ivr-in=") == 0 
> +				&& ((index = value.Find("proxy:")) != P_MAX_INDEX)) {
> +				index += strlen("proxy:");
> +				const PINDEX semicolonpos = value.Find(';', index);
> +				value = value.Mid(index, semicolonpos == P_MAX_INDEX
> +					? P_MAX_INDEX : (semicolonpos-index)
> +					);
> +				if (!value) {
> +					authData.m_proxyMode = Toolkit::AsBool(value)
> +						? CallRec::ProxyEnabled : CallRec::ProxyDisabled;
> +					PTRACE(5, "RADAUTH\t" << GetName() << " - proxy mode "
> +					        << (authData.m_proxyMode == CallRec::ProxyEnabled ? "enabled" : "disabled")
> +						);
> +				}
> +			}
> +			attr = response->FindVsaAttr(RadiusAttr::CiscoVendorId, 
> +				RadiusAttr::CiscoVSA_AV_Pair, attr
> +				);
> +		}
> +	}
> +
>   	if (result)
>   		result = OnReceivedPDU(*response, arqPdu, authData);
>   	else
> @@ -1192,6 +1221,36 @@
>   		}
>   	}
> 
> +
> +	// process h323-ivr-in=proxy attribute
> +	if (result) {
> +		attr = response->FindVsaAttr(RadiusAttr::CiscoVendorId, 
> +			RadiusAttr::CiscoVSA_AV_Pair
> +			);
> +		while (attr != NULL) {
> +			PINDEX index;
> +			value = attr->AsCiscoString();
> +			if (value.Find("h323-ivr-in=") == 0 
> +				&& ((index = value.Find("proxy:")) != P_MAX_INDEX)) {
> +				index += strlen("proxy:");
> +				const PINDEX semicolonpos = value.Find(';', index);
> +				value = value.Mid(index, semicolonpos == P_MAX_INDEX
> +					? P_MAX_INDEX : (semicolonpos-index)
> +					);
> +				if (!value) {
> +					authData.m_proxyMode = Toolkit::AsBool(value)
> +						? CallRec::ProxyEnabled : CallRec::ProxyDisabled;
> +					PTRACE(5, "RADAUTH\t" << GetName() << " - proxy mode "
> +					        << (authData.m_proxyMode == CallRec::ProxyEnabled ? "enabled" : "disabled")
> +						);
> +				}
> +			}
> +			attr = response->FindVsaAttr(RadiusAttr::CiscoVendorId, 
> +				RadiusAttr::CiscoVSA_AV_Pair, attr
> +				);
> +		}
> +	}
> +
>   	if (result)
>   		result = OnReceivedPDU(*response, setup, authData);
>   	else
> 
> 
> C уважением                       With Best Regards
> Георгиевский Юрий.                Georgiewskiy Yuriy
> +7 4872 711666                    +7 4872 711666
> факс +7 4872 711143               fax +7 4872 711143
> Компания ООО "Ай Ти Сервис"       IT Service Ltd
> http://nkoort.ru                  http://nkoort.ru
> JID: GHhost@xxxxxxxxxxxxxxxxxxxxx JID: GHhost@xxxxxxxxxxxxxxxxxxxxx
> YG129-RIPE                        YG129-RIPE


-- 
Jan Willamowius, jan@xxxxxxxxxxxxxx, http://www.gnugk.org/

------------------------------------------------------------------------------
Come build with us! The BlackBerry(R) Developer Conference in SF, CA
is the only developer event you need to attend this year. Jumpstart your
developing skills, take BlackBerry mobile applications to market and stay 
ahead of the curve. Join us from November 9 - 12, 2009. Register now!
http://p.sf.net/sfu/devconference
_______________________________________________________

Posting: mailto:Openh323gk-users@xxxxxxxxxxxxxxxxxxxxx
Archive: http://sourceforge.net/mailarchive/forum.php?forum_name=openh323gk-users
Unsubscribe: http://lists.sourceforge.net/lists/listinfo/openh323gk-users
Homepage: http://www.gnugk.org/


[Index of Archives]     [SIP]     [Open H.323]     [Gnu Gatekeeper]     [Asterisk PBX]     [ISDN Cause Codes]     [Yosemite News]

  Powered by Linux