最近我正在尝试接收短信到 plivo 号码。当我从外部 plivo 发送一条短信时,它已发送,并且 plivo 日志状态将显示已发送。但我需要将数据保存到数据库中。它不会触发我的控制器功能。
我已经通过另一个功能发送了短信。它发送并保存到我的数据库中,但问题是,当有人回复这个号码时。
控制器功能:
public function index()
{
// Sender's phone numer
$from_number = $this->input->get("From"); // $this->input->post("From"); dosen't work.
// Receiver's phone number - Plivo number
$to_number = $this->input->get("To"); // $this->input->post("To"); dosen't work.
// The SMS text message which was received
$text = $this->input->get("Text"); // $this->input->post("Text"); dosen't work.
// Output the text which was received to the log file.
// error_log("Message received - From: ".$from_number.", To: ".$to_number. ", Text: ".$text);
$arr = array("from" => $from_number, "to" => $to_number, "text" => $text);
$this->receive_model->add($arr);
}
Plivo 应用程序网址:http: //xxxxxxx.com/receive_sms
消息方法:GET
消息方法:POST // 不工作。
Codeigniter 配置:$config['allow_get_array'] = TRUE;
在 plivo 日志状态交付。
有什么帮助吗?