ringo_core/account.rs
1/// A SIP account to register, independent of any ringo profile/config. Callers
2/// (the softphone or the scenario runner) build this from their own source.
3#[derive(Debug, Clone, Default, serde::Serialize, serde::Deserialize)]
4pub struct Account {
5 pub username: String,
6 pub domain: String,
7 pub password: String,
8 pub display_name: Option<String>,
9 pub transport: Option<String>,
10 pub auth_user: Option<String>,
11 pub outbound: Option<String>,
12 pub stun_server: Option<String>,
13 pub media_enc: Option<String>,
14 pub regint: Option<u32>,
15 pub mwi: bool,
16 /// DTMF transmission mode (`rtpevent` / `info` / `auto`). `info` sends DTMF as
17 /// SIP INFO, independent of the RTP audio stream — needed where the audio TX
18 /// may be idle (e.g. headless with no clocked source). `None` keeps the
19 /// backend's default.
20 pub dtmf_mode: Option<String>,
21 /// Mark this account as a baresip `catchall` UA: incoming INVITEs whose
22 /// request-URI user matches no registered contact-user fall back to this UA
23 /// instead of being rejected with `404 (UA not found)`. Needed when a
24 /// provider delivers calls addressed to identities other than the
25 /// registration username (the request-URI user is the called number/identity,
26 /// not the account login), which baresip's contact-user match would reject.
27 /// Only safe with a single registered UA per process — with several, baresip
28 /// routes the fallback to just one of them.
29 pub catchall: bool,
30}
31
32/// Overrides for auto-detected backend settings. Any `None`/empty field
33/// is auto-detected at spawn time.
34#[derive(Debug, Clone, Default, serde::Serialize, serde::Deserialize)]
35pub struct BackendOptions {
36 pub audio_driver: Option<String>,
37 pub audio_player_device: Option<String>,
38 pub audio_source_device: Option<String>,
39 pub audio_alert_device: Option<String>,
40 pub sip_cafile: Option<String>,
41 /// `None` = auto-detect; `Some("")` = explicitly disable.
42 pub sip_capath: Option<String>,
43 /// Max simultaneous calls (`call_max_calls`). `None` = 4.
44 pub max_calls: Option<u32>,
45 /// Auto-hold the active call when another comes up / the user switches
46 /// (`call_hold_other_calls`). `None` = on. The scenario runner turns this
47 /// off so a test keeps explicit control over hold/resume.
48 pub hold_other_calls: Option<bool>,
49 /// Outgoing-call ring timeout in seconds (`call_local_timeout`). `None` = 120.
50 pub local_timeout_s: Option<u32>,
51 /// SIP `User-Agent` string passed to `ua_init` (e.g. `ringo-phone/0.11.0`).
52 /// `None` = bare `ringo`. Set by the binary so it carries its own version.
53 pub user_agent: Option<String>,
54 /// Arbitrary extra config lines appended at the end (key, value).
55 pub extra: Vec<(String, String)>,
56 /// Capture the full call's sent + received audio in-process (for the
57 /// scenario runner's `--save-audio`). When off, only a short rolling window
58 /// is retained for `verify-audio`. The softphone leaves this off.
59 pub record_audio: bool,
60}