darrensessions / app_swift Goto Github PK
View Code? Open in Web Editor NEWapp_swift
Home Page: http://www.darrensessions.com
License: GNU General Public License v2.0
app_swift
Home Page: http://www.darrensessions.com
License: GNU General Public License v2.0
Subroutine app_exec() doesn't seem to work. Variable argv is initialized with 0, but no data copied into. Therefore ast_strlen_zero(text) is always true and message "%s requires text to speak!" is reported.
Thanks,
Klaus
Asterisk version is determined in configure script thusly:
AST_FULL_VER='asterisk -V | awk '{ print $2 }' -'
My fresh Asterisk 13.1 install prints "Asterisk certified/13.1-cert8" when fed the -V flag. AST_FULL_VER is therefore being set to "certified/13.1-cert8', which is preventing the makefile from building. The specific error I'm getting is "./configure: line 135: [: certified/13:integer expression expected"
Hello,
We are looking into an issue with asterisk segfaults when using app_swift.
There is a documented issue in the asterisk issues database:
Crash in framehook during ast_write when called by app_swift; https://issues.asterisk.org/jira/browse/ASTERISK-23635
I have also created a linked issue with fresh backtraces, and gdb outputs for review:
https://issues.asterisk.org/jira/browse/ASTERISK-23688
Unfortunately, my level of experience/knowledge is extremely shallow, and I'm looking to the community contributors to look into this further.
Please contact me via github and we can get in touch to continue troubleshooting.
Thanks!
Sean Hayes
Using app_swift with asterisk 13.8.2~dfsg-1 (Ubuntu 16.04 LTS and other 13.x from Debian Jessie) causes a segfault.
Asterisk 11.x does not cause any problem.
The complete backtrace is attached separately.
#13 0x00007fbfe5635ccd in app_exec (chan=0x7fc01400ca28, data=0x7fbfd8578c20 "Test") at app_swift.c:383
res = 0
max_digits = 0
timeout = 0
alreadyran = 0
ms = -1
len = 0
availatend = 0
argv = {0x7fc054000000 " ", 0x2 <error: Cannot access memory at address 0x2>, 0x10 <error: Cannot access memory at address 0x10>}
text = 0x7fbfd85784e0 "Test"
rc = 0x0
tmp_exten = "\000"
results = '\000' <repeats 19 times>
u = 0x7fc0540027b0
f = 0x55e400000001
next = {tv_sec = 140464019743784, tv_usec = 94440999475153}
ps = 0x7fc0540027d0
parse = 0x7fbfd85784e0 "Test"
old_writeformat = 0x0
args = {argc = 1, argv = 0x7fbfd8578618, text = 0x7fbfd85784e0 "Test", timeout = 0x0, max_digits = 0x0}
myf = {f = {frametype = 0, subclass = {integer = 0, format = 0x0, frame_ending = 0}, datalen = 0, samples = 0, mallocd = 0, mallocd_hdr_len = 0, offset = 0, src = 0x0, data = {ptr = 0x0, uint32 = 0, pad = "\000\000\000\000\000\00
0\000"}, delivery = {tv_sec = 0, tv_usec = 0}, frame_list = {next = 0x0}, flags = 0, ts = 0, len = 0, seqno = 0}, offset = '\000' <repeats 63 times>, frdata = {0 <repeats 20 times>}}
engine = 0x7fc0540012d0
port = 0x0
voice = 0x7ffd0ab40def
params = 0x0
sresult = -1036888781
tts_stream = 0xffffffff
event_mask = 32703
vvoice = 0x0
__PRETTY_FUNCTION__ = "app_exec"
All DEBUG messages appear in asterisk CLI even when the verbosity and debug levels are set to 0.
This fills up the asterisk log files with information that makes debugging other issues a lot more difficult.
I believe this is the case because the app_swift.c has debug statements with no checks check for option_verbose or option_debug prior to the ast_log(LOG_DEBUG, ...) statement.
I added a check to a number of these e.g.:
if (option_verbose && option_debug > 3) {
ast_log(LOG_DEBUG, "Easy read; %d bytes and %d at end, %d free\n", len, availatend, cfg_buffer_size - ps->qc);
}
This removed the DEBUG message but this had an adverse affect on picking up the DTMF variable in the dial plan (less likely to set the variable when a digit was pressed).
I am using:
CentOs release 6.4 (Final) 64-bit
Asterisk 11.5.1 64-bit
Cepstral_David-8kHz_x86-64-linux_6.0.1
app_swift latest version downloaded from https://github.com/darrensessions/app_swift
Have you any ideas what can be done to reduce the DEBUG messages but still use the DTMF feature.
Put another way everything works as is but there are too many DEBUG messages generated.
Thanks,
Paul
I've verified everything, can't work out what is wrong:-
Voice | Version | Lic? | Gender | Age | Language | Sample Rate |
---|---|---|---|---|---|---|
Allison | 5.1.0 | Yes | Female | 28 | US English | 16000 Hz |
/etc/asterisk/swift.conf
voice=Allison
[2013-02-25 06:55:38] VERBOSE[18887] pbx.c: == Registered application 'Swift'
[2013-02-25 06:55:38] VERBOSE[18887] config.c: == Parsing '/etc/asterisk/swift.conf': [2013-02-25 06:55:38] VERBOSE[18887] config.c: == Found
[2013-02-25 06:55:38] DEBUG[18887] app_swift.c: Config buffer_size is 65535
[2013-02-25 06:55:38] DEBUG[18887] app_swift.c: Config goto_exten is 0
[2013-02-25 06:55:38] DEBUG[18887] app_swift.c: Config voice is Allison
[2013-02-25 06:55:38] VERBOSE[18887] loader.c: app_swift.so => (Cepstral Swift TTS Application)
[2013-02-25 06:55:55] VERBOSE[18955] pbx.c: -- Executing [1234@from-internal:1] Set("SIP/301-00000000", "SWIFT_VOICE=Allison") in new stack
[2013-02-25 06:55:55] VERBOSE[18955] pbx.c: -- Executing [1234@from-internal:2] Swift("SIP/301-00000000", "Congratulations! You have installed Cepstral.") in new stack
[2013-02-25 06:55:55] DEBUG[18955] app_swift.c: Text to Speak : Congratulations! You have installed Cepstral.
[2013-02-25 06:55:55] ERROR[18955] app_swift.c: Failed to set voice.
swift -n "Allison" -o test.wav "This is a test"
-> works and generates test.wav
CentOS release 5.8 (Final)
Connected to Asterisk 1.8.15-cert1
I'm not sure how to reproduce this issue but it happens every few days.
Asterisk version:
Asterisk 11.6-cert4 built by asterisk @ ivrd02 on a x86_64 running Linux on 2014-08-11 13:55:25 UTC
OS:
Linux livrp03 2.6.32-431.11.2.el6.x86_64 #1 SMP Mon Mar 3 13:32:45 EST 2014 x86_64 x86_64 x86_64 GNU/Linux
When Asterisk crashes, the backtrace always looks something like the following:
[Thread debugging using libthread_db enabled]
Core was generated by `/opt/asterisk/sbin/asterisk -f -C /opt/asterisk/etc/asterisk/asterisk.c'.
Program terminated with signal 11, Segmentation fault.
#0 0x00007f79439ba061 in LM_set_port_number () from /opt/swift/lib/libswift.so.6
#0 0x00007f79439ba061 in LM_set_port_number () from /opt/swift/lib/libswift.so.6
No symbol table info available.
#1 0x00007f79439bb7c6 in LM_init () from /opt/swift/lib/libswift.so.6
No symbol table info available.
#2 0x00007f79439c5f0d in swift_engine_open () from /opt/swift/lib/libswift.so.6
No symbol table info available.
#3 0x00007f7943bf9b6e in app_exec (chan=0x7f7914009e08, data=0x7f7928f9c680 "413 E 3RD ST") at app_swift.c:370
res = 0
max_digits = 0
timeout = 0
alreadyran = 0
ms = 0
len = 6043056
availatend = 0
argv = {0x0, 0xffffffffffffb9b0 <Address 0xffffffffffffb9b0 out of bounds>, 0x0}
text = 0x7f7928f9a230 "413 E 3RD ST"
rc = 0x0
tmp_exten = "\000"
results = '\000' <repeats 19 times>
u = 0x7f7974001dc0
f = 0x7f7928f9a4c0
next = {tv_sec = 6014649, tv_usec = 21020457123253}
ps = 0x7f79740165e0
parse = 0x7f7928f9a230 "413 E 3RD ST"
old_writeformat = {id = 687449040, fattr = {format_attr = {32633, 5184330, 0, 687448768, 32633, 5710841, 0, 48, 48, 687448992, 32633, 687448800, 32633, 1946162544, 0, 1946162544, 32633, 8448136, 0, 84, 0, 4294967292, 0, 687449104, 32633, 5827993, 0, 84, 0, 1717986919, 1717986918, 8448135, 0, 5623124, 0, 687449040, 32633, 5630801, 0, 9, 0, 687449040, 0, 687449104, 32633, 40, 0, 1413666990, 0, 5222777, 0, 1946239199, 32633, 687449192, 32633, 80, 0, 0, 0, 2, 0, 5187840, 0, 1946207160}, rtp_marker_bit = 121 'y'}}
args = {argc = 1, argv = 0x7f7928f9a280, text = 0x7f7928f9a230 "413 E 3RD ST", timeout = 0x0, max_digits = 0x0}
myf = {f = {frametype = 0, subclass = {integer = 0, format = {id = 0, fattr = {format_attr = {0, 0, 0, 0, 257, 0, 2, 0, 1839600224, 32767, 645521943, 1069709714, 4, 0, 0, 0, 1839600224, 32767, 687448144, 32633, 127525399, 3225199326, 3012944407, 1069709582, 1, 0 <repeats 33 times>, 1839600016, 32767, 2, 0, 34150224, 0}, rtp_marker_bit = 0 '\000'}}}, datalen = 0, samples = 97009376, mallocd = 0, mallocd_hdr_len = 177, offset = 1, src = 0x7f7928f9a050 "\207", <incomplete sequence \350\200>, data = {ptr = 0x0, uint32 = 0, pad = "\000\000\000\000\000\000\000"}, delivery = {tv_sec = 0, tv_usec = 0}, frame_list = {next = 0x0}, flags = 0, ts = 0, len = 0, seqno = 0}, offset = "\000\000\000\000\000\000\000\000\310\314\335\005\000\000\000\000\310\314\335\005", '\000' <repeats 20 times>, "`\177\316\005\000\000\000\000\377\377\000\000\001\000\000\000\000\000\000\000\000\000\000"
Hi,
is it possible that we get "SWIFT_PORT_UNAVAILABLE" in asterisk dial plan variable? like we can get DTMF value in ${SWIFT_DTMF}.
when all ports are in use then we get "SWIFT_PORT_UNAVAILABLE" in asterisk CLI then call hangs up.
if i can get "SWIFT_PORT_UNAVAILABLE" in variable then i can handle the call, instead of hangup
Thanks.
Error:
./configure: line 141: [: certified/16: integer expression expected
creating Makefile
sed: -e expression #1, char 130: unknown option to `s'
$ asterisk -V
Asterisk certified/16.8-cert2
Running Asterisk 13.23.1:
After running the ./configure, the echo text says to run 'make'
After running make, an error is displayed 'Could not locate Asterisk include files'
I did run: find / -name include/asterisk of which 0 directories were found
If the include/asterisk dircetory is looking for "channel.h", it is located deep in a kernel dir.
if the include/asterisk files are installed with the alsa files, let it be known running the yum command does not find all the files:
yum install -y alsa-lib alsa-lib-devel alsa-utils alsa-plugins-oss
The 'asterisk.h' file was copied from GetHub and placed in the /usr/include directory as instructed.
Please advise an how to resolve this issue.
As soon as the SWIFT command is issued, boom, segfault.
Asterisk's core dump: https://gist.github.com/4fbb6c2de5f20a177aa7
Using binary build from debian/jessie, I get garbled audio. Compiling by hand, I get no audio. In neither case are there any errors (or any other information for that matter) shown with verbose and debug settings turned up.
CLI swift works fine to generate normal-sounding audio files.
when making an outbound call via /var/spool/asterisk/outgoing/ swift audio is silent. DTMF detection still works. inbound calls work (like using swift in the dialplan). dont have time to debug atm. *note pull request [https://github.com//pull/18] being used.
I'm trying to use app_swift on Asterisk Certified 16 + CentOS 8.1 + Cepstral TTS engine, but I get an error while trying to use app_swift:
[May 28 21:12:21] ERROR[2185][C-00000004]: app_swift.c:703 app_exec: FRACK!, Failed assertion bad magic number 0x0 for object 0x7fe0bc0025f0 (0)
[May 28 21:12:21] ERROR[2186]: app_swift.c:224 swift_cb: FRACK!, Failed assertion bad magic number 0x0 for object 0x7fe0bc0025f0 (0)
[May 28 21:12:21] ERROR[2185][C-00000004]: Got 9 backtrace records
I had app_swift working with freepbx about a year ago. Sometime along the way it stopped working after an upgrade. I did a yum install asterisk-devel to get the latest headers. Then I pulled the latest app_swift from github and did a configure, make, make install, make reload but get the following...
[2016-01-24 16:30:37] WARNING[25658] loader.c: Module 'app_swift.so' was not compiled with the same compile-time options as this version of Asterisk.
[2016-01-24 16:30:37] WARNING[25658] loader.c: Module 'app_swift.so' will not be initialized as it may cause instability.
[2016-01-24 16:30:37] WARNING[25658] loader.c: Module 'app_swift' could not be loaded.
asterisk -rx "core show version"
Asterisk 11.19.0 built by root @ jenkins-builder1.schmoozecom.net on a x86_64 running Linux on 2015-08-09 16:12:26 UTC
Maybe I missed something? Is this a new issue?
A declarative, efficient, and flexible JavaScript library for building user interfaces.
๐ Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
An Open Source Machine Learning Framework for Everyone
The Web framework for perfectionists with deadlines.
A PHP framework for web artisans
Bring data to life with SVG, Canvas and HTML. ๐๐๐
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
Some thing interesting about web. New door for the world.
A server is a program made to process requests and deliver data to clients.
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
Some thing interesting about visualization, use data art
Some thing interesting about game, make everyone happy.
We are working to build community through open source technology. NB: members must have two-factor auth.
Open source projects and samples from Microsoft.
Google โค๏ธ Open Source for everyone.
Alibaba Open Source for everyone
Data-Driven Documents codes.
China tencent open source team.