2016-03-01 101 views
0

我想在被叫掛機後爲主叫方執行AGI腳本。例如,爲了對客戶進行調查,我將在座席掛斷後運行AGI腳本。 不幸的是,當AGI腳本運行時,agi調試輸出顯示: 「511:該命令無法在死信道上執行」 我在我的agi腳本中使用諸如「ANSWER」或「STREAM FILE」之類的命令需要通道運行上。 我知道一旦被叫方掛機,呼叫頻道就會掛斷。 我嘗試了DeadAGI而不是AGI,並且在撥號命令中也使用了「g」選項,但它們都不起作用。 所以,我認爲我必須尋找一種解決方案,以保持呼叫頻道,以便我可以運行我的腳本。 有什麼建議嗎?呼叫通道在Asterisk掛機後保持呼叫頻道

回答

0

你不應該在這種情況下使用「g」參數,因爲它是CALLER掛斷。你應該用 「F」

F([[context^]exten^]priority): When the caller hangs up, transfer 
    the *called* party to the specified destination and *start* execution 
    at that location. 
    NOTE: Any channel variables you want the called channel to inherit 
    from the caller channel must be prefixed with one or two underbars ('_'). 
    F: When the caller hangs up, transfer the *called* party to the next 
    priority of the current extension and *start* execution at that location. 
    NOTE: Any channel variables you want the called channel to inherit 
    from the caller channel must be prefixed with one or two underbars ('_'). 
    NOTE: Using this option from a Macro() or GoSub() might not make 
    sense as there would be no return points. 
    g: Proceed with dialplan execution at the next priority in the current 
    extension if the destination channel hangs up. 
+0

其實我想爲接聽電話做這種情況,所以我想在被叫方掛機後爲外線來電做些事情。正如你在這裏提到的選項「F」是針對呼叫者掛斷的情況。這是不同的 – Amir

+0

如果CALLED聚會掛斷沒有任何問題。選項g和類似的隊列選項可以正常工作,請參閱extensions.conf.sample中的示例。可能您只是做了錯誤的事情。 – arheops

+0

我正在使用elastix 2.3。我寫了一個非常簡單的代碼:'[test] exten => 22,1,dial(sip/100) exten => h,1,播放(再見)'' 。真的很奇怪 – Amir

0

我終於找到了答案。問題在於我們不必在h擴展中執行agi腳本,否則我們會在agi中爲某些函數(如answer或streamfile)提供錯誤。我們不得不在h擴展之前將呼叫重定向到某個擴展,並且在elastix中我必須更改extensions.conf。