[Home]

Summary:ASTERISK-11210: Recorded files get deleted before mixing if the call was blind transfered
Reporter:Grzegorz Garlewicz (garlew)Labels:
Date Opened:2008-01-11 06:47:52.000-0600Date Closed:2009-02-25 07:44:30.000-0600
Priority:MajorRegression?No
Status:Closed/CompleteComponents:Resources/res_monitor
Versions:Frequency of
Occurrence
Related
Issues:
Environment:Attachments:( 0) res_monitor.diff
Description:We record all calls coming into ACD queue with
exten => 1,1,Set(MONITOR_FILENAME=NEW-${UNIQUEID})
exten => 1,n,Set(CDR(userfield)=${MONITOR_FILENAME}.wav)
exten => 1,n,monitor(alaw,${MONITOR_FILENAME},bm)
exten => 1,n,Queue(${QUEUENAME})

If the call is blind transfered (we use SIP endpoints) the recorded files
get deleted by Asterisk.

I believe the main reason is chan->monitor->filename_changed being set incorrectly during transfer.
The quick fix (patch included) is to check if the file names in ast_monitor_stop are
equal and not touch the files if so.

Comments:By: Grzegorz Garlewicz (garlew) 2008-01-12 01:41:33.000-0600

1.2 branch also does this

By: Mark Michelson (mmichelson) 2008-01-31 13:41:22.000-0600

You're definitely on the right track with this one, but the issue is a bit deeper than the fix you provided (as you noted in the description). With regards to monitor, it doesn't make sense for it to think that the filename has changed if it really hasn't. Also, the renaming a file to itself shouldn't cause it to end up with a different name (I found that if you specify an absolute pathname, you'll end up with an extra / at the beginning, which causes the error seen). I will get a fix created shortly.

Thanks for the submission, and sorry it took so long for someone to get around to looking at it.

By: Digium Subversion (svnbot) 2008-01-31 14:57:38.000-0600

Repository: asterisk
Revision: 101531

U   branches/1.4/res/res_monitor.c

------------------------------------------------------------------------
r101531 | mmichelson | 2008-01-31 14:57:34 -0600 (Thu, 31 Jan 2008) | 10 lines

1. Prevent the addition of an extra '/' to the beginning of an absolute pathname.
2. If ast_monitor_change_fname is called and the new filename is the same as the old, then exit early and don't set the
  filename_changed field in the monitor structure. Setting it in this case was causing ast_monitor_stop to erroneously
  delete them.

(closes issue ASTERISK-11210)
Reported by: garlew
Tested by: putnopvut


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

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

By: Digium Subversion (svnbot) 2008-01-31 14:59:22.000-0600

Repository: asterisk
Revision: 101532

_U  trunk/
U   trunk/res/res_monitor.c

------------------------------------------------------------------------
r101532 | mmichelson | 2008-01-31 14:59:21 -0600 (Thu, 31 Jan 2008) | 18 lines

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

........
r101531 | mmichelson | 2008-01-31 15:00:24 -0600 (Thu, 31 Jan 2008) | 10 lines

1. Prevent the addition of an extra '/' to the beginning of an absolute pathname.
2. If ast_monitor_change_fname is called and the new filename is the same as the old, then exit early and don't set the
  filename_changed field in the monitor structure. Setting it in this case was causing ast_monitor_stop to erroneously
  delete them.

(closes issue ASTERISK-11210)
Reported by: garlew
Tested by: putnopvut


........

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

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