/// Send a request to the call manager to make the call active.
/// Only one call can be active at a time. Before requesting the call at `index` be made
/// active, all active calls are either terminated or placed on hold depending on
/// `terminate_others`.
Send a request to the call manager to make the call active.
Only one call can be active at a time. Before requesting the call at `index` be made
active, all active calls are either terminated or placed on hold depending on
`terminate_others`.
Send a request to the call manager to make the call active . Only one call can be active at a time . Before requesting the call at ` index ` be made active all active calls are either terminated or placed on hold depending on ` terminate_others ` .
pub fn request_active(
        &mut self,
        index: CallIdx,
        terminate_others: bool,
    ) -> Result<(), CallError> {
        let action =
            if terminate_others { CallProxy::request_terminate } else { CallProxy::request_hold };
        // Collect active_calls into a Vec to avoid double borrowing self.
        let active_calls: Vec<_> = self
            .current_calls
            .calls()
            .filter_map(|(i, call)| (i != index && call.is_active()).then(|| i))
            .collect();
        for i in active_calls {
            // Failures are ignored.
            let _ = self.send_call_request(i, action);
        }
        self.send_call_request(index, CallProxy::request_active)
    }
pub fn request_active ( & mut self , index : CallIdx , terminate_others : bool , ) -> Result < ( ) , CallError > { let action = if terminate_others { CallProxy :: request_terminate } else { CallProxy :: request_hold } ; // Collect active_calls into a Vec to avoid double borrowing self. let active_calls : Vec < _ > = self . current_calls . calls ( ) . filter_map ( | ( i , call ) | ( i != index && call . is_active ( ) ) . then ( | | i ) ) . collect ( ) ; for i in active_calls { // Failures are ignored. let _ = self . send_call_request ( i , action ) ; } self . send_call_request ( index , CallProxy :: request_active ) }
Send a request to the call manager to make the call active.
Send a request to the call manager to make the call active .
&mut self
index
CallIdx
terminate_others
bool