@@ -47,11 +47,9 @@ use tracing::{debug, info, warn};
4747/// caller: "sip:alice@example.com".try_into()?,
4848/// callee: "sip:bob@example.com".try_into()?,
4949/// content_type: Some("application/sdp".to_string()),
50- /// destination: None,
5150/// offer: Some(sdp_offer_bytes),
5251/// contact: "sip:alice@192.168.1.100:5060".try_into()?,
53- /// credential: None,
54- /// headers: None,
52+ /// ..Default::default()
5553/// };
5654/// # Ok(())
5755/// # }
@@ -85,11 +83,11 @@ use tracing::{debug, info, warn};
8583/// caller: "sip:alice@example.com".try_into()?,
8684/// callee: "sip:bob@example.com".try_into()?,
8785/// content_type: Some("application/sdp".to_string()),
88- /// destination: None,
8986/// offer: Some(sdp_bytes),
9087/// contact: "sip:alice@192.168.1.100:5060".try_into()?,
9188/// credential: Some(auth_credential),
9289/// headers: Some(custom_headers),
90+ /// ..Default::default()
9391/// };
9492/// # Ok(())
9593/// # }
@@ -111,18 +109,18 @@ use tracing::{debug, info, warn};
111109/// let invite_option = InviteOption {
112110/// caller: "sip:alice@example.com".try_into()?,
113111/// callee: "sip:bob@example.com".try_into()?,
114- /// content_type: None, // Will default to "application/sdp"
115- /// destination: None,
116112/// offer: Some(sdp_bytes),
117113/// contact: "sip:alice@192.168.1.100:5060".try_into()?,
118114/// credential: Some(credential),
119- /// headers: None,
115+ /// ..Default::default()
120116/// };
121117/// # Ok(())
122118/// # }
123119/// ```
124120#[ derive( Default , Clone ) ]
125121pub struct InviteOption {
122+ pub caller_display_name : Option < String > ,
123+ pub caller_params : Vec < rsip:: uri:: Param > ,
126124 pub caller : rsip:: Uri ,
127125 pub callee : rsip:: Uri ,
128126 pub destination : Option < SipAddr > ,
@@ -248,9 +246,9 @@ impl DialogLayer {
248246 let recipient = to. uri . clone ( ) ;
249247
250248 let from = rsip:: typed:: From {
251- display_name : None ,
249+ display_name : opt . caller_display_name . clone ( ) ,
252250 uri : opt. caller . clone ( ) ,
253- params : vec ! [ ] ,
251+ params : opt . caller_params . clone ( ) ,
254252 }
255253 . with_tag ( make_tag ( ) ) ;
256254
0 commit comments