пытаюсь затянуть аккаунтинг с фрисвича. BGB 6.0, CentOS 6.1, java version "1.7.0_09". решил писать скрипт предобработки. пакет от фрисвича 02-06/02:23:25 INFO [rdsLstnr-p-4-t-4] RadiusListenerWorker - REQUEST: Packet type: Accounting-Request Identifier: 139 Authenticator: {8A 27 06 7F 7D 17 0D 32 C5 26 17 B4 5B 8A F1 EB} Attributes: User-Name=305 NAS-IP-Address=127.0.0.1 NAS-Port=0 Framed-IP-Address=xx.xx.xx.xx Acct-Status-Type=2 Acct-Delay-Time=0 Acct-Session-Time=5 Acct-Session-Id=1caa8d10-8eb4-11e3-8756-c1191c44ca8c Freeswitch-CLID=Cat Freeswitch-Dialplan=XML Freeswitch-Src=305 Freeswitch-Dst=xxxxxxxx Freeswitch-Ani=305 Freeswitch-Aniii= Freeswitch-Lastapp=bridge Freeswitch-Hangupcause=16 Freeswitch-Billusec=5199916 Freeswitch-RDNIS= Freeswitch-Source=mod_sofia Freeswitch-Context=test Freeswitch-Callanswerdate=2014-02-06T02:23:19.788079+0400 Freeswitch-Callstartdate=2014-02-06T02:23:17.308049+0400 Freeswitch-State=2014-02-06T02:23:24.987995+0400 Freeswitch-Direction=inbound
после скрипта получается 02-06/02:23:25 INFO [rdsLstnr-p-4-t-4] NasScript - REQUEST_AFTER_SCRIPT: Packet type: Accounting-Request Identifier: 139 Authenticator: {8A 27 06 7F 7D 17 0D 32 C5 26 17 B4 5B 8A F1 EB} Attributes: User-Name=305 NAS-IP-Address=127.0.0.1 NAS-Port=0 Framed-IP-Address=xx.xx.xx.xx Acct-Status-Type=2 Acct-Delay-Time=0 Acct-Session-Time=5 Calling-Station-Id=305 Acct-Session-Id=1caa8d10-8eb4-11e3-8756-c1191c44ca8c Called-Station-Id= h323-remote-address=217.77.155.55 h323-setup-time=2014-02-06T02:23:17.308049+0400 h323-conf-id=1caa8d10-8eb4-11e3-8756-c1191c44ca8c h323-call-type=VOIP h323-call-origin=answer h323-disconnect-time=2014-02-06T02:23:24.987995+0400 h323-connect-time=2014-02-06T02:23:19.788079+0400 h323-disconnect-cause=22 Freeswitch-CLID=Cat Freeswitch-Dialplan=XML Freeswitch-Src=305 Freeswitch-Dst=xxxxxxxx Freeswitch-Ani=305 Freeswitch-Aniii= Freeswitch-Lastapp=bridge Freeswitch-Hangupcause=16 Freeswitch-Billusec=5199916 Freeswitch-RDNIS= Freeswitch-Source=mod_sofia Freeswitch-Context=test Freeswitch-Callanswerdate=2014-02-06T02:23:19.788079+0400 Freeswitch-Callstartdate=2014-02-06T02:23:17.308049+0400 Freeswitch-State=2014-02-06T02:23:24.987995+0400 Freeswitch-Direction=inbound Common options: {call.type=2} 02-06/02:23:25 INFO [rdsLstnr-p-4-t-3] RadiusListenerWorker - RESPONSE: Packet type: Accounting-Response Identifier: 138 Authenticator: {D6 72 F2 47 D7 30 0A 1C D0 51 EB 00 49 54 F0 81} Attributes:
нигде в логах не ругается. логично предположить что пакет затягивается.
только куда от потом девается непонятно. смотрю в Модули -> Модуль телефонии -> Монитор. там пусто. никаких записей не появляется. в логах тишина. куда копать? где его искать?
сам скрипт вышел такой:
import bitel.billing.server.radius.*; import ru.bitel.bgbilling.kernel.network.radius.*;
if (request.getIntAttribute(RadiusStandartAttributes.Acct_Status_Type) == 2) { // Устанавливаем Calling-Station-Id = Asterisk-Src CallingStationId = request.getVendorAttributes( 27880, 4).get(0).getValue(); request.setStringAttribute(RadiusStandartAttributes.Calling_Station_Id, CallingStationId);
// Устанавливаем h323-remote-address int FS_Remoteip=0; FS_Remoteip=request.getIntAttribute(-1, 8, FS_Remoteip); request.setStringAttribute(9, 23, "217.77.155.55");
// Устанавливаем Called-Station-Id = Asterisk-Dst FS_Dst=""; FS_Dst=request.getStringAttribute(27880, 103, FS_Dst); request.setStringAttribute(RadiusStandartAttributes.Called_Station_Id, FS_Dst);
// Проверяем наличие Asterisk-User-Field, и если такой существует, // то на основании его значения устанавливаем h323-call-origin CallType = request.getVendorAttributes(27880, 24); if (CallType != null && CallType.get(0).getValue() .equals("inbound")) { request.setStringAttribute( 9, 26, "answer"); request.setFlag(2); } else { request.setStringAttribute(9, 26, "originate"); request.setFlag(1); }
// Устанавливаем h323-call-type = VOIP request.setStringAttribute(9, 27, "VOIP");
// Устанавливаем h323-setup-time = Asterisk-Start-Time FS_Start_Time=""; FS_Start_Time=request.getStringAttribute(27880, 20, FS_Start_Time); request.setStringAttribute(9, 25, FS_Start_Time);
// Устанавливаем h323-connect-time = Asterisk-Answer-Time FS_Answer_Time="---"; FS_Answer_Time=request.getStringAttribute(27880, 21, FS_Answer_Time); request.setStringAttribute(9, 28, FS_Answer_Time);
// Устанавливаем h323-disconnect-time = Asterisk-End-Time String FS_End_Time="---"; FS_End_Time=request.getStringAttribute(27880, 23, FS_End_Time); request.setStringAttribute(9, 29, FS_End_Time);
// Устанавливаем h323-disconnect-cause на основании Asterisk-Disposition FS_Disposition=""; FS_Disposition=request.getStringAttribute(27880, 12, FS_Disposition); if (FS_Disposition .equals("ANSWERED")) request.setStringAttribute(9, 30, "0"); else if (FS_Disposition .equals("NO ANSWER")) request.setStringAttribute(9, 30, "5"); else if (FS_Disposition .equals("BUSY")) request.setStringAttribute(9, 30, "17"); else request.setStringAttribute(9, 30, "22");
// Устанавливаем h323-conf-id = Acct-Session-Id request.setStringAttribute(9, 24, request.getStringAttribute(RadiusStandartAttributes.Acct_Session_Id));
} // Конец if (Acct_Status_Type == 2)
|