[Openh323gk-users] FramedIP in RadAcct Start/Stop

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

 



Hello

As there is no support for Radius-Alive packets, but my billing want to have
this addresses in accounting log here is a small hack. May be it will be
useful for someone.

p.s. GnuGK Radius support is very useful, good thing ;), thanks

diff -Nu ../orig/openh323gk/radacct.cxx ./radacct.cxx
--- ../orig/openh323gk/radacct.cxx	2003-07-03 18:30:39.000000000 +0300
+++ ./radacct.cxx	2003-07-31 18:08:32.000000000 +0300
@@ -84,6 +84,8 @@
 			RadAcctConfigSectionName, "LocalInterface", ""
 			)
 		),
+	includeFramedIPAccount( cfg.GetBoolean(RadAcctConfigSectionName, "IncludeFramedIPAccount")
+		),
 	fixedUsername( cfg.GetString(
 			RadAcctConfigSectionName, "FixedUsername", ""
 			)
@@ -230,7 +232,13 @@
 		Toolkit::Instance()->GKName()
 		);
 	*pdu += new RadiusAttr( RadiusAttr::NasPortType, RadiusAttr::NasPort_Virtual );
-		
+	
+	if (includeFramedIPAccount) {
+		PIPSocket::Address ipaddr;
+		GetIPFromTransportAddr(*(call->GetCallingAddress()), ipaddr);
+		*pdu += new RadiusAttr(RadiusAttr::FramedIpAddress,ipaddr);
+	}
+	
 	if( evt & (AcctStart | AcctStop | AcctUpdate) )
 	{
 		*pdu += new RadiusAttr( RadiusAttr::ServiceType, RadiusAttr::ST_Login );
diff -Nu ../orig/openh323gk/radacct.h ./radacct.h
--- ../orig/openh323gk/radacct.h	2003-07-03 18:30:40.000000000 +0300
+++ ./radacct.h	2003-07-31 18:05:41.000000000 +0300
@@ -116,6 +116,7 @@
 	PString localInterface;	
 	/// Fixed value for User-Name attribute in outgoing requests
 	PString fixedUsername;
+	BOOL includeFramedIPAccount;
 	/// RADIUS protocol client class associated with this authenticator
 	RadiusClient* radiusClient;

-- 
Yours, Max	             [Msg N 2206]
-------------------------------------------
mailto: mx@lucky.net phone: +380-44-2054455


-------------------------------------------------------
This SF.Net email sponsored by: Free pre-built ASP.NET sites including
Data Reports, E-commerce, Portals, and Forums are available now.
Download today and enter to win an XBOX or Visual Studio .NET.
http://aspnet.click-url.com/go/psa00100003ave/direct;at.aspnet_072303_01/01
_______________________________________________
List: Openh323gk-users@lists.sourceforge.net
Archive: http://sourceforge.net/mailarchive/forum.php?forum_id=8549
Homepage: http://www.gnugk.org/

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

  Powered by Linux