[Home]

Summary:ASTERISK-09883: ast_check_hangup does not return true after Hangup() has been called.
Reporter:Donny Kavanagh (donnyk)Labels:
Date Opened:2007-07-16 17:29:41Date Closed:2007-07-17 14:44:58
Priority:MinorRegression?No
Status:Closed/CompleteComponents:Channels/General
Versions:Frequency of
Occurrence
Related
Issues:
Environment:Attachments:( 0) 10209.patch
( 1) 10209-trunk.patch
( 2) 10209-trunk-2.patch
( 3) ast_check_hangup2.patch
Description:ast_check_hangup does not properly return 1 (to indicate a hangup is in progress) after Hangup() has been called in the dialplan and the channel has gone into the h extension.

I discovered this while working on a patch for res_agi.

This bug has been confirmed with russellb and Corydon76 in #asterisk-dev

This bug affects 1.2,1.4 and trunk.
Comments:By: Donny Kavanagh (donnyk) 2007-07-16 23:51:56

Now that i've thought about this a little, this will work for Hangup() but not for any other application that may request a hangup.

This will require a little more digging.

By: Donny Kavanagh (donnyk) 2007-07-17 10:25:35

The last patch works fine for me.

By: Russell Bryant (russell) 2007-07-17 10:59:03

That last patch is close to what I had in mind, but it should do that for any negative result, and not just -1, because the rest of the code there doesn't treat them any different.

By: Russell Bryant (russell) 2007-07-17 11:03:52

I'd like to get some testing on this patch first to make sure that we don't break something that we didn't anticipate.  From IRC, it sounds like blitzrage is going ot give it a try.

By: Leif Madsen (lmadsen) 2007-07-17 12:03:17

Tested 10209 and 10210 together. No adverse affects thus far on any channels with the 10209.patch file from Russell.

Will do a bit more testing and report back in a few mins.

By: Leif Madsen (lmadsen) 2007-07-17 12:06:08

OK made a bunch of calls through my system:

* internal extension calling
* calling externally through to a PSTN provider
* calling from the PSTN into the PBX

All calls hang up fine. No hung channels or anything funny.

By: Donny Kavanagh (donnyk) 2007-07-17 12:18:26

Thanks blitzrage.  You cant code, but you sure can test :)

By: Leif Madsen (lmadsen) 2007-07-17 12:20:04

I can test like a mofo :)

By: Donny Kavanagh (donnyk) 2007-07-17 12:34:13

Everything looks good in my testing.

By: Russell Bryant (russell) 2007-07-17 12:59:02

Alright, I'm going to apply this to 1.4 and trunk for now.  If we identify that it solves any other problems aside from the res_agi patch that Juggie is working on for 1.4 and trunk, we can put it in 1.2 as well.

By: Donny Kavanagh (donnyk) 2007-07-17 13:19:15

Russ,

ast_check_hangup looks to be used quite alot in 1.2 from a quick grep.  I dont know if any of them could be affected by the same requested by the application hangup issue but it certainly is possible.  I agree that it has the possibility to change behavior though so we should proceed with caution.

By: Donny Kavanagh (donnyk) 2007-07-17 14:24:21

Based on irc discussion patch updated, then updated again after we realized the first ast_softhangup was redundant.

By: Digium Subversion (svnbot) 2007-07-17 14:44:18

Repository: asterisk
Revision: 75403

------------------------------------------------------------------------
r75403 | russell | 2007-07-17 14:44:17 -0500 (Tue, 17 Jul 2007) | 12 lines

(closes issue ASTERISK-9883)
Reported by: juggie
Patches:
     10209-trunk-2.patch uploaded by juggie
Tested by: juggie, blitzrage

In ast_pbx_run(), mark a channel as hung up after an application returned -1,
or when it runs out of extensions to execute.  This is so that code can detect
that this channel has been hung up for things like making sure DeadAGI is used
on actual dead channels, and is beneficial for other things, like making sure
someone doesn't try to start spying on a channel that is about to go away.

------------------------------------------------------------------------

By: Digium Subversion (svnbot) 2007-07-17 14:44:58

Repository: asterisk
Revision: 75404

------------------------------------------------------------------------
r75404 | russell | 2007-07-17 14:44:57 -0500 (Tue, 17 Jul 2007) | 20 lines

Merged revisions 75403 via svnmerge from
https://origsvn.digium.com/svn/asterisk/branches/1.4

........
r75403 | russell | 2007-07-17 15:01:12 -0500 (Tue, 17 Jul 2007) | 12 lines

(closes issue ASTERISK-9883)
Reported by: juggie
Patches:
     10209-trunk-2.patch uploaded by juggie
Tested by: juggie, blitzrage

In ast_pbx_run(), mark a channel as hung up after an application returned -1,
or when it runs out of extensions to execute.  This is so that code can detect
that this channel has been hung up for things like making sure DeadAGI is used
on actual dead channels, and is beneficial for other things, like making sure
someone doesn't try to start spying on a channel that is about to go away.

........

------------------------------------------------------------------------