Hangups during speak playback causes Asterisk to crash

184 views
Skip to first unread message

Rob Scheibel

unread,
Jan 6, 2012, 9:54:27 AM1/6/12
to Adhearsion
I've got an odd one that's been bugging me lately. Occasionally if the
client hangs up in the middle of a playback of a "speak" command from
adhearsion (using Cepstral), asterisk will crash (adhearsion keeps
running, but asterisk dies). Any ideas?

I'm running Asterisk 10.0.0, latest Adhearsion git clone, latest
app_swift git clone for Asterisk 10, and Allison-8kHz Cepstral 5.1.0
on a Linux box.

I have just a simple dialplan that is an IVR prompting for requests,
looking things up in a database, and speaking back results.

Adhearsion shows the hangup:

INFO agi: HANGUP event for call with uniqueid "1325860978.2" and
channel "SIP/200-00000002"
INFO agi: Adhearsion::VoIP::Asterisk::AGI::Server::RubyServer
0.0.0.0:4573 client:59739 disconnect

Asterisk logs aren't showing anything out of the ordinary - even if I
turn on the debug log nothing appears in it...

Has anyone else had/seen similar issues? Perhaps I need to explicitly
add events trying to catch hangups and do something with them?

An example line of Adhearsion where Asterisk dies if a hangup occurs:

@pin = input 8, :interruptible => true, :timeout =>
10.seconds, :accept_key => '#', :speak => {:text => 'Please enter you
PIN followed by the Pound Sign'}

Thanks in advance!

-rob

Ben Klang

unread,
Jan 6, 2012, 12:55:48 PM1/6/12
to adhea...@googlegroups.com
On Jan 6, 2012, at 9:54 AM, Rob Scheibel wrote:

I've got an odd one that's been bugging me lately. Occasionally if the
client hangs up in the middle of a playback of a "speak" command from
adhearsion (using Cepstral), asterisk will crash (adhearsion keeps
running, but asterisk dies). Any ideas?

I would almost guarantee that this is a bug in app_swift.  You might see if a new version is available.  Also, be sure to get a version that is intended for Asterisk 10 (there are some internal API changes from Asterisk 1.8).  If you can get a core dump from Asterisk we can open an issue with Digium and ask them to fix it.

/BAK/
-- 
Ben Klang

Mojo Lingo -- Voice applications that work like magic
Twitter: @MojoLingo



I'm running Asterisk 10.0.0, latest Adhearsion git clone, latest
app_swift git clone for Asterisk 10, and Allison-8kHz Cepstral 5.1.0
on a Linux box.

I have just a simple dialplan that is an IVR prompting for requests,
looking things up in a database, and speaking back results.

Adhearsion shows the hangup:

INFO agi: HANGUP event for call with uniqueid "1325860978.2" and
channel "SIP/200-00000002"
INFO agi: Adhearsion::VoIP::Asterisk::AGI::Server::RubyServer
0.0.0.0:4573 client:59739 disconnect

Asterisk logs aren't showing anything out of the ordinary - even if I
turn on the debug log nothing appears in it...

Has anyone else had/seen similar issues? Perhaps I need to explicitly
add events trying to catch hangups and do something with them?

An example line of Adhearsion where Asterisk dies if a hangup occurs:

 @pin = input 8, :interruptible => true, :timeout =>
10.seconds, :accept_key => '#', :speak => {:text => 'Please enter you
PIN followed by the Pound Sign'}

Thanks in advance!

-rob

--
You received this message because you are subscribed to the Google Groups "Adhearsion" group.
To post to this group, send email to adhea...@googlegroups.com.
To unsubscribe from this group, send email to adhearsion+...@googlegroups.com.
For more options, visit this group at http://groups.google.com/group/adhearsion?hl=en.


Rob Scheibel

unread,
Jan 6, 2012, 2:25:54 PM1/6/12
to Adhearsion
Thanks for the quick reply. I'm running the most current version of
app_swift (as far as I know) from: https://github.com/dmsessions/app_swift
dated 12/11/11. I'm also using the version specifically for Asterisk
10.0.0. I can't seem to find any other people with similar issues via
google...so maybe it's just my machine. I'm trying another machine to
see if that has similar results later today and will let you know...

I did generate a core dump for you - it's about 59mb - glad to post it
somewhere for somebody to look at - just let me know where.

Thanks!

-rob

On Jan 6, 11:55 am, Ben Klang <bkl...@mojolingo.com> wrote:
> On Jan 6, 2012, at 9:54 AM, Rob Scheibel wrote:
>
> > I've got an odd one that's been bugging me lately. Occasionally if the
> > client hangs up in the middle of a playback of a "speak" command from
> > adhearsion (using Cepstral), asterisk will crash (adhearsion keeps
> > running, but asterisk dies). Any ideas?
>
> I would almost guarantee that this is a bug in app_swift.  You might see if a new version is available.  Also, be sure to get a version that is intended for Asterisk 10 (there are some internal API changes from Asterisk 1.8).  If you can get a core dump from Asterisk we can open an issue with Digium and ask them to fix it.
>
> /BAK/
> --
> Ben Klang
> bkl...@mojolingo.com
> 404.475.4841
>
> Mojo Lingo -- Voice applications that work like magichttp://mojolingo.com

Ben Klang

unread,
Jan 6, 2012, 2:36:52 PM1/6/12
to adhea...@googlegroups.com
On Jan 6, 2012, at 2:25 PM, Rob Scheibel wrote:

Thanks for the quick reply. I'm running the most current version of
app_swift (as far as I know) from: https://github.com/dmsessions/app_swift
dated 12/11/11. I'm also using the version specifically for Asterisk
10.0.0. I can't seem to find any other people with similar issues via
google...so maybe it's just my machine. I'm trying another machine to
see if that has similar results later today and will let you know...

Then it sounds like it's either a new bug, or at least that hasn't been fixed yet.

I did generate a core dump for you - it's about 59mb - glad to post it
somewhere for somebody to look at - just let me know where.

The coredump by itself is not terribly useful without your also having hte "asterisk" binary and all of the modules  Instead, try this:

1) Start up gdb like this:
gdb /path/to/asterisk --core=/path/to/core

2) Then, on the gdb prompt, type:

bt

This will spit out the backtrace from the crashed thread.  Copy/paste whatever you get in an email to me.  That should confirm that the bug is in app_swift.  I suspect some kind of race condition with hanging up channels.

When we open the bug on issues.asterisk.org/jira, they may also want the gdb output from the following commands:

bt full
thread apply all bt full

In any event, if Asterisk ever segfaults, it's always a bug in Asterisk (or one of its modules) and not in Adhearsion.  Asterisk should never segfault.  I'll do what I can to help you document the issue so hopefully Darren can fix it.

/BAK/
-- 
Mojo Lingo -- Voice applications that work like magic
Twitter: @MojoLingo


david ryder

unread,
Jan 6, 2012, 2:42:54 PM1/6/12
to Adhearsion
You will likely get the same results. This was happening to me and
before the Asterisk forge was taken down I found a thread with a patch
that fixed this problem.

I uploaded the patch here: http://libryder.com/uploads/app_swift-2.0.patch

patch app-swift.c app_swift-2.0.patch
make clean
make
make install

Something like that should get you back on track. Good luck!

Rob Scheibel

unread,
Jan 6, 2012, 3:03:16 PM1/6/12
to Adhearsion
David -

Thanks for the patch - it was close to accurate with the version of
app_swift I'm using. Here's the patch file that worked for me:

--- app_swift.c 2012-01-06 13:54:23.325324132 -0600
+++ app_swift.c.new 2012-01-06 13:54:10.505104756 -0600
@@ -461,8 +461,8 @@
ast_log(LOG_NOTICE, "DTMF = %s\n", results);
pbx_builtin_setvar_helper(chan, "SWIFT_DTMF", results);
}
+ ast_frfree(f);
}
- ast_frfree(f);
}
}

I just posted this as an issue over at Darren's app_swift github
project so others can benefit - thanks David and Ben for helping.

Ben - did you still want the debugging output - happy to provide it if
it helps!

Thanks again for a great project - Adhearsion is a real treat to work
with!

-rob

Ben Klang

unread,
Jan 6, 2012, 3:10:00 PM1/6/12
to adhea...@googlegroups.com

On Jan 6, 2012, at 3:03 PM, Rob Scheibel wrote:

> David -
>
> Thanks for the patch - it was close to accurate with the version of
> app_swift I'm using. Here's the patch file that worked for me:
>
> --- app_swift.c 2012-01-06 13:54:23.325324132 -0600
> +++ app_swift.c.new 2012-01-06 13:54:10.505104756 -0600
> @@ -461,8 +461,8 @@
> ast_log(LOG_NOTICE, "DTMF = %s\n", results);
> pbx_builtin_setvar_helper(chan, "SWIFT_DTMF", results);
> }
> + ast_frfree(f);
> }
> - ast_frfree(f);
> }
> }
>
> I just posted this as an issue over at Darren's app_swift github
> project so others can benefit - thanks David and Ben for helping.
>
> Ben - did you still want the debugging output - happy to provide it if
> it helps!

I don't need the debugging output unless it happens again (and if it does, please use the newest core file that is generated when it crashes).

>
> Thanks again for a great project - Adhearsion is a real treat to work
> with!
>

Thanks! Glad you're enjoying it as much as we do.
/BAK/

Reply all
Reply to author
Forward
0 new messages