[][src]Crate libsip

libsip has three basic components a parser and managers.

Managers are utility struct's meant to ease one specifc asspect of the sip protocol, the only manager currently implemented is for endpoint registration.

Parsing

libsip exposes many parsing function though only one parse_message is needed.

This example deliberately fails to compile
  let packet = "SIP/2.0 200 OK\r\n\r\n";
  let output = parse_message(packet)?;

Registration

The registration manager is used to generate REGISTER requests. Once that is sent to the server you must wait for the Challange response pass it to the set_challenge method of the RegistrationManager.

This example deliberately fails to compile
   let manager = RegistrationManager::new(account_uri, local_uri, Default::default());
   let req = manager.get_request()?;
   // send request
   // get response as res
   manager.set_challenge(res)?;
   let final_req = manager.get_request()?;
   // send request and expect 200 Ok.

Re-exports

pub use crate::core::Version;
pub use crate::core::Method;
pub use crate::headers::Header;
pub use crate::uri::Uri;
pub use crate::uri::Domain;
pub use crate::core::SipMessage;
pub use crate::core::message::parse_message;
pub use crate::registration::RegistrationManager;

Modules

core
headers
registration
uri

Macros

domain

Generate a URI domain from an domain name.

ip_domain

Generate a URI domain from an ip address.

named_header

Generate NamedHeader from a uri;

uri_auth

Generate a URI authentication from credentials.