html - Passing PHP value to AGI -
i'm still new php , asterisk. trying pass value html text input php page communicates asterisk send sms text via gsm modem. far code have experimented on.
$num = $_post['cnum']; $msg = $_post['cmessage']; $type='gsm'; $method='send'; $sync='sync sms'; $span='4'; $destination=$num; $message=$msg; $timeout='20'; $id='1234'; $agi->command("$type $method $sync $span $destination $message $timeout $id"); exit(0);
this work problem example enter "sample space" text input "cmessage", text message receive "sample" (without double quotation marks). words after first space character omitted. if try , code way:
$num = $_post['cnum']; $msg = $_post['cmessage']; $type='gsm'; $method='send'; $sync='sync sms'; $span='4'; $destination=$num; $message='"sample space"'; <----------- example $timeout='20'; $id='1234'; $agi->command("$type $method $sync $span $destination $message $timeout $id"); exit(0);
i receive whole message "sample space" (without double quotation marks) please me this?
seams missed quotation when learned php.
try use it
$message='\"sample space\"'; <----------- example
Comments
Post a Comment