Support outbound call

This commit is contained in:
2026-03-29 02:07:39 -04:00
parent 06c8bd9919
commit 0483588af5
4 changed files with 95 additions and 33 deletions

View File

@@ -17,7 +17,9 @@ use database::DidTargetType;
#[derive(Debug, Deserialize)]
struct RouteData {
#[serde(rename = "Caller-Destination-Number")]
dest_did: String
dest_did: String,
#[serde(rename = "Caller-Network-Addr")]
caller_ipaddr: String
}
#[derive(Debug, Deserialize)]
@@ -28,9 +30,10 @@ struct JsonDid {
active: bool
}
async fn route_did(data: web::Form<RouteData>) -> impl Responder {
let did = data.dest_did.clone();
let xml = httapi::route_call(did);
async fn route_did(form_data: web::Form<RouteData>) -> impl Responder {
let did = form_data.dest_did.clone();
let caller_ipaddr = form_data.caller_ipaddr.clone();
let xml = httapi::route_call(did, caller_ipaddr);
HttpResponse::Ok()
.content_type(ContentType::xml())
.body(xml)