cal_core/
routing.rs

1use std::collections::HashMap;
2use serde::{Deserialize, Serialize};
3use crate::RecordReference;
4
5#[derive(Serialize, Deserialize, Clone, Debug)]
6#[serde(rename_all = "camelCase")]
7pub struct Proxy {
8    #[serde(deserialize_with = "crate::shared::object_id_as_string", rename = "_id")]
9    pub id:String,
10    pub username: Option<String>,
11    pub password: Option<String>,
12    pub port: u16,
13    pub priority: u8,
14    pub inbound: bool,
15    pub outbound: bool,
16    pub active: bool,
17    pub ip: String,
18    #[serde(rename = "type")]
19    pub proxy_type: String,
20    pub zone: String,
21    pub description: String,
22    pub country_code:String,
23    #[serde(default)]
24    pub headers: HashMap<String, String>,
25}
26
27
28#[derive(Serialize, Deserialize, Clone)]
29#[serde(rename_all = "camelCase")]
30pub struct Route {
31    #[serde(deserialize_with = "crate::shared::object_id_as_string", rename = "_id")]
32    pub id: String,
33    pub caller: String,
34    pub called: String,
35    pub diversion: Option<String>,
36    pub paid: Option<String>,
37    pub from_domain: Option<String>,
38    pub obp: RecordReference,
39    #[serde(default)]
40    pub headers: HashMap<String, String>,
41}