aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authormetamuffin <metamuffin@disroot.org>2024-07-17 14:03:46 +0200
committermetamuffin <metamuffin@disroot.org>2024-07-17 14:03:46 +0200
commit2d9a31244eab6d3a9871369d3148de253e902d36 (patch)
tree84eb24139bfd0f481b4973fbfb98b4ece0119bf2
parent272d3ddb76e8f017a8a2fe0899e58e0dff840c9f (diff)
downloadsip-rs-2d9a31244eab6d3a9871369d3148de253e902d36.tar
sip-rs-2d9a31244eab6d3a9871369d3148de253e902d36.tar.bz2
sip-rs-2d9a31244eab6d3a9871369d3148de253e902d36.tar.zst
a
-rw-r--r--examples/server.rs9
-rw-r--r--src/encoding/uri.rs1
2 files changed, 1 insertions, 9 deletions
diff --git a/examples/server.rs b/examples/server.rs
index 6132dd5..02c06b4 100644
--- a/examples/server.rs
+++ b/examples/server.rs
@@ -7,7 +7,6 @@ use sip::{
method::Method,
response::Response,
status::Status,
- uri::Uri,
},
transaction::TransactionUser,
transport::tcp::TcpTransport,
@@ -55,13 +54,6 @@ async fn handle_client(stream: TcpStream, addr: SocketAddr) -> Result<()> {
Response {
status: Status::Ok,
headers: HeaderMap::new()
- // .add(Contact {
- // display_name: None,
- // uri: Uri {
- // content: format!("sip:username@{addr}"),
- // },
- // params: ";expires=600".to_string(),
- // })
.add(contact)
.add(via)
.add(to)
@@ -72,6 +64,7 @@ async fn handle_client(stream: TcpStream, addr: SocketAddr) -> Result<()> {
)
.await?;
}
+ if req.method == Method::Invite {}
}
}
diff --git a/src/encoding/uri.rs b/src/encoding/uri.rs
index db20700..b1a1282 100644
--- a/src/encoding/uri.rs
+++ b/src/encoding/uri.rs
@@ -37,7 +37,6 @@ impl Display for Uri {
impl FromStr for Uri {
type Err = anyhow::Error;
fn from_str(s: &str) -> Result<Self, Self::Err> {
- eprintln!("{s:?}");
let (pr, s) = s.split_once(":").ok_or(anyhow!("protocol sep"))?;
let (lp, s) = s.split_once("@").unwrap_or(("", s));
let (addr, params) = s.split_once(";").unwrap_or((s, ""));