]> git.ipfire.org Git - thirdparty/asterisk.git/commitdiff
func_cut: Add example to documentation.
authorphoneben <3232963@gmail.com>
Tue, 18 Jul 2023 22:05:15 +0000 (01:05 +0300)
committerasterisk-org-access-app[bot] <120671045+asterisk-org-access-app[bot]@users.noreply.github.com>
Fri, 4 Aug 2023 10:57:13 +0000 (10:57 +0000)
This adds an example to the XML documentation clarifying usage
of the CUT function to address a common misusage.

funcs/func_cut.c

index f8bc4941ecb2203b6b353c6cdb0acdea66508482..a0d508d575ad243ed68e0e1d9d7d743fe1dbb5dc 100644 (file)
                </syntax>
                <description>
                        <para>Cut out information from a string (<replaceable>varname</replaceable>), based upon a named delimiter.</para>
+                                       <example title="The 'varname' parameter can only accept a variable name, not a variable expression">
+                               exten => s,1,Set(foo=${CUT(bar,,2)}); This is correct syntax
+                               exten => s,2,Set(foo=${CUT(${bar},,2)}); This is invalid syntax (unless bar contains the name of another variable)
+                                       </example>
                </description>
        </function>
  ***/