Dial plan functions are very powerful, and once you begin using them, you will wonder how you got along without them. Functions are used in the dial plan in a similar manner to variables. If it helps, you can think of them as intelligent variables (or for those of you from the database world, variables with triggers). When you invoke them, they perform a specific action, and their result will become a part of the command in which you have included the function (in exactly the same way as a variable would).
THIS FILE NEEDS TO HAVE EVERYTING FROM BASE64_ENCODE TO THE END RE-WORDED, AS IT WAS ALL LIFTED VERBATIM OUT OF THE CONSOLE OUTPUT (JIM)