From 06321a39e07b3bc4a9f5701e86c0b70c702b8d7e Mon Sep 17 00:00:00 2001 From: Vasil Velichkov Date: Tue, 15 May 2018 21:36:14 +0300 Subject: Improve voice boundary detection Decode Alerting and Progress messages and if the in-band information flag is set start decoding the voice --- lib/decoding/tch_h_decoder_impl.cc | 23 ++++++++++++++++++++++- 1 file changed, 22 insertions(+), 1 deletion(-) (limited to 'lib/decoding/tch_h_decoder_impl.cc') diff --git a/lib/decoding/tch_h_decoder_impl.cc b/lib/decoding/tch_h_decoder_impl.cc index b7672e3..d2f29c7 100644 --- a/lib/decoding/tch_h_decoder_impl.cc +++ b/lib/decoding/tch_h_decoder_impl.cc @@ -293,8 +293,29 @@ namespace gr { // check if this is a call control message if ((frameBuffer[3] & 0x0f) == 0x03) { + // Alerting + if ((frameBuffer[4] & 0x3f) == 0x01) + { + if ((frameBuffer[5] == 0x1e) && //element id + (frameBuffer[6] == 2) && //length + ((frameBuffer[8] & 0x7f) == 0x08)) + { + //.000 1000 = Progress description: In-band information or appropriate pattern now available (8) + d_boundary_decode = true; + } + } + // Progress + else if ((frameBuffer[4] & 0x3f) == 0x03) + { + if ((frameBuffer[5] == 2) && //length + (frameBuffer[7] & 0x7f) == 0x08) + { + //.000 1000 = Progress description: In-band information or appropriate pattern now available (8) + d_boundary_decode = true; + } + } // Connect specified in GSM 04.08, 9.3.5 - if ((frameBuffer[4] & 0x3f) == 0x07) + else if ((frameBuffer[4] & 0x3f) == 0x07) { d_boundary_decode = true; } -- cgit v1.2.3