[Home]

Summary:ASTERISK-15261: [patch] Incorrect path passed to MONITOR_EXEC application after 'Monitor()' call finishes.
Reporter:Nick Barnes (bcnit)Labels:
Date Opened:2009-12-02 18:13:42.000-0600Date Closed:2010-01-19 10:48:33.000-0600
Priority:MinorRegression?No
Status:Closed/CompleteComponents:Resources/res_monitor
Versions:Frequency of
Occurrence
Related
Issues:
Environment:Attachments:( 0) res_monitor.c-issue16376-1.patch
Description:The following dialplan:

-- Executing [s@inbound:1] Set("SIP/pbx19-0000000e", "MONITOR_EXEC=/etc/asterisk/bin/1wav2mp3.sh") in new stack
-- Executing [s@inbound:2] Set("SIP/pbx19-0000000e", "MONITOR_EXEC_ARGS=20091202 1259797479.14 500 402") in new stack
-- Executing [s@inbound:3] Monitor("SIP/pbx19-0000000e", "wav|/opt/pbx/raw/1259797479.14|m") in new stack

Calls the script '/etc/asterisk/bin/1wav2mp3.sh' with the following parameters:

$1 = /var/spool/asterisk/monitor//opt/pbx/raw/1259797479.14-in.wav
$2 = /var/spool/asterisk/monitor//opt/pbx/raw/1259797479.14-out.wav
$3 = /var/spool/asterisk/monitor//opt/pbx/raw/1259797479.14.wav
$4 = 20091202
$5 = 1259797479.14
$6 = 500
$7 = 402

i.e. the path '/var/spool/asterisk/monitor/' is being prepended to the actual path/file used for the recording. I can confirm that this path is not defined anywhere in /etc/asterisk/*

I have coded the script to cut the first 28 characters, but it's a bit annoying.

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

I have seen this problem in 1.6.1.11 too.
Comments:By: dant (dant) 2009-12-04 10:53:16.000-0600

Regression introduced as a result of ASTERISK-14303 which always adds path (ast_config_AST_MONITOR_DIR) to filename_base...

By: dant (dant) 2009-12-04 11:02:42.000-0600

Patch attached that includes the check for '/' used elsewhere when adding a path to filename_base...

By: Digium Subversion (svnbot) 2009-12-21 13:43:44.000-0600

Repository: asterisk
Revision: 235940

U   branches/1.4/res/res_monitor.c

------------------------------------------------------------------------
r235940 | jpeeler | 2009-12-21 13:43:42 -0600 (Mon, 21 Dec 2009) | 13 lines

Change Monitor to not assume file to write to does not contain pathing.

227944 changed the fname_base argument to always append the configured monitor
path. This change was necessary to properly compare files for uniqueness.
If a full path is given though, nothing needs to be appended and that is
handled correctly now.

(closes issue ASTERISK-15263)
(closes issue ASTERISK-15261)
Reported by: bcnit
Patches:
     res_monitor.c-issue16376-1.patch uploaded by dant (license 670)

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

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

By: Digium Subversion (svnbot) 2009-12-21 13:54:21.000-0600

Repository: asterisk
Revision: 235941

_U  trunk/
U   trunk/res/res_monitor.c

------------------------------------------------------------------------
r235941 | jpeeler | 2009-12-21 13:54:20 -0600 (Mon, 21 Dec 2009) | 20 lines

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

........
 r235940 | jpeeler | 2009-12-21 13:43:41 -0600 (Mon, 21 Dec 2009) | 13 lines
 
 Change Monitor to not assume file to write to does not contain pathing.
 
 227944 changed the fname_base argument to always append the configured monitor
 path. This change was necessary to properly compare files for uniqueness.
 If a full path is given though, nothing needs to be appended and that is
 handled correctly now.
 
 (closes issue ASTERISK-15263)
 (closes issue ASTERISK-15261)
 Reported by: bcnit
 Patches:
       res_monitor.c-issue16376-1.patch uploaded by dant (license 670)
........

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

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

By: Digium Subversion (svnbot) 2009-12-21 13:54:57.000-0600

Repository: asterisk
Revision: 235942

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

------------------------------------------------------------------------
r235942 | jpeeler | 2009-12-21 13:54:56 -0600 (Mon, 21 Dec 2009) | 27 lines

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

................
 r235941 | jpeeler | 2009-12-21 13:54:20 -0600 (Mon, 21 Dec 2009) | 20 lines
 
 Merged revisions 235940 via svnmerge from
 https://origsvn.digium.com/svn/asterisk/branches/1.4
 
 ........
   r235940 | jpeeler | 2009-12-21 13:43:41 -0600 (Mon, 21 Dec 2009) | 13 lines
   
   Change Monitor to not assume file to write to does not contain pathing.
   
   227944 changed the fname_base argument to always append the configured monitor
   path. This change was necessary to properly compare files for uniqueness.
   If a full path is given though, nothing needs to be appended and that is
   handled correctly now.
   
   (closes issue ASTERISK-15263)
   (closes issue ASTERISK-15261)
   Reported by: bcnit
   Patches:
         res_monitor.c-issue16376-1.patch uploaded by dant (license 670)
 ........
................

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

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

By: Digium Subversion (svnbot) 2009-12-21 13:55:27.000-0600

Repository: asterisk
Revision: 235943

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

------------------------------------------------------------------------
r235943 | jpeeler | 2009-12-21 13:55:26 -0600 (Mon, 21 Dec 2009) | 27 lines

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

................
 r235941 | jpeeler | 2009-12-21 13:54:20 -0600 (Mon, 21 Dec 2009) | 20 lines
 
 Merged revisions 235940 via svnmerge from
 https://origsvn.digium.com/svn/asterisk/branches/1.4
 
 ........
   r235940 | jpeeler | 2009-12-21 13:43:41 -0600 (Mon, 21 Dec 2009) | 13 lines
   
   Change Monitor to not assume file to write to does not contain pathing.
   
   227944 changed the fname_base argument to always append the configured monitor
   path. This change was necessary to properly compare files for uniqueness.
   If a full path is given though, nothing needs to be appended and that is
   handled correctly now.
   
   (closes issue ASTERISK-15263)
   (closes issue ASTERISK-15261)
   Reported by: bcnit
   Patches:
         res_monitor.c-issue16376-1.patch uploaded by dant (license 670)
 ........
................

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

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

By: Digium Subversion (svnbot) 2009-12-21 13:58:43.000-0600

Repository: asterisk
Revision: 235944

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

------------------------------------------------------------------------
r235944 | jpeeler | 2009-12-21 13:58:42 -0600 (Mon, 21 Dec 2009) | 27 lines

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

................
 r235941 | jpeeler | 2009-12-21 13:54:20 -0600 (Mon, 21 Dec 2009) | 20 lines
 
 Merged revisions 235940 via svnmerge from
 https://origsvn.digium.com/svn/asterisk/branches/1.4
 
 ........
   r235940 | jpeeler | 2009-12-21 13:43:41 -0600 (Mon, 21 Dec 2009) | 13 lines
   
   Change Monitor to not assume file to write to does not contain pathing.
   
   227944 changed the fname_base argument to always append the configured monitor
   path. This change was necessary to properly compare files for uniqueness.
   If a full path is given though, nothing needs to be appended and that is
   handled correctly now.
   
   (closes issue ASTERISK-15263)
   (closes issue ASTERISK-15261)
   Reported by: bcnit
   Patches:
         res_monitor.c-issue16376-1.patch uploaded by dant (license 670)
 ........
................

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

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