Closed gobindabd closed 4 years ago
And how to reproduce this error?
Here is my dialplan
[internal]
exten = 1,1,Answer
same = n,Wait(1)
sane = n,Set(TALK_DETECT(set)=128)
same = n,SpeechCreate
same = n,SpeechBackground(vm-intro)
same = n,Verbose(0,Result was ${SPEECH_TEXT(0)})
If you use this and dial 5-10, you will face this issue again. Also facing a broken voice issue( with all codec )
[Jun 17 19:24:22] ERROR[24475][C-00000007]: frame.c:140 __frame_free: FRACK!, Failed assertion bad magic number 0x0 for object 0x1494048 (0)
[Jun 17 19:24:22] ERROR[24475][C-00000007]: Got 15 backtrace records
# 0: /usr/sbin/asterisk(__ao2_ref+0x97) [0x45dca7]
# 1: /usr/sbin/asterisk(ast_frame_free+0x193) [0x4efbf3]
# 2: /usr/sbin/asterisk(ast_audiohook_write_list+0x8b6) [0x4675d6]
# 3: /usr/sbin/asterisk(ast_write_stream+0xfcf) [0x4a63df]
# 4: /usr/sbin/asterisk() [0x4e2688]
# 5: /usr/sbin/asterisk() [0x4e2829]
# 6: /usr/sbin/asterisk() [0x4ae3a9]
# 7: /usr/lib64/asterisk/modules/app_talkdetect.so(+0x19ac) [0x7f6af391c9ac]
# 8: /usr/sbin/asterisk(pbx_exec+0xb9) [0x52e5a9]
# 9: /usr/sbin/asterisk() [0x521f01]
#10: /usr/sbin/asterisk() [0x523f64]
#11: /usr/sbin/asterisk() [0x5254eb]
#12: /usr/sbin/asterisk() [0x5a4e69]
#13: /lib64/libpthread.so.0(+0x7ea5) [0x7f6b47203ea5]
#14: /lib64/libc.so.6(clone+0x6d) [0x7f6b465a48dd]
As I see you have sane = n,Set(TALK_DETECT(set)=128) Shouldn't it be "same" instead of "sane"?
Thank you. typing mistake. Still, your code has a crash issue. I think the problem comes from "SpeechBackground" application while trying to communicate via web socket. I request you please use SpeechBackground(VM-intro) and make some test call you will find the crash point. I think you are trying to access an invalid memory address or variable. I don't think anyone able to use SpeechBackground in production layer with vosk-server due to broken voice.
I have pushed a fix, please update and test if it solves your issue.
Still same
-- Executing [h@default:5] Hangup("Local/6661@default-00000000;1", "") in new stack
== Spawn extension (default, h, 5) exited non-zero on 'Local/6661@default-00000000;1'
[Jul 2 22:51:42] NOTICE[20293][C-00000004]: res_speech_vosk.c:98 vosk_recog_destroy: (vosk) Destroy speech resource
== WebSocket connection to '127.0.0.1:2700' closed
[Jul 2 22:51:42] NOTICE[20293][C-00000004]: res_speech_vosk.c:98 vosk_recog_destroy: (vosk) Destroy speech resource
== WebSocket connection to '127.0.0.1:2700' closed
[Jul 2 22:51:42] NOTICE[20293][C-00000004]: res_speech_vosk.c:98 vosk_recog_destroy: (vosk) Destroy speech resource
== WebSocket connection to '127.0.0.1:2700' closed
[Jul 2 22:51:42] NOTICE[20293][C-00000004]: res_speech_vosk.c:98 vosk_recog_destroy: (vosk) Destroy speech resource
== WebSocket connection to '127.0.0.1:2700' closed
[Jul 2 22:51:42] NOTICE[20293][C-00000004]: res_speech_vosk.c:98 vosk_recog_destroy: (vosk) Destroy speech resource
== WebSocket connection to '127.0.0.1:2700' closed
[Jul 2 22:51:42] NOTICE[20293][C-00000004]: res_speech_vosk.c:98 vosk_recog_destroy: (vosk) Destroy speech resource
== WebSocket connection to '127.0.0.1:2700' closed
[Jul 2 22:51:42] NOTICE[20293][C-00000004]: res_speech_vosk.c:98 vosk_recog_destroy: (vosk) Destroy speech resource
== WebSocket connection to '127.0.0.1:2700' closed
[Jul 2 22:51:42] NOTICE[20293][C-00000004]: res_speech_vosk.c:98 vosk_recog_destroy: (vosk) Destroy speech resource
== WebSocket connection to '127.0.0.1:2700' closed
[Jul 2 22:51:42] ERROR[20293][C-00000004]: format_cap.c:146 format_cap_framed_destroy: FRACK!, Failed assertion bad magic number 0x0 for object 0x29a2cc8 (0)
[Jul 2 22:51:42] ERROR[20293][C-00000004]: Got 17 backtrace records
# 0: /usr/sbin/asterisk(__ao2_ref+0x97) [0x45e177]
# 1: /usr/sbin/asterisk(__ao2_ref+0x27d) [0x45e35d]
# 2: /usr/sbin/asterisk() [0x4ee557]
# 3: /usr/sbin/asterisk(__ao2_ref+0x27d) [0x45e35d]
# 4: /usr/sbin/asterisk() [0x58d946]
# 5: /usr/sbin/asterisk(__ao2_ref+0x27d) [0x45e35d]
# 6: /usr/sbin/asterisk(ast_channel_internal_cleanup+0xb4) [0x4b6814]
# 7: /usr/sbin/asterisk() [0x49b8f1]
# 8: /usr/sbin/asterisk(__ao2_ref+0x27d) [0x45e35d]
# 9: /usr/sbin/asterisk() [0x52596a]
#10: /usr/sbin/asterisk() [0x52687f]
#11: /usr/sbin/asterisk() [0x5271c2]
#12: /usr/sbin/asterisk(ast_pbx_outgoing_exten+0xb4) [0x52a8d4]
#13: /usr/lib64/asterisk/modules/pbx_spool.so(+0x41c3) [0x7fda0e3831c3]
#14: /usr/sbin/asterisk() [0x5a3d79]
#15: /lib64/libpthread.so.0(+0x7ea5) [0x7fda5af51ea5]
#16: /lib64/libc.so.6(clone+0x6d) [0x7fda5a2f28dd]
[Jul 2 22:51:42] ERROR[20293][C-00000004]: format_cap.c:146 format_cap_framed_destroy: FRACK!, Failed assertion bad magic number 0x0 for object 0x29a2cc8 (0)
[Jul 2 22:51:42] ERROR[20293][C-00000004]: Got 15 backtrace records
# 0: /usr/sbin/asterisk(__ao2_ref+0x97) [0x45e177]
# 1: /usr/sbin/asterisk(__ao2_ref+0x27d) [0x45e35d]
# 2: /usr/sbin/asterisk() [0x4ee557]
# 3: /usr/sbin/asterisk(__ao2_ref+0x27d) [0x45e35d]
# 4: /usr/sbin/asterisk(ast_channel_nativeformats_set+0x6c) [0x4b4e0c]
# 5: /usr/sbin/asterisk() [0x49b929]
# 6: /usr/sbin/asterisk(__ao2_ref+0x27d) [0x45e35d]
# 7: /usr/sbin/asterisk() [0x52596a]
# 8: /usr/sbin/asterisk() [0x52687f]
# 9: /usr/sbin/asterisk() [0x5271c2]
#10: /usr/sbin/asterisk(ast_pbx_outgoing_exten+0xb4) [0x52a8d4]
#11: /usr/lib64/asterisk/modules/pbx_spool.so(+0x41c3) [0x7fda0e3831c3]
#12: /usr/sbin/asterisk() [0x5a3d79]
#13: /lib64/libpthread.so.0(+0x7ea5) [0x7fda5af51ea5]
#14: /lib64/libc.so.6(clone+0x6d) [0x7fda5a2f28dd]
[Jul 2 22:51:42] NOTICE[20293][C-00000004]: pbx_spool.c:463 attempt_thread: Call completed to Local/6661
[Jul 2 22:51:42] ERROR[20293][C-00000004]: format_cap.c:146 format_cap_framed_destroy: FRACK!, Failed assertion bad magic number 0x0 for object 0x29a2cc8 (0)
[Jul 2 22:51:42] ERROR[20293][C-00000004]: Got 8 backtrace records
# 0: /usr/sbin/asterisk(__ao2_ref+0x97) [0x45e177]
# 1: /usr/sbin/asterisk(__ao2_ref+0x27d) [0x45e35d]
# 2: /usr/sbin/asterisk() [0x4ee557]
# 3: /usr/sbin/asterisk(__ao2_ref+0x27d) [0x45e35d]
# 4: /usr/lib64/asterisk/modules/pbx_spool.so(+0x40e4) [0x7fda0e3830e4]
# 5: /usr/sbin/asterisk() [0x5a3d79]
# 6: /lib64/libpthread.so.0(+0x7ea5) [0x7fda5af51ea5]
# 7: /lib64/libc.so.6(clone+0x6d) [0x7fda5a2f28dd]
[Jul 2 22:52:01] ERROR[20097]: format_cap.c:146 format_cap_framed_destroy: FRACK!, Failed assertion bad magic number 0x0 for object 0x29a2cc8 (0)
[Jul 2 22:52:01] ERROR[20097]: Got 12 backtrace records
# 0: /usr/sbin/asterisk(__ao2_ref+0x97) [0x45e177]
# 1: /usr/sbin/asterisk(__ao2_ref+0x27d) [0x45e35d]
# 2: /usr/sbin/asterisk() [0x4ee557]
# 3: /usr/sbin/asterisk(__ao2_ref+0x27d) [0x45e35d]
# 4: /usr/lib64/asterisk/modules/chan_sip.so(+0x2d4a2) [0x7fda0e7dc4a2]
# 5: /usr/sbin/asterisk(__ao2_ref+0x27d) [0x45e35d]
# 6: /usr/lib64/asterisk/modules/chan_sip.so(+0x18acb) [0x7fda0e7c7acb]
# 7: /usr/sbin/asterisk(ast_sched_runq+0x101) [0x567d41]
# 8: /usr/lib64/asterisk/modules/chan_sip.so(+0x810ae) [0x7fda0e8300ae]
# 9: /usr/sbin/asterisk() [0x5a3d79]
#10: /lib64/libpthread.so.0(+0x7ea5) [0x7fda5af51ea5]
#11: /lib64/libc.so.6(clone+0x6d) [0x7fda5a2f28dd]
This patch solves the issue:
diff --git a/apps/app_speech_utils.c b/apps/app_speech_utils.c
index 2ba297e..21cca6a 100644
--- a/apps/app_speech_utils.c
+++ b/apps/app_speech_utils.c
@@ -538,6 +538,7 @@ static struct ast_custom_function speech_function = {
};
+#include "asterisk/format_cache.h"
/*! \brief SpeechCreate() Dialplan Application */
static int speech_create(struct ast_channel *chan, const char *data)
@@ -545,8 +546,15 @@ static int speech_create(struct ast_channel *chan, const char *data)
struct ast_speech *speech = NULL;
struct ast_datastore *datastore = NULL;
+ struct ast_format_cap *cap;
+ if (!(cap = ast_format_cap_alloc(AST_FORMAT_CAP_FLAG_DEFAULT))) {
+ pbx_builtin_setvar_helper(chan, "ERROR", "1");
+ return 0;
+ }
+ ast_format_cap_append(cap, ast_format_slin, 0);
/* Request a speech object */
- speech = ast_speech_new(data, ast_channel_nativeformats(chan));
+ speech = ast_speech_new(data, cap);
+
if (speech == NULL) {
/* Not available */
pbx_builtin_setvar_helper(chan, "ERROR", "1");
Corresponding asterisk issue https://issues.asterisk.org/jira/browse/ASTERISK-27986
Frack issue should be solved now as pull request is merged to https://issues.asterisk.org/jira/browse/ASTERISK-29040
Here is the error details