Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
18 changes: 15 additions & 3 deletions src/dialog/invitation.rs
Original file line number Diff line number Diff line change
Expand Up @@ -133,6 +133,7 @@ pub struct InviteOption {
pub credential: Option<Credential>,
pub headers: Option<Vec<rsip::Header>>,
pub support_prack: bool,
pub call_id: Option<String>,
}

pub struct DialogGuard {
Expand Down Expand Up @@ -249,10 +250,21 @@ impl DialogLayer {
}
.with_tag(make_tag());

let call_id = opt
.call_id
.as_ref()
.map(|id| rsip::headers::CallId::from(id.clone()));

let via = self.endpoint.get_via(None, None)?;
let mut request =
self.endpoint
.make_request(rsip::Method::Invite, recipient, via, from, to, last_seq);
let mut request = self.endpoint.make_request(
rsip::Method::Invite,
recipient,
via,
from,
to,
last_seq,
call_id,
);

let contact = rsip::typed::Contact {
display_name: None,
Expand Down
1 change: 1 addition & 0 deletions src/dialog/registration.rs
Original file line number Diff line number Diff line change
Expand Up @@ -402,6 +402,7 @@ impl Registration {
from,
to,
self.last_seq,
None,
);

// Thanks to https://github.com/restsend/rsipstack/issues/32
Expand Down
7 changes: 5 additions & 2 deletions src/transaction/message.rs
Original file line number Diff line number Diff line change
Expand Up @@ -62,7 +62,8 @@ impl EndpointInner {
/// via,
/// from,
/// to,
/// 1
/// 1,
/// None,
/// );
/// # Ok(())
/// # }
Expand Down Expand Up @@ -96,10 +97,12 @@ impl EndpointInner {
from: rsip::typed::From,
to: rsip::typed::To,
seq: u32,
call_id: Option<rsip::headers::CallId>,
) -> rsip::Request {
let call_id = call_id.unwrap_or_else(|| make_call_id(self.option.callid_suffix.as_deref()));
let headers = vec![
Header::Via(via.into()),
Header::CallId(make_call_id(self.option.callid_suffix.as_deref())),
Header::CallId(call_id),
Header::From(from.into()),
Header::To(to.into()),
Header::CSeq(rsip::typed::CSeq { seq, method }.into()),
Expand Down