aboutsummaryrefslogtreecommitdiffstats
path: root/lib/decoding
diff options
context:
space:
mode:
authorVasil Velichkov <vvvelichkov@gmail.com>2018-05-15 21:36:14 +0300
committerPiotr Krysik <ptrkrysik@gmail.com>2018-12-29 00:52:05 +0100
commit06321a39e07b3bc4a9f5701e86c0b70c702b8d7e (patch)
tree345ae1b80c2758637d60050e69d875971b79183e /lib/decoding
parent6ade8b8f19e95934db9a6897a7bc3bd965c3d1fc (diff)
Improve voice boundary detection
Decode Alerting and Progress messages and if the in-band information flag is set start decoding the voice
Diffstat (limited to 'lib/decoding')
-rw-r--r--lib/decoding/tch_h_decoder_impl.cc23
1 files changed, 22 insertions, 1 deletions
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;
}