forum.bitel.ru http://forum.bitel.ru/ |
|
Скрипт для предобработки - Juniper ERX. Вывод mac-адреса. http://forum.bitel.ru/viewtopic.php?f=5&t=3431 |
Страница 1 из 1 |
Автор: | aardvark [ 15 янв 2010, 16:15 ] |
Заголовок сообщения: | Скрипт для предобработки - Juniper ERX. Вывод mac-адреса. |
Может кому пригодится. в dictonary.xml Код: <vendor code="4874" name="Juniper"> <attribute name="ERX-Ingress-Policy-Name" type="string" code="10"/> <attribute name="ERX-Egress-Policy-Name" type="string" code="11"/> <attribute name="ERX-Ingress-Statistics" type="integer" code="12"/> <attribute name="ERX-Egress-Statistics" type="integer" code="13"/> <attribute name="ERX-Pppoe-Description" type="string" code="24"/> <attribute name="ERX-Input-Gigapkts" type="integer" code="42"/> <attribute name="ERX-Output-Gigapkts" type="integer" code="43"/> <attribute name="ERX-Interface-Desc" type="string" code="63"/> </vendor> В скриптах предобработки, вставляем следующий скрипт Код: import bitel.billing.server.radius.*;
prefix = "pppoe "; length = prefix.length(); attributes = request.getVendorAttributes( 4874 ); if( attributes != null ) for( it = attributes.iterator(); it.hasNext(); ) { ra = (RadiusAttribute)it.next(); value = ra.getStringValue(); if( value.startsWith( prefix ) ) { request.setStringAttribute( RadiusStandartAttributes.Calling_Station_Id, value.substring( length ) ); } } |
Страница 1 из 1 | Часовой пояс: UTC + 5 часов [ Летнее время ] |
Powered by phpBB® Forum Software © phpBB Group http://www.phpbb.com/ |