Skip to main content

CDR and accounting variables

About

These variables are used in various modules related to CDR and accounting:

Module name
mod_cdr_csv
mod_cdr_sqlite
mod_xml_ldap
mod_nibblebill

accountcode

Account code is mostly an arbitrary value that you can assign on a per leg basis. An important feature of accountcode is that if its value matches one of the CDR CSV templates defined in cdr_csv.conf.xml then that CDR template will be used when generating a CSV CDR.

Usage:

<action application="set" data="accountcode=custom"/>

Implemented By:

Module NameSource FileLast Revised
mod_cdr_csvmod_cdr_csv.c6564

cdr_csv_base

Description needed! Please contribute one.

Usage:

Example needed! Please contribute one.

Implemented By:

Module NameSource FileLast Revised
mod_cdr_csvmod_cdr_csv.c6542

copy_xml_cdr

Copy's the other leg's XML CDR into this leg's CDR. For example, the A leg's CDR will contain a variable named b_leg_cdr whose contents are the URL-encoded XML CDR data from the B leg. This variable must be set on the B leg, so use {copy\_xml\_cdr=true} in the dialstring or use export instead of set.

Usage:

<action application="bridge" data="{copy_xml_cdr=true} user/${dialed_extension}@${domain_name}"/>

Implemented By:

Module NameSource FileLast Revised
coreswitch_ivr_bridge.c8955

failed_xml_cdr_prefix

If you set that on the A leg and any and all failed B originates generate a full XML CDR report and set it as a variable, this includes during a forked dial.

So say you try to call sofia/profile/a@xxxxxxx,sofia/profile/b@xxxxxxx

And it fails completely, before you make the call you set failed_xml_cdr_prefix to "bad_call"

Then you end up with ${bad\_call\_1} and ${bad\_call\_2} which are each a full XML report including all the vars etc.

Usage:

<action application="set" data="failed_xml_cdr_prefix=failinggw" />

See also:

  • Maillist message [1]

Implemented By:

Module NameSource FileLast Revised
coreswitch_ivr_originate.c8730

process_cdr

Indicates how to process CDR records.

Can be undefined or set to "false", "true", "a_only", "b_only"

  • false - indicates to not process the record.
  • true - or undefined indicates the default behavior which is to process all CDR records.
  • a_only - indicates to only process CDR records on the inbound leg of a call.
  • b_only - indicates to only process CDR records on the outbound leg of a call.

This variable is unconditionally exported

Usage:

<action application="set" data="process_cdr=a_only"/>

Implemented By:

Module NameSource FileLast Revised
coreswitch_core_session.c7214
coreswitch_core_state_machine.c7212

skip_cdr_causes

This is a list of call hangup causes that should not trigger cdr processing.

Implemented By:

Module NameSource FileLast Revised
mod_sofiasofia.c2012-09-19, git commit 3cf238fc9a1370a45d362c2193b8d3634ccd1d11

xml_cdr_base

Description needed! Please contribute one.

Usage:

Example needed! Please contribute one.

Implemented By:

Module NameSource FileLast Revised
mod_xml_cdrmod_xml_cdr.c6708

mod_xml_cdr variable list and definitions (under contruction)

| <?xml version="1.0"?> | | | | | | | | ------------------------------------------------------------------- | --------------------------------------------- | ---------------------------------------------- | ----------------------- | | | | | <cdr core-uuid="[UUID]" switchname="freeswitch"> | | | | | | | | | <channel_data> | | | | | | | | | | <state> | | | | | | | | | <direction> | | | | | | | | | <state_number> | | | | | | | | | <flags> | | | | | | | | | <caps> | | | | | | | | </channel_data> | | | | | | | | | <call-stats> | | | | | | | | | | <audio> | | | | | | | | | | <inbound> | | | | | | | | | | <raw_bytes> | | | | | | | | | <media_bytes> | | | | | | | | | <packet_count> | | | | | | | | | <media_packet_count> | | | | | | | | | <skip_packet_count> | | | | | | | | | <jitter_packet_count> | | | | | | | | | <dtmf_packet_count> | | | | | | | | | <cng_packet_count> | | | | | | | | | <flush_packet_count> | | | | | | | | | <largest_jb_size> | | | | | | | | | <jitter_min_variance> | | | | | | | | | <jitter_max_variance> | | | | | | | | | <jitter_loss_rate> | | | | | | | | | <jitter_burst_rate> | | | | | | | | | <mean_interval> | | | | | | | | | <flaw_total> | | | | | | | | | <quality_percentage> | | | | | | | | | <mos> | | | | | | | | </inbound> | | | | | | | | | <outbound> | | | | | | | | | | <raw_bytes> | | | | | | | | | <media_bytes> | | | | | | | | | <packet_count> | | | | | | | | | <media_packet_count> | | | | | | | | | <skip_packet_count> | | | | | | | | | <dtmf_packet_count> | | | | | | | | | <cng_packet_count> | | | | | | | | | <rtcp_packet_count> | | | | | | | | | <rtcp_octet_count> | | | | | | | | </outbound> | | | | | | | | </audio> | | | | | | | | | <video> | | | | | | | | | | <inbound> | | | | | | | | | | <raw_bytes> | | | | | | | | | <media_bytes> | | | | | | | | | <packet_count> | | | | | | | | | <media_packet_count> | | | | | | | | | <skip_packet_count> | | | | | | | | | <jitter_packet_count> | | | | | | | | | <dtmf_packet_count> | | | | | | | | | <cng_packet_count> | | | | | | | | | <flush_packet_count> | | | | | | | | | <largest_jb_size> | | | | | | | | | <jitter_min_variance> | | | | | | | | | <jitter_max_variance> | | | | | | | | | <jitter_loss_rate> | | | | | | | | | <jitter_burst_rate> | | | | | | | | | <mean_interval> | | | | | | | | | <flaw_total> | | | | | | | | | <quality_percentage> | | | | | | | | | <mos> | | | | | | | | </inbound> | | | | | | | | | <outbound> | | | | | | | | | | <raw_bytes> | | | | | | | | | <media_bytes> | | | | | | | | | <packet_count> | | | | | | | | | <media_packet_count> | | | | | | | | | <skip_packet_count> | | | | | | | | | <dtmf_packet_count> | | | | | | | | | <cng_packet_count> | | | | | | | | | <rtcp_packet_count> | | | | | | | | | <rtcp_octet_count> | | | | | | | | </outbound> | | | | | | | | </video> | | | | | | | | </call-stats> | | | | | | | | | <variables> | | | | | | | | | | <is_outbound> | | | | | | | | | <uuid> | | | | | | | | | <session_id> | | | | | | | | | <text_media_flow> | | | | | | | | | <direction> | | | | | | | | | <ep_codec_string> | | | | | | | | | <channel_name> | | | | | | | | | <secondary_recovery_module> | | | | | | | | | <verto_dvar_email> | | | | | | | | | <verto_dvar_avatar> | | | | | | | | | <jsock_uuid_str> | | | | | | | | | <verto_user> | | | | | | | | | <presence_id> | | | | | | | | | <verto_client_address> | | | | | | | | | <chat_proto> | | | | | | | | | <verto_host> | | | | | | | | | <event_channel_cookie> | | | | | | | | | <verto_profile_name> | | | | | | | | | <record_stereo> | | | | | | | | | <default_areacode> | | | | | | | | | <transfer_fallback_extension> | | | | | | | | | <toll_allow> | | | | | | | | | <accountcode> | | | | | | | | | <user_context> | | | | | | | | | <effective_caller_id_name> | | | | | | | | | <effective_caller_id_number> | | | | | | | | | <outbound_caller_id_name> | | | | | | | | | <outbound_caller_id_number> | | | | | | | | | <callgroup> | | | | | | | | | <user_name> | | | | | | | | | <domain_name> | | | | | | | | | <Event-Name> | | | | | | | | | <Core-UUID> | | | | | | | | | <FreeSWITCH-Hostname> | | | | | | | | | <FreeSWITCH-Switchname> | | | | | | | | | <FreeSWITCH-IPv4> | | | | | | | | | <FreeSWITCH-IPv6> | | | | | | | | | <Event-Date-Local> | | | | | | | | | <Event-Date-GMT> | | | | | | | | | <Event-Date-Timestamp> | | | | | | | | | <Event-Calling-File> | | | | | | | | | <Event-Calling-Function> | | | | | | | | | <Event-Calling-Line-Number> | | | | | | | | | <Event-Sequence> | | | | | | | | | <verto_remote_caller_id_name> | | | | | | | | | <verto_remote_caller_id_number> | | | | | | | | | <switch_r_sdp> | | | | | | | | | <DP_MATCH> | | | | | | | | | <DP_MATCH> | | | | | | | | | <call_uuid> | | | | | | | | | <open> | | | | | | | | | <rtp_secure_media> | | | | | | | | | <export_vars> | | | | | | | | | <conference_enter_sound> | | | | | | | | | <conference_exit_sound> | | | | | | | | | <video_banner_text> | | | | | | | | | <rtp_use_codec_string> | | | | | | | | | <remote_audio_media_flow> | | | | | | | | | <audio_media_flow> | | | | | | | | | <rtp_audio_recv_pt> | | | | | | | | | <rtp_use_codec_name> | | | | | | | | | <rtp_use_codec_fmtp> | | | | | | | | | <rtp_use_codec_rate> | | | | | | | | | <rtp_use_codec_ptime> | | | | | | | | | <rtp_use_codec_channels> | | | | | | | | | <rtp_last_audio_codec_string> | | | | | | | | | <original_read_codec> | | | | | | | | | <original_read_rate> | | | | | | | | | <write_codec> | | | | | | | | | <write_rate> | | | | | | | | | <remote_audio_ip> | | | | | | | | | <remote_audio_port> | | | | | | | | | <remote_audio_rtcp_ip> | | | | | | | | | <remote_audio_rtcp_port> | | | | | | | | | <dtmf_type> | | | | | | | | | <remote_video_media_flow> | | | | | | | | | <video_media_flow> | | | | | | | | | <video_possible> | | | | | | | | | <rtp_video_pt> | | | | | | | | | <rtp_video_recv_pt> | | | | | | | | | <video_read_codec> | | | | | | | | | <video_read_rate> | | | | | | | | | <video_write_codec> | | | | | | | | | <video_write_rate> | | | | | | | | | <rtp_last_video_codec_string> | | | | | | | | | <rtp_use_video_codec_name> | | | | | | | | | <rtp_use_video_codec_rate> | | | | | | | | | <rtp_use_video_codec_ptime> | | | | | | | | | <remote_video_ip> | | | | | | | | | <remote_video_port> | | | | | | | | | <remote_video_rtcp_ip> | | | | | | | | | <remote_video_rtcp_port> | | | | | | | | | <local_media_ip> | | | | | | | | | <local_media_port> | | | | | | | | | <advertised_media_ip> | | | | | | | | | <rtp_use_timer_name> | | | | | | | | | <rtp_use_pt> | | | | | | | | | <rtp_use_ssrc> | | | | | | | | | <rtp_2833_send_payload> | | | | | | | | | <rtp_2833_recv_payload> | | | | | | | | | <remote_media_ip> | | | | | | | | | <remote_media_port> | | | | | | | | | <local_video_ip> | | | | | | | | | <local_video_port> | | | | | | | | | <rtp_use_video_pt> | | | | | | | | | <rtp_use_video_ssrc> | | | | | | | | | <rtp_local_sdp_str> | | | | | | | | | <current_application_data> | | | | | | | | | <current_application> | | | | | | | | | <send_silence_when_idle> | | | | | | | | | <rtp_has_crypto> | | | | | | | | | <endpoint_disposition> | | | | | | | | | <conference_name> | | | | | | | | | <conference_member_id> | | | | | | | | | <conference_moderator> | | | | | | | | | <conference_ghost> | | | | | | | | | <conference_uuid> | | | | | | | | | <video_width> | | | | | | | | | <video_height> | | | | | | | | | <video_fps> | | | | | | | | | <verto_hangup_disposition> | | | | | | | | | <read_codec> | | | | | | | | | <read_rate> | | | | | | | | | <hangup_cause> | | | | | | | | | <hangup_cause_q850> | | | | | | | | | <digits_dialed> | | | | | | | | | <start_stamp> | | | | | | | | | <profile_start_stamp> | | | | | | | | | <answer_stamp> | | | | | | | | | <progress_media_stamp> | | | | | | | | | <end_stamp> | | | | | | | | | <start_epoch> | | | | | | | | | <start_uepoch> | | | | | | | | | <profile_start_epoch> | | | | | | | | | <profile_start_uepoch> | | | | | | | | | <answer_epoch> | | | | | | | | | <answer_uepoch> | | | | | | | | | <bridge_epoch> | | | | | | | | | <bridge_uepoch> | | | | | | | | | <last_hold_epoch> | | | | | | | | | <last_hold_uepoch> | | | | | | | | | <hold_accum_seconds> | | | | | | | | | <hold_accum_usec> | | | | | | | | | <hold_accum_ms> | | | | | | | | | <resurrect_epoch> | | | | | | | | | <resurrect_uepoch> | | | | | | | | | <progress_epoch> | | | | | | | | | <progress_uepoch> | | | | | | | | | <progress_media_epoch> | | | | | | | | | <progress_media_uepoch> | | | | | | | | | <end_epoch> | | | | | | | | | <end_uepoch> | | | | | | | | | <last_app> | | | | | | | | | <last_arg> | | | | | | | | | <caller_id> | | | | | | | | | <duration> | | | | | | | | | <billsec> | | | | | | | | | <progresssec> | | | | | | | | | <answersec> | | | | | | | | | <waitsec> | | | | | | | | | <progress_mediasec> | | | | | | | | | <flow_billsec> | | | | | | | | | <mduration> | | | | | | | | | <billmsec> | | | | | | | | | <progressmsec> | | | | | | | | | <answermsec> | | | | | | | | | <waitmsec> | | | | | | | | | <progress_mediamsec> | | | | | | | | | <flow_billmsec> | | | | | | | | | <uduration> | | | | | | | | | <billusec> | | | | | | | | | <progressusec> | | | | | | | | | <answerusec> | | | | | | | | | <waitusec> | | | | | | | | | <progress_mediausec> | | | | | | | | | <flow_billusec> | | | | | | | | | <rtp_audio_in_raw_bytes> | | | | | | | | | <rtp_audio_in_media_bytes> | | | | | | | | | <rtp_audio_in_packet_count> | | | | | | | | | <rtp_audio_in_media_packet_count> | | | | | | | | | <rtp_audio_in_skip_packet_count> | | | | | | | | | <rtp_audio_in_jitter_packet_count> | | | | | | | | | <rtp_audio_in_dtmf_packet_count> | | | | | | | | | <rtp_audio_in_cng_packet_count> | | | | | | | | | <rtp_audio_in_flush_packet_count> | | | | | | | | | <rtp_audio_in_largest_jb_size> | | | | | | | | | <rtp_audio_in_jitter_min_variance> | | | | | | | | | <rtp_audio_in_jitter_max_variance> | | | | | | | | | <rtp_audio_in_jitter_loss_rate> | | | | | | | | | <rtp_audio_in_jitter_burst_rate> | | | | | | | | | <rtp_audio_in_mean_interval> | | | | | | | | | <rtp_audio_in_flaw_total> | | | | | | | | | <rtp_audio_in_quality_percentage> | | | | | | | | | <rtp_audio_in_mos> | | | | | | | | | <rtp_audio_out_raw_bytes> | | | | | | | | | <rtp_audio_out_media_bytes> | | | | | | | | | <rtp_audio_out_packet_count> | | | | | | | | | <rtp_audio_out_media_packet_count> | | | | | | | | | <rtp_audio_out_skip_packet_count> | | | | | | | | | <rtp_audio_out_dtmf_packet_count> | | | | | | | | | <rtp_audio_out_cng_packet_count> | | | | | | | | | <rtp_audio_rtcp_packet_count> | | | | | | | | | <rtp_audio_rtcp_octet_count> | | | | | | | | | <rtp_video_in_raw_bytes> | | | | | | | | | <rtp_video_in_media_bytes> | | | | | | | | | <rtp_video_in_packet_count> | | | | | | | | | <rtp_video_in_media_packet_count> | | | | | | | | | <rtp_video_in_skip_packet_count> | | | | | | | | | <rtp_video_in_jitter_packet_count> | | | | | | | | | <rtp_video_in_dtmf_packet_count> | | | | | | | | | <rtp_video_in_cng_packet_count> | | | | | | | | | <rtp_video_in_flush_packet_count> | | | | | | | | | <rtp_video_in_largest_jb_size> | | | | | | | | | <rtp_video_in_jitter_min_variance> | | | | | | | | | <rtp_video_in_jitter_max_variance> | | | | | | | | | <rtp_video_in_jitter_loss_rate> | | | | | | | | | <rtp_video_in_jitter_burst_rate> | | | | | | | | | <rtp_video_in_mean_interval> | | | | | | | | | <rtp_video_in_flaw_total> | | | | | | | | | <rtp_video_in_quality_percentage> | | | | | | | | | <rtp_video_in_mos> | | | | | | | | | <rtp_video_out_raw_bytes> | | | | | | | | | <rtp_video_out_media_bytes> | | | | | | | | | <rtp_video_out_packet_count> | | | | | | | | | <rtp_video_out_media_packet_count> | | | | | | | | | <rtp_video_out_skip_packet_count> | | | | | | | | | <rtp_video_out_dtmf_packet_count> | | | | | | | | | <rtp_video_out_cng_packet_count> | | | | | | | | | <rtp_video_rtcp_packet_count> | | | | | | | | | <rtp_video_rtcp_octet_count> | | | | | | | | </variables> | | | | | | | | | <app_log> | | | | | | | | | | <application app_name="..." app_data="..."> | | | | | | | | | <application app_name="..." app_data="..."> | | | | | | | | </app_log> | | | | | | | | | <callflow dialplan="XML" unique-id="[UUID]" profile_index="1"> | | | | | | | | | | | <extension name="my conference" number="3500"> | | | | | | | | | <application app_name="..." app_data="..."> | | | | | | | | </extension> | | | | | | | | | <caller_profile> | | | | | | | | | | <username> | | | | | | | | | <dialplan> | | | | | | | | | <caller_id_name> | | | | | | | | | <caller_id_number> | | | | | | | | | <callee_id_name> | | | | | | | | | <callee_id_number> | | | | | | | | | <ani> | | | | | | | | | <aniii> | | | | | | | | | <network_addr> | | | | | | | | | <rdnis> | | | | | | | | | <destination_number> | | | | | | | | | <uuid> | | | | | | | | | <source> | | | | | | | | | <context> | | | | | | | | | <chan_name> | | | | | | | | </caller_profile> | | | | | | | | | <times> | | | | | | | | | | <created_time> | | | | | | | | | <profile_created_time> | | | | | | | | | <progress_time> | | | | | | | | | <progress_media_time> | | | | | | | | | <answered_time> | | | | | | | | | <bridged_time> | | | | | | | | | <last_hold_time> | | | | | | | | | <hold_accum_time> | | | | | | | | | <hangup_time> | | | | | | | | | <resurrect_time> | | | | | | | | | <transfer_time> | | | | | | | | </times> | | | | | | | | </callflow> | | | | | | | | </cdr> | | | | | | |

Comments:

The variables on this document have been reconciled into the Variables Master List. Posted by ryharris at Feb 07, 2018 12:49