Support outbound call
This commit is contained in:
@@ -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)
|
||||
|
||||
Reference in New Issue
Block a user