Skip to main content

CallRecord

Struct CallRecord 

Source
pub struct CallRecord {
Show 52 fields pub call_num: u64, pub transmission_id: String, pub freq: u64, pub freq_error: i64, pub signal: Option<f64>, pub noise: Option<f64>, pub snr: Option<f64>, pub clean_voice_pct: Option<f64>, pub source_num: i64, pub recorder_num: i64, pub tdma_slot: i64, pub phase2_tdma: bool, pub start_time: i64, pub stop_time: i64, pub start_time_ms: i64, pub stop_time_ms: i64, pub emergency: bool, pub priority: i64, pub mode: bool, pub duplex: bool, pub encrypted: bool, pub algid: i64, pub key_id: i64, pub decrypted: bool, pub clock_off: bool, pub call_length: f64, pub call_length_ms: i64, pub talkgroup: u32, pub talkgroup_ota: Option<u32>, pub talkgroup_tag: String, pub talkgroup_description: String, pub talkgroup_group_tag: String, pub talkgroup_group: String, pub nac: String, pub color_code: i64, pub ran: i64, pub tone_mode: String, pub tone_detected: String, pub tone_confidence: f64, pub audio_type: String, pub system_type: String, pub voice_mode: String, pub short_name: String, pub site: String, pub patched_talkgroups: Vec<u32>, pub freq_list: Vec<FreqEntry>, pub error_list: Vec<ErrorInterval>, pub src_list: Vec<SrcEntry>, pub tones: Vec<ToneEntry>, pub tone_patterns: Vec<TonePattern>, pub signals: Vec<String>, pub extra: Map<String, Value>,
}
Expand description

A call’s JSON, in Trunk Recorder’s format: the .json file beside its audio. The recorder makes one of these for every call and writes it as it serialises (field order, flags as 0/1, levels to a tenth of a dB); read back, it accepts Trunk Recorder’s own files too (flags as 0/1 or booleans). Fields neither writes are kept in extra. Its default is the recorder’s for what wasn’t heard (-1, "off", "digital").

Serialise it as JSON with serde_json (CallRecord::to_json): its numbers are written through serde_json’s raw values, which other serde formats don’t take.

Fields§

§call_num: u64§transmission_id: String

The same on every copy of one transmission (a system’s sites, each recording it): <system>-<talkgroup>-<radio>-<start ms>, the radio the first known to talk (0: none), the start the first copy’s. With conversation mode on, a call’s first transmission names it.

§freq: u64

Hz.

§freq_error: i64

How far off its channel the voice carrier came in, Hz (the mean over the call).

§signal: Option<f64>

Levels while it was heard, dB (null: not measured).

§noise: Option<f64>§snr: Option<f64>§clean_voice_pct: Option<f64>

Voice frames decoded without errors, % (null: no digital voice).

§source_num: i64§recorder_num: i64§tdma_slot: i64§phase2_tdma: bool§start_time: i64

Unix seconds.

§stop_time: i64§start_time_ms: i64

Unix ms.

§stop_time_ms: i64§emergency: bool§priority: i64§mode: bool

Packet mode.

§duplex: bool§encrypted: bool§algid: i64

The cipher its encryption sync named (-1: none heard).

§key_id: i64§decrypted: bool

Its encrypted voice was decrypted, at least in part (this recorder’s addition).

§clock_off: bool

Its times may be off: when it ended, the recorder’s clock was measured a quarter second or more off, or the operating system said it wasn’t synchronized (this recorder’s addition; absent when the clock was fine).

§call_length: f64

Seconds of audio.

§call_length_ms: i64§talkgroup: u32§talkgroup_ota: Option<u32>

Conventional P25 / DMR / NXDN: the talkgroup the air named (this recorder’s addition, like site). talkgroup is what the call is filed under, which a channel row may set to another number; none for analog, trunked calls, or a call whose air named none.

§talkgroup_tag: String§talkgroup_description: String§talkgroup_group_tag: String§talkgroup_group: String§nac: String

P25: the NAC its voice carried on a conventional channel, its site’s on a trunked system, in hex as radios and channel files write it ("293"; empty: none; this recorder’s addition).

§color_code: i64

DMR: its colour code (-1: none).

§ran: i64

NXDN: its RAN (-1: none).

§tone_mode: String

An analog call’s tone (Trunk Recorder’s): “ctcss”, “dcs”, “search” (identified, not matched) or “off”.

§tone_detected: String§tone_confidence: f64§audio_type: String

“digital” | “digital tdma” | “analog”

§system_type: String

The kind of system it came on, as SystemInfo::kind has it: “p25” | “smartnet” | “dmr” | “nxdn” | “edacs” | “conventional” (this recorder’s addition).

§voice_mode: String

What its voice was: “p25” | “p25_phase2” | “dmr” | “nxdn48” | “nxdn96” | “provoice” | “fm” | “am” — a conventional channel’s mode, or a trunked grant’s (this recorder’s addition).

§short_name: String§site: String

The site its copy was kept from (this recorder’s addition; a system of one site: its short name; none for a conventional system’s).

§patched_talkgroups: Vec<u32>

Every talkgroup patched with this one during the call, its own included; absent (empty) when it wasn’t patched with another.

§freq_list: Vec<FreqEntry>§error_list: Vec<ErrorInterval>

Voice frame errors over the call, in stretches of its audio.

§src_list: Vec<SrcEntry>§tones: Vec<ToneEntry>

In-band tones sent in its voice (DTMF, KNOX, call progress, single tones), in order. This recorder’s: Trunk Recorder has none.

§tone_patterns: Vec<TonePattern>

What its tones make up: pages, alerts, digit strings, in order.

§signals: Vec<String>

The system’s signals it carried (their ids), in the order first heard.

§extra: Map<String, Value>

Implementations§

Source§

impl CallRecord

Source

pub fn error_count(&self) -> u64

Voice frames with bit errors, over the call.

Source

pub fn spike_count(&self) -> u64

Source

pub fn to_json(&self) -> String

As the .json file has it.

Trait Implementations§

Source§

impl Clone for CallRecord

Source§

fn clone(&self) -> Self

Returns a duplicate of the value. Read more
1.0.0 (const: unstable) · Source§

fn clone_from(&mut self, source: &Self)

Performs copy-assignment from source. Read more
Source§

impl Debug for CallRecord

Source§

fn fmt(&self, f: &mut Formatter<'_>) -> Result

Formats the value using the given formatter. Read more
Source§

impl Default for CallRecord

Source§

fn default() -> Self

Returns the “default value” for a type. Read more
Source§

impl<'de> Deserialize<'de> for CallRecord

Source§

fn deserialize<__D>(__deserializer: __D) -> Result<Self, __D::Error>
where __D: Deserializer<'de>,

Deserialize this value from the given Serde deserializer. Read more
Source§

impl PartialEq for CallRecord

Source§

fn eq(&self, other: &Self) -> bool

Equality operator ==. Read more
1.0.0 (const: unstable) · Source§

fn ne(&self, other: &Rhs) -> bool

Inequality operator !=. Read more
Source§

impl Serialize for CallRecord

Source§

fn serialize<__S>(&self, __serializer: __S) -> Result<__S::Ok, __S::Error>
where __S: Serializer,

Serialize this value into the given Serde serializer. Read more
Source§

impl StructuralPartialEq for CallRecord

Auto Trait Implementations§

Blanket Implementations§

Source§

impl<T> Any for T
where T: 'static + ?Sized,

Source§

fn type_id(&self) -> TypeId

Gets the TypeId of self. Read more
Source§

impl<T> Borrow<T> for T
where T: ?Sized,

Source§

fn borrow(&self) -> &T

Immutably borrows from an owned value. Read more
Source§

impl<T> BorrowMut<T> for T
where T: ?Sized,

Source§

fn borrow_mut(&mut self) -> &mut T

Mutably borrows from an owned value. Read more
Source§

impl<T> CloneToUninit for T
where T: Clone,

Source§

unsafe fn clone_to_uninit(&self, dest: *mut u8)

🔬This is a nightly-only experimental API. (clone_to_uninit)
Performs copy-assignment from self to dest. Read more
Source§

impl<T> DeserializeOwned for T
where T: for<'de> Deserialize<'de>,

Source§

impl<T> DynClone for T
where T: Clone,

Source§

fn __clone_box(&self, _: Private) -> *mut ()

Source§

impl<T> From<T> for T

Source§

fn from(t: T) -> T

Returns the argument unchanged.

Source§

impl<T, U> Into<U> for T
where U: From<T>,

Source§

fn into(self) -> U

Calls U::from(self).

That is, this conversion is whatever the implementation of From<T> for U chooses to do.

Source§

impl<T> ToOwned for T
where T: Clone,

Source§

type Owned = T

The resulting type after obtaining ownership.
Source§

fn to_owned(&self) -> T

Creates owned data from borrowed data, usually by cloning. Read more
Source§

fn clone_into(&self, target: &mut T)

Uses borrowed data to replace owned data, usually by cloning. Read more
Source§

impl<T, U> TryFrom<U> for T
where U: Into<T>,

Source§

type Error = !

The type returned in the event of a conversion error.
Source§

fn try_from(value: U) -> Result<T, !>

Performs the conversion.
Source§

impl<T, U> TryInto<U> for T
where U: TryFrom<T>,

Source§

type Error = <U as TryFrom<T>>::Error

The type returned in the event of a conversion error.
Source§

fn try_into(self) -> Result<U, <U as TryFrom<T>>::Error>

Performs the conversion.