官术网_书友最值得收藏!

  • Mastering FreeSWITCH
  • Anthony Minessale II Giovanni Maruzzelli
  • 537字
  • 2021-07-14 10:44:08

Call Detail Records

Each call will generate one or more Call Detail Record (CDR). CDRs are written after the call ends, and contains all information needed for accounting and billing that call. As an example, an outbound call (outbound is most critical for accounting and billing) the CDR would contain information such as date/time, caller account, caller device, destination, and duration. As an added bonus it can contain all kinds of details about the call itself, such as codec used, outbound route or gateway, and/or the status of the system.

So, in CDRs you can store and gather any kind of info you deem useful on a per-call basis. A complete call is often composed of an A leg (caller) bridged to a B leg (callee). In the FS console, the show calls command shows that each call is composed of two channels (A leg and B leg). You can choose to write a CDR for A leg, B leg, or both.

There are two main kinds of CDRs FreeSWITCH is able to generate: Comma Separated Value (CSV) files, and XML files. CSV files are easier for humans to read, and can be parsed quite simply with regular expressions and spreadsheets. XML CDRs are able to better describe complex information, and can be processed by advanced XML and XSLT libraries.

From their respective configuration files (cdr_csv.conf.xml and xml_cdr.conf.xml) you can define which call legs you want to write CDRs about. By default, like in normal practice, only A legs generate CDRs.

CDRs are built following a template that can be constructed to contain any kind of variable available in the channel, and in any format you may deem useful. For example, there is a template that mimics the Asterisk CDR format, that you can use for compatibility with legacy accounting and billing software, and another template that would generates files with SQL insert rows, that can then be used to directly populate a database.

CDRs will then be kept as traffic documentation, and/or further processed: inserted in a database, for example, where each call will be given a cost, and that cost added to the caller account bill.

XML or CSV — the best practice in any case is to have files written to the disc, that can be used to reconcile accounting and billing in case of database or network malfunction. Also, at the end of each individual call, all of the variables that were associated with the leg (many more variables than you suspect!) can be automatically dumped in the file, so allowing for later debug and troubleshooting.

An advanced technique that can be useful in special or corner cases: CDRs can be generated real-time by a custom application that listens to FS events and do whatever is needed to record, rate, and/or bill each single call while it happens, interfacing whatever systems your operation and business model requires (AAA, Radius, Diameter, Databases, The Spanish Inquisition, and more).

Tip

In a high volume environment, it is considered best practice to do the further massaging of CDRs on a different machine to the FreeSWITCH server. This is so you don't have the CPU and Disk load degrade the performance and the audio quality delivered to customers.

主站蜘蛛池模板: 通城县| 汤阴县| 昂仁县| 和顺县| 德令哈市| 林周县| 松溪县| 伊吾县| 雷波县| 阿鲁科尔沁旗| 集安市| 璧山县| 武冈市| 徐水县| 廉江市| 游戏| 太和县| 罗田县| 县级市| 固镇县| 公安县| 上林县| 九龙城区| 扎赉特旗| 山丹县| 海阳市| 隆昌县| 龙山县| 阳春市| 普格县| 正阳县| 开江县| 临武县| 孟津县| 贵溪市| 友谊县| 曲沃县| 略阳县| 德保县| 嘉鱼县| 怀仁县|