gpt4 book ai didi

sms - 如何从 GOIP 发送/检索短信

转载 作者:行者123 更新时间:2023-12-04 14:53:57 26 4
gpt4 key购买 nike

PHP 或 VB.net 有没有办法在 GOIP(短信网关)上检索/发送短信而无需访问内置于 Web 管理器中的短信?

所述设备正在使用 UDP 端口 44444。

最佳答案

此脚本仅用于在 GOIP VOIP 网关上通过 php 发送 SMS

<?php
$rand = rand();
$url = 'http://goip-ip-adress-here/default/en_US/sms_info.html';
$line = '1'; // sim card to use in my case #1
$telnum = '1230000000'; // phone number to send sms
$smscontent = 'this is a test sms'; //your message
$username = "admin"; //goip username
$password = "1234"; //goip password

$fields = array(
'line' => urlencode($line),
'smskey' => urlencode($rand),
'action' => urlencode('sms'),
'telnum' => urlencode($telnum),
'smscontent' => urlencode($smscontent),
'send' => urlencode('send')
);

//url-ify the data for the POST
foreach($fields as $key=>$value) { $fields_string .= $key.'='.$value.'&'; }
rtrim($fields_string, '&');

//open connection
$ch = curl_init();

//set the url, number of POST vars, POST data
curl_setopt($ch,CURLOPT_URL, $url);

curl_setopt($ch, CURLOPT_URL, $url);
curl_setopt($ch, CURLOPT_RETURNTRANSFER, true);
curl_setopt($ch, CURLOPT_USERPWD, "$username:$password");
curl_setopt($ch, CURLOPT_HTTPAUTH, CURLAUTH_BASIC);
curl_setopt($ch, CURLOPT_PORT, 80);
curl_setopt($ch,CURLOPT_POST, count($fields));
curl_setopt($ch,CURLOPT_POSTFIELDS, $fields_string);

//execute post
echo curl_exec($ch);
echo curl_getinfo($ch);

//close connection
curl_close($ch);
?>

关于sms - 如何从 GOIP 发送/检索短信,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/28941059/

26 4 0
Copyright 2021 - 2024 cfsdn All Rights Reserved 蜀ICP备2022000587号
广告合作:1813099741@qq.com 6ren.com