Asterisk : 进入队列时向呼叫者播放消息

Asterisk : play message to caller when entering a queue

我正在为此苦苦挣扎:进入队列时,我想向来电者播放欢迎消息。

来电者先进入一个没有广播的短队列(initQ),然后进入mynewQ我想播放自定义欢迎消息的地方。

到目前为止,我只能播放默认 queue-youarenext.alaw 和 :

文件 queues.conf :

[general]

[initQ]
strategy=ringall                
timeout=15
member => PJSIP/111
member => PJSIP/112
member => PJSIP/112

[mynewQ]
strategy=ringall
timeout=120
context=mynewQ-context
ringinuse=no
member => PJSIP/111
member => PJSIP/112
member => PJSIP/113
announce-to-first-user = yes
periodic-announce = custom/bienvenue

拨号方案:

...
exten = takeCall,1,Queue(initQ,Crn)
 same = n,Queue(mynewQ,Cn)

...
[mynewQ-context]

exten = 1,1,NoOp("mynewQ-context : key 1 pressed to leave a message")
 same = n,VoiceMail(999@boitevocale,start)
 same = n,Playback(goodbye)
 same = n,Hangup()

我这里的目标是播放我自己的欢迎词custom/bienvenue

我尝试使用 queue-thankyouperiodic-announcequeues.conf.sample 文件中的其他方法,但没有很好的结果。

因为我定义了一个上下文,所以我也探索了这个,但是当我进入这个上下文时我无法播放消息。上下文用于捕获 DTMF,然后触发操作:留言,要求回电,......并且工作正常。

你可以这样做

exten = enterQ,1,Answer
same => n,Playback(intro-message)
same => n,Queue(initQ,Crn)

或者将您的消息添加到 musiconhold 并确保您的等待音乐始终从头开始(参见 musiconhold.conf 选项)。

这是我最终完成的方式。非常感谢 arheops 提出改变保持音乐的建议。

文件 queues.conf :

[general]

[initQ]
strategy=ringall                
timeout=15
member => PJSIP/111
member => PJSIP/112
member => PJSIP/112

[mynewQ]
strategy=ringall
timeout=120
context=mynewQ-context
musicclass=mynewQmoh
ringinuse=no
member => PJSIP/111
member => PJSIP/112
member => PJSIP/113

文件musiconhold.conf:

[mynewQmoh]
mode=files
announcement=custom/bienvenue
directory=moh

并且拨号方案保持不变。