com>\r\nExpires:30\r\nFrom:sip:+12125551212@server.phone2net.com;\
tag=887s\r\nIn-Reply-To:70710@saturn.bell-tel.com,17320@saturn.\
bell-tel.com\r\nMax-Forwards:32\r\nMIME-Version:2.0\r\nMin-Expires:\
- 30\r\nOrganization:Foobar\r\nVia: localhost\r\n\r\n")
+ 30\r\nOrganization:Foobar\r\nPriority:normal\r\nVia: localhost\r\n\r\n")
});
let finished = request.and_then(|(socket, _request)| {
Language, AlertParam, Qop, AuthenticationInfo, AuthParam, Algorithm, DigestResponse,
Credentials, CallId, Purpose, InfoParam, Info, NameAddr, ContactParam, Target,
Contact, DispositionType, Handling, DispositionParam, ContentCoding, Day, Month, Date,
- Time, DateTime, ErrorUri, FromParam, From};
+ Time, DateTime, ErrorUri, FromParam, From, Priority};
fn is_mark(c: u8) -> bool {
c == b'-' || c == b'_' || c == b'.' || c == b'!' || c == b'~' || c == b'*' || c == b'\'' ||
tag!(b"Organization:"),
word));
+named!(priority_header<Priority>, preceded!(
+ tag!(b"Priority:"),
+ alt!(
+ tag!(b"emergency") => { |_| Priority::Emergency } |
+ tag!(b"urgent") => { |_| Priority::Urgent } |
+ tag!(b"normal") => { |_| Priority::Normal } |
+ tag!(b"non-urgent") => { |_| Priority::NonUrgent } |
+ token => { |t| Priority::Other(t) })));
+
named!(pub header<Header>, alt!(
// RFC 3261 Headers
accept_header => { |a| Header::Accept(a) } |
max_forwards_header => { |m| Header::MaxForwards(m) } |
mime_version_header => { |(m, v)| Header::MimeVersion(m, v) } |
min_expires_header => { |m| Header::MinExpires(m) } |
- organization_header => { |o| Header::Organization(o) }
+ organization_header => { |o| Header::Organization(o) } |
+ priority_header => { |p| Header::Priority(p) }
));