[Asterisk-Users] How to notify the user about new message
using SMS
Steven Critchfield
critch at basesys.com
Sun Aug 8 14:10:29 MST 2004
On Sun, 2004-08-08 at 14:57, Bartosz Wegrzyn wrote:
> exten => 0,11,System("/scripts/sendSMS.pl -r 17083519199 -p TMOBILE -s
> operator -m ${CALLERID}")
> and this is the error:
>
> -- Executing System("SIP/192.168.0.3-0891abc8", ""/scripts/sendSMS.pl -r
> 17083519199 -p TMOBILE -s operator -m "Bartosz Wegrzyn" <7734660101>"")
> in new stack
> /bin/sh: line 1: /scripts/sendSMS.pl -r 17083519199 -p TMOBILE -s operator
> -m Bartosz: No such file or directory
>
> The script is not working because of the "<>" characters in caller ID.
> Is there any way to change that so asterisk will pass the variables
> without ""<> characters.
>
> Or do you know any other way to send SMS messages.
> I tried to create the separate executable file with the command to send
> sms message, but then I dont have a caller ID. Is there any way that I
> could pass the $CALLERID variable to my script.
When you read that error message you should know that it is /bin/sh that
is complaining, not the perl script. So you need to deal with the Caller
ID so the shell doesn't barf. Try single quoting the ${CALLERID} so it
is not interpreted by the shell. Try
exten => 0,11,System("/scripts/sendSMS.pl -r 17083519199 -p TMOBILE -s operator -m '${CALLERID}'")
--
Steven Critchfield <critch at basesys.com>
More information about the asterisk-users
mailing list