Howto: Session-Timeout for DTAG (Zwangstrennung)
Hello list, This might be interesting for users in germany, since there is a disconnect each 24h if you are working with products from Deutsche Telekom (DTAG). The disconnect will be forced, if the session is up for more than 24h. So the job was to set the session-timeout so that logout will ocur each day at the same time. I solved it with freeradius/postgres with an internal sql-function. Its a quick hack and there might be 100 better ways to solve. Here we go: The function for postgres: CREATE FUNCTION sessionto(character varying(64)) RETURNS integer AS' DECLARE user ALIAS FOR $1; timeout INTEGER; BEGIN IF (select time from disctime where username=user and time is not NULL)
extract(epoch from (localtime)) THEN select into timeout round((select time from disctime where username=user and time is not NULL) - extract(epoch from (localtime))); ELSE select into timeout round((86400 + (select time from disctime where username=user and time is not NULL) - extract(epoch from (localtime)))); END IF; if (timeout is NULL) THEN timeout:=86399; END IF; RETURN timeout; END; ' LANGUAGE 'plpgsql';
disctime is a table which has fields for username and time in seconds since 0:00 of the day. The session-timeout can be set via sql xlat from reply module as an dynamic value: attribute,op, value Session-Timeout = `%{sql: select sessionto('%{User-Name}') }` BR Uwe -- kiste lat: 54.322684, lon: 10.13586
Am Montag, 20. April 2009 19:13:08 schrieb Uwe Kastens:
Hello list,
This might be interesting for users in germany, since there is a disconnect each 24h if you are working with products from Deutsche Telekom (DTAG). The disconnect will be forced, if the session is up for more than 24h. So the job was to set the session-timeout so that logout will ocur each day at the same time.
I solved it with freeradius/postgres with an internal sql-function. Its a quick hack and there might be 100 better ways to solve. Here we go: (...)
hi, thanks for the posting. Good to know the technics behind the scenes even for large providers. -- Dr. Michael Schwartzkopff MultiNET Services GmbH Addresse: Bretonischer Ring 7; 85630 Grasbrunn; Germany Tel: +49 - 89 - 45 69 11 0 Fax: +49 - 89 - 45 69 11 21 mob: +49 - 174 - 343 28 75 mail: misch@multinet.de web: www.multinet.de Sitz der Gesellschaft: 85630 Grasbrunn Registergericht: Amtsgericht München HRB 114375 Geschäftsführer: Günter Jurgeneit, Hubert Martens --- PGP Fingerprint: F919 3919 FF12 ED5A 2801 DEA6 AA77 57A4 EDD8 979B Skype: misch42
participants (2)
-
Michael Schwartzkopff -
Uwe Kastens