Board logo

標題: 怎么利用asterisk来了解天气? [打印本頁]

作者: kermit    時間: 2010-9-9 01:49     標題: 怎么利用asterisk来了解天气?

有没有会员研究这个?我在网上有看到有人用分机dial一个号码,就会报天气的情况,比如温度,晴,湿度,风向等。但是一直没有搞清楚怎么弄。
作者: 電腦超人    時間: 2010-9-9 01:54

應該是IVR再加一點小程式吧...
可能是有小程式連到天文台網頁拿數據後放進數據庫(或檔案)...然後當有人打進分機後...asterisk便從數據庫/檔案中拿數據...
作者: Qnewbie    時間: 2010-9-9 02:38

Plz check http://nerdvittles.com/index.php?p=135 & http://nerdvittles.com/index.php?p=160

Unfortunately, it is only available for cities@US/Canada.
作者: ckleea    時間: 2010-9-9 06:17

I try before. You need to implement AGI scripts. For Hong Kong, you can get the airport weather but not very good in sound quality
作者: candenn    時間: 2010-10-3 23:54

有可能的。

http://www.weather.gov.hk/textonly/forecast/englishwx.htm

用 PHP 或 Java 寫一個 AGI Script  parse 呢個 web page ,你便已經做佐九成功能了。
其餘一成只係 dialplan 的 SayDigit 或 SayNumber 的工作罷了。

在香港,九成九十九的 IVR 報香港天氣都係讀呢個 page。
作者: ckleea    時間: 2010-10-4 12:35

但需要一个好的 TTS (Text to Speech). I try flite without success, festival same, espeak not able to compile.
作者: candenn    時間: 2010-10-4 21:46

回復 6# ckleea


    不需要 TTS 的。其實你有相應的 wave file 再加上用 SayXXXXX的一類 dialplan function,已經做到了比 TTS 更加好質素的語音。等我組織一下先。
作者: nicholas_wind    時間: 2010-10-4 21:58

天氣我沒做過..我反而做過入stock no..用shell script上網拿..再用FESTIVAL text2wave讀出來..不過音質就的確不好..好像快譯通...
作者: ckleea    時間: 2010-10-4 22:18

回復 8# nicholas_wind


    How can you make festival work? I use centos 5.5 as linux server
作者: nicholas_wind    時間: 2010-10-6 20:12

Ckleea Ching. I use Elastix and make the dialplan in the path=/usr/bin/text2wave can pass the file or text to wav and then play back. in the textbook <<Asterisk: the fucture of telephony>> P.305 have that example.
作者: ckleea    時間: 2010-10-7 13:46

謝謝,但在使用 festival 方面有問題,需要再研究。
作者: ckleea    時間: 2010-11-17 22:04

a simple dial plan like this can help to get the Hong Kong Weather

exten=> 123, 1, DIAL(SIP/HKBN2b/18503); Cantonese
18501; English




歡迎光臨 電訊茶室 (http://telecom-cafe.com/forum/) Powered by Discuz! 7.2