[asterisk-users] quoting arguments to System command in dialplan

Eric Cooper ecc at cmu.edu
Wed Jul 2 16:25:01 CDT 2014

I'm trying to invoke a program to send a received
fax.  I'd like to *safely* pass the value of ${CALLERID(all)} as an
argument to the program, executed by System(...).  The problem is that
the callerid can have quotes or other dangerous characters as far as
the shell is concerned.

For example, the test-fax service that I'm using sets the callerid to
(I forget the actual N digits, that's unimportant).  What's important
is the quotation marks.

I haven't been able to figure out a way using the QUOTE function to
accomplish what I want.  I either get too few or too many quotes, both
resulting in multiple arguments being passed to my program instead of one.

I can paste some logging output if that would help.

Any suggestions would be appreciated.

Eric Cooper             e c c @ c m u . e d u

More information about the asterisk-users mailing list