Module ocs_log
This library module implements functions used in handling logging
in the ocs application.
Copyright © 2016 - 2026 SigScale Global Inc.
References
This library module implements functions used in handling logging
in the ocs application.
Event logging in ocs uses
disk_log wrap logs configured for file
size, and number of files, using application environment variables
(e.g. acct_log_size, acct_log_files). As the log items are
chronologically ordered finding an event by start time is relatively
efficient. The btree_search/2 function is
used to perform a binary tree search across the files and a chunk
head comparison to quickly find the file and chunk containing items
with a given start time.
All log items have the common form:
- tuple with artity > 2
- first element (TS) is timestamp()
- second element(N) is unique()
{TS, N} is unique within a log
Functions reading log files SHALL assume the above format and
SHOULD ignore items with unexpected tuple arity or element values.
abmf_event() = {Timestamp::ocs_log:timestamp(), N::ocs_log:unique(), Node::atom(), Type::topup | adjustment | delete | deduct | reserve | unreserve | transfer, Subscriber::binary(), Bucket::undefined | string(), Units::cents | seconds | octets | messages, Product::string(), Amount::integer(), AmountBefore::integer() | undefined, AmountAfter::integer() | undefined, Validity::undefined | pos_integer(), Channel::undefined | string(), Requestor::undefined | [{Id::string(), Role::string(), Name::string()}], RelatedParty::undefined | [{Id::string(), Role::string(), Name::string()}], PaymentMeans::undefined | string(), Action::undefined | string(), Status::undefined | term()}
acct_event() = {Timestamp::ocs_log:timestamp(), N::ocs_log:unique(), Protocol::ocs_log:protocol(), Node::atom(), Server::ocs_log:server(), Type::ocs_log:acct_type(), RequestAttributes::ocs_log:acct_request(), ResponseAttributes::ocs_log:acct_response(), Rated::[#rated{bucket_value = non_neg_integer() | undefined | '_', bucket_type = cents | octets | seconds | messages | undefined | '_', currency = string() | undefined | '_', is_billed = boolean() | '_', is_tax_exempt = boolean() | undefined | '_', tariff_type = atom() | undefined | '_', product = term() | undefined | '_', price_name = string() | undefined | '_', price_type = tariff | usage | event | undefined | '_', description = string() | undefined | '_', tax_excluded_amount = non_neg_integer() | undefined | '_', tax_included_amount = non_neg_integer() | undefined | '_', tax_rate = integer() | undefined | '_', usage_rating_tag = usage | included | non_included | undefined | '_'}]}
acct_rated() = [#rated{bucket_value = non_neg_integer() | undefined | '_', bucket_type = cents | octets | seconds | messages | undefined | '_', currency = string() | undefined | '_', is_billed = boolean() | '_', is_tax_exempt = boolean() | undefined | '_', tariff_type = atom() | undefined | '_', product = term() | undefined | '_', price_name = string() | undefined | '_', price_type = tariff | usage | event | undefined | '_', description = string() | undefined | '_', tax_excluded_amount = non_neg_integer() | undefined | '_', tax_included_amount = non_neg_integer() | undefined | '_', tax_rate = integer() | undefined | '_', usage_rating_tag = usage | included | non_included | undefined | '_'}]
acct_request() = #'3gpp_ro_CCR'{} | #'3gpp_ro_RAR'{} | #'3gpp_gx_CCR'{} | #'3gpp_gx_RAR'{} | radius_attributes:attributes() | nrf_request()
acct_response() = #'3gpp_ro_CCA'{} | #'3gpp_ro_RAA'{} | #'3gpp_gx_CCA'{} | #'3gpp_gx_RAA'{} | radius_attributes:attributes() | nrf_response()
acct_type() = on | off | start | stop | update | interim | final | event
auth_event() = diameter_auth_event() | radius_auth_event()
auth_request() = auth_request_rad() | auth_request_dia()
auth_request_dia() = #diameter_nas_app_AAR{} | #diameter_eap_app_DER{} | #'3gpp_sta_DER'{} | #'3gpp_swm_DER'{} | #'3gpp_sta_STR'{} | #'3gpp_swm_STR'{} | #'3gpp_s6b_STR'{} | #'3gpp_swx_RTR'{} | #'3gpp_s6b_AAR'{} | #'3gpp_s6a_AIR'{} | #'3gpp_s6a_ULR'{} | #'3gpp_s6a_PUR'{}
auth_request_rad() = radius_attributes:attributes()
auth_response() = auth_response_rad() | auth_response_dia()
auth_response_dia() = #diameter_nas_app_AAA{} | #diameter_eap_app_DEA{} | #'3gpp_sta_DEA'{} | #'3gpp_swm_DEA'{} | #'3gpp_sta_STA'{} | #'3gpp_swm_STA'{} | #'3gpp_s6b_STA'{} | #'3gpp_swx_RTA'{} | #'3gpp_s6b_AAA'{} | #'3gpp_s6a_AIA'{} | #'3gpp_s6a_ULA'{} | #'3gpp_s6a_PUA'{}
auth_response_rad() = radius_attributes:attributes()
auth_type() = accept | reject | change
diameter_auth_event() = {Timestamp::ocs_log:timestamp(), N::ocs_log:unique(), Protocol::ocs_log:protocol(), Node::atom(), Server::ocs_log:server(), Client::ocs_log:server(), RequestAttributes::ocs_log:auth_request(), ResponseAttributes::ocs_log:auth_response()}
http_event() = {Host::string(), User::string(), DateTime::string(), Method::string(), URI::string(), HttpStatus::string()}
nrf_request() = map()
nrf_response() = map()
protocol() = radius | diameter | nrf
radius_auth_event() = {Timestamp::ocs_log:timestamp(), N::ocs_log:unique(), Protocol::ocs_log:protocol(), Node::atom(), Server::ocs_log:server(), Client::ocs_log:server(), Type::ocs_log:auth_type(), RequestAttributes::ocs_log:auth_request(), ResponseAttributes::ocs_log:auth_response()}
server() = {Address::inet:ip_address(), Port::non_neg_integer()} | undefined
timestamp() = pos_integer()
unique() = pos_integer()
log_name(Var) -> Name
- Var = atom()
- Name = term()
Return log name from Var application environment variable.
acct_open() -> Result
- Result = ok | {error, Reason}
- Reason = term()
Open an accounting event disk log.
acct_log(Protocol, Server, Type, Request, Response, Rated) -> Result
Write an event to accounting log.
acct_close() -> Result
- Result = ok | {error, Reason}
- Reason = term()
Close accounting disk log.
acct_query(Continuation, Start, End, Types, Matches) -> Result
- Continuation = start | disk_log:continuation()
- Start = calendar:datetime() | timestamp()
- End = calendar:datetime() | timestamp()
- Types = [Type] | '_'
- Type = acct_type()
- Matches = [Match] | '_'
- Match = RadiusMatch | DiameterMatchSpec | NrfMatchSpec | RatedMatchSpec
- RadiusMatch = {Attribute, AttributeMatch}
- Attribute = byte()
- AttributeMatch = {exact, term()} | {notexact, term()} | {lt, term()} | {lte, term()} | {gt, term()} | {gte, term()} | {regex, term()} | {like, [term()]} | {notlike, [term()]} | {in, [term()]} | {notin, [term()]} | {contains, [term()]} | {notcontain, [term()]} | {containsall, [term()]}
- DiameterMatchSpec = {DiameterMatchHead, MatchConditions}
- DiameterMatchHead = #'3gpp_ro_CCR'{} | #'3gpp_ro_CCA'{} | #'3gpp_ro_RAR'{} | #'3gpp_ro_RAA'{} | #'3gpp_gx_CCR'{} | #'3gpp_gx_CCA'{} | #'3gpp_gx_RAR'{} | #'3gpp_gx_RAA'{}
- NrfMatchSpec = {NrfMatchHead, MatchConditions}
- NrfMatchHead = map()
- RatedMatchSpec = {RatedMatchHead, MatchConditions}
- RatedMatchHead = #rated{bucket_value = non_neg_integer() | undefined | '_', bucket_type = cents | octets | seconds | messages | undefined | '_', currency = string() | undefined | '_', is_billed = boolean() | '_', is_tax_exempt = boolean() | undefined | '_', tariff_type = atom() | undefined | '_', product = term() | undefined | '_', price_name = string() | undefined | '_', price_type = tariff | usage | event | undefined | '_', description = string() | undefined | '_', tax_excluded_amount = non_neg_integer() | undefined | '_', tax_included_amount = non_neg_integer() | undefined | '_', tax_rate = integer() | undefined | '_', usage_rating_tag = usage | included | non_included | undefined | '_'}
- MatchConditions = [tuple()]
- Result = {Continuation2, Events} | {error, Reason}
- Continuation2 = eof | disk_log:continuation()
- Events = [acct_event()]
- Reason = term()
Equivalent to acct_query(Continuation,
Start,
End,
'_',
Types,
AttrsMatch).
Query accounting log events with filters.
acct_query(Continuation, Start, End, Protocol, Types, Matches) -> Result
- Continuation = start | disk_log:continuation()
- Start = calendar:datetime() | timestamp()
- End = calendar:datetime() | timestamp()
- Protocol = protocol() | [protocol()] | '_'
- Types = [Type] | '_'
- Type = acct_type()
- Matches = [Match] | '_'
- Match = RadiusMatch | DiameterMatchSpec | NrfMatchSpec | RatedMatchSpec
- RadiusMatch = {Attribute, AttributeMatch}
- Attribute = byte()
- AttributeMatch = {exact, term()} | {notexact, term()} | {lt, term()} | {lte, term()} | {gt, term()} | {gte, term()} | {regex, term()} | {like, [term()]} | {notlike, [term()]} | {in, [term()]} | {notin, [term()]} | {contains, [term()]} | {notcontain, [term()]} | {containsall, [term()]}
- DiameterMatchSpec = {DiameterMatchHead, MatchConditions}
- DiameterMatchHead = #'3gpp_ro_CCR'{} | #'3gpp_ro_CCA'{} | #'3gpp_ro_RAR'{} | #'3gpp_ro_RAA'{} | #'3gpp_gx_CCR'{} | #'3gpp_gx_CCA'{} | #'3gpp_gx_RAR'{} | #'3gpp_gx_RAA'{}
- NrfMatchSpec = {NrfMatchHead, MatchConditions}
- NrfMatchHead = map()
- RatedMatchSpec = {RatedMatchHead, MatchConditions}
- RatedMatchHead = #rated{bucket_value = non_neg_integer() | undefined | '_', bucket_type = cents | octets | seconds | messages | undefined | '_', currency = string() | undefined | '_', is_billed = boolean() | '_', is_tax_exempt = boolean() | undefined | '_', tariff_type = atom() | undefined | '_', product = term() | undefined | '_', price_name = string() | undefined | '_', price_type = tariff | usage | event | undefined | '_', description = string() | undefined | '_', tax_excluded_amount = non_neg_integer() | undefined | '_', tax_included_amount = non_neg_integer() | undefined | '_', tax_rate = integer() | undefined | '_', usage_rating_tag = usage | included | non_included | undefined | '_'}
- MatchConditions = [tuple()]
- Result = {Continuation2, Events} | {error, Reason}
- Continuation2 = eof | disk_log:continuation()
- Events = [acct_event()]
- Reason = term()
Query accounting log events with filters.
The first time called Continuation should have the value start.
Events before Start or after Stop, or which do not match
the Protocol or one of the Types, are ignored.
Events which do not include Attribute in attributes are ignored.
If Match is '_' any attribute value will match or
{Operator, MatchValue} may be used for more complex queries.
All attribute filters must match or the event will be ignored.
Protocol, Types, or MatchSpec may be '_' which matches any value.
Returns a new Continuation and a list of matching accounting events.
Successive calls use the new Continuation to read more events.
auth_open() -> Result
- Result = ok | {error, Reason}
- Reason = term()
Open authorization event disk log.
auth_log(Protocol, Server, Client, Type, RequestAttributes, ResponseAttributes) -> Result
Write a RADIUS event to authorization log.
auth_log(Protocol, Server, Client, Request, Response) -> Result
Write a DIAMETER event to authorization log.
auth_query(Continuation, Start, End, Types, ReqAttrsMatch, RespAttrsMatch) -> Result
- Continuation = start | disk_log:continuation()
- Start = calendar:datetime() | timestamp()
- End = calendar:datetime() | timestamp()
- Types = [Type] | '_'
- Type = auth_type()
- ReqAttrsMatch = [{Attribute, Match}] | '_'
- RespAttrsMatch = [{Attribute, Match}] | '_'
- Attribute = byte()
- Match = {exact, term()} | {notexact, term()} | {lt, term()} | {lte, term()} | {gt, term()} | {gte, term()} | {regex, term()} | {like, [term()]} | {notlike, [term()]} | {in, [term()]} | {notin, [term()]} | {contains, [term()]} | {notcontain, [term()]} | {containsall, [term()]} | '_'
- Result = {Continuation2, Events} | {error, Reason}
- Continuation2 = eof | disk_log:continuation()
- Events = [auth_event()]
- Reason = term()
Equivalent to auth_query(Continuation,
Start,
End,
'_',
Types,
ReqAttrsMatch,
RespAttrsMatch).
Query access log events with filters.
auth_query(Continuation, Start, End, Protocol, Types, ReqAttrsMatch, RespAttrsMatch) -> Result
- Continuation = start | disk_log:continuation()
- Start = calendar:datetime() | timestamp()
- End = calendar:datetime() | timestamp()
- Protocol = protocol() | '_'
- Types = [Type] | '_'
- Type = auth_type()
- ReqAttrsMatch = [{Attribute, Match}] | '_'
- RespAttrsMatch = [{Attribute, Match}] | '_'
- Attribute = byte()
- Match = {exact, term()} | {notexact, term()} | {lt, term()} | {lte, term()} | {gt, term()} | {gte, term()} | {regex, term()} | {like, [term()]} | {notlike, [term()]} | {in, [term()]} | {notin, [term()]} | {contains, [term()]} | {notcontain, [term()]} | {containsall, [term()]} | '_'
- Result = {Continuation2, Events} | {error, Reason}
- Continuation2 = eof | disk_log:continuation()
- Events = [auth_event()]
- Reason = term()
Query access log events with filters.
The first time called Continuation should have the value start.
Events before Start or after Stop or which do not match
Protocol or one of the Types are ignored.
Events which do not include Attribute in request or response
attributes are ignored. If Match is '_' any attribute value
will match or {Operator, MatchValue} may be used for more
complex queries.
All attribute filters must match or the event will be ignored.
Protocol, Types, ReqAttrsMatch ResAttrsMatch may be
'_' which matches any value.
Returns a new Continuation and a list of matching access events.
Successive calls use the new Continuation to read more events.
auth_close() -> Result
- Result = ok | {error, Reason}
- Reason = term()
Close auth disk log.
http_query(Continuation, LogType, DateTime, Host, User, Method, URI, HTTPStatus) -> Result
- Continuation = start | disk_log:continuation()
- LogType = transfer | error | security
- DateTime = '_' | string()
- Host = '_' | string()
- User = '_' | string()
- Method = '_' | string()
- URI = '_' | string()
- HTTPStatus = '_' | string() | integer()
- Result = {Continuation2, Events} | {error, Reason}
- Continuation2 = eof | disk_log:continuation()
- Events = [http_event()]
- Reason = term()
Query http log events with filters
ipdr_log(Type, File, Start, End) -> Result
Log accounting records within range to new IPDR disk log.
Creates a new disk_log:log(),
or overwrites an existing, with filename File. The log starts
with a #ipdrDocWLAN{} | #ipdrDocVoIP{} header, is followed
by #ipdr_wlan{} | #ipdr_voip{} records, and ends with a
#ipdrDocEnd{} trailer.
The ocs_acct log is searched for events created between Start
and End which may be given as
{{Year, Month, Day}, {Hour, Minute, Second}} or the native
erlang:system_time(millisecond).
ipdr_file(Type, LogFile, Format) -> Result
- Type = wlan | voip
- LogFile = file:filename()
- Format = xml | xdr | csv
- Result = ok | {error, Reason}
- Reason = term()
Export internal IPDR disk log.
Creates a file named LogFile.Format with the details from the
disk_log:log() file LogFile
created previously with ipdr_log/3.
get_range(Log, Start, End) -> Result
Get all events in a log within a date/time range.
dump_file(Log, FileName) -> Result
Write all logged events to a file.
http_file(Log, FileName) -> Result
- Log = transfer | error | security
- FileName = file:filename()
- Result = ok | {error, Reason}
- Reason = term()
Write events logged by httpd to a file.
httpd_logname(LogType) -> disk_log:log()
- LogType = transfer | error | security
Find local name of httpd disk_log.
last(Log, MaxItems) -> Result
- Log = disk_log:log()
- MaxItems = pos_integer()
- Result = {NumItems, Items} | {error, Reason}
- NumItems = non_neg_integer()
- Items = [term()]
- Reason = term()
Get the last MaxItems events in most recent item first order.
Convert between Unix epoch timestamp and OTP date and time.
iso8601(DateTime) -> DateTime
Convert between ISO 8601 and Unix epoch milliseconds.
Parsing is not strict to allow prefix matching.
abmf_open() -> Result
- Result = ok | {error, Reason}
- Reason = term()
Open balance activity event disk log.
abmf_log(Type, ServiceId, Bucket, Units, Product, Amount, AmountBefore, AmountAfter, Validity, Channel, Requestor, RelatedParty, PaymentMeans, Action, Status) -> Result
- Type = topup | adjustment | delete | deduct | reserve | unreserve | transfer
- ServiceId = undefined | binary()
- Bucket = string()
- Units = cents | seconds | octets | messages
- Product = string()
- Amount = integer()
- AmountBefore = integer() | undefined
- AmountAfter = integer() | undefined
- Validity = undefined | timestamp()
- Channel = undefined | string()
- Requestor = undefined | [{Id, Role, Name}]
- RelatedParty = undefined | [{Id, Role, Name}]
- PaymentMeans = undefined | string()
- Action = undefined | string()
- Status = undefined | term()
- Id = string()
- Role = string()
- Name = string()
- Result = ok | {error, Reason}
- Reason = term()
Write a balance activity log event.
abmf_query(Continuation, Start, End, Type, Subscriber, Bucket, Units, Product) -> Result
- Continuation = start | disk_log:continuation()
- Start = calendar:datetime() | timestamp()
- End = calendar:datetime() | timestamp()
- Type = [{type, {MatchType, TypeValue}}] | '_'
- TypeValue = deduct | reserve | unreserve | transfer | topup | adjustment | '_'
- Subscriber = [{subscriber, {MatchType, SubscriberValue}}] | '_'
- SubscriberValue = binary() | '_'
- Bucket = [{bucket, {MatchType, BucketValue}}] | '_'
- BucketValue = string() | '_'
- Units = [{units, {MatchType, UnitsValue}}] | '_'
- UnitsValue = cents | seconds | octets | messages | '_'
- Product = [{product, {MatchType, ProductValue}}] | '_'
- ProductValue = string() | '_'
- MatchType = exact | like
- Result = {Continuation2, Events} | {error, Reason}
- Continuation2 = eof | disk_log:continuation()
- Events = [abmf_event()]
- Reason = term()
Query balance activity log events with filters.
auth_to_ecs(Event) -> ECS
Convert auth_event to ECS.
acct_to_ecs(Event) -> ECS
Convert auth_event to ECS.
btree_search(Log, Start) -> Result
Binary tree search of multi file wrap disk_log.
ipdr_codec(Event) -> IPDRs
- Event = tuple()
- IPDRs = [IPDR]
- IPDR = #ipdr_wlan{ipdrCreationTime = string() | undefined, seqNum = non_neg_integer() | undefined, username = string() | undefined, scIdType = 1..3 | undefined, scId = string() | undefined, homeServiceProviderType = 1..4 | undefined, homeServiceProvider = string() | undefined, acctSessionId = string() | undefined, userIpAddress = string() | undefined, callingStationId = string() | undefined, calledStationId = string() | undefined, nasIpAddress = string() | undefined, nasId = string() | undefined, accessProviderType = 1..4 | undefined, accessServiceProvider = string() | undefined, locationName = string() | undefined, locationId = string() | undefined, locationType = string() | undefined, locationCountryCode = string() | undefined, locationStateProvince = string() | undefined, locationCity = string() | undefined, locationGeocode = string() | undefined, locationGeocodeType = string() | undefined, nasPortType = 0..19 | undefined, paymentType = 1..3 | undefined, networkConnectionType = string() | undefined, sessionDuration = pos_integer() | undefined, inputOctets = pos_integer() | undefined, outputOctets = pos_integer() | undefined, class = string() | undefined, gmtSessionStartDateTime = string() | undefined, gmtSessionEndDateTime = string() | undefined, sessionTerminateCause = 1..7 | undefined, billingClassOfService = string() | undefined, unitOfMeasure = 1..7 | undefined, chargeableUnit = 1..7 | undefined, chargeableQuantity = pos_integer() | undefined, chargeAmount = pos_integer() | undefined, chargeCurrencyType = string() | undefined, bucketType = cents | octets | seconds | messages | undefined, bucketValue = non_neg_integer() | undefined, tariffType = atom() | undefined, product = term() | undefined, priceType = tariff | usage | event | undefined, usageRating = usage | included | non_included | undefined, otherParty = string() | undefined, taxPercentage = 0..100 | undefined, taxAmount = pos_integer() | undefined, taxType = 1..14 | undefined, intermediaryName = string() | undefined, serviceName = 1..6 | undefined, relatedIpdrIdList = string() | undefined, tempUserId = string() | undefined} | #ipdr_voip{ipdrCreationTime = string() | undefined, seqNum = non_neg_integer() | undefined, seizeTime = string() | undefined, startTime = string() | undefined, endTime = string() | undefined, timeZoneOffset = integer() | undefined, callCompletionCode = integer() | string() | undefined, originalDestinationId = string() | undefined, hostName = string() | undefined, subscriberId = string() | undefined, uniqueCallID = string() | undefined, ipAddress = string() | undefined, imisIngress = integer() | undefined, esnIngress = integer() | undefined, callProgressState = 1..8 | undefined, disconnectReason = integer() | string() | undefined, destinationID = string() | undefined, thirdPartyID = string() | undefined, ani = string() | undefined, oLIiiDigit = string() | undefined, pin = string() | undefined, serviceConsumerType = string() | undefined, startAccessTime = string() | undefined, endAccessTime = string() | undefined, callSetupDuration = integer() | undefined, callDuration = integer() | undefined, totalDuration = integer() | undefined, tearDownDuration = integer() | undefined, averagePacketLatency = integer() | undefined, type = string() | undefined, paymentType = string() | undefined, bucketType = cents | octets | seconds | messages | undefined, bucketValue = non_neg_integer() | undefined, tariffType = atom() | undefined, product = term() | undefined, priceType = tariff | usage | event | undefined, usageRating = usage | included | non_included | undefined, chargeAmount = pos_integer() | undefined, feature = string() | undefined, incommingCodec = string() | undefined, outgoingCodec = string() | undefined, silenceCompressionMode = string() | undefined, modem = string() | undefined, supplementaryService = string() | undefined, extendedReasonCode = string() | undefined, disconnectLocation = string() | undefined, proprietaryErrorCode = integer() | undefined, unitsConsumed = integer() | undefined, inboundByteCount = integer() | undefined, outboundByteCount = integer() | undefined, inboundPacketCount = integer() | undefined, outboundPacketCount = integer() | undefined, inboundLostPacketCount = integer() | undefined, outboundLostPacketCount = integer() | undefined, inboundRxmtPacketCount = integer() | undefined, outboundRxmtPacketCount = integer() | undefined, subscribedQoSClasses = 1..4 | undefined, callClarityIndex = 1..5 | undefined, voiceQualityIndex = 1..5 | undefined, transmissionRatingRFactor = 1..100 | undefined, userPercivedRFactor = 1..100 | undefined, packetLossPercentage = integer() | undefined, outOfSequencePackets = integer() | undefined, correctSequencePackets = integer() | undefined, packetDelayVariation = integer() | undefined, ipAddressIngressDevice = string() | undefined, portNumber = string() | undefined, imsiEgress = string() | undefined, esnEgress = string() | undefined, homeLocationIdIngress = string() | undefined} | undefined
Convert ocs_acct log entry to IPDR log entry.
ipdr_ims(ServiceType, Protocol, TimeStamp, ReqType, Req, Res, Rated) -> IPDR
- ServiceType = binary()
- Protocol = diameter | nrf
- TimeStamp = timestamp()
- ReqType = stop
- Req = #'3gpp_ro_CCR'{}
- Res = #'3gpp_ro_CCA'{}
- Rated = [#rated{bucket_value = non_neg_integer() | undefined | '_', bucket_type = cents | octets | seconds | messages | undefined | '_', currency = string() | undefined | '_', is_billed = boolean() | '_', is_tax_exempt = boolean() | undefined | '_', tariff_type = atom() | undefined | '_', product = term() | undefined | '_', price_name = string() | undefined | '_', price_type = tariff | usage | event | undefined | '_', description = string() | undefined | '_', tax_excluded_amount = non_neg_integer() | undefined | '_', tax_included_amount = non_neg_integer() | undefined | '_', tax_rate = integer() | undefined | '_', usage_rating_tag = usage | included | non_included | undefined | '_'}] | undefined
- IPDR = #ipdr_voip{ipdrCreationTime = string() | undefined, seqNum = non_neg_integer() | undefined, seizeTime = string() | undefined, startTime = string() | undefined, endTime = string() | undefined, timeZoneOffset = integer() | undefined, callCompletionCode = integer() | string() | undefined, originalDestinationId = string() | undefined, hostName = string() | undefined, subscriberId = string() | undefined, uniqueCallID = string() | undefined, ipAddress = string() | undefined, imisIngress = integer() | undefined, esnIngress = integer() | undefined, callProgressState = 1..8 | undefined, disconnectReason = integer() | string() | undefined, destinationID = string() | undefined, thirdPartyID = string() | undefined, ani = string() | undefined, oLIiiDigit = string() | undefined, pin = string() | undefined, serviceConsumerType = string() | undefined, startAccessTime = string() | undefined, endAccessTime = string() | undefined, callSetupDuration = integer() | undefined, callDuration = integer() | undefined, totalDuration = integer() | undefined, tearDownDuration = integer() | undefined, averagePacketLatency = integer() | undefined, type = string() | undefined, paymentType = string() | undefined, bucketType = cents | octets | seconds | messages | undefined, bucketValue = non_neg_integer() | undefined, tariffType = atom() | undefined, product = term() | undefined, priceType = tariff | usage | event | undefined, usageRating = usage | included | non_included | undefined, chargeAmount = pos_integer() | undefined, feature = string() | undefined, incommingCodec = string() | undefined, outgoingCodec = string() | undefined, silenceCompressionMode = string() | undefined, modem = string() | undefined, supplementaryService = string() | undefined, extendedReasonCode = string() | undefined, disconnectLocation = string() | undefined, proprietaryErrorCode = integer() | undefined, unitsConsumed = integer() | undefined, inboundByteCount = integer() | undefined, outboundByteCount = integer() | undefined, inboundPacketCount = integer() | undefined, outboundPacketCount = integer() | undefined, inboundLostPacketCount = integer() | undefined, outboundLostPacketCount = integer() | undefined, inboundRxmtPacketCount = integer() | undefined, outboundRxmtPacketCount = integer() | undefined, subscribedQoSClasses = 1..4 | undefined, callClarityIndex = 1..5 | undefined, voiceQualityIndex = 1..5 | undefined, transmissionRatingRFactor = 1..100 | undefined, userPercivedRFactor = 1..100 | undefined, packetLossPercentage = integer() | undefined, outOfSequencePackets = integer() | undefined, correctSequencePackets = integer() | undefined, packetDelayVariation = integer() | undefined, ipAddressIngressDevice = string() | undefined, portNumber = string() | undefined, imsiEgress = string() | undefined, esnEgress = string() | undefined, homeLocationIdIngress = string() | undefined}
CODEC for IMS VOIP
To do
ipdr_ims_voip(Protocol, TimeStamp, ReqType, Req, Res, Rated) -> IPDR
- Protocol = diameter | nrf
- TimeStamp = timestamp()
- ReqType = stop
- Req = #'3gpp_ro_CCR'{} | map()
- Res = #'3gpp_ro_CCA'{} | map()
- Rated = [#rated{bucket_value = non_neg_integer() | undefined | '_', bucket_type = cents | octets | seconds | messages | undefined | '_', currency = string() | undefined | '_', is_billed = boolean() | '_', is_tax_exempt = boolean() | undefined | '_', tariff_type = atom() | undefined | '_', product = term() | undefined | '_', price_name = string() | undefined | '_', price_type = tariff | usage | event | undefined | '_', description = string() | undefined | '_', tax_excluded_amount = non_neg_integer() | undefined | '_', tax_included_amount = non_neg_integer() | undefined | '_', tax_rate = integer() | undefined | '_', usage_rating_tag = usage | included | non_included | undefined | '_'}] | undefined
- IPDR = #ipdr_voip{ipdrCreationTime = string() | undefined, seqNum = non_neg_integer() | undefined, seizeTime = string() | undefined, startTime = string() | undefined, endTime = string() | undefined, timeZoneOffset = integer() | undefined, callCompletionCode = integer() | string() | undefined, originalDestinationId = string() | undefined, hostName = string() | undefined, subscriberId = string() | undefined, uniqueCallID = string() | undefined, ipAddress = string() | undefined, imisIngress = integer() | undefined, esnIngress = integer() | undefined, callProgressState = 1..8 | undefined, disconnectReason = integer() | string() | undefined, destinationID = string() | undefined, thirdPartyID = string() | undefined, ani = string() | undefined, oLIiiDigit = string() | undefined, pin = string() | undefined, serviceConsumerType = string() | undefined, startAccessTime = string() | undefined, endAccessTime = string() | undefined, callSetupDuration = integer() | undefined, callDuration = integer() | undefined, totalDuration = integer() | undefined, tearDownDuration = integer() | undefined, averagePacketLatency = integer() | undefined, type = string() | undefined, paymentType = string() | undefined, bucketType = cents | octets | seconds | messages | undefined, bucketValue = non_neg_integer() | undefined, tariffType = atom() | undefined, product = term() | undefined, priceType = tariff | usage | event | undefined, usageRating = usage | included | non_included | undefined, chargeAmount = pos_integer() | undefined, feature = string() | undefined, incommingCodec = string() | undefined, outgoingCodec = string() | undefined, silenceCompressionMode = string() | undefined, modem = string() | undefined, supplementaryService = string() | undefined, extendedReasonCode = string() | undefined, disconnectLocation = string() | undefined, proprietaryErrorCode = integer() | undefined, unitsConsumed = integer() | undefined, inboundByteCount = integer() | undefined, outboundByteCount = integer() | undefined, inboundPacketCount = integer() | undefined, outboundPacketCount = integer() | undefined, inboundLostPacketCount = integer() | undefined, outboundLostPacketCount = integer() | undefined, inboundRxmtPacketCount = integer() | undefined, outboundRxmtPacketCount = integer() | undefined, subscribedQoSClasses = 1..4 | undefined, callClarityIndex = 1..5 | undefined, voiceQualityIndex = 1..5 | undefined, transmissionRatingRFactor = 1..100 | undefined, userPercivedRFactor = 1..100 | undefined, packetLossPercentage = integer() | undefined, outOfSequencePackets = integer() | undefined, correctSequencePackets = integer() | undefined, packetDelayVariation = integer() | undefined, ipAddressIngressDevice = string() | undefined, portNumber = string() | undefined, imsiEgress = string() | undefined, esnEgress = string() | undefined, homeLocationIdIngress = string() | undefined}
ipdr_wlan(Protocol, TimeStamp, ReqType, Req, Res, Rated) -> IPDRWlan
- Protocol = radius | diameter | nrf
- TimeStamp = timestamp()
- ReqType = stop
- Req = [tuple()] | #'3gpp_ro_CCR'{} | map() | undefined
- Res = [tuple()] | #'3gpp_ro_CCA'{} | map() | undefined
- Rated = #rated{bucket_value = non_neg_integer() | undefined | '_', bucket_type = cents | octets | seconds | messages | undefined | '_', currency = string() | undefined | '_', is_billed = boolean() | '_', is_tax_exempt = boolean() | undefined | '_', tariff_type = atom() | undefined | '_', product = term() | undefined | '_', price_name = string() | undefined | '_', price_type = tariff | usage | event | undefined | '_', description = string() | undefined | '_', tax_excluded_amount = non_neg_integer() | undefined | '_', tax_included_amount = non_neg_integer() | undefined | '_', tax_rate = integer() | undefined | '_', usage_rating_tag = usage | included | non_included | undefined | '_'} | undefined
- IPDRWlan = #ipdr_wlan{ipdrCreationTime = string() | undefined, seqNum = non_neg_integer() | undefined, username = string() | undefined, scIdType = 1..3 | undefined, scId = string() | undefined, homeServiceProviderType = 1..4 | undefined, homeServiceProvider = string() | undefined, acctSessionId = string() | undefined, userIpAddress = string() | undefined, callingStationId = string() | undefined, calledStationId = string() | undefined, nasIpAddress = string() | undefined, nasId = string() | undefined, accessProviderType = 1..4 | undefined, accessServiceProvider = string() | undefined, locationName = string() | undefined, locationId = string() | undefined, locationType = string() | undefined, locationCountryCode = string() | undefined, locationStateProvince = string() | undefined, locationCity = string() | undefined, locationGeocode = string() | undefined, locationGeocodeType = string() | undefined, nasPortType = 0..19 | undefined, paymentType = 1..3 | undefined, networkConnectionType = string() | undefined, sessionDuration = pos_integer() | undefined, inputOctets = pos_integer() | undefined, outputOctets = pos_integer() | undefined, class = string() | undefined, gmtSessionStartDateTime = string() | undefined, gmtSessionEndDateTime = string() | undefined, sessionTerminateCause = 1..7 | undefined, billingClassOfService = string() | undefined, unitOfMeasure = 1..7 | undefined, chargeableUnit = 1..7 | undefined, chargeableQuantity = pos_integer() | undefined, chargeAmount = pos_integer() | undefined, chargeCurrencyType = string() | undefined, bucketType = cents | octets | seconds | messages | undefined, bucketValue = non_neg_integer() | undefined, tariffType = atom() | undefined, product = term() | undefined, priceType = tariff | usage | event | undefined, usageRating = usage | included | non_included | undefined, otherParty = string() | undefined, taxPercentage = 0..100 | undefined, taxAmount = pos_integer() | undefined, taxType = 1..14 | undefined, intermediaryName = string() | undefined, serviceName = 1..6 | undefined, relatedIpdrIdList = string() | undefined, tempUserId = string() | undefined}
CODEC for IPDR Wlan
http_parse(Event) -> any()
open_log(Directory, Log, LogSize, LogFiles) -> Result
- Directory = string()
- Log = term()
- LogSize = integer()
- LogFiles = integer()
- Result = ok | {error, Reason}
- Reason = term()
open disk log file
write_log(Log, Event) -> Result
- Log = atom()
- Event = list()
- Result = ok | {error, Reason}
- Reason = term()
write event into given log file
close_log(Log) -> Result
- Log = atom()
- Result = ok | {error, Reason}
- Reason = term()
close log files
query_log(Continuation, Start, End, Log, MFA) -> Result
Filter events by Start and End.
acct_query(Continuation, Protocol, Types, Matches) -> Result
- Continuation = {Continuation2, Events}
- Continuation2 = eof | disk_log:continuation()
- Events = [acct_event()]
- Protocol = protocol() | [protocol()] | '_'
- Types = [Type] | '_'
- Type = start | interim | stop | event | on | off
- Matches = [Match] | '_'
- Match = RadiusMatch | DiameterMatchSpec | NrfMatchSpec | RatedMatchSpec
- RadiusMatch = {Attribute, AttributeMatch}
- Attribute = byte()
- AttributeMatch = {exact, term()} | {notexact, term()} | {lt, term()} | {lte, term()} | {gt, term()} | {gte, term()} | {regex, term()} | {like, [term()]} | {notlike, [term()]} | {in, [term()]} | {notin, [term()]} | {contains, [term()]} | {notcontain, [term()]} | {containsall, [term()]}
- DiameterMatchSpec = {DiameterMatchHead, MatchConditions}
- DiameterMatchHead = #'3gpp_ro_CCR'{} | #'3gpp_ro_CCA'{} | #'3gpp_ro_RAR'{} | #'3gpp_ro_RAA'{} | #'3gpp_gx_CCR'{} | #'3gpp_gx_CCA'{} | #'3gpp_gx_RAR'{} | #'3gpp_gx_RAA'{}
- NrfMatchSpec = {NrfMatchHead, MatchConditions}
- NrfMatchHead = map()
- RatedMatchSpec = {RatedMatchHead, MatchConditions}
- RatedMatchHead = #rated{bucket_value = non_neg_integer() | undefined | '_', bucket_type = cents | octets | seconds | messages | undefined | '_', currency = string() | undefined | '_', is_billed = boolean() | '_', is_tax_exempt = boolean() | undefined | '_', tariff_type = atom() | undefined | '_', product = term() | undefined | '_', price_name = string() | undefined | '_', price_type = tariff | usage | event | undefined | '_', description = string() | undefined | '_', tax_excluded_amount = non_neg_integer() | undefined | '_', tax_included_amount = non_neg_integer() | undefined | '_', tax_rate = integer() | undefined | '_', usage_rating_tag = usage | included | non_included | undefined | '_'}
- MatchConditions = [tuple()]
- Result = {Continuation2, Events}
Continue query of accounting log events.
auth_query(Continuation, Protocol, Types, ReqAttrsMatch, RespAttrsMatch) -> Result
- Continuation = {Continuation2, Events}
- Protocol = radius | diameter | '_'
- Types = [Type] | '_'
- Type = atom()
- ReqAttrsMatch = [tuple()] | '_'
- RespAttrsMatch = [tuple()] | '_'
- Result = {Continuation2, Events}
- Continuation2 = eof | disk_log:continuation()
- Events = [acct_event()]
Continue query of authentication log events.
abmf_query(Continuation, Type, Subscriber, Bucket, Units, Product) -> Result
- Continuation = {Continuation2, Events}
- Continuation2 = eof | disk_log:continuation()
- Events = [abmf_event()]
- Type = [{type, {MatchType, TypeValue}}] | '_'
- TypeValue = deduct | reserve | unreserve | transfer | topup | adjustment | '_'
- Subscriber = [{subscriber, {MatchType, SubscriberValue}}] | '_'
- SubscriberValue = binary() | '_'
- Bucket = [{bucket, {MatchType, BucketValue}}] | '_'
- BucketValue = string() | '_'
- Units = [{units, {MatchType, UnitsValue}}] | '_'
- UnitsValue = cents | seconds | octets | messages | '_'
- Product = [{product, {MatchType, ProductValue}}] | '_'
- ProductValue = string() | '_'
- MatchType = exact | like
- Result = {Continuation2, Events}
Continue query of balance activity log events.
Generated by EDoc