Openser中文网

专注于VoIP,Opensips,Kamailio等技术,QQ群:QQ群:293697898

Kamailio IMS charging 计费文档


tags:Kamailio IMS 计费 文档 创建时间:2015-12-19 11:03:40

`This page was saved using WebZIP 7.0.3.1030 offline browser (Unregistered) on 10/03/15 23:42:10. Address: http://kamailio.org/docs/modules/stable/modules/ims_charging.html Title: The IMS Charging Module • Size: 76418 • Last Modified: Wed, 03 Jun 2015 20:25:53 GMT The IMS Charging Module

Jason Penton

Smile Communications
<jason.penton@smilecoms.com>
Carsten Bock

ng-voice GmbH
<carsten@ng-voice.com>
Carlos Ruiz Diaz

ng-voice GmbH
<carlos@ng-voice.com>
翻译

李 浩

<1354608370@qq.com>
Copyright © 2013 Smile Communications

Copyright © 2013 ng-voice GmbH

Copyright © 2015 上海宁卫 李浩

目录

1. 用户指南
1. 概述
2. 依赖模块
2.1. Kamailio 模块
2.2. 外部库和应用程序
3. 了解IMS的计费
3.1. Offline Charging (Rf)
3.2. Online Charging (Ro)
3.3. Online Charging (Ro): 一个实际应用例子
4. 参数表
4.1. hash_size(int)
4.2. interim_update_credits(int)
4.3. timer_buffer(int)
4.4. ro_forced_peer(string)
4.5. ro_auth_expiry(integer)
4.6. ro_auth_expiry(integer)
4.7. cdp_event_latency(integer)
4.8. cdp_event_threshold(integer)
4.9. cdp_event_latency_log(integer)
4.10. single_ro_session_per_dialog(integer)
4.11. origin_host(string)
4.12. origin_realm(string)
4.13. destination_host(string)
4.14. destination_realm(string)
4.15. service_context_id_root(string)
4.16. service_context_id_ext(string)
4.17. service_context_id_mnc(string)
4.18. voice_service_identifier(string)
4.19. voice_rating_group(string)
4.20. video_service_identifier(string)
4.21. video_rating_group(string)
4.22. service_context_id_mcc(string)
4.23. service_context_id_release(string)
5. 函数表
5.1. Ro_CCR(route_name, direction, reservation_units, domain, incoming_trunk_id, outgoing_trunk_id
6. 统计
6.1. Initial CCRs (initial_ccrs)
6.2. Interim CCRs (interim_ccrs)
6.3. Final CCRs (final_ccrs)
6.4. Sucessful initial CCRs (successful_initial_ccrs)
6.5. Sucessful interim CCRs (successful_interim_ccrs)
6.6. Sucessful final CCRs (successful_final_ccrs)
6.7. Failed initial CCRs (failed_initial_ccrs)
6.8. Failed interim CCRs (failed_interim_ccrs)
6.9. Failed final CCRs (failed_final_ccrs)
6.10. CCRs average response time (ccr_avg_response_time)
6.11. CCRs responses time (ccr_responses_time)
6.12. CCRs requests, which ended with a timeout (ccr_timeouts)
6.13. Billed seconds (billed_secs)
6.14. Killed calls (killed_calls)
示例

1.1. hash_sizeparameter usage
1.2. interim_update_creditsparameter usage
1.3. timer_bufferparameter usage
1.4. ro_forced_peerparameter usage
1.5. ro_auth_expiryparameter usage
1.6. ro_auth_expiryparameter usage
1.7. cdp_event_latencyparameter usage
1.8. cdp_event_thresholdparameter usage
1.9. cdp_event_latency_logparameter usage
1.10. single_ro_session_per_dialogparameter usage
1.11. origin_hostparameter usage
1.12. origin_realmparameter usage
1.13. destination_hostparameter usage
1.14. destination_realmparameter usage
1.15. service_context_id_rootparameter usage
1.16. service_context_id_extparameter usage
1.17. service_context_id_mncparameter usage
1.18. voice_service_identifierparameter usage
1.19. voice_rating_groupparameter usage
1.20. video_service_identifierparameter usage
1.21. video_rating_groupparameter usage
1.22. service_context_id_mccparameter usage
1.23. service_context_id_releaseparameter usage
1.24. Ro_CCR
第1节. 用户指南

Table of Contents

1. 概述
2. 依赖模块
2.1. Kamailio 模块
2.2. 外部库和应用程序
3. 了解IMS的计费
3.1. Offline Charging (Rf)
3.2. Online Charging (Ro)
3.3. Online Charging (Ro): A practical 示例
4. 参数表
4.1. hash_size(int)
4.2. interim_update_credits(int)
4.3. timer_buffer(int)
4.4. ro_forced_peer(string)
4.5. ro_auth_expiry(integer)
4.6. ro_auth_expiry(integer)
4.7. cdp_event_latency(integer)
4.8. cdp_event_threshold(integer)
4.9. cdp_event_latency_log(integer)
4.10. single_ro_session_per_dialog(integer)
4.11. origin_host(string)
4.12. origin_realm(string)
4.13. destination_host(string)
4.14. destination_realm(string)
4.15. service_context_id_root(string)
4.16. service_context_id_ext(string)
4.17. service_context_id_mnc(string)
4.18. voice_service_identifier(string)
4.19. voice_rating_group(string)
4.20. video_service_identifier(string)
4.21. video_rating_group(string)
4.22. service_context_id_mcc(string)
4.23. service_context_id_release(string)
5. 函数表
5.1. Ro_CCR(route_name, direction, reservation_units, domain, incoming_trunk_id, outgoing_trunk_id
6. 统计
6.1. Initial CCRs (initial_ccrs)
6.2. Interim CCRs (interim_ccrs)
6.3. Final CCRs (final_ccrs)
6.4. Sucessful initial CCRs (successful_initial_ccrs)
6.5. Sucessful interim CCRs (successful_interim_ccrs)
6.6. Sucessful final CCRs (successful_final_ccrs)
6.7. Failed initial CCRs (failed_initial_ccrs)
6.8. Failed interim CCRs (failed_interim_ccrs)
6.9. Failed final CCRs (failed_final_ccrs)
6.10. CCRs average response time (ccr_avg_response_time)
6.11. CCRs responses time (ccr_responses_time)
6.12. CCRs requests, which ended with a timeout (ccr_timeouts)
6.13. Billed seconds (billed_secs)
6.14. Killed calls (killed_calls)
1.概述

This module contains all methods related to the IMS charging control functions performed by an network element (e.g. a S-CSCF) over the Ro interface. This module is dependent on the CDP (C Diameter Peer) modules for communicating with a Charging-Server as specified in 3GPP specification TS xx.xxx.
这个模块包含了所有的和IMS计费控制函数执行相关的所有方法,是通过一个网络单元(如 S-CSCF)在Ro的接口之上。这个模块依赖CDP(C Diameter Peer)模块去和计费服务器使用3GPP通信。 规范 TS xx.xxx.

Please also refer to RFC 4006 (Diameter Credit-Control Application)
请参考RFC4006(Diameter Credit-Control Application)

2.依赖模块

2.1. Kamailio 模块

The Following mouldes must be loaded before this module:
依赖模块必须要本模块前加载

Dialog_ng

TM - Transaction Manager

CDP - C Diameter Peer

CDP_AVP - CDP AVP Applications

2.2.外部库和应用程序

This modules requires the internal IMS library.
依赖的外部库或应用程序必须在加载本模块前被安装:

3.了解IMS的计费

Before each service usage, the charging system must be asked for permission (credit authorization). The charging server must make a decision: Either authorize or deny the session. For postpaid scenarios this is fairly easy: The charging-server only needs to collect the usage data for processing it at the end of the month. As no realtime account updating is needed, this is often called "offline-charging". For prepaid scenarios the charging server needs to know the user's account balance and it will need to update the account in real-time. This is often referred to as "online-charging".
在每次使用服务前,必须向计费系统请求许可(信用授权)。计费服务器必须给出回应:允许或 拒绝会话。对于后付费方案这是非常容易的:计费服务器仅需要去收集用户数据在本月底处理它。 由于没有实时帐户更新的需要,这种计费方式通常被称为“offline-charging”.预付费方案的计费服务器需要知道 用户的帐户余额且它要进行实时更新。这个通常被称之为"online-charging".

Question: What is the double of the Radius? Answer: It's the Diameter!
问题:半径的两倍是什么?答:这是直径!
译者注:这是一个冷笑话,现在新标准推出的计费系统叫Diameter,而以前的计费系统标准是Radius.

As quite often, we use the Diameter-Protocol to do the Charging in the IMS. And as quite often, IMS uses a huge bunch of acronyms to describe the different interfaces: We call the diameter-interface for offline-charging the "Rf"-interface and the interface for online charging the "Ro"-interface.
通常地,我们使用diameter协议在IMS中计费。往往,IMS采用一堆庞大的首字母缩略词来描述不同的接口:我们 称呼 diameter-interface for offline-charging 为 "Rf" 接口,diameter-interface for online charging为"Ro"接口。
Each system, that needs this credit authorization, have to be equipped with a proper charging trigger, a so-called charging-trigger-function (CTF) in order to communicate with the charging-server (also called charging-function):
每一个系统都需要这个授权,必须要配有一个适当的计费触发器,一个所谓的计费触发器(CTF)为了与计费服务器通信(叫计费功能)。

3.1. Offline Charging (Rf)

For the offlinc charging (Rf), we have the following two diameter-messages:
针对Rf,我们需要两个diameter-message

ACR - Accounting Request

ACA - Accounting Answer

Each request can have the following Accounting-Record-Type:
每一个请求必须按照Accounting-Record-Type:

START_RECORD - used to start an accounting session, typically when the application receives a SIP 200 OK acknowledging an initial SIP INVITE.
START_RECORD - 开始一个计费会话,通常是当应用收到一个200 OK确认了一个初始的SIP INVITE.

INTERIM_RECORD - used to update a session, for 示例, in the case of SIP RE-INVITE and/or UPDATE in the current SIP dialog.
INTERIM_RECORD - 用于更新一个会话,如:在当前SIP会话中出现了SIP RE-INVITE以及UPDATE等时。

STOP_RECORD - used to stop an accounting session, for 示例, when the application receives a SIP BYE message.
STOP_RECORD - 停止一个计费会话,例如:当收到一个SIP BYE 消息。

EVENT_RECORD - used for event-based accounting, e.g. a short message or similar
EVENT_RECORD - 用于基于事件的计费,例如和短信类似的

3.2. Online Charging (Ro)

For online charging (Ro), this get's a little bit more complicated. The charging function needs to perform credit control before allowing resource usage. The prepaid subscriber needs to exist in the charging-server and all activities must be monitored by the charging-server. We must distinguish between the following two cases:
针对Ro,这块应该说比较复杂。计费功能需要在资源使用前控制授权。预付费用户需要在计费 服务器中存在且所有活动被计费服务器监控。我们必须区分以下两种案例:

Direct debiting - the amount is immediately deducted from the user's account in one single transaction. This could be for 示例 a SMS or the ordering of a movie in case of Video-on-Demand.
按次计费 - 金额直接从用户帐号一次性扣除,这个类似于一条短信或视频直播等。

Unit reservation - an amount is reserved by the charging-server. This is done, because the charging-server does not know yet, how many units are needed to provide the service. During the session, the used amount may be deducted and more units can be requested; at the end of the session the used sessions are reported in the final request. These sessions could be typically a voice- or video-call or a Pay-TV session, if you pay per usage.
按单位(秒、6秒、分钟等)计费 - 从计费服务器中获取一定数量的单位。这样做是因为,计费服务器 不知道,需要提供多少个单位用于这次服务。在这次会话中,所用金额可能会被扣除,那么需要请求更多 的单位;在会话结束时报告最后的请求。这些会话通常用于语音,视频通话或付费电视等,如果你为每次 使用付费的话。

As a result, we have the following three scenarios: 
因此,我们有以下三种情况:

Immediate Event Charging (IEC) - used for simple Event-based charging
立即事件计费(IEC) - 用于简单的基于事件的计费

Event Charging with Unit Reservation (ECUR) (of type Event-based charging) 
事件计费基于单位预留(ECUR)

Session Charging with Unit Reservation (SCUR) (of type Session-based charging) 
基于事件的会话计费(SCUR)

3.3. Online Charging (Ro): 一个实际应用例子

But how does it look in reality? Let us make a more practical 示例:
但它如何在现实中寻找?让我们做一个更实际的例子:

Let us assume we have a subscriber, who has sufficient credit for 75 seconds of talking. The subscriber initiates a call; as we do not know, how long the call will take, we start with requesting credit for 30 seconds (CCR-Request, we could request any duration, e.g. 2 hours, but it would probably block other calls if we reserve all the required credit). 
让我们假设我们有一个用户,他有75秒的交谈费用。用户发起一个呼叫;我们不知道这个呼叫会持结多久, 我们开始请求30秒的的费用(CCR-Request,我们可以请求任意长的时间,如2小时,但是它会阻止其它呼叫来请求费用)

The call proceeds, so after 30 seconds we send another CCR-Request with the indication that we used the reserved 30 seconds and that we request another 30 seconds. We reduce the account of the subscriber by 30 seconds, so he has a credit of 45 seconds. Since 45 seconds is more than the requested 30 seconds, this second request can also easily be accepted and another 30 seconds can be granted. After this request, the account is at 45 seconds and we still (or again) have 30 seconds reserved.
在呼叫进行中,过了30秒我们会发送另一个ccr-request 请求30秒的保留时长,我们的用户帐户减少了30秒 所以我们的帐户上还有45秒。因为45秒超过了30秒的请求,这个时间请求可以被接受,所以又被授予了30秒。 这个时候,帐号有45秒,并且有一个30秒的保留。

Meanwhile the subscriber initiates a second call. We try to request again 30 seconds from the charging-server, but as our account is at 45 seconds of speaking time and since we reserved another 30 seconds for the first call, we can only grant 15 seconds for the second call. The last 15 seconds are now reserved for this subscriber; we have 45 seconds on the account of which 45 seconds are reserved. 
同时,帐户再次发起呼叫。我们尝试从计费服务器中获取30和时长,但是我们的帐户只有45秒时长而且保留了一部分给第一次的呼叫, 那么我们只能给这次呼叫15秒,我们的帐户有45秒通话时长,且这45秒全被保留。

Now the first call gets terminated: We only used 20 seconds from the granted 30 seconds. So we decrease the account of the subscriber by 20 seconds and we reduce the amount of reserved units by 30. We have 25 seconds in the account and we have still reserved 15 seconds for the second call. 
现在第一个通话中止了。我们仅用了20秒,但授权是30秒。因此我们减少了用户的帐户20秒,我们同时减少了保留时间30。 现在我们有25秒的帐户,而保留时长仍为15秒。

As the second call is still proceeding, we will try to request another 30 seconds and we indicate, that we used the granted 15 seconds. The account is deducted by 15 seconds (the used units) and we can grant another 10 seconds for the second call, as this is the remains on the account.
因为第二次呼叫仍在进行中,我们尝试再次请求30秒,我们使用了被授权的15秒。 帐号扣除15秒,我们可以给予另一个电话10秒,因为这是这个帐号的剩余。

After 10 seconds, no more units can be granted, so the call is teared down.
10秒后,没有更多的授权,所以不得不挂机。

The following diagram is a graphical representation of the above 示例:
下图是上面的例子的图形化表示:


4.参数表

4.1. hash_size(int)

The size of the hash table internally used to keep the Diameter-Ro-Session. A larger table is much faster but consumes more memory. The hash size must be a power of two number.
在内部使用的Diameter-Ro_session的hash 表的大小。一个大的表可以更快,但是消耗更多的内存。 hash的大小必须是2的幂

IMPORTANT: If Ro-Session's information should be stored in a database, a constant hash_size should be used, otherwise the restoring process will not take place. If you really want to modify the hash_size you must delete all table's rows before restarting the server.
重要的:如果Ro-Session的信息保存在数据库中,一个固定大小的hash_size将被使用,否则将不能恢复起来。 如果你真的想要改变hash_size,你必须要重启服务前删除所有行。

默认值: 4096.

示例 1.1. hash_sizeparameter usage

...
modparam("ims_charging", "hash_size", 1024)
...

4.2. interim_update_credits(int)

How much credit should be requested interim request? At the start of the call, we request the amout of seconds as per Command. For each interim request, we would request credit for "interim_update_credits". 
临时请求的秒数应多大?在开始电话时,我们请求的是秒级的,针对每次的请求命令。我们将授权:interim_update_credits

默认值: 30.

示例 1.2. interim_update_creditsparameter usage

...
modparam("ims_charging", "interim_update_credits", 600)
...

4.3. timer_buffer(int)

How many seconds before expiry of our credit should we request more credit?
从请求到到期的秒数,以便我们请求更多的授权。

默认值: 8.

示例 1.3. timer_bufferparameter usage

...
modparam("ims_charging", "timer_buffer", 10)
...

4.4. ro_forced_peer(string)

FQDN of Diameter Peer (OCS) to use for communication (CCR). If you use this, the routing defined in your diameter xml configuration file (CDP) will be ignored and as a result you will lose the benefits of load balancing and failover. 
FQDN of Diameter Peer (OCS) 被用于通信。如果你使用这个,在你的diameter xml 配置文件中的路由定义将被忽略,同时你也会失去负载均衡和故障转移。

默认值: '.

示例 1.4. ro_forced_peerparameter usage

...
modparam("ims_charging", "ro_forced_peer", "ocs.ims.smilecoms.com")
...

4.5. ro_auth_expiry(integer)

This is the expiry length in seconds of the initiated Diameter sessions. 
diameter 会话在几秒内有效。

默认值: 7200.

示例 1.5. ro_auth_expiryparameter usage

...
modparam("ims_charging", "ro_auth_expiry", 14400)
...

4.6. ro_auth_expiry(integer)

This is the expiry length in seconds of the initiated Diameter sessions.

默认值: 7200.

示例 1.6. ro_auth_expiryparameter usage

...
modparam("ims_charging", "ro_auth_expiry", 14400)
...

4.7. cdp_event_latency(integer)

This is a flag to determine whether or slow CDP responses should be reported in the log file. 1 is enabled and 0 is disabled. 
这是一个用于标识是否决定使用慢的CDP回应以便写入到日志文件中,1 允许,0禁止。

默认值: 1.

示例 1.7. cdp_event_latencyparameter usage

...
modparam("ims_charging", "cdp_event_latency", 1)
...

4.8. cdp_event_threshold(integer)

This time in milliseconds is the limit we should report a CDP response as slow. i.e. if a CDP response exceeds this limit it will be reported in the log file. This is only relevant is cdp_event_latency is enabled (set to 0). 
这个时间是毫秒级的,我们以CDP slow 回应的极限。即如果一个CDP回应超过了这个极限后, 它将写入日志文件。这个仅和cdp_event_latency is enabled (set to 0)有关。

默认值: 500.

示例 1.8. cdp_event_thresholdparameter usage

...
modparam("ims_charging", "cdp_event_threshold", 500)
...

4.9. cdp_event_latency_log(integer)

This time log level at which we should report slow CDP responses. 0 is ERROR, 1 is WARN, 2 is INFO and 3 is DEBUG. This is only relevant is cdp_event_latency is enabled (set to 0)
这个是时间日志级别,当我们应当写入slow CDP 回应时。0 is ERROR, 1 is WARN, 2 is INFO and 3 is DEBUG. 这个仅和cdp_event_latency is enabled (set to 0)有关。

默认值: 0.

示例 1.9. cdp_event_latency_logparameter usage

...
modparam("ims_charging", "cdp_event_latency_log", 1)
...

4.10. single_ro_session_per_dialog(integer)

This tells the module whether it should do a single ro session per dialog no matter how many times Ro_send_CCR is called from the config file or initiate an ro session each time Ro_send_CCR is called. It is useful for IMS charging where you might want to charge for on-net originating and off-net originating calls but always have only a single ro session.
这个告诉模块,它应做一个单独的ro session 对于每一个对话来说,不管多少次的Ro_send_CCR被从配置文件或会话中 调用,它是用于IMS计费,你可能想记录一个呼叫的起始源地址以及网络的断网源地址,但是始终只有一个唯一的ro会话。

默认值: 0.

示例 1.10. single_ro_session_per_dialogparameter usage

...
modparam("ims_charging", "single_ro_session_per_dialog", 1)
...

4.11. origin_host(string)

Origin host to be used in Diameter messages to charging-server.
Origin host用于和计费服务器的diameter消息中

默认值: "scscf.ims.smilecoms.com".

示例 1.11. origin_hostparameter usage

...
modparam("ims_charging", "origin_host", "scscf.kamailio-ims.org")
...

4.12. origin_realm(string)

Origin Realm to be used in Diameter messages to charging-server.

默认值: "ims.smilecome.com".

示例 1.12. origin_realmparameter usage

...
modparam("ims_charging", "origin_realm", "kamailio-ims.org")
...

4.13. destination_host(string)

Destination host to be used in Diameter messages to charging-server.

默认值: 5s.

示例 1.13. destination_hostparameter usage

...
modparam("ims_charging", "destination_host", "ocs.kamailio-ims.org")
...

4.14. destination_realm(string)

Destination realm to be used in Diameter messages to charging-server.

默认值: "ims.smilecoms.com".

示例 1.14. destination_realmparameter usage

...
modparam("ims_charging", "destination_realm", "kamailio-ims.org")
...

4.15. service_context_id_root(string)

This defines a root-element of the Service-Context-Id AVP used in the diameter-message 
这个定义使用在diameter-message中的service-context-id avp的root元素。

The Service-Context-Id AVP is of type UTF8String (AVP Code 461) and contains a unique identifier of the Diameter credit-control service specific document that applies to the request (as defined in section RFC 4006 4.1.2). This is an identifier allocated by the service provider, by the service element manufacturer, or by a standardization body, and MUST uniquely identify a given Diameter credit-control service specific document. The format of the Service-Context-Id is: 
Service-Context-Id AVP是一个utf8字符串(avp code 461),且包含了一个用于 diameter-control服务用于允许该请求的指定文档(RFC 4006 4.1.2)的唯一标识, 这是一个由服务提供商分配的标识符,由服务提供商或一个标准化机构,必须 给一个唯一标识按照Diameter credit-control service specific document。 Service-Context-Id的格式如下:

"service-context" "@" "domain" service-context = Token
The Token is an arbitrary string of characters and digits.
Token是一个任意的字符和数字组成的字符串。

'domain' represents the entity that allocated the Service-Context-Id. It can be ietf.org, 3gpp.org, etc., if the identifier is allocated by a standardization body, or it can be the FQDN of the service provider (e.g., provider.example.com) or of the vendor (e.g., vendor.example.com) if the identifier is allocated by a private entity.
Service-specific documents that are for private use only (i.e., to one provider's own use, where no interoperability is deemed useful) may define private identifiers without need of coordination. However, when interoperability is wanted, coordination of the identifiers via, for 示例, publication of an informational RFC is RECOMMENDED in order to make Service-Context-Id globally available.

默认值: "32260@3gpp.org".

示例 1.15. service_context_id_rootparameter usage

...
modparam("ims_charging", "service_context_id_root", "calls@kamailio-ims.org")
...

4.16. service_context_id_ext(string)

This defines the extension of the Service-Context-Id AVP used in the diameter-message.
定义用于diameter-message中的 Service-Context-Id AVP的分机。

默认值: "ext".

示例 1.16. service_context_id_extparameter usage

...
modparam("ims_charging", "service_context_id_ext", "ext2")
...

4.17. service_context_id_mnc(string)

This defines Mobile-Network-Code (MNC) of the Service-Context-Id AVP used in the diameter-message.
这个定义用于diameter-message中的Service-Context-Id AVP的Mobile-Network-Code (MNC)

默认值: "01".

示例 1.17. service_context_id_mncparameter usage

...
modparam("ims_charging", "service_context_id_mnc", "42")
...

4.18. voice_service_identifier(string)

This defines the service identifier to be used for charging voice.
这里定义用于语音计费中的service identifier 。

默认值: "1000".

示例 1.18. voice_service_identifierparameter usage

...
modparam("ims_charging", "voice_service_identifier", "1000")
...

4.19. voice_rating_group(string)

This defines the rating group to be used for charging voice.
这里定义语音计费的rating group

默认值: "100".

示例 1.19. voice_rating_groupparameter usage

...
modparam("ims_charging", "voice_rating_group", "100")
...

4.20. video_service_identifier(string)

This defines the service identifier to be used for charging video.
这里定义视频计费的service identifier

默认值: "1001".

示例 1.20. video_service_identifierparameter usage

...
modparam("ims_charging", "video_service_identifier", "1000")
...

4.21. video_rating_group(string)

This defines the rating group to be used for charging video.
这里定义视频计费的rating group

默认值: "200".

示例 1.21. video_rating_groupparameter usage

...
modparam("ims_charging", "video_rating_group", "100")
...

4.22. service_context_id_mcc(string)

This defines Mobile-Country-Code (MCC) of the Service-Context-Id AVP used in the diameter-message.
这里定义用于diameter-message中的Mobile-Country-Code (MCC)

see https://en.wikipedia.org/wiki/Mobile_country_code_(MCC) for details.

默认值: "001".

示例 1.22. service_context_id_mccparameter usage

...
modparam("ims_charging", "service_context_id_mcc", "262")
...

4.23. service_context_id_release(string)

This defines Release of the Service-Context-Id AVP used in the diameter-message.
这里定义 diameter-message 中的 Service-Context-Id AVP的Release

默认值: "8" (Release 8).

示例 1.23. service_context_id_releaseparameter usage

...
modparam("ims_charging", "service_context_id_release", "262")
...

5. Functions

5.1. Ro_CCR(route_name, direction, reservation_units, domain, incoming_trunk_id, outgoing_trunk_id

Perform a CCR on Diameter Ro interface for Charging
执行计费的一个CCR diameter Ro的接口。

Meaning of the parameters is as follows:
参数如下:

route_name route to be executed upon reception of charging requests

direction "orig"inating or "term"inating

reservation_units how many units (at the moment seconds) should be reservated at the moment.

domain Logical domain within registrar.

incoming_trunk_id Identifies the trunk group from which this originates.

outgoing_trunk_id Identifies the trunk group where this will be terminated.

This function can be used from REQUEST_ROUTE.

This method is executed asynchronously. See 示例 on how to retrieve return value.

示例 1.24. Ro_CCR

...
  xlog("L_DBG","Sending initial CCR Request for call\n");
    Ro_CCR("RO_ASYNC_TERM_REPLY", "term", 30, "1", "1");
}

route[CHARGING_CCR_REPLY] 
  xlog("L_DBG","cca_return code is $avp(s:cca_return_code)\n");
  switch ($avp(s:cca_return_code)) {
    case 1: #success
        xlog("L_DBG", "CCR success - will route message\n");
        route(Finalize_Orig);
        break;
    case -1: #failure
        xlog("L_ERR", "CCR failure - error response sent from module\n");
        sl_send_reply("402","Payment required");
        break;
    case -2: #error
        xlog("L_ERR", "CCR error - error response sent from module\n");
        sl_send_reply("500", "Charging Error");
        break;
    default:
        xlog("L_ERR", "Unknown return code from CCR: [$avp(s:cca_return_code)] \n");
        break;
  }
  exit;
  }
...

6. Statistics

6.1. Initial CCRs (initial_ccrs)

The number of initial CCRs, i.e., the CCRs that were sent for the initial INVITEs.
初始CCR的数量,如:由INVITE送给CCR的数量。

6.2. Interim CCRs (interim_ccrs)

The number of CCRs sent within established sessions.
建立会话时发送的ccr数量。

6.3. Final CCRs (final_ccrs)

The number of CCRs sent to terminate a session.
中止一个会话时发送的ccr数量。

6.4. Sucessful initial CCRs (successful_initial_ccrs)

Initial CCRs that ended with DIAMETER_SUCCESS response code.
收到DIAMETER_SUCCESS的结束码时初始化ccr.

6.5. Sucessful interim CCRs (successful_interim_ccrs)

Interim CCRs that ended with DIAMETER_SUCCESS response code.
收到DIAMETER_SUCCESS的结束码时改变ccr

6.6. Sucessful final CCRs (successful_final_ccrs)

Final CCRs that ended with DIAMETER_SUCCESS response code.
收到DIAMETER_SUCCESS的结束码时结束ccr

6.7. Failed initial CCRs (failed_initial_ccrs)

Initial CCRs that ended with no DIAMETER_SUCCESS response or with some other error during processing.
收到不是DIAMETER_SUCCESS的结束码时或其它错误,初始化ccr

6.8. Failed interim CCRs (failed_interim_ccrs)

Interim CCRs that ended with no DIAMETER_SUCCESS response or with some other error during processing.
收到不是DIAMETER_SUCCESS的结束码时或其它错误,改造ccr

6.9. Failed final CCRs (failed_final_ccrs)

Final CCRs that ended with no DIAMETER_SUCCESS response or with some other error during processing.
收到不是DIAMETER_SUCCESS的结束码时或其它错误,结束ccr

6.10. CCRs average response time (ccr_avg_response_time)

Average CCA arrival time in milliseconds.
基于毫秒的cca平均到达时间

6.11. CCRs responses time (ccr_responses_time)

Total CCA arrival time in milliseconds. 基于毫秒的cca总的到达时间

6.12. CCRs requests, which ended with a timeout (ccr_timeouts)

Number of CCR-Requests, which ran into an timeout.
CCR-Requests数量,当CCR遇到超进

6.13. Billed seconds (billed_secs)

Number of seconds billed in total. 总的安排时间

6.14. Killed calls (killed_calls)

Number of calls that were killed due to lack of credit. 由于没有通过授权而停掉的呼叫数量。`


如果在有疑问或需要沟通的地方,可以QQ:1354608370 或 加FreeSWITCH+Kamailio+Opensips QQ群: 293697898 沟通交流!