From: Matthew Jordan Date: Sun, 14 Jul 2013 01:59:19 +0000 (+0000) Subject: Clarify documentation for function PASSTHRU X-Git-Tag: 11.6.0-rc1~3^2~84 X-Git-Url: http://git.ipfire.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=4c8e75bcf01db19342ae8cdb38226b2741ffca8b;p=thirdparty%2Fasterisk.git Clarify documentation for function PASSTHRU It is not apparent to the average user that the PASSTHRU function should not be passed as ${PASSTHRU(string)} but just as PASSTHRU(string) to functions which take a variable name and not its contents. This patch clarifies the behavior in the documentation and provides an example. (closes issue ASTERISK-21717) Reported by: Richard Miller patches: func_strings.diff uploaded by Richard Miller (license 5685) ........ Merged revisions 394302 from http://svn.asterisk.org/svn/asterisk/branches/1.8 git-svn-id: https://origsvn.digium.com/svn/asterisk/branches/11@394303 65c4cc65-6c06-0410-ace0-fbb531ad65f3 --- diff --git a/funcs/func_strings.c b/funcs/func_strings.c index 2ba1d535bd..a642823992 100644 --- a/funcs/func_strings.c +++ b/funcs/func_strings.c @@ -165,6 +165,10 @@ AST_THREADSTORAGE(tmp_buf); Literally returns the given string. The intent is to permit other dialplan functions which take a variable name as an argument to be able to take a literal string, instead. + The functions which take a variable name need to be passed var and not + ${var}. Similarly, use PASSTHRU() and not ${PASSTHRU()}. + Example: ${CHANNEL} contains SIP/321-1 + ${CUT(PASSTHRU(${CUT(CHANNEL,-,1)}),/,2)}) will return 321