bts: f_TC_rtp: Chose payload suitable for given codec

Change-Id: I4dbc621c347811f2e320f5001170937ae9c6499c
This commit is contained in:
Harald Welte 2018-04-02 19:45:15 +02:00
parent 16a57f17b7
commit 29713c3946
1 changed files with 23 additions and 2 deletions

View File

@ -2705,6 +2705,27 @@ private function f_RTP_len_by_chan_mod(RSL_IE_ChannelMode chmod) return integer
return -1;
}
private function f_RTP_pl_by_chan_mod(RSL_IE_ChannelMode chmod) return octetstring {
select (chmod) {
case (ts_RSL_ChanMode(RSL_CHRT_TCH_F, RSL_CMOD_SP_GSM1)) {
return 'D00000000000000000000000000000000000000000000000000000000000000000'O;
}
case (ts_RSL_ChanMode(RSL_CHRT_TCH_F, RSL_CMOD_SP_GSM2)) {
return 'C0000000000000000000000000000000000000000000000000000000000000'O
}
case (ts_RSL_ChanMode(RSL_CHRT_TCH_F, RSL_CMOD_SP_GSM3)) {
return ''O; // FIXME
}
case (ts_RSL_ChanMode(RSL_CHRT_TCH_H, RSL_CMOD_SP_GSM1)) {
return '700000000000000000000000000000'O;
}
case (ts_RSL_ChanMode(RSL_CHRT_TCH_H, RSL_CMOD_SP_GSM3)) {
return ''O; // FIXME
}
}
return ''O;
}
/* establish DChan, verify existance + contents of RTP stream */
function f_TC_rtp(charstring id) runs on ConnHdlr {
@ -2744,8 +2765,8 @@ function f_TC_rtp(charstring id) runs on ConnHdlr {
[] as_l1_dcch();
/* respond to TCH DL with TCH UL (codec frame) */
[] L1CTL.receive(tr_L1CTL_TRAFFIC_IND(g_chan_nr, ?, *, ?, ?)) {
var octetstring fr := 'D00000000000000000000000000000000000000000000000000000000000000000'O;
L1CTL.send(ts_L1CTL_TRAFFIC_REQ(g_chan_nr, ts_RslLinkID_DCCH(0), fr));
var octetstring pl := f_RTP_pl_by_chan_mod(g_pars.chan_mode);
L1CTL.send(ts_L1CTL_TRAFFIC_REQ(g_chan_nr, ts_RslLinkID_DCCH(0), pl));
repeat;
}
/* ignore everything else L1CTL might send us */