[Home]

Summary:ASTERISK-15364: [patch] Monitor resumes recording after SIP transfer despite StopMonitor() having been called
Reporter:Kirill Katsnelson (kkm)Labels:
Date Opened:2010-01-12 14:17:51.000-0600Date Closed:2010-04-25 13:14:19
Priority:MajorRegression?No
Status:Closed/CompleteComponents:Resources/res_monitor
Versions:Frequency of
Occurrence
Related
Issues:
Environment:Attachments:( 0) resmonitor-16590-1.6.1.diff
( 1) resmonitor-16590-trunk.239289.diff
Description:During call setup, Monitor() with the "b" flag is called.

When a call reenters PBX after transfer, dialplan calls StopMonitor() application. Recording is stopped, and a post-recording program (soxmerge or other if overridden) is called. This is the expected behavior.

Unexpected part: After the call is bridged again, recording resumes with the same file name, overwriting the previous recording.

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

To facilitate recording only after a call is bridged, Monitor() does not initiate recording right away; rather, it sets a variable AUTO_MONITOR with the arguments from the original Monitor() call, removing only the b argument.

ast_bridge_call() in features.c checks if the variable is set, and starts monitoring by call a function back in res_monitor.c.

StopMonitor() fails to reset this variable. While it stops monitoring as expected, recording resumes upon the second call is connected from the same channel, because the variable AUTO_MONITOR still exists and has the old value.

A fix should remove the variable from the channel somewhere down the road from  StopMonitor() and CLI friends. Perhaps it would be also a good idea to un-set the second variable set by Monitor(), namely MONITORING=true. This is informational-only, AFAIK, but still would be more consistent.

*NO CLEAN WORKAROUND FOUND* Asterisk dialplan has no provision to reset a variable so that it does not exist. Setting AUTO_MONITOR to empty value causes the following error after the second call is bridged:

ERROR[22769]: res_monitor.c:479 in start_monitor_exec: Monitor requires an argument

Releases affected: the error bumped into in 1.6.1.6, confirmed not fixed in 1.6.2.0, visually inspected code in trunk's HEAD has not changed.
Comments:By: Kirill Katsnelson (kkm) 2010-01-12 16:23:20.000-0600

Uploaded patches against 1.6.1.6 and trunk head. Either could be applied to interim versions, albeit with offset: the logic has not changed.

By: Leif Madsen (lmadsen) 2010-01-13 09:19:52.000-0600

Are you saying that a version prior to 1.6.1.6 does not experience this issue? (i.e. regression?) Thanks!

By: Kirill Katsnelson (kkm) 2010-01-13 13:08:11.000-0600

No, I am not implying that. This should be also unlikely, unless the "b" option itself was introduced recently. I merely first used StopMonitor() in such circumstances on the server running 1.6.1.6. Sorry for being unclear on that.

By: Leif Madsen (lmadsen) 2010-01-13 13:25:34.000-0600

OK great, thanks for the feedback!

By: Digium Subversion (svnbot) 2010-04-25 13:09:06

Repository: asterisk
Revision: 258775

U   branches/1.4/res/res_monitor.c

------------------------------------------------------------------------
r258775 | tilghman | 2010-04-25 13:09:05 -0500 (Sun, 25 Apr 2010) | 6 lines

When StopMonitor is called, ensure that it will not be restarted by a channel event.
(closes issue ASTERISK-15364)
Reported by: kkm
Patches:
      resmonitor-16590-trunk.239289.diff uploaded by kkm (license 888)

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

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

By: Digium Subversion (svnbot) 2010-04-25 13:12:14

Repository: asterisk
Revision: 258776

_U  trunk/
U   trunk/res/res_monitor.c

------------------------------------------------------------------------
r258776 | tilghman | 2010-04-25 13:12:14 -0500 (Sun, 25 Apr 2010) | 13 lines

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

........
 r258775 | tilghman | 2010-04-25 13:09:05 -0500 (Sun, 25 Apr 2010) | 6 lines
 
 When StopMonitor is called, ensure that it will not be restarted by a channel event.
 (closes issue ASTERISK-15364)
  Reported by: kkm
  Patches:
        resmonitor-16590-trunk.239289.diff uploaded by kkm (license 888)
........

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

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

By: Digium Subversion (svnbot) 2010-04-25 13:14:01

Repository: asterisk
Revision: 258777

_U  branches/1.6.0/
U   branches/1.6.0/res/res_monitor.c

------------------------------------------------------------------------
r258777 | tilghman | 2010-04-25 13:14:01 -0500 (Sun, 25 Apr 2010) | 20 lines

Merged revisions 258776 via svnmerge from
https://origsvn.digium.com/svn/asterisk/trunk

................
 r258776 | tilghman | 2010-04-25 13:12:14 -0500 (Sun, 25 Apr 2010) | 13 lines
 
 Merged revisions 258775 via svnmerge from
 https://origsvn.digium.com/svn/asterisk/branches/1.4
 
 ........
   r258775 | tilghman | 2010-04-25 13:09:05 -0500 (Sun, 25 Apr 2010) | 6 lines
   
   When StopMonitor is called, ensure that it will not be restarted by a channel event.
   (closes issue ASTERISK-15364)
    Reported by: kkm
    Patches:
          resmonitor-16590-trunk.239289.diff uploaded by kkm (license 888)
 ........
................

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

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

By: Digium Subversion (svnbot) 2010-04-25 13:14:09

Repository: asterisk
Revision: 258778

_U  branches/1.6.1/
U   branches/1.6.1/res/res_monitor.c

------------------------------------------------------------------------
r258778 | tilghman | 2010-04-25 13:14:09 -0500 (Sun, 25 Apr 2010) | 20 lines

Merged revisions 258776 via svnmerge from
https://origsvn.digium.com/svn/asterisk/trunk

................
 r258776 | tilghman | 2010-04-25 13:12:14 -0500 (Sun, 25 Apr 2010) | 13 lines
 
 Merged revisions 258775 via svnmerge from
 https://origsvn.digium.com/svn/asterisk/branches/1.4
 
 ........
   r258775 | tilghman | 2010-04-25 13:09:05 -0500 (Sun, 25 Apr 2010) | 6 lines
   
   When StopMonitor is called, ensure that it will not be restarted by a channel event.
   (closes issue ASTERISK-15364)
    Reported by: kkm
    Patches:
          resmonitor-16590-trunk.239289.diff uploaded by kkm (license 888)
 ........
................

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

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

By: Digium Subversion (svnbot) 2010-04-25 13:14:19

Repository: asterisk
Revision: 258779

_U  branches/1.6.2/
U   branches/1.6.2/res/res_monitor.c

------------------------------------------------------------------------
r258779 | tilghman | 2010-04-25 13:14:18 -0500 (Sun, 25 Apr 2010) | 20 lines

Merged revisions 258776 via svnmerge from
https://origsvn.digium.com/svn/asterisk/trunk

................
 r258776 | tilghman | 2010-04-25 13:12:14 -0500 (Sun, 25 Apr 2010) | 13 lines
 
 Merged revisions 258775 via svnmerge from
 https://origsvn.digium.com/svn/asterisk/branches/1.4
 
 ........
   r258775 | tilghman | 2010-04-25 13:09:05 -0500 (Sun, 25 Apr 2010) | 6 lines
   
   When StopMonitor is called, ensure that it will not be restarted by a channel event.
   (closes issue ASTERISK-15364)
    Reported by: kkm
    Patches:
          resmonitor-16590-trunk.239289.diff uploaded by kkm (license 888)
 ........
................

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

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