[asterisk-commits] mnick: branch 1.6.2 r233240 - in /branches/1.6.2: ./ pbx/pbx_config.c

SVN commits to the Asterisk project asterisk-commits at lists.digium.com
Fri Dec 4 15:07:20 CST 2009


Author: mnick
Date: Fri Dec  4 15:07:16 2009
New Revision: 233240

URL: http://svnview.digium.com/svn/asterisk?view=rev&rev=233240
Log:
Merged revisions 233093 via svnmerge from 
https://origsvn.digium.com/svn/asterisk/trunk

........
  r233093 | mnick | 2009-12-04 11:15:47 -0600 (Fri, 04 Dec 2009) | 8 lines
  
  Parse global variables or expressions in hint extensions
  
  Parse global variables or expressions in hint extensions. Like: exten => 400,hint,DAHDI/i2/${GLOBAL(var)}
  
  (closes issue #16166)
  Reported by: rmudgett
  Tested by: mnick, rmudgett
........

Modified:
    branches/1.6.2/   (props changed)
    branches/1.6.2/pbx/pbx_config.c

Propchange: branches/1.6.2/
------------------------------------------------------------------------------
Binary property 'trunk-merged' - no diff available.

Modified: branches/1.6.2/pbx/pbx_config.c
URL: http://svnview.digium.com/svn/asterisk/branches/1.6.2/pbx/pbx_config.c?view=diff&rev=233240&r1=233239&r2=233240
==============================================================================
--- branches/1.6.2/pbx/pbx_config.c (original)
+++ branches/1.6.2/pbx/pbx_config.c Fri Dec  4 15:07:16 2009
@@ -1497,13 +1497,29 @@
 					/* No arguments */
 					data = "";
 				} else {
+					char *orig_appl = ast_strdup(appl);
+
+					if (!orig_appl)
+						return -1;
+					
 					appl = strsep(&stringp, "(");
-					data = S_OR(stringp, "");
-					if ((end = strrchr(data, ')'))) {
-						*end = '\0';
+
+					/* check if there are variables or expressions without an application, like: exten => 100,hint,DAHDI/g0/${GLOBAL(var)}  */
+					if (strstr(appl, "${") || strstr(appl, "$[")){
+						/* set appl to original one */
+						strcpy(appl, orig_appl);
+						/* set no data */
+						data = "";
+					/* no variable before application found -> go ahead */
 					} else {
-						ast_log(LOG_WARNING, "No closing parenthesis found? '%s(%s'\n", appl, data);
+						data = S_OR(stringp, "");
+						if ((end = strrchr(data, ')'))) {
+							*end = '\0';
+						} else {
+							ast_log(LOG_WARNING, "No closing parenthesis found? '%s(%s'\n", appl, data);
+						}
 					}
+					ast_free(orig_appl);
 				}
 
 				appl = ast_skip_blanks(appl);




More information about the asterisk-commits mailing list