[Home]

Summary:ASTERISK-12739: In some cases parking extension isn't removed after parked channel is gone (continuation of problem reported in #13425)
Reporter:mdu113 (mdu113)Labels:
Date Opened:2008-09-16 11:32:47Date Closed:2008-09-17 16:51:27
Priority:MinorRegression?No
Status:Closed/CompleteComponents:Resources/res_features
Versions:Frequency of
Occurrence
Related
Issues:
Environment:Attachments:( 0) bug13493.diff
Description:The fix commited for issue 13425 is not completely solved the problem I reported in http://bugs.digium.com/view.php?id=13425#92536
In some cases, specifically when parked channel hangs up during parking announcement is still being played to the parkee, the parking extension isn't properly removed from parking context. There's some interesting detail to it though. Parked channel must hangup close to the end of announcement for it to happen.
Scenario: A calls B (PARINGEXTEN=701 set), B answers and parks A. A is parked at extension 701@parkedcalls. Now, if I hangup parked channel during asterisk playing "one" then extension 701@parkedcalls isn't removed.

****** ADDITIONAL INFORMATION ******

After fresh asterisk restart:
webdevel*CLI> dialplan show parkedcalls
[ Context 'parkedcalls' created by 'res_features' ]
 '700' =>          1. Park()                                     [res_features]

-= 1 extension (1 priority) in 1 context. =-

Now I make a call, park it at 701 and hangup parked channel during asterisk is playing "digit/1"

webdevel*CLI>
   -- Executing [1100@xyz:1] Set("SIP/xyz011101-081dded0", "TIMEOUT(absolute)=10800") in new stack
   -- Channel will hangup at 2008-09-16 19:20:19 UTC.
   -- Executing [1100@xyz:2] AGI("SIP/xyz011101-081dded0", "agi://devel.acecape.com") in new stack
   -- AGI Script Executing Application: (SetCallerPres) Options: (allowed_passed_screen)
   -- AGI Script Executing Application: (Set) Options: (CALLERID(name)=Unknown)
   -- AGI Script Executing Application: (Set) Options: (CALLERID(num)=Unknown)
   -- AGI Script Executing Application: (Dial) Options: (SIP/xyz110001|180|kK)
   -- Called xyz110001
   -- SIP/xyz110001-081e6128 is ringing
   -- SIP/xyz110001-081e6128 answered SIP/xyz011101-081dded0
   -- Started music on hold, class 'default', on channel 'SIP/xyz011101-081dded0'
 == Parked SIP/xyz011101-081dded0 on 701@parkedcalls. Will timeout back to extension [xyz] s, 1 in 600 seconds
   -- <SIP/xyz110001-081e6128> Playing 'digits/7' (language 'en')
   -- <SIP/xyz110001-081e6128> Playing 'digits/0' (language 'en')
   -- Stopped music on hold on SIP/xyz011101-081dded0
 == SIP/xyz011101-081dded0 got tired of being parked
   -- <SIP/xyz110001-081e6128> Playing 'digits/1' (language 'en')
   -- Added extension '701' priority 1 to parkedcalls
 == Spawn extension (xyz, s, 1) exited non-zero on 'Parked/SIP/xyz011101-081dded0<ZOMBIE>'
   -- Executing [h@xyz:1] NoOp("Parked/SIP/xyz011101-081dded0<ZOMBIE>", "v2 hangup extension. channel type=NULL") in new stack
   -- Executing [h@xyz:2] GotoIf("Parked/SIP/xyz011101-081dded0<ZOMBIE>", "1?lines_out:+1") in new stack
   -- Goto (xyz,h,5)
   -- Executing [h@xyz:5] GotoIf("Parked/SIP/xyz011101-081dded0<ZOMBIE>", "1?lines_done:+1") in new stack
   -- Goto (xyz,h,8)
   -- Executing [h@xyz:8] NoOp("Parked/SIP/xyz011101-081dded0<ZOMBIE>", "") in new stack

webdevel*CLI> dialplan show parkedcalls
[ Context 'parkedcalls' created by 'res_features' ]
 '700' =>          1. Park()                                     [res_features]
 '701' =>          1. ParkedCall(701)                            [res_features]

-= 2 extensions (2 priorities) in 1 context. =-

701@parkedcalls isn't properly removed
Comments:By: Jeff Peeler (jpeeler) 2008-09-16 15:25:22

Try this patch, I think it is a winner.

By: mdu113 (mdu113) 2008-09-16 15:45:49

Yes, this is better. Now I can't reproduce that behavior. Thanks!

By: Digium Subversion (svnbot) 2008-09-16 16:34:36

Repository: asterisk
Revision: 143270

U   branches/1.4/res/res_features.c

------------------------------------------------------------------------
r143270 | jpeeler | 2008-09-16 16:34:35 -0500 (Tue, 16 Sep 2008) | 9 lines

(closes issue ASTERISK-12739)
Reported by: mdu113
Patches:
     bug13493.diff uploaded by jpeeler (license 325)
Tested by: mdu113

Changed park_call_full to hold the parkinglot lock a little longer, which protects the parkeduser struct from being freed out from underneath. Made sure that the parking extension is added to the parking context while holding the lock thereby ensuring that there are no spurious warnings from removal attempts when a hangup occurs while the parking lot is being announced.


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

http://svn.digium.com/view/asterisk?view=rev&revision=143270