Php 如何将linphone图像共享服务器配置到我们自己的服务器
我最近玩过linphone,我成功地将它与我自己的服务器集成,用于呼叫和短信,但是我试图配置发送图像,它根本不起作用。我在自己的服务器上获得用于文件上载的.php文件,并将共享图像服务器从linphone指向它,但它不会向服务器发送任何参数。这里的示例Php 如何将linphone图像共享服务器配置到我们自己的服务器,php,linphone,aster,Php,Linphone,Aster,我最近玩过linphone,我成功地将它与我自己的服务器集成,用于呼叫和短信,但是我试图配置发送图像,它根本不起作用。我在自己的服务器上获得用于文件上载的.php文件,并将共享图像服务器从linphone指向它,但它不会向服务器发送任何参数。这里的示例 好的,这是原始PHP文件- 只是复制粘贴,它的工作 它会将此xml文档发送/应答给使用linphone的其他用户 <?xml version="1.0" encoding="UTF-8"?><file xmlns="urn:
好的,这是原始PHP文件-
只是复制粘贴,它的工作
它会将此xml文档发送/应答给使用linphone的其他用户
<?xml version="1.0" encoding="UTF-8"?><file xmlns="urn:gsma:params:xml:ns:rcs:rcs:fthttp">
<file-info type="file">
<file-size>64475</file-size>
<file-name>25756.jpg</file-name>
<content-type>image/jpeg</content-type>
<data url = "http://xxx.xxx.xxx./path/file.jpg" until = "2015-11-18T20:13:00Z"/>
</file-info>
</file>
64475
25756.jpg
图像/jpeg
如果你想让它与Asterix兼容,你需要实现正确的答案,比如xml文档,或者只发送
echo“Photo.”$http_url.“
(这与Jitsi一起工作)但是在图像上传到服务器后,我根本看不到任何消息通知接收者客户端,我想知道如何配置asterisk server以接受此设置?原始PHP文件现在位于:
<?php
date_default_timezone_set("UTC");
if (count($_FILES) != 0) {
$uploaddir = dirname(__FILE__).'/tmp/';
$rcvname=$_FILES['File']['name'];
//$ext= strtolower(pathinfo($rcvname, PATHINFO_EXTENSION));
//$allowed_ext = array("jpg", "txt", "zip", "zlib", "gz");
if (!in_array($ext, $allowed_ext)) $ext="jpg";
$tmpfile=$_FILES['File']['tmp_name'];
error_log('Uploaded '.$rcvname.' to '.$tmpfile."\n", 3, "/var/log/trace_file_sharing.log");
//$uploadfile = $uploaddir.time().md5_file($tmpfile).".".$ext;
$uploadfile = $uploaddir.uniqid()."_".bin2hex(openssl_random_pseudo_bytes(10)).".$ext";
if (move_uploaded_file($tmpfile, $uploadfile)) {
error_log('Moved to '.$uploadfile."\n", 3, "/var/log/trace_file_sharing.log");
$ipport = $_SERVER['HTTP_HOST'];
$prefix= (isset($_SERVER["HTTPS"]) && strtolower($_SERVER["HTTPS"])=="on")?"https":"http";
$start= $prefix."://".$ipport.dirname($_SERVER['REQUEST_URI']);
$http_url = $start."/tmp/".basename($uploadfile);
// validity time is one week ahead from now
$until = date("Y-m-d\TH:i:s\Z",time()+7*24*60*60);
echo '<?xml version="1.0" encoding="UTF-8"?><file xmlns="urn:gsma:params:xml:ns:rcs:rcs:fthttp">
<file-info type="file">
<file-size>'.$_FILES['File'][size].'</file-size>
<file-name>'.$_FILES['File'][name].'</file-name>
<content-type>'.$_FILES['File'][type].'</content-type>
<data url = "'.$http_url.'" until = "'.$until.'"/>
</file-info>
</file>';
}
}
if ((count($_POST) == 0) && (count($_FILES) == 0)) {
if (!function_exists('http_response_code')) {
$protocol = (isset($_SERVER['SERVER_PROTOCOL']) ? $_SERVER['SERVER_PROTOCOL'] : 'HTTP/1.0');
header($protocol . ' 204 No Content');
$GLOBALS['http_response_code'] = 204;
} else {
http_response_code(204);
}
}
?>
<?xml version="1.0" encoding="UTF-8"?><file xmlns="urn:gsma:params:xml:ns:rcs:rcs:fthttp">
<file-info type="file">
<file-size>64475</file-size>
<file-name>25756.jpg</file-name>
<content-type>image/jpeg</content-type>
<data url = "http://xxx.xxx.xxx./path/file.jpg" until = "2015-11-18T20:13:00Z"/>
</file-info>
</file>