Skip to content

Commit 5bcb002

Browse files
committed
imrpove: remove unused definition
1 parent e1b6ebf commit 5bcb002

1 file changed

Lines changed: 0 additions & 56 deletions

File tree

tests/sdp_bridge_e2e_test.rs

Lines changed: 0 additions & 56 deletions
Original file line numberDiff line numberDiff line change
@@ -13,62 +13,6 @@ use rustpbx::media::{RtpTrackBuilder, Track};
1313
use rustrtc::TransportMode;
1414
use rustrtc::sdp::{SdpType, SessionDescription};
1515

16-
struct BridgeCodecLists {
17-
caller_side: Vec<rustpbx::media::negotiate::CodecInfo>,
18-
callee_side: Vec<rustpbx::media::negotiate::CodecInfo>,
19-
}
20-
21-
trait TestBridgeCodecLists {
22-
fn build_bridge_codec_lists(
23-
caller_sdp: &str,
24-
caller_is_webrtc: bool,
25-
callee_is_webrtc: bool,
26-
allow_codecs: &[CodecType],
27-
) -> BridgeCodecLists;
28-
}
29-
30-
impl TestBridgeCodecLists for rustpbx::media::negotiate::MediaNegotiator {
31-
fn build_bridge_codec_lists(
32-
caller_sdp: &str,
33-
caller_is_webrtc: bool,
34-
callee_is_webrtc: bool,
35-
allow_codecs: &[CodecType],
36-
) -> BridgeCodecLists {
37-
let mut caller_side = Self::build_codec_list_from_offer(caller_sdp, allow_codecs);
38-
if caller_is_webrtc {
39-
caller_side = filter_webrtc_answer_codecs(caller_side);
40-
}
41-
42-
let mut callee_side = Self::build_callee_codec_offer_with_allow(caller_sdp, allow_codecs);
43-
if callee_is_webrtc {
44-
callee_side = Self::filter_webrtc_offer_codecs(caller_sdp, callee_side);
45-
}
46-
47-
BridgeCodecLists {
48-
caller_side,
49-
callee_side,
50-
}
51-
}
52-
}
53-
54-
fn filter_webrtc_answer_codecs(
55-
codecs: Vec<rustpbx::media::negotiate::CodecInfo>,
56-
) -> Vec<rustpbx::media::negotiate::CodecInfo> {
57-
let audio_clock_rates: std::collections::HashSet<_> = codecs
58-
.iter()
59-
.filter(|codec| !codec.is_dtmf() && codec.codec != CodecType::G729)
60-
.map(|codec| codec.clock_rate)
61-
.collect();
62-
63-
codecs
64-
.into_iter()
65-
.filter(|codec| {
66-
codec.codec != CodecType::G729
67-
&& (!codec.is_dtmf() || audio_clock_rates.contains(&codec.clock_rate))
68-
})
69-
.collect()
70-
}
71-
7216
/// Helper: create a WebRTC track simulating a browser caller (e.g., JsSIP).
7317
fn create_webrtc_caller(port_start: u16) -> Box<dyn Track> {
7418
Box::new(

0 commit comments

Comments
 (0)