aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorHarald Welte <laforge@gnumonks.org>2017-12-24 23:59:47 +0100
committerHarald Welte <laforge@gnumonks.org>2017-12-25 00:03:07 +0100
commit809816472116dc4dc8ccca751c8ad648e51e7320 (patch)
tree0c2ff84acae0fd1fedd34fbf04dbf20d0e88dc45
parent3f6f48f4c1194844da7e2f1c7b26cb97342179f7 (diff)
RTP_Emulation: Integrate IuUP support
-rwxr-xr-xbsc/gen_links.sh2
-rw-r--r--library/RTP_Emulation.ttcn31
2 files changed, 28 insertions, 5 deletions
diff --git a/bsc/gen_links.sh b/bsc/gen_links.sh
index 5d8555a8..4316966e 100755
--- a/bsc/gen_links.sh
+++ b/bsc/gen_links.sh
@@ -76,5 +76,5 @@ FILES="RTP_EncDec.cc RTP_Types.ttcn"
gen_links $DIR $FILES
DIR=../library
-FILES="General_Types.ttcn Osmocom_Types.ttcn GSM_Types.ttcn IPA_Types.ttcn IPA_CodecPort.ttcn IPA_CodecPort_CtrlFunct.ttcn IPA_CodecPort_CtrlFunctDef.cc IPA_Emulation.ttcn L3_Templates.ttcn BSSMAP_Templates.ttcn BSSMAP_Emulation.ttcn RLCMAC_CSN1_Types.ttcn GSM_RR_Types.ttcn RSL_Types.ttcn RSL_Emulation.ttcn MGCP_Types.ttcn MGCP_Templates.ttcn MGCP_CodecPort.ttcn MGCP_CodecPort_CtrlFunct.ttcn MGCP_CodecPort_CtrlFunctDef.cc BSSAP_CodecPort.ttcn Osmocom_CTRL_Types.ttcn Osmocom_CTRL_Functions.ttcn RTP_CodecPort.ttcn RTP_CodecPort_CtrlFunct.ttcn RTP_CodecPort_CtrlFunctDef.cc RTP_Emulation.ttcn"
+FILES="General_Types.ttcn Osmocom_Types.ttcn GSM_Types.ttcn IPA_Types.ttcn IPA_CodecPort.ttcn IPA_CodecPort_CtrlFunct.ttcn IPA_CodecPort_CtrlFunctDef.cc IPA_Emulation.ttcn L3_Templates.ttcn BSSMAP_Templates.ttcn BSSMAP_Emulation.ttcn RLCMAC_CSN1_Types.ttcn GSM_RR_Types.ttcn RSL_Types.ttcn RSL_Emulation.ttcn MGCP_Types.ttcn MGCP_Templates.ttcn MGCP_CodecPort.ttcn MGCP_CodecPort_CtrlFunct.ttcn MGCP_CodecPort_CtrlFunctDef.cc BSSAP_CodecPort.ttcn Osmocom_CTRL_Types.ttcn Osmocom_CTRL_Functions.ttcn RTP_CodecPort.ttcn RTP_CodecPort_CtrlFunct.ttcn RTP_CodecPort_CtrlFunctDef.cc RTP_Emulation.ttcn IuUP_Types.ttcn IuUP_EncDec.cc IuUP_Emulation.ttcn"
gen_links $DIR $FILES
diff --git a/library/RTP_Emulation.ttcn b/library/RTP_Emulation.ttcn
index e55890e9..f9525106 100644
--- a/library/RTP_Emulation.ttcn
+++ b/library/RTP_Emulation.ttcn
@@ -21,6 +21,9 @@ import from RTP_Types all;
import from RTP_CodecPort all;
import from RTP_CodecPort_CtrlFunct all;
+import from IuUP_Types all;
+import from IuUP_Emulation all;
+
type component RTP_Emulation_CT {
/* down-facing ports for RTP and RTCP codec ports on top of IPL4asp */
port RTP_CODEC_PT RTP;
@@ -32,7 +35,7 @@ type component RTP_Emulation_CT {
port RTPEM_CTRL_PT CTRL;
/* configurable by user, should be fixed */
- var RtpemConfig g_cfg := c_default_cfg;
+ var RtpemConfig g_cfg := c_RtpemDefaultCfg;
var HostName g_remote_host;
var PortNumber g_remote_port;
@@ -47,6 +50,8 @@ type component RTP_Emulation_CT {
var INT7b g_rx_payload_type := 0;
var LIN2_BO_LAST g_rx_last_seq;
var uint32_t g_rx_last_ts;
+
+ var IuUP_Entity g_iuup_ent; // := valueof(t_IuUP_Entity(1));
}
type enumerated RtpemMode {
@@ -61,15 +66,19 @@ type record RtpemConfig {
integer tx_samplerate_hz,
integer tx_duration_ms,
BIT32_BO_LAST tx_ssrc,
- octetstring tx_fixed_payload optional
+ octetstring tx_fixed_payload optional,
+ boolean iuup_mode,
+ boolean iuup_tx_init
};
-const RtpemConfig c_default_cfg := {
+const RtpemConfig c_RtpemDefaultCfg := {
tx_payload_type := 0,
tx_samplerate_hz := 8000,
tx_duration_ms := 20,
tx_ssrc := '11011110101011011011111011101111'B,
- tx_fixed_payload := '01020304'O
+ tx_fixed_payload := '01020304'O,
+ iuup_mode := false,
+ iuup_tx_init := true
}
signature RTPEM_bind(in HostName local_host, inout PortNumber local_port);
@@ -98,6 +107,9 @@ template PDU_RTP ts_RTP(BIT32_BO_LAST ssrc, INT7b pt, LIN2_BO_LAST seq, uint32_t
}
private function f_tx_rtp(octetstring payload, BIT1 marker := '0'B) runs on RTP_Emulation_CT {
+ if (g_cfg.iuup_mode) {
+ payload := f_IuUP_Em_tx_encap(g_iuup_ent, payload);
+ }
var PDU_RTP rtp := valueof(ts_RTP(g_cfg.tx_ssrc, g_cfg.tx_payload_type, g_tx_next_seq,
g_tx_next_ts, payload, marker));
RTP.send(t_RTP_Send(g_rtp_conn_id, RTP_messages_union:{rtp:=rtp}));
@@ -128,6 +140,8 @@ function f_main() runs on RTP_Emulation_CT
tr_rtp.connId := g_rtcp_conn_id;
tr_rtcp.msg := { rtcp := ? };
+ g_iuup_ent := valueof(t_IuUP_Entity(g_cfg.iuup_tx_init));
+
while (true) {
alt {
/* control procedures (calls) from the user */
@@ -164,11 +178,13 @@ function f_main() runs on RTP_Emulation_CT
[] CTRL.getcall(RTPEM_mode:{RTPEM_MODE_NONE}) {
T_transmit.stop;
g_rx_enabled := false;
+ CTRL.reply(RTPEM_mode:{RTPEM_MODE_NONE});
}
[] CTRL.getcall(RTPEM_mode:{RTPEM_MODE_TXONLY}) {
/* start transmit timer */
T_transmit.start;
g_rx_enabled := false;
+ CTRL.reply(RTPEM_mode:{RTPEM_MODE_TXONLY});
}
[] CTRL.getcall(RTPEM_mode:{RTPEM_MODE_RXONLY}) {
@@ -179,6 +195,7 @@ function f_main() runs on RTP_Emulation_CT
RTCP.clear;
g_rx_enabled := true;
}
+ CTRL.reply(RTPEM_mode:{RTPEM_MODE_RXONLY});
}
[] CTRL.getcall(RTPEM_mode:{RTPEM_MODE_BIDIR}) {
T_transmit.start;
@@ -188,9 +205,12 @@ function f_main() runs on RTP_Emulation_CT
RTCP.clear;
g_rx_enabled := true;
}
+ CTRL.reply(RTPEM_mode:{RTPEM_MODE_BIDIR});
}
[] CTRL.getcall(RTPEM_configure:{?}) -> param (cfg) {
g_cfg := cfg;
+ g_iuup_ent.cfg.active_init := g_cfg.iuup_tx_init;
+ CTRL.reply(RTPEM_configure:{cfg});
}
/* simply ignore any RTTP/RTCP if receiver not enabled */
@@ -200,6 +220,9 @@ function f_main() runs on RTP_Emulation_CT
/* process received RTCP/RTP if receiver enabled */
[g_rx_enabled] RTP.receive(tr_rtp) -> value rx_rtp {
log("RX RTP: ", rx_rtp);
+ if (g_cfg.iuup_mode) {
+ rx_rtp.msg.rtp.data := f_IuUP_Em_rx_decaps(g_iuup_ent, rx_rtp.msg.rtp.data);
+ }
}
[g_rx_enabled] RTCP.receive(tr_rtcp) -> value rx_rtp {
log("RX RTCP: ", rx_rtp);