Closed guiwushaonian closed 5 months ago
简单写了一下,测试可以用了,还没写 auth 部分,有时间我再完善一下吧
handler_call.lua
中的 upload()
函数替换为下面内容,并修改代码中的域名和路径创建目录或上传
权限-- 录音上传 alist 版本
local function upload_alist()
local time = os.time()
local date = os.date("*t", time)
local date_str =
table.concat(
{
date.year .. "/",
string.format("%02d", date.month) .. "/",
string.format("%02d", date.day) .. "/",
string.format("%02d", date.hour) .. "-",
string.format("%02d", date.min) .. "-",
string.format("%02d", date.sec)
},
""
)
-- alist 上传接口
local base_url = "http://{改成自己的alist域名}"
local url = base_url .. "/api/fs/put"
-- 录音上传路径: /xxx/record/18888888888/2022/12/12/12-00-00/10086_1668784328.wav
local path = "/{改成自己的alist上传路径}/record/"
path = path .. (sim.getNumber() or "unknown") .. "/"
path = path .. date_str .. "/"
path = path .. CALL_NUMBER .. "_" .. time .. "." .. record_extention
record_upload_header["File-Path"] = path
local function httpCallback(...)
customHttpCallback(base_url .. path, ...)
end
sys.taskInit(http.request, "PUT", url, nil, record_upload_header, record_upload_body, 50000, httpCallback)
end
试了一下,可以了。感谢大佬!!! Thanks♪(・ω・)ノ 哈哈,看文档不仔细,只看到了表单上传文件接口,没有看到下面还有一个流式上传文件接口
配置项中新增一个Alist的token配置
UPLOAD_ALIST_TOKEN = "xxx"
handler_call.lua中修改,新增一个Authorization头
-- ALIST token
local alist_token = config.UPLOAD_ALIST_TOKEN
handler_call.lua中upload_list方法增加一个header头
record_upload_header["File-Path"] = path
record_upload_header["Authorization"] = alist_token
改了一下,采用token验证更安全一点
其实设置无条件呼叫转移就可以了 实现短信收发就可以了 来电用无条件呼叫转移, 这样也能及时收到消息
其实设置无条件呼叫转移就可以了 实现短信收发就可以了 来电用无条件呼叫转移, 这样也能及时收到消息
是的,通话录音我实际使用下来真的没有多少人会去用,大多都是听到提示音直接挂掉
以下是从官方demo中找到的,但是奈何不会lua,调试半天也一直报错,不知哪里有问题
{"code":500,"message":"multipart: NextPart: EOF","data":null}