[Home]

Summary:ASTERISK-12748: Crash in ast_cdr_start() during one-touch parking if parking extension set with PARKINGEXTEN already busy
Reporter:mdu113 (mdu113)Labels:
Date Opened:2008-09-17 11:57:12Date Closed:2011-06-07 14:00:48
Priority:CriticalRegression?No
Status:Closed/CompleteComponents:CDR/General
Versions:Frequency of
Occurrence
Related
Issues:
Environment:Attachments:( 0) crash_in_ast_cdr_start.txt
Description:This is related to issues ASTERISK-12685 and ASTERISK-12633.
Each of the fixes for those issues fix their respective problems, but when they applied together they causes crash if one-touch parking fails due to PARKINGEXTEN pointing to already taken parking extension.
Scenario: A calls B (PARKINGEXTEN=701 set). B dials feature code to park A. A is parked at 701@parkedcalls. Now C calls B (PARKINGEXTEN=701 set). B dials feature code to park C. Asterisk prints a warning:
[Sep 17 13:00:47] WARNING[4715]: res_features.c:338 park_call_full: Requested parking extension already exists: 701@parkedcalls
and crashes at this point.

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

If fixes for issues ASTERISK-12685 and ASTERISK-12633 are applied separately (fix for 13425 applied, but for 13364 is not or opposite fix for 13364 applied but fix for 13425 is not) then there's no crash and everything works fine except that problem described in the respective issue reappears. When both fixes applied the crash is introduced. I don't know which of the fixes is problematic, but sine crash happens in ast_cdr_start() I categorized it as CDR/General.
Attached is console output and backtrace
Comments:By: mdu113 (mdu113) 2008-09-17 13:23:29

One more detail. The crash doesn't happen if apply the following patch:
Index: res/res_features.c
===================================================================
--- res/res_features.c  (revision 143334)
+++ res/res_features.c  (working copy)
@@ -328,7 +328,7 @@
                       ast_log(LOG_WARNING, "PARKINGEXTEN does not indicate a valid parking slot: '%s'.\n", parkingexten);
                       ast_mutex_unlock(&parking_lock);
                       free(pu);
-                       return 1;       /* Continue execution if possible */
+                       return -1;      /* Continue execution if possible */
               }
               snprintf(pu->parkingexten, sizeof(pu->parkingexten), "%d", x);

@@ -336,7 +336,7 @@
                       ast_mutex_unlock(&parking_lock);
                       free(pu);
                       ast_log(LOG_WARNING, "Requested parking extension already exists: %s@%s\n", parkingexten, parking_con);
-                       return 1;       /* Continue execution if possible */
+                       return -1;      /* Continue execution if possible */
               }
       } else {
               /* Select parking space within range */

It also doesn't happen if I don't use PARKINGEXTEN and parking failed because all available parking spaces are busy.
So I guess the problem exists when pbx tries to continue execution after parking failure.

By: mdu113 (mdu113) 2008-10-02 12:40:20

I can't replicate this problem with the latest code r145839, so I guess this issue can be closed

By: snuffy (snuffy) 2008-10-03 00:29:20

closed by request