Thanks for this beautiful piece of a software. It seems to be working fine with a Python example script feeding the Kaldi server with chunks of .wav file. Same trick I wanted to perform in Asterisk by following official README instructions, however, it doesn't work as intended.
Next, I've cloned & built Asterisk's git branch code of v18.6 (no luck with latest v18.19 though):
So the Asterisk version seems to be okay at this point. The vosk-asterisk
lib was also built and installed in to Asterisk's default lib directory as follows:
[internal]
exten => 111,1,NoOp()
same => n,Answer()
same => n,SpeechCreate()
same => n,Wait(1)
same => n,SpeechBackground(/var/spool/asterisk/recording/ru-long1, 90)
same => n,Verbose(0,Result was ${SPEECH_TEXT(0)})
same => n,hangup()
... it's just a bunch of empty responses back from the Kaldi server as I understand. There is no real media chunks passing there, so no recognition happens actually. There was an idea to trace VM's internal traffic with tcpdump
and I've managed to catch some interesting info:
02:31:40.874029 lo In IP localhost.2700 > localhost.57494: Flags [.], ack 138126, win 512, options [nop,nop,TS val 4031340119 ecr 4031340077], length 0
02:31:40.954156 vethb24d8fa P IP 172.17.0.2.2700 > 172.17.0.1.51092: Flags [P.], seq 1123:1145, ack 138126, win 2105, options [nop,nop,TS val 3874166157 ecr 1350685573], length 22
02:31:40.954171 docker0 In IP 172.17.0.2.2700 > 172.17.0.1.51092: Flags [P.], seq 1123:1145, ack 138126, win 2105, options [nop,nop,TS val 3874166157 ecr 1350685573], length 22
02:31:40.954200 docker0 Out IP 172.17.0.1.51092 > 172.17.0.2.2700: Flags [.], ack 1145, win 501, options [nop,nop,TS val 1350685695 ecr 3874166157], length 0
02:31:40.954205 vethb24d8fa Out IP 172.17.0.1.51092 > 172.17.0.2.2700: Flags [.], ack 1145, win 501, options [nop,nop,TS val 1350685695 ecr 3874166157], length 0
02:31:40.954319 lo In IP localhost.2700 > localhost.57494: Flags [P.], seq 1123:1145, ack 138126, win 512, options [nop,nop,TS val 4031340200 ecr 4031340077], length 22
02:31:40.954328 lo In IP localhost.57494 > localhost.2700: Flags [.], ack 1145, win 512, options [nop,nop,TS val 4031340200 ecr 4031340200], length 0
02:31:41.022153 lo In IP localhost.57494 > localhost.2700: Flags [P.], seq 138126:141334, ack 1145, win 512, options [nop,nop,TS val 4031340267 ecr 4031340200], length 3208
02:31:41.022194 lo In IP localhost.2700 > localhost.57494: Flags [.], ack 141334, win 495, options [nop,nop,TS val 4031340267 ecr 4031340267], length 0
02:31:41.022281 docker0 Out IP 172.17.0.1.51092 > 172.17.0.2.2700: Flags [P.], seq 138126:141334, ack 1145, win 501, options [nop,nop,TS val 1350685763 ecr 3874166157], length 3208
02:31:41.022286 vethb24d8fa Out IP 172.17.0.1.51092 > 172.17.0.2.2700: Flags [P.], seq 138126:141334, ack 1145, win 501, options [nop,nop,TS val 1350685763 ecr 3874166157], length 3208
02:31:41.022308 vethb24d8fa P IP 172.17.0.2.2700 > 172.17.0.1.51092: Flags [.], ack 141334, win 2155, options [nop,nop,TS val 3874166226 ecr 1350685763], length 0
02:31:41.022314 docker0 In IP 172.17.0.2.2700 > 172.17.0.1.51092: Flags [.], ack 141334, win 2155, options [nop,nop,TS val 3874166226 ecr 1350685763], length 0
02:31:41.124809 vethb24d8fa P IP 172.17.0.2.2700 > 172.17.0.1.51092: Flags [P.], seq 1145:1167, ack 141334, win 2155, options [nop,nop,TS val 3874166328 ecr 1350685763], length 22
02:31:41.124816 docker0 In IP 172.17.0.2.2700 > 172.17.0.1.51092: Flags [P.], seq 1145:1167, ack 141334, win 2155, options [nop,nop,TS val 3874166328 ecr 1350685763], length 22
02:31:41.124837 docker0 Out IP 172.17.0.1.51092 > 172.17.0.2.2700: Flags [.], ack 1167, win 501, options [nop,nop,TS val 1350685866 ecr 3874166328], length 0
02:31:41.124840 vethb24d8fa Out IP 172.17.0.1.51092 > 172.17.0.2.2700: Flags [.], ack 1167, win 501, options [nop,nop,TS val 1350685866 ecr 3874166328], length 0
02:31:41.124906 lo In IP localhost.2700 > localhost.57494: Flags [P.], seq 1145:1167, ack 141334, win 512, options [nop,nop,TS val 4031340370 ecr 4031340267], length 22
02:31:41.124915 lo In IP localhost.57494 > localhost.2700: Flags [.], ack 1167, win 512, options [nop,nop,TS val 4031340370 ecr 4031340370], length 0
02:31:41.211333 lo In IP localhost.57494 > localhost.2700: Flags [P.], seq 141334:144542, ack 1167, win 512, options [nop,nop,TS val 4031340457 ecr 4031340370], length 3208
02:31:41.211389 lo In IP localhost.2700 > localhost.57494: Flags [.], ack 144542, win 495, options [nop,nop,TS val 4031340457 ecr 4031340457], length 0
02:31:41.211601 docker0 Out IP 172.17.0.1.51092 > 172.17.0.2.2700: Flags [P.], seq 141334:144542, ack 1167, win 501, options [nop,nop,TS val 1350685953 ecr 3874166328], length 3208
02:31:41.211612 vethb24d8fa Out IP 172.17.0.1.51092 > 172.17.0.2.2700: Flags [P.], seq 141334:144542, ack 1167, win 501, options [nop,nop,TS val 1350685953 ecr 3874166328], length 3208
02:31:41.211645 vethb24d8fa P IP 172.17.0.2.2700 > 172.17.0.1.51092: Flags [.], ack 144542, win 2205, options [nop,nop,TS val 3874166415 ecr 1350685953], length 0
02:31:41.211655 docker0 In IP 172.17.0.2.2700 > 172.17.0.1.51092: Flags [.], ack 144542, win 2205, options [nop,nop,TS val 3874166415 ecr 1350685953], length 0
02:31:41.216790 vethb24d8fa P IP 172.17.0.2.2700 > 172.17.0.1.51092: Flags [P.], seq 1167:1189, ack 144542, win 2205, options [nop,nop,TS val 3874166420 ecr 1350685953], length 22
02:31:41.216803 docker0 In IP 172.17.0.2.2700 > 172.17.0.1.51092: Flags [P.], seq 1167:1189, ack 144542, win 2205, options [nop,nop,TS val 3874166420 ecr 1350685953], length 22
Please pay your attention to the very end of each string of this output - you should see the packet lengths are pretty much the same, implying the abscense of any significant media payload inside the IP packets flowing between the Asterisk and Kaldi server. When I was testing Kaldi with the Python script, tracing all the IP traffic again, it had different packet lengths all the time, so I assume there was a real media exchange as it should be.
Let me know if I could give you more information on my setup, what was configured and how, show you some logs etc. Thank you!