<html><body style="word-wrap: break-word; -webkit-nbsp-mode: space; -webkit-line-break: after-white-space; ">I didn't know about the function but from what I understand from the "show function FILTER" output it doesn't validate a string but it cleans the string from not allowed characters. So TRIM(1234567890,01243567&505) results in 01243567505. If the length of the output string is shorter then the input string the call setup should stop because not allowed characters were stripped. With some extra lines TRIM() will do as good as the macro I guess. You can add some lines so someone trying to perform number injection will be connected with an answering machine and be requested to leave name and phone number ;-)<div><br></div><div><br></div><div>Erik</div><div><br></div><div><br><div><div>On 17 feb 2010, at 00:41, Warren Selby wrote:</div><br class="Apple-interchange-newline"><blockquote type="cite"><div class="gmail_quote">On Tue, Feb 16, 2010 at 4:38 PM, meetmecall <span dir="ltr"><<a href="mailto:info@meetmecall.nl">info@meetmecall.nl</a>></span> wrote:<br></div><br>Doesn't the built-in function FILTER() already do this?<br><br>*CLI> core show function FILTER<br>*CLI><br><br> -= Info about function 'FILTER' =-<br> <br>[Synopsis]<br>Filter the string to include only the allowed characters<br><br>[Description]<br>Permits all characters listed in <allowed-chars>, filtering all others outs.<br>In addition to literally listing the characters, you may also use ranges<br> of characters (delimited by a '-'<br>Hexadecimal characters started with a '\x'(i.e. \x20)<br>Octal characters started with a '\0' (i.e. \040)<br>Also '\t','\n' and '\r' are recognized.<br> NOTE: If you want the '-' character it needs to be prefixed with a '\'<br><br>[Syntax]<br>FILTER(allowed-chars,string)<br><br>[Arguments]<br>Not available<br><br>[See Also]<br>Not available<br><br><br clear="all"> <br>-- <br>Thanks,<br>--Warren Selby<br><a href="http://www.selbytech.com">http://www.selbytech.com</a><br> -- <br>_____________________________________________________________________<br>-- Bandwidth and Colocation Provided by <a href="http://www.api-digital.com">http://www.api-digital.com</a> --<br><br>asterisk-users mailing list<br>To UNSUBSCRIBE or update options visit:<br> <a href="http://lists.digium.com/mailman/listinfo/asterisk-users">http://lists.digium.com/mailman/listinfo/asterisk-users</a></blockquote></div><br></div></body></html>