Pstn
Asterisk 沒有播放附加到 IVR 的錄音
我已經設置了一個 IVR 來接聽來電,以允許他們輸入分機或按一個分機進入我們辦公室的響鈴組。唯一的問題是 Asterisk 沒有播放我上傳的 WAV/MP3/GSM 音頻文件。使用預設錄音有效,我不知道為什麼我的不會。我也知道 IVR 可以工作,因為我可以在它停止振鈴後輸入分機。我使用 Elastix 作為 Asterisk 的 GUI。
這是 /var/log/asterisk 中包含的“完整”日誌文件的片段:
[Dec 30 22:48:12] VERBOSE[4296] pbx.c: -- Executing [s@from-pstn:1] Set("DAHDI/1-1", "__FROM_DID=s") in new stack [Dec 30 22:48:12] VERBOSE[4296] pbx.c: -- Executing [s@from-pstn:2] Gosub("DAHDI/1-1", "app-blacklist-check,s,1") in new stack [Dec 30 22:48:12] VERBOSE[4296] pbx.c: -- Executing [s@app-blacklist-check:1] GotoIf("DAHDI/1-1", "0?blacklisted") in new stack [Dec 30 22:48:12] VERBOSE[4296] pbx.c: -- Executing [s@app-blacklist-check:2] Set("DAHDI/1-1", "CALLED_BLACKLIST=1") in new stack [Dec 30 22:48:12] VERBOSE[4296] pbx.c: -- Executing [s@app-blacklist-check:3] Return("DAHDI/1-1", "") in new stack [Dec 30 22:48:12] VERBOSE[4296] pbx.c: -- Executing [s@from-pstn:3] ExecIf("DAHDI/1-1", "1 ?Set(CALLERID(name)=)") in new stack [Dec 30 22:48:12] VERBOSE[4296] pbx.c: -- Executing [s@from-pstn:4] Ringing("DAHDI/1-1", "") in new stack [Dec 30 22:48:12] VERBOSE[4296] pbx.c: -- Executing [s@from-pstn:5] Set("DAHDI/1-1", "__CALLINGPRES_SV=allowed_not_screened") in new stack [Dec 30 22:48:12] VERBOSE[4296] pbx.c: -- Executing [s@from-pstn:6] Set("DAHDI/1-1", "CALLERPRES()=allowed_not_screened") in new stack [Dec 30 22:48:12] VERBOSE[4296] pbx.c: -- Executing [s@from-pstn:7] Goto("DAHDI/1-1", "ivr-3,s,1") in new stack [Dec 30 22:48:12] VERBOSE[4296] pbx.c: -- Goto (ivr-3,s,1) [Dec 30 22:48:12] VERBOSE[4296] pbx.c: -- Executing [s@ivr-3:1] Set("DAHDI/1-1", "MSG=custom/Untitled24") in new stack [Dec 30 22:48:12] VERBOSE[4296] pbx.c: -- Executing [s@ivr-3:2] Set("DAHDI/1-1", "LOOPCOUNT=0") in new stack [Dec 30 22:48:12] VERBOSE[4296] pbx.c: -- Executing [s@ivr-3:3] Set("DAHDI/1-1", "__DIR-CONTEXT=") in new stack [Dec 30 22:48:12] VERBOSE[4296] pbx.c: -- Executing [s@ivr-3:4] Set("DAHDI/1-1", "_IVR_CONTEXT_ivr-3=") in new stack [Dec 30 22:48:12] VERBOSE[4296] pbx.c: -- Executing [s@ivr-3:5] Set("DAHDI/1-1", "_IVR_CONTEXT=ivr-3") in new stack [Dec 30 22:48:12] VERBOSE[4296] pbx.c: -- Executing [s@ivr-3:6] GotoIf("DAHDI/1-1", "0?begin") in new stack [Dec 30 22:48:12] VERBOSE[4296] pbx.c: -- Executing [s@ivr-3:7] Answer("DAHDI/1-1", "") in new stack [Dec 30 22:48:12] VERBOSE[4296] pbx.c: -- Executing [s@ivr-3:8] Wait("DAHDI/1-1", "1") in new stack [Dec 30 22:48:14] VERBOSE[4296] pbx.c: -- Executing [s@ivr-3:9] Set("DAHDI/1-1", "TIMEOUT(digit)=3") in new stack [Dec 30 22:48:14] VERBOSE[4296] func_timeout.c: -- Digit timeout set to 3.000 [Dec 30 22:48:14] VERBOSE[4296] pbx.c: -- Executing [s@ivr-3:10] Set("DAHDI/1-1", "TIMEOUT(response)=20") in new stack [Dec 30 22:48:14] VERBOSE[4296] func_timeout.c: -- Response timeout set to 20.000 [Dec 30 22:48:14] VERBOSE[4296] pbx.c: -- Executing [s@ivr-3:11] Set("DAHDI/1-1", "__IVR_RETVM=") in new stack [Dec 30 22:48:14] VERBOSE[4296] pbx.c: -- Executing [s@ivr-3:12] ExecIf("DAHDI/1-1", "1?Background(custom/Untitled24)") in new stack [Dec 30 22:48:14] WARNING[4296] format_wav.c: Not a wav file 49 [Dec 30 22:48:14] WARNING[4296] file.c: Unable to open format wav [Dec 30 22:48:14] WARNING[4296] file.c: Unable to open custom/Untitled24 (format 0x4 (ulaw)): No such file or directory [Dec 30 22:48:14] WARNING[4296] pbx.c: ast_streamfile failed on DAHDI/1-1 for custom/Untitled24 [Dec 30 22:48:14] VERBOSE[4296] pbx.c: -- Executing [s@ivr-3:13] WaitExten("DAHDI/1-1", ",") in new stack [Dec 30 22:48:16] VERBOSE[4297] pbx.c: == Spawn extension (ivr-3, s, 13) exited non-zero on 'DAHDI/3-1' [Dec 30 22:48:16] VERBOSE[4297] pbx.c: -- Executing [h@ivr-3:1] Hangup("DAHDI/3-1", "") in new stack [Dec 30 22:48:16] VERBOSE[4297] pbx.c: == Spawn extension (ivr-3, h, 1) exited non-zero on 'DAHDI/3-1' [Dec 30 22:48:16] VERBOSE[4297] sig_analog.c: -- Hanging up on 'DAHDI/3-1' [Dec 30 22:48:16] VERBOSE[4297] chan_dahdi.c: -- Hungup 'DAHDI/3-1'
在您的輸出中,來自 format_wav.c 模組的錯誤提示輸入不是 wav 文件。檢查您的格式並確保以 Asterisk 期望的格式保存它。
作為一種解決方法,您可以使用開源音頻工具“sox”讓事情變得更簡單:
sox /var/lib/asterisk/sounds/custom/Untitled24.wav -r 8000 -c 1 /var/lib/asterisk/sounds/custom/Untitled24.gsm resample -ql
這將創建文件的 GSM 格式,並應使您的擴展邏輯正常工作。