Skip to content

Instantly share code, notes, and snippets.

@SinTeZWh1te
Created April 11, 2024 21:24
Show Gist options
  • Save SinTeZWh1te/5bd9cc59b8a4eb1823c6121bdfcc5104 to your computer and use it in GitHub Desktop.
Save SinTeZWh1te/5bd9cc59b8a4eb1823c6121bdfcc5104 to your computer and use it in GitHub Desktop.
package ru.test.bgbilling.modules.inet;
import bitel.billing.server.radius.RadiusStandartAttributes;
import org.apache.logging.log4j.LogManager;
import org.apache.logging.log4j.Logger;
import ru.bitel.bgbilling.kernel.network.radius.RadiusPacket;
import ru.bitel.bgbilling.modules.inet.dyn.device.redback.SmartEdgeProtocolHandler;
import ru.bitel.common.Utils;
import ru.bitel.common.sql.ConnectionSet;
public class CustomSmartEdgeProtocolHandler
extends SmartEdgeProtocolHandler {
private static final Logger logger = LogManager.getLogger();
@Override
public void preprocessAccountingRequest(RadiusPacket request, RadiusPacket response, ConnectionSet connectionSet) throws Exception {
super.preprocessAccountingRequest(request, response, connectionSet);
String nasPortId = request.getStringAttribute(-1, RadiusStandartAttributes.NAS_Port, "");
if (Utils.notBlankString(nasPortId)) {
request.setStringAttribute(-1, RadiusStandartAttributes.Calling_Station_Id, nasPortId);
}
}
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment