<div dir="ltr">How about using the FILTER function to strip out anything you don't like from the CALLERID variables?<br><br>Set(CIDNAME=${FILTER(A-Z,${CALLERID(NAME)})})<br>Set(CIDNUM=${FILTER(0-9,${CALLERID(NUM)})})<br>
<br><br><div class="gmail_extra"><br><br><div class="gmail_quote">On Wed, Jul 2, 2014 at 2:25 PM, Eric Cooper <span dir="ltr"><<a href="mailto:ecc@cmu.edu" target="_blank">ecc@cmu.edu</a>></span> wrote:<br><blockquote class="gmail_quote" style="margin:0px 0px 0px 0.8ex;border-left:1px solid rgb(204,204,204);padding-left:1ex">
I'm trying to invoke a program to send a received<br>
fax.  I'd like to *safely* pass the value of ${CALLERID(all)} as an<br>
argument to the program, executed by System(...).  The problem is that<br>
the callerid can have quotes or other dangerous characters as far as<br>
the shell is concerned.<br>
<br>
For example, the test-fax service that I'm using sets the callerid to<br>
    "UNAVAILABLE  " <888NNNNNNN><br>
(I forget the actual N digits, that's unimportant).  What's important<br>
is the quotation marks.<br>
<br>
I haven't been able to figure out a way using the QUOTE function to<br>
accomplish what I want.  I either get too few or too many quotes, both<br>
resulting in multiple arguments being passed to my program instead of one.<br>
<br>
I can paste some logging output if that would help.<br>
<br>
Any suggestions would be appreciated.<br>
<span class=""><font color="#888888"><br>
--<br>
Eric Cooper             e c c @ c m u . e d u<br>
<br>
--<br>
_____________________________________________________________________<br>
-- Bandwidth and Colocation Provided by <a href="http://www.api-digital.com" target="_blank">http://www.api-digital.com</a> --<br>
New to Asterisk? Join us for a live introductory webinar every Thurs:<br>
               <a href="http://www.asterisk.org/hello" target="_blank">http://www.asterisk.org/hello</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" target="_blank">http://lists.digium.com/mailman/listinfo/asterisk-users</a><br>
</font></span></blockquote></div><br><br clear="all"><br>-- <br>A human being should be able to change a diaper, plan an invasion, butcher a hog, conn a ship, design a building, write a sonnet, balance accounts, build a wall, set a bone, comfort the dying, take orders, give orders, cooperate, act alone, solve equations, analyze a new problem, pitch manure, program a computer, cook a tasty meal, fight efficiently, die gallantly. Specialization is for insects.<br>
---Heinlein
</div></div>