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