subida ó gitlab

This commit is contained in:
serxoz 2024-04-15 13:27:34 +02:00
parent 72e3e5ac08
commit 38b24b53df
2 changed files with 11 additions and 6 deletions

View File

@ -18,7 +18,7 @@ use tokio::net::UdpSocket;
use tokio::time::{sleep, Duration};
// delay seconds for tarpit feature
static TARPIT_DELAY: u64 = 2; // more than 2 seconds make spivicious go timeout
static TARPIT_DELAY: u64 = 0; // more than 2 seconds make spivicious go timeout
struct Server {
socket: UdpSocket,
@ -129,10 +129,11 @@ impl Server {
let notfound = Generic {
command: "SIP/2.0 404 NotFound".to_string(),
via: register.via,
call_id: register.call_id,
call_id: register.call_id.unwrap(),
from: register.from,
to: format!("{};tag={}", register.to, register.branch),
cseq: register.cseq,
max_forwards: 70,
server: Some("Asterisk PBX 18.9.0".to_string()),
content_length: Some(0)
};

View File

@ -1,13 +1,15 @@
// Mandatory: To, From, CSeq, Call-ID, Max-Forwards, and Via;
// Para enviar respostas xenéricas
// un "vale para todo"
#[derive(Debug)]
pub struct Generic {
pub command: String,
pub via: String,
pub call_id: Option<String>,
pub from: String,
pub to: String,
pub from: String,
pub cseq: String,
pub call_id: String,
pub max_forwards: i32,
pub via: String,
pub server: Option<String>,
pub content_length: Option<i32>,
}
@ -18,6 +20,7 @@ impl Generic {
"{}
Via: {}
Call-ID: {}
Max-Forwards: {}
From: {}
To: {}
CSeq: {}
@ -25,7 +28,8 @@ Server: {}
Content-Length: {}",
&self.command,
&self.via,
&self.call_id.as_ref().unwrap(),
&self.call_id,
&self.max_forwards,
&self.from,
&self.to,
&self.cseq,