[英]Is there a way of sending/receiving SMS(s) from a Huawei B315 LTE Router with PHP?
我尝试使用 curl 访问路由器的接口,但我是一名新编码员,我很难做到这一点。
<?php
$data = array( "User name" => "admin", "password" => "*****", "form" => "submit" );
// Initialized the cURL session with Target URL
$ch = curl_init("192.168.8.1");
curl_setopt($ch, CURLOPT_FOLLOWLOCATION, "true"); // Allow redirections
curl_setopt($ch, CURLOPT_POST, true); // We are making a post request
/*curl_setopt($ch, CURLOPT_POSTFIELDS, $data);*/
curl_setopt($ch, CURLOPT_COOKIEJAR, 'cookie.txt');
curl_setopt($ch, CURLOPT_RETURNTRANSFER, "true");
$result = curl_exec($ch);
curl_close($ch);
echo $result;
?>
我知道这个答案晚了几年,但对于仍在寻找答案的人来说,Github 上有一个 PHP 脚本,它允许通过 Huawei-B315s-22 HTTP API 发送和接收短信。请参阅https://github .com/Zili0/Huawei-B315s-22
我注意到它调用了以下端点:
/api/webserver/SesTokInfo
/api/user/state-login
/api/monitoring/status
/api/user/authentication_login
/api/device/information
/api/net/current-plmn
/api/monitoring/traffic-statistics
/api/sms/sms-count
/api/sms/sms-list
/api/wlan/multi-basic-settings
/api/device/control
/api/user/logout
我还发现了另外两个类似的脚本,它们都是在 Python 中编写的,它们做的事情相似。 希望其中之一能提供您需要的东西:
声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.