Summary:ASTERISK-14746: [patch] 100% Cpu usage when caller hangup while app_dial is executing a Macro
Reporter:Matteo Brancaleoni (mbrancaleoni)Labels:
Date Opened:2009-09-01 10:56:06Date Closed:2010-11-23 16:37:32.000-0600
Versions:Frequency of
Environment:Attachments:( 0) autoservice_workaround.patch
Description:If a peer is called using the M option to app_dial, and caller hangup
when peer is on macro, asterisk cpu usage goes 100% until peer closes
the call. After that asterisk still works ok.

Comments:By: Matteo Brancaleoni (mbrancaleoni) 2009-09-01 10:58:31

What is expected is that if caller hangsup, also the peer channel is closed.

By: dcolombo (dcolombo) 2009-09-01 11:01:06

I can confirm the issue also with version

By: dcolombo (dcolombo) 2009-09-17 02:24:22

I think that the problem could be in the autoservice_run function (autoservice.c).
Infact when the caller channel is hangup, while the called peer is on macro, there is an infinite loop due to this:

if (!x) {

because x var is always 0 in this case.

By: Paul Belanger (pabelanger) 2010-06-02 13:24:03

Are you able to provide a patch?

By: Matteo Brancaleoni (mbrancaleoni) 2010-06-02 14:02:17

but is a workaround, not a real fix.

I cannot understand what is the proper method to fix it.

By: Theo Belder (tbelder) 2010-09-24 06:58:24

Could this issue be related to ASTERISK-16299?

What dcolombo describes about:
if (!x) {

is fixed in this case with a sleep of 10 msecs in the loop.

By: Tilghman Lesher (tilghman) 2010-11-23 16:37:29.000-0600

Confirmed.  Already fixed in SVN.