[asterisk-bugs] [Asterisk 0018120]: Ability to escape # in spool files

Asterisk Bug Tracker noreply at bugs.digium.com
Tue Oct 12 04:40:46 CDT 2010


A NOTE has been added to this issue. 
====================================================================== 
https://issues.asterisk.org/view.php?id=18120 
====================================================================== 
Reported By:                zobo
Assigned To:                
====================================================================== 
Project:                    Asterisk
Issue ID:                   18120
Category:                   PBX/pbx_spool
Reproducibility:            always
Severity:                   feature
Priority:                   normal
Status:                     new
Asterisk Version:           SVN 
JIRA:                        
Regression:                 No 
Reviewboard Link:            
SVN Branch (only for SVN checkouts, not tarball releases):  trunk 
SVN Revision (number only!):  
Request Review:              
====================================================================== 
Date Submitted:             2010-10-12 04:38 CDT
Last Modified:              2010-10-12 04:40 CDT
====================================================================== 
Summary:                    Ability to escape # in spool files
Description: 
I wanted to send a # char to a command as a parameter in spool file,
however if there is a space infront of # there is no way to escape it.
There fore this small patch. This applies to all versions.
====================================================================== 

---------------------------------------------------------------------- 
 (0127856) zobo (reporter) - 2010-10-12 04:40
 https://issues.asterisk.org/view.php?id=18120#c127856 
---------------------------------------------------------------------- 
Adds ability to escape # comments in spool files.
--- a/pbx/pbx_spool.c
+++ b/pbx/pbx_spool.c
@@ -137,6 +137,10 @@ static int apply_outgoing(struct outgoin
 		while ((c = strchr(c, '#'))) {
 			if ((c == buf) || (*(c-1) == ' ') || (*(c-1) == '\t'))
 				*c = '\0';
+			else if ((c > buf) && (c[-1] == '\\')) {
+				memmove(c - 1, c, strlen(c) + 1);
+				c++;
+			}
 			else
 				c++;
 		} 

Issue History 
Date Modified    Username       Field                    Change               
====================================================================== 
2010-10-12 04:40 zobo           Note Added: 0127856                          
======================================================================




More information about the asterisk-bugs mailing list