Vous êtes sur la page 1sur 30

rtBilling™

CBOSS rtBilling 21.00.00


REAL-TIME BILLING SYSTEM

Hot Billing API


PROGRAMMER'S REFERENCE GUIDE
REVISION 1.0

CBOSS Oy

2015
CBOSS rtBilling. Real-Time Billing System. Hot Billing API Programmer's Reference Guide Release 21.00.00
Copyright ©2005- 2015 CBOSS Oy. All rights reserved
This document contains information relevant as of the documents creation date. CBOSS Oy does not warrant that this document has
no misprints or omissions. CBOSS Oy reserves the right to modify the document without prior notification.
No part of this document may be reproduced or transferred in any form or by any means without prior permission in writing from
CBOSS Oy. rtBilling is a registered trademark of CBOSS Oy. CBOSSbcc is a registered trademark of CJSC CBOSS. These
trademarks are the intellectual property of CBOSS Oy and CJSC CBOSS and are protected by applicable legislation.
All other products or company names are used for reference only and may be proprietary to their respective holders.

Confidential
Table of contents
Introduction...........................................................................................................6
1. Overview of Hot Billing API...............................................................................8
2. Event descriptions.............................................................................................9
2.1 SMS-MO events.....................................................................................9
2.1.1 Required fields................................................................................9
2.1.2 Optional fields.................................................................................9
2.2 SMS-MT events....................................................................................10
2.2.1 Required fields..............................................................................10
2.2.2 Optional fields...............................................................................11
2.3 Time-based data events.......................................................................12
2.3.1 Required fields..............................................................................12
2.3.2 Optional fields...............................................................................12
2.4 Volume-based data events..................................................................13
2.4.1 Required fields..............................................................................13
2.4.2 Optional fields...............................................................................14
2.5 Application events................................................................................14
2.5.1 Required fields..............................................................................14
2.5.2 Optional fields...............................................................................15
2.6 Voice-MO events..................................................................................16
2.6.1 Required fields..............................................................................16
2.6.2 Optional fields...............................................................................16
2.7 Voice-MT events..................................................................................17
2.7.1 Required fields..............................................................................17
2.7.2 Optional fields...............................................................................18
3. Interface description........................................................................................20
3.1 Data structures.....................................................................................20
3.1.1 File header structure xdr_header_type.........................................20
3.1.2 Hot Billing data structure xdr_info_type........................................20
3.2 Function calls and usage.....................................................................25

Confidential
4

3.2.1 XDR_open_file()...........................................................................25
3.2.2 XDR_write_file()............................................................................25
3.2.3 XDR_close_file()...........................................................................25
3.2.4 XDR_cv_to_timeval()....................................................................25
3.2.5 XDR_convert_string_timeval()......................................................26
Appendix A: Examples........................................................................................27
Revisions.............................................................................................................30

Confidential
Send us your comments
CBOSS rtBilling 21.00.00. Real-Time Billing System. Hot Billing API.
Programmer's Reference Guide. Revision 1.0
We welcome your comments and suggestions on the quality and usefulness of this publication.
Your feedback is an important part of the information used for revision.
If you find any errors or have any suggestions for improvement, please let us know. Please
specify the document in question, chapter, section and page number. You can contact us by
using either of the following methods:
▪ In case of an error: send a trouble ticket to technical support
▪ In case of improvements: send an e-mail to Publications@cboss.fi

Confidential
Introduction

Purpose
The purpose of this document is to define the usage of rtBilling Hot Billing API.

Intended audience
This guide is intended for customer and third party developers.

What is new?
In rtB20.00.00, the following changes have taken place:
LTE Rel 10 enhancements to 3GPP Diameter:
▪ rat_type and tai_location added to 3.1.2 Hot Billing data structure xdr_info_type
▪ a_switch_id_type: id types list updated

Structure
Introduction highlights the audience for which this document is intended, an abbreviations list
and the notation conventions used in creating this guide.
Chapter 1, Overview of Hot Billing API gives a brief introduction to Hot Billing API.
Chapter 2, Event description describes Hot Billing API events.
Chapter 3, Interface description describes the data structures and function calls.

Acronyms

Acronym Description
API Application Programming Interface
APN Access Point Name
FRS Feature Requirements Specification
GMT Greenwich Mean Time
GSM Global System for Mobile communications
HPLMN Home Public Land Mobile Network
IN Intelligent Network
MG Management Gateway
MSISDN Mobile Station ISDN Number
SCP Service Control Point
SDR Service Detail Record
SP Service Provider
SPE Subscriber Provisioning Environment

Confidential
7 Introduction

Acronym Description
SPid Service Provider ID
SQL Structured Query Language
TP Transaction Processor
UTC Coordinated Universal Time

Notation conventions
The following summarises the notation conventions for syntax presentation in this guide.
General styles in use:

Style Description Example


Bold Bold is used to refer to screen texts, field and In the File menu, select Open. Click
but-ton names, menus, menu items and so on OK.
Italic Italic is used to refer to other material For more information, see the MG
Installation Guide
Underline Underlining is used for URLs and email The Java package can be downloaded
addresses from http://java.sun.com/j2se/

Notation conventions for on-screen computer output, user input, code excerpts and so on:

Style Description Example


Courier Used in names of commands, files VOLUME [\system-name.]
and directories and in on-screen $volume.subvolume
computer output
Courier bold Used in text the user types, Start instance installation with the
contrasted with on-screen computer cre_instance command:
output % ./cre_instance
Courier italic Used in command-line placeholder, Log in as root user and enter the
to be replaced with a real name or password when prompted.
value Login: root
Password: password

Punctuation
Parentheses, commas, semicolons, and other symbols must be entered as they appear in the
guide.

Confidential
1. Overview of Hot Billing API

Hot Billing API consists of I/O interface library and accompanied structure definitions. This
library provides a simple file-based interface for hot billing event production.
Prerequisites
Hot Billing API requires that Informix C-ISAM 7 has been installed in the development
environment.

Confidential
2. Event descriptions

This chapter describes the required and optional field values of each event.

2.1 SMS-MO events

2.1.1 Required fields


Field Type Value
version short See section 3.1.2
record_number long See section 3.1.2
external_record_type char[5] See section 3.1.2
event_type char[5] 3 SMS
direction char[5] 0 Originating event
msisdn char[32] MSISDN charged for the event. Has to be in the same format
as the subscriber in the MG database
originating_address char[100] Same as MSISDN. Can also be in international format, if
subscribers are in international format in the MG database
destination_address char[100] B party of the event. MSISDN in SUB format or international
format, if subscribers are in international format in the MG
database
call_class char[5] For voice, data and SMS. Mandatory
call_type char[5] 3 SMS
call_status char[5] ▪ 1 Connected
▪ 2 Disconnected OK
▪ 3 Disconnected with error

sub_type char[5] 0 Normal

2.1.2 Optional fields


There are more optional fields in section 3.1.2. These are the ones that affect rating.

Field Type Value


msc_id char[50] Id of the switch or cell. Needed for processing roaming SMS

Confidential
10 Event descriptions

Field Type Value


a_switch_id_type char[5] Id type of the switch or cell. Needed for processing roaming
SMS
▪ 0 location id
▪ 1 Cell ID
▪ 2 GT address
▪ 3 MSCID

roaming_indicator char[5] ▪ 0 not roaming


▪ 1 roaming
Default = 0. If not given, the HPLMN value from the switch
location table is used to determine roaming
cell_id char [32] Cell identifier
time_offset long Default = time offset of MG local time from UTC
start_time timeval Default = current time
end_time timeval Default = current time. If given, must be the same as
start_time
number_of_events char[5] The number of events to be rated. The default is 1
original_file_id char[80] If you want to have the file name in the CDRs, enter it here
nw_bearer_id_type char[5] Defines the type of the bearer identification. The values are:
▪ 0 = Network Bearer ID is a textual ID, e.g. data9600
(default)
▪ 1 = Network Bearer ID is Bearer Capability
▪ 2 = Network Bearer ID is Bearer Service Code
nw_bearer_id_value char[20] Bearer Capability or Bearer Service Code value used in the
network
bearer_capability char[5] Default = 0. Used if feature BEARERCAPABILITY is off. If
BEARERCAPABILITY is on, then use either
bearer_capability or
nw_bearer_id_type and nw_bearer_id_value

2.2 SMS-MT events

2.2.1 Required fields


Field Type Value
version short See section 3.1.2
record_number long See section 3.1.2
external_record_type char[5] See section 3.1.2
event_type char[5] 3 SMS
direction char[5] 1 Terminating event
msisdn char[32] MSISDN charged for the event
originating_address char[100] A party of the event
destination_address char[100] Same as MSISDN
call_class char[5] For voice, data and SMS. Mandatory
call_type char[5] 3 SMS

Confidential
11 Event descriptions

Field Type Value


call_status char[5] ▪ 1 Connected
▪ 2 Disconnected OK
▪ 3 Disconnected with error
sub_type char[5] 0 Normal

2.2.2 Optional fields


There are more optional fields in section 3.1.2. These are the ones that affect rating.

Field Type Value


msc_id char[50] Id of the switch or cell. Needed for processing roaming SMS
a_switch_id_type char[5] Id type of the switch or cell. Needed for processing roaming
SMS
▪ 0 location id
▪ 1 Cell ID
▪ 2 GT address
▪ 3 MSCID
cell_id char [32] Cell identifier
roaming_indicator char[5] ▪ 0 not roaming
▪ 1 roaming
Default = 0. If not given, the HPLMN value from the switch
location table is used to determine roaming
time_offset long Default = time offset of MG local time from UTC
start_time timeval Default = current time
end_time timeval Default = current time. If given, must be same as
start_time
original_file_id char[80] If you want to have the file name in the CDRs, you must enter
it here
number_of_events char[5] The number of events to be rated. The default is 1
nw_bearer_id_type char[5] Defines the type of the bearer identification. The values are:
▪ 0 = Network Bearer ID is a textual ID, e.g. data9600
(default)
▪ 1 = Network Bearer ID is Bearer Capability
▪ 2 = Network Bearer ID is Bearer Service Code
nw_bearer_id_value char[20] Bearer Capability or Bearer Service Code value used in the
network
bearer_capability char[5] Default = 0. Used if feature BEARERCAPABILITY is off. If
BEARERCAPABILITY is on, then use either
bearer_capability or
nw_bearer_id_type and nw_bearer_id_value

Confidential
12 Event descriptions

2.3 Time-based data events

2.3.1 Required fields


Field Type Value
version short See section 3.1.2
record_number long See section 3.1.2
external_record_type char[5] See section 3.1.2
event_type char[5] 2 Data
direction char[5] 0 Originating event
msisdn char[32] MSISDN charged for the event. Has to be in the same format
as the subscriber in the MG database
originating_address char[100] Same as MSISDN. Can also be in international format, if
subscribers are in international format in the MG database
destination_address char[100] B party of the event. MSISDN in SUB format or international
format, if subscribers are in international format in the MG
database
call_class char[5] For voice, data and SMS. Mandatory
call_type char[5] 1 Normal Call
call_status char[5] ▪ 1 Connected
▪ 2 Disconnected OK
▪ 3 Disconnected with error
sub_type char[5] 0 Normal
duration long Duration in seconds of the event if time-based charging

2.3.2 Optional fields


There are more optional fields in section 3.1.2. These are the ones that affect rating.

Field Type Value


msc_id char[50] Id of the switch or cell
a_switch_id_type char[5] Id type of the switch or cell. Needed for processing roaming
calls.
▪ 0 location id
▪ 1 Cell ID
▪ 2 GT address
▪ 3 MSCID
cell_id char [32] Cell identifier
destination_address_type char[5] Destination address type
▪ 0 Any address
▪ 2 APN
See section 3.1.2 for more values
roaming_indicator char[5] ▪ 0 not roaming
▪ 1 roaming
Default = 0. If not given, the HPLMN value from the switch
location table is used to determine roaming

Confidential
13 Event descriptions

Field Type Value


time_offset long Default = time offset of MG local time from UTC
start_time timeval Default = current time
end_time timeval Default = start time + duration
original_file_id char[80] If you want to have the file name in the CDRs, you must enter
it here
nw_bearer_id_type char[5] Defines the type of the bearer identification.
The values are:
▪ 0 = Network Bearer ID is a textual ID, e.g. data9600
(default)
▪ 1 = Network Bearer ID is Bearer Capability
▪ 2 = Network Bearer ID is Bearer Service Code
nw_bearer_id_value char[20] Bearer Capability or Bearer Service Code value used in the
network
bearer_capability char[5] Default = 0. Used if feature BEARERCAPABILITY is off. If
BEARERCAPABILITY is on, then use either
bearer_capability or
nw_bearer_id_type and nw_bearer_id_value

2.4 Volume-based data events

2.4.1 Required fields


Field Type Value
version short See section 3.1.2
record_number long See section 3.1.2
external_record_type char[5] See section 3.1.2
event_type char[5] 2 Data
direction char[5] 0 Originating event
msisdn char[32] MSISDN charged for the event. Has to be in the same format
as the subscriber in the MG database
originating_address char[100] Same as MSISDN. Can also be in international format, if
subscribers are in international format in the MG database
destination_address char[100] B party of the event. MSISDN in SUB format or international
format, if subscribers are in international format in the MG
database
call_class char[5] For voice, data and SMS. Mandatory
call_type char[5] 1 Normal Call
call_status char[5] ▪ 1 Connected
▪ 2 Disconnected OK
▪ 3 Disconnected with error

sub_type char[5] 0 Normal


down_volume long Volume in kilobytes
up_volume long Volume in kilobytes

Confidential
14 Event descriptions

2.4.2 Optional fields


There are more optional fields in section 3.1.2. These are the ones that affect rating.

Field Type Value


msc_id char[50] Id of the switch or cell
a_switch_id_type char[5] Id type of the switch or cell. Needed for processing roaming
calls.
▪ 0 location id
▪ 1 Cell ID
▪ 2 GT address
▪ 3 MSCID

cell_id char [32] Cell identifier


destination_address_type char[5] Destination address type
▪ 0 Any address
▪ 2 APN
See section 3.1.2 for more values
roaming_indicator char[5] ▪ 0 not roaming
▪ 1 roaming
Default = 0. If not given, the HPLMN value from the switch
location table is used to determine roaming
time_offset long Default = time offset of MG local time from UTC
start_time timeval Default = current time
original_file_id char[80] If you want to have the file name in the CDRs, you must enter
it here
nw_bearer_id_type char[5] Defines the type of the bearer identification. The values are:
▪ 0 = Network Bearer ID is a textual ID, e.g. data9600
(default)
▪ 1 = Network Bearer ID is Bearer Capability
▪ 2 = Network Bearer ID is Bearer Service Code

nw_bearer_id_value char[20] Bearer Capability or Bearer Service Code value used in the
network
bearer_capability char[5] Default = 0. Used if feature BEARERCAPABILITY is off. If
BEARERCAPABILITY is on, then use either
bearer_capability or
nw_bearer_id_type and nw_bearer_id_value

2.5 Application events

2.5.1 Required fields


Field Type Value
version short See section 3.1.2
record_number long See section 3.1.2
external_record_type char[5] See section 3.1.2
event_type char[5] 4 Application event
direction char[5] 0 Originating event

Confidential
15 Event descriptions

Field Type Value


msisdn char[32] MSISDN charged for the event. Has to be in the same format
as the subscriber in the MG database
originating_address char[100] Same as MSISDN. Can also be in international format, if
subscribers are in international format in the MG database
destination_address char[100] B party of the event
call_type char[5] 1 Normal Call
sub_type char[5] 0 Normal

2.5.2 Optional fields


There are more optional fields in section 3.1.2. These are the ones that affect rating.

Field Type Value


msc_id char[50] Id of the switch or cell
a_switch_id_type char[5] Id type of the switch or cell. Needed for processing roaming
events.
▪ 0 location id
▪ 1 Cell ID
▪ 2 GT address
▪ 3 MSCID
cell_id char [32] Cell identifier
number_of_events char[5] The number of events to be rated. The default is 1
destination_address_type char[5] Destination address type
▪ 0 Any address
▪ 1 E-mail / MAILTO
▪ 2 APN
▪ 3 HTTP
▪ 4 HTTPS
▪ 5 FTP
▪ 6 NEWS/NNTP
▪ 7 Telnet
▪ 8 File
See section 3.1.2 for more values
roaming_indicator char[5] ▪ 0 not roaming
▪ 1 roaming
Default = 0. If not given, the HPLMN value from the switch
location table is used to determine roaming
time_offset long Default = time offset of MG local time from UTC
start_time timeval Default = current time
original_file_id char[80] If you want to have the file name in the CDRs, you must enter
it here
nw_bearer_id_type char[5] Defines the type of the bearer identification. The values are:
▪ 0 = Network Bearer ID is a textual ID, e.g. data9600
(default)
▪ 1 = Network Bearer ID is Bearer Capability
▪ 2 = Network Bearer ID is Bearer Service Code

Confidential
16 Event descriptions

Field Type Value


nw_bearer_id_value char[20] Bearer Capability or Bearer Service Code value used in the
network
bearer_capability char[5] Default = 0. Used if feature BEARERCAPABILITY is off. If
BEARERCAPABILITY is on, then use either
bearer_capability or
nw_bearer_id_type and nw_bearer_id_value

2.6 Voice-MO events

2.6.1 Required fields


Field Type Value
version short See section 3.1.2
record_number long See section 3.1.2
external_record_type char[5] See section 3.1.2
event_type char[5] 1 Voice
direction char[5] 0 Originating event
msisdn char[32] MSISDN charged for the event. Has to be in the same format
as the subscriber in the MG database
originating_address char[100] A party of the event
destination_address char[100] B party of the event. MSISDN in SUB format or international
format, if subscribers are in international format in the MG
database
call_class char[5] For voice, data and SMS. Mandatory
call_type char[5] ▪ 1 Normal Call
▪ 2 First Call
▪ 5 Ringback Call
▪ 10 Voice Mail
▪ 11 Forwarded Call
call_status char[5] ▪ 1 Connected
▪ 2 Disconnected OK
▪ 3 Disconnected with error

sub_type char[5] 0 Normal


duration long Duration in seconds of the event if time-based charging

2.6.2 Optional fields


There are more optional fields in section 3.1.2. These are the ones that affect rating.

Field Type Value


msc_id char[50] Id of the switch or cell
a_switch_id_type char[5] Id type of the switch or cell. Needed for processing roaming
calls.
▪ 0 location id

Confidential
17 Event descriptions

Field Type Value

▪ 1 Cell ID
▪ 2 GT address
▪ 3 MSCID
cell_id char [32] Cell identifier
destination_address_type char[5] Destination address type
▪ 0 Any address
▪ 2 APN
See section 3.1.2 for more values
roaming_indicator char[5] ▪ 0 not roaming
▪ 1 roaming
Default = 0. If not given, the HPLMN value from the switch
location table is used to determine roaming
time_offset long Default = time offset of MG local time from UTC
start_time timeval Default = current time
end_time timeval Default = start time + duration
original_file_id char[80] If you want to have the file name in the CDRs, you must enter
it here
answer_time timeval The time when the call was answered. Does not affect rating
if duration is given
nw_bearer_id_type char[5] Defines the type of the bearer identification. The values are:
▪ 0 = Network Bearer ID is a textual ID, e.g. data9600
(default)
▪ 1 = Network Bearer ID is Bearer Capability
▪ 2 = Network Bearer ID is Bearer Service Code

nw_bearer_id_value char[20] Bearer Capability or Bearer Service Code value used in the
network
bearer_capability char[5] Default = 0. Used if feature BEARERCAPABILITY is off. If
BEARERCAPABILITY is on, then use either
bearer_capability or
nw_bearer_id_type and nw_bearer_id_value.

2.7 Voice-MT events

2.7.1 Required fields


Field Type Value
version short See section 3.1.2
record_number long See section 3.1.2
external_record_type char[5] See section 3.1.2
event_type char[5] 1 Voice
direction char[5] 1 Terminating event
msisdn char[32] Destination address
originating_address char[100] A party of the event

Confidential
18 Event descriptions

Field Type Value


destination_address char[100] B party of the event. MSISDN in SUB format or international
format, if subscribers are in international format in the MG
database
call_class char[5] For voice, data and SMS. Mandatory
call_type char[5] ▪ 1 Normal Call
▪ 2 First Call
▪ 5 Ringback Call
▪ 10 Voice Mail
▪ 11 Forwarded Call

call_status char[5] ▪ 1 Connected


▪ 2 Disconnected OK
▪ 3 Disconnected with error
sub_type char[5] 0 Normal
duration long Duration in seconds of the event if time-based charging

2.7.2 Optional fields


There are more optional fields in section 3.1.2. These are the ones that affect rating.

Field Type Value


msc_id char[50] Id of the switch or cell
a_switch_id_type char[5] Id type of the switch or cell. Needed for processing roaming
calls.
▪ 0 location id
▪ 1 Cell ID
▪ 2 GT address
▪ 3 MSCID
cell_id char [32] Cell identifier
destination_address_type char[5] Destination address type
▪ 0 Any address
▪ 2 APN
See section 3.1.2 for more values
roaming_indicator char[5] ▪ 0 not roaming
▪ 1 roaming
Default = 0. If not given, the HPLMN value from the switch
location table is used to determine roaming
time_offset long Default = time offset of MG local time from UTC
start_time timeval Default = current time
end_time timeval Default = start time + duration
original_file_id char[80] If you want to have the file name in the CDRs, you must enter
it here
answer_time timeval The time when the call was answered. Does not affect rating
if duration is given.

Confidential
19 Event descriptions

Field Type Value


nw_bearer_id_type char[5] Defines the type of the bearer identification. The values are:
▪ 0 = Network Bearer ID is a textual ID, e.g. data9600
(default)
▪ 1 = Network Bearer ID is Bearer Capability
▪ 2 = Network Bearer ID is Bearer Service Code
nw_bearer_id_value char[20] Bearer Capability or Bearer Service Code value used in the
network.
bearer_capability char[5] Default = 0. Used if feature BEARERCAPABILITY is off. If
BEARERCAPABILITY is on, then use either
bearer_capability or
nw_bearer_id_type and nw_bearer_id_value.

Confidential
3. Interface description

This chapter describes the data structures and function calls.

3.1 Data structures


The data sizes are effective data sizes, for example not including the terminating NULL
character. All of the fields should be set to NULL before filling the structures. Fields may not
contain leading or trailing blanks (spaces).

3.1.1 File header structure xdr_header_type


This structure describes data to be written in a particular file and it is used on a call to
xdr_open_file function.

Field Type Description & values


version short Must be set to XDR_HEADER_VERSION defined in the
include file
msg_type char[64] Not required. If set, must be XDR
record_count long Number of records to be written into current file

3.1.2 Hot Billing data structure xdr_info_type


This is the structure for hot billing events.

Field Type Mandatory Description & values


version short Always Must be set to XDR_INFO_VERSION
defined in the include file
record_number long Always Logical record number, start from 0 and
increase by 1 for each record
external_record_type char[5] Always Logical record number, start from 0 and
increase by 1 for each record
event_type char[5] Always 1 Voice
2 Data
3 SMS
4 Application event
direction char[5] Always 0 Originating event
1 Terminating event
account_id char[32] No Determined automatically, not used
msc_id char[50] If rate not found, Id of the switch or cell. Used for location
use default determination from the switch location
location table

Confidential
21 Interface description

Field Type Mandatory Description & values


a_switch_id_type char[5] If rate not found, Id type of the switch or cell. Needed for
use default processing roaming calls.
location 0 Location id
1 GSM Cell ID
2 GT address/GSM MSC ID
3 ANSI MSCID
4 ANSI Cell ID
5 IPv4-address
6 IPv6-address
7 TAI-Location Type
8 ECGI-Location Type
msisdn char[32] Always MSISDN charged for the event.
Mandatory
roaming_indicator char[5] No 0 not roaming
1 roaming
Default = 0. If not given, the HPLMN
value from the switch location table is
used to determine roaming
time_offset long No Number of 1/4 hours to get the local time
of the event.
Default = time offset of MG local time
from UTC
start_time timeval No Seconds in UTC. Use time converting
functions in the API. Default = current
time
end_time timeval No Seconds in UTC. Use time converting
functions in the API. Default = current
time
original_call_id char[32] No Free-format identification
original_file_id char[80] No Free-format identification.
If you want to have the file name in the
CDRs, you must enter it here
answer_time timeval No The time when the call was answered.
Does not affect rating if duration is given
description char[250] No Free-format description of the event (for
example, service name)
originating_address char[100] Always A party of the event (for example,
MSISDN)
originating_network char[16] No Network id of the A party. Should exist in
network pop-up parameters (in System –
Parameters and Features - Pop-up
parameters, field Pop: enter NW)
originating_address_type char[5] No Address type
0 Any address
1 E-mail / MAILTO
2 APN
3 HTTP
4 HTTPS
5 FTP
6 NEWS/NNTP
7 Telnet
8 File
destination_address char[100] Always B party of the event
destination_network char[16] No Network id of the B party
destination_address_type char[5] No Address type
0 Any address

Confidential
22 Interface description

Field Type Mandatory Description & values


1 E-mail / MAILTO
2 APN
3 HTTP
4 HTTPS
5 FTP
6 NEWS/NNTP
7 Telnet
8 File
forward_address char[100] Only for C party of the event
forwarded calls
forward_network char[16] No Network id of the C party
forward_type char[5] Only for C type. Same values as in destination type
forwarded calls or originating type
forward_address_type char[5] No C address type. Same values as in
destination address type or originating
address type
cell_id char [32] No Cell identifier
call_class char[5] For voice, data 0 Determined by TP
and SMS. 1 Normal Call
2 Premium Call
3 International Call
call_type char[5] For voice, data 1 Normal Call
and SMS 2 First Call
3 SMS
5 Ringback Call
10 Voice Mail
11 Forwarded Call
call_status char[5] For voice, SMS 1 Connected
and data 2 Disconnected OK
3 Disconnected with Error
call_processing_status char[5] No 1 First intermediate CDR
2 End CDR (no intermediate CDRs)
5 Intermediate CDR
6 End CDR with intermediate CDRs
Default = 2
charging_event_type char[5] No For future use. Must be set to NULL
charge_type char[5] No For future use. Must be set to NULL
event_action char[5] No For future use. Must be set to NULL
charging_event_status char[5] No For future use. Must be set to NULL
transaction_id char[20] No For future use. Must be set to NULL
recharging_msisdn char[32] No For future use. Must be set to NULL
voucher_card_number char[20] No For future use. Must be set to NULL
voucher_owner_spid char[4] No For future use. Must be set to NULL
voucher_type char[5] No For future use. Must be set to NULL
sub_type char[5] Always 0 Normal
2 Closed User Group
In the input the sub_type has to be 0
always. Old values 1 (Mobile
terminating) and 3 (Event) are internally
converted to 0 to support files created
with previous releases
supplementary_service char[5] No 0 Default, no service

Confidential
23 Interface description

Field Type Mandatory Description & values


1 Call Forward (CF)
2 Call Hold (CH)
3 Call Wait (CW)
4 Conference Call (CC)
Default = 0
qos char[5] No Default = 0, For future use
bearer_capability char[5] No Default = 0. Used if feature
BEARERCAPABILITY is off. If
BEARERCAPABILITY is on, then use
either bearer_capability or
nw_bearer_id_type and
nw_bearer_id_value
report_end_time timeval No For future use. Must be set to NULL
report_start_time timeval No For future use. Must be set to NULL
tariff_group_id char[20] No For future use. Must be set to NULL
language char[5] No For future use. Must be set to NULL
original_price double No For future use. Must be set to NULL
original_currency char[5] No For future use. Must be set to NULL
converted_price double No For future use. Must be set to NULL
price double No For future use. Must be set to NULL
charged_price double No For future use. Must be set to NULL
charged_currency char[5] No For future use. Must be set to NULL
b_switch_id_type char[5] No For future use. Must be set to NULL
c_switch_id_type char[5] No For future use. Must be set to NULL
tax_code char[5] No Tax code of the event. See System –
Global Data - Tax code for possible
codes
tax_percentage double No Percentage of the tax. Overrides
percentage of the tax code
duration long For voice and Duration in seconds of the event if time-
data if time based based charging
down_volume long For data if Volume in kilobytes if volume-based
volume based charging
down_speed long No Speed in kilobytes
down_speed_requested long No Requested speed in kilobytes
up_volume long For data if Volume in kilobytes if volume based
volume based charging
up_speed long No Speed in kilobytes
up_speed_requested long No Requested speed in kilobytes
number_of_events char[5] No Defines the number of events to be rated.
The value must be a positive integer. The
default is 1.
nw_bearer_id_type char[5] No Defines the type of the bearer
identification. The values are:
0 = Network Bearer ID is a textual ID, e.g.
data9600 (default)
1.1 = Network Bearer ID is Bearer
Capability
2.2 = Network Bearer ID is Bearer Service

Confidential
24 Interface description

Field Type Mandatory Description & values


Code
nw_bearer_id_value char[20] No Bearer Capability or Bearer Service Code
value used in the network
external_ff char[5] No Defines the handling of the FF indicators.
Possible values in the incoming request
for the indicators are:
<null>
1 = is in the external list
0 = is not in the external list
The indicators are received in the field
external_ff.
external_bf char[5] No Defines the handling of the BF indicators.
Possible values in the incoming request
for the indicators are:
<null>
1 (is in the external list)
0 (is not in the external list)
The indicators are received in the field
external_bf.
service_identifier char[10] No Identifies a service within rating group
used in rating. 'Service_identifier',
'rating_group' and 'destination_address'
are used as a key to Flow Based Charging
table to select a number mask (i.e. B-party
address) which is used to determine a rate
for the service. If not found then
'destination_address' is used as is as B-
party address.
rating_group char[10] No Identifies a rating group used in rating.
Service_identifier', 'rating_group' and
'destination_address' are used as a key to
Flow Based Charging table to select a
number mask (i.e. B-party address) which
is used to determine a rate for the service.
If not found then 'destination_address' is
used as is as B-party address.
sgsn_address char[32] No SGSN address. Only IPv4 address, in
dotted decimal format, e.g.,
192.168.100.100.
rat_type char[5] No Radio Access Technology type. Values:
1 UTRAN
101 IEEE 802.16e
102 3GPP2 eHRPD
103 3GPP2 HRPD
104 3GPP2 1xRTT
105 3GPP2 UMB
2 GERAN
3 WLAN
4 GAN
5 HSPA Evolution
6 EUTRAN
7 Virtual
tai_location char[32] No Tracking Area Identity location. Give the
location ID.

Confidential
25 Interface description

3.2 Function calls and usage

3.2.1 XDR_open_file()
This function is used to open the output file and initialize header and default values.

Name Scope Type Description & values


retval Int Error code from system functions, see
errno man page for possible values
output_file_name in char * File to be created, can be absolute or relative
path
header in xdr_header_type Header containing version, type and record
count
def_data in xdr_info_type Default values if no data is given in following
calls to XDR_write_file
status out short * Same as function return value

On successful completion, the function return value is set to zero.

3.2.2 XDR_write_file()
This function writes single hot billing event to file opened with XDR_open_file() function. It
should be called as many times as set in header record_count

Name Scope Type Description & values


retval Int Error code from system functions, see man errno
data in xdr_info_type Single event to be written into file
status out short * Same as function return value

On successful completion, the function return value is set to zero.

3.2.3 XDR_close_file()
After all records have been written, use XDR_close_file() to close file and free internal
buffers.

Name Scope Type Description & values


retval int Error code from system functions, see man errno
status out short * Same as function return value

On successful completion, the function return value is set to zero.

3.2.4 XDR_cv_to_timeval()
This function converts given time values to timeval structure used in hot billing record.

Confidential
26 Interface description

Name Scope Type Description & values


retval Int ▪ 1 = successful conversion
▪ 0 = error

year in Int Year for the event


month in Int Month for the event
day in Int Day for the event
hour in Int Hours for the event
min in Int Minutes for the event
sec in Int Seconds for the event
zone in Int Seconds for timezone offset from UTC. If –1
is given, localtime is assumed
usec in Int Microseconds for the event
std_time out Timeval Timeval structure of given time

On successful completion, the function return value is set to 1.

3.2.5 XDR_convert_string_timeval()
This function converts given time string to timeval structure used in hot billing record.

Name Scope Type Description & values


retval Int 1 for successful conversion, 0 for error
time_str in Char * Standard time string in format:
YYYYMMDDHHMISS
or
YYYYMMDDHHMISSUUUUUUTZ
where
YYYY is year
MM is month
DD is day
HH is hours in 24-hour format
MI is minutes
SS is seconds
UUUUUU is microseconds
TZ is timezone in standard format (see man page timezone
(3) for details
std_time out timeval Timeval structure of given time

On successful completion, the function return value is set to 1.

Confidential
Appendix A: Examples

Makefile
#

PROG = postp

SRCS = postp.c

OBJS = $(SRCS:.c=.o)

CCHECK = -check -msg_disable


misalgndmem,misalgndstrct,noparmlist,embedcomment,expandeddefined,igno
recallval,strctpadding

CFLAGS = $(CCHECK) -ansi -g -I../incl

LDFLAGS = -L../lib

LDLIBS = -lxdrfapi -lisam

all : $(PROG)

$(PROG) : $(OBJS)

$(CC) -o $@ $(OBJS) $(LDFLAGS) $(LDLIBS)

postp.o : Makefile

clean:

$(RM) $(RMFLAGS) *.o $(PROG) *~

postp.c

/*

Confidential
28 Appendix A: Examples

** $Id: postp.c,v 1.3 2002/03/04 10:42:40 admi Exp $

*/

#include <stdio.h>

#include <string.h>

#include "xdr_info_type.h"

#include "xdr_file_api.h"

int

main(int argc, char **argv)

xdr_info_type xdr,

defvalues = { XDR_INFO_VERSION };

xdr_header_type header = {

XDR_HEADER_VERSION,

"XDR",

};

short status;

long index = 0;

if (XDR_open_file("xdroutputdata.bin", &header, &defvalues,


&status) == 0) {

while (1) { /* Loop as long as you have data */

memset(&xdr, 0, sizeof (xdr));

xdr.version = XDR_INFO_VERSION;

xdr.record_number = index++;

Confidential
29 Appendix A: Examples

/* Fill the rest of the fields */

if (XDR_write_file(&xdr, &status) != 0) {

/* error on data */

break;

if (index > 1)

break;

XDR_close_file(&status);

return 0;

Confidential
Revisions

Revision 1.0
Dated 08.01.15

Confidential

Vous aimerez peut-être aussi