Skip to content

GUI cannot view nor edit manually created .toml trunks/routes/queues #179

@rgon

Description

@rgon

As an admin, I expect the GUI to represent all of the current configuration options, so that no behavior is hidden.

When adding a new configuration file (in this case netelip2.toml -> [trunks.netelipB] those config files are correctly loaded by the backend according to the proxy.routes_files file glob pattern.

rustpbx  | 2026-04-12T17:03:43.509231304Z  INFO rustpbx::handler::ami: Reload SIP trunks via /reload/trunks endpoint client_ip=127.0.0.1:34052
rustpbx  | 2026-04-12T17:03:43.51304868Z  INFO rustpbx::proxy::data: generated trunks file from database path=config/trunks/trunks.generated.toml entries=1
rustpbx  | 2026-04-12T17:03:43.513690193Z  INFO rustpbx::proxy::data: loaded trunk 'netelipB' from config/trunks/netelip2.toml
rustpbx  | 2026-04-12T17:03:43.513951282Z  INFO rustpbx::proxy::data: loaded trunk 'netelip' from config/trunks/trunks.generated.toml
rustpbx  | 2026-04-12T17:03:43.514298755Z  INFO rustpbx::proxy::data: loaded trunk 'netelip' from config/trunks/trunks.generated.toml
rustpbx  | 2026-04-12T17:03:43.514373144Z  INFO rustpbx::proxy::data: trunks reloaded total=2 config_count=0 file_count=2 generated_entries=1 duration_ms=4

However, the GUI hides them, and the only indication that it the second .toml file is loaded is the reload message. If we don't reload, it's completely hidden to our view.
Image

This is because the /console/sip-trunk request handler queries the DB

async fn query_sip_trunks(
State(state): State<Arc<ConsoleState>>,
AuthRequired(_): AuthRequired,
Json(payload): Json<ListQuery<QuerySipTrunkFilters>>,
) -> Response {
let db = state.db();
let filters_payload;
{
let (payload, _) = build_filters_payload(db).await;
filters_payload = payload;
}
let filters = payload.filters.clone().unwrap_or_default();
let (_, per_page) = payload.normalize();
let mut selector = SipTrunkEntity::find();
if let Some(ref q_raw) = filters.q {
let trimmed = q_raw.trim();
if !trimmed.is_empty() {
let mut condition = Condition::any();
condition = condition.add(SipTrunkColumn::Name.contains(trimmed));
condition = condition.add(SipTrunkColumn::DisplayName.contains(trimmed));
condition = condition.add(SipTrunkColumn::Carrier.contains(trimmed));
condition = condition.add(SipTrunkColumn::SipServer.contains(trimmed));
selector = selector.filter(condition);
}
}

instead of reading the config files (yet it writes the routes.generated.toml file).

An acceptable option, if we don't want to rewrite the entire route handling, would be to at least list the .toml-configured routes/trunks/queues in the GUI, next to the .generated.toml ones, even if they can't be edited (but same-class support for all toml files would be also nice).

Will probably affect the same code areas as #176.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions