我将远程音频文件保存在Google云存储中。 我想在freeswitch中播放这些文件。
当我使用时:
mediaLink = "http://storage.googleapis.com/myBucket/file.wav";
session:streamFile(mediaLink);
效果很好。
但是当我使用签名网址时
mediaLink = "http://storage.googleapis.com/myBucket/file.wav?GoogleAccessId=xxx-xxx@developer.gserviceaccount.com&Expires=1408903962590&Signature=xxb%2Fx%2FDfGJlrUuz0%2F6kA6ormmReW6oN%2F0xxy3%2BwWxXc%3D";
session:streamFile(mediaLink);
我收到此错误:
2014-08-24 20:42:48.770818 [ERR] mod_httapi.c:2696 File at url [http://storage.googleapis.com/myBucket/file.wav?GoogleAccessId=xxx-xxx@developer.gserviceaccount.com&Expires=1408903962590&Signature=xxb%2Fx%2FDfGJlrUuz0%2F6kA6ormmReW6oN%2F0xxy3%2BwWxXc%3D] is unreachable!
谢谢, Snabel
答案 0 :(得分:0)
在FreeSWITCH 1.10上,可以从playback
和mod_dptools
(获得mod_shout
支持)中使用mp3
。 Google Storage signing algorithm目前也在V4。
测试工作流程:
$ gsutil signurl -r us service-account.json gs://the-bucket/a-song.mp3
URL
gs://the-bucket/a-song.mp3
HTTP Method
GET
Expiration
2019-08-24 19:03:02
Signed URL
https://storage.googleapis.com/the-bucket/a-song.mp3?x-goog-signature=a4d1dc28eeebfcdfd09f00cbc1bbe605590df3773fd473a9bcc961928bd0a64bc9ea6367a7c2de98cb5f397529bd82f455651b1d04fc1650c97587fb3c298ab49ee6dfc9092068a09612b30b9707595af4705d904e8a63b8fd3e4fcf3eb6767635d2ffb77f036b58e2cae39c7ac571bd520ef5e49435599b6f9871d1bbd43d4e1329a1af1274c15ff63731f058c61cdc693e4c5d85cbeca8b3c5886a9f1d86bfa196ea89300bccd103c66c4dec0000caa80cee5f5cbd748312dc1288c33800750313e9534bfbd8ecbd23bec31fa7c97dd0fcc1581c3353fa38e09c1e888fd8c07766059e63e14579fa44d25a57231ab4504265217c8a8225bdd68983bf6570dd&x-goog-algorithm=GOOG4-RSA-SHA256&x-goog-credential=name-of-the-service-account%2F20190824%2Fus%2Fstorage%2Fgoog4_request&x-goog-date=20190824T183009Z&x-goog-expires=3600&x-goog-signedheaders=host
将playback
与FreeSWITCH Lua API's IVRMenu
(examples)(这里是full application code)一起使用:
-- signed URL above stripped of the URL scheme
local signed_url_without_url_scheme = "storage.googleapis..."
i.unregistered_main:bindAction(
"menu-exec-app",
"playback shout://" .. signed_url_without_url_scheme,
"3"
)
我对streamFile
并不满意,但这不是因为签名的URL,而是因为我什至无法使它工作。该文档非常参差不齐,某些部分甚至相互矛盾(例如,比较mod_shout
和session:streamFile
)。