从分机发起呼叫

发布于 2024-12-13 05:59:49 字数 558 浏览 2 评论 0原文

可以从分机发起呼叫吗?我的分机如下所示:

[read_text]
    exten => s,1,Answer( )
    exten => s,n,Dial(SIP/1,G(99))
    exten => s,n,Dial(SIP/2,G(99))
    exten => s,n,Goto(1)
    exten => s,100,System(echo '${text}' | /usr/bin/espeak  --stdout |sox -t  wav - -r 8000  /tmp/voice.wav)
    exten => s,n,Playback(/tmp/voice)
    exten => s,n,System(rm /tmp/voice.wav)
    exten => s,n,Hangup( )

因此,如果 SIP/1 或 SIP/2 应答,它会播放文本并挂断,如果没有人应答,它会继续拨号 我尝试制作通话文件,但它需要设置一些通道,我尝试使用本地,但不成功。 我还发现有队列,但找不到从呼叫文件发起对队列的呼叫的方法。我对星号很陌生。

It is possible to initiate call from extension? My extension is look like the following:

[read_text]
    exten => s,1,Answer( )
    exten => s,n,Dial(SIP/1,G(99))
    exten => s,n,Dial(SIP/2,G(99))
    exten => s,n,Goto(1)
    exten => s,100,System(echo '${text}' | /usr/bin/espeak  --stdout |sox -t  wav - -r 8000  /tmp/voice.wav)
    exten => s,n,Playback(/tmp/voice)
    exten => s,n,System(rm /tmp/voice.wav)
    exten => s,n,Hangup( )

So if SIP/1 or SIP/2 answers, It plays text and hangup, if nobody answer it continues to Dial
I tried to make call file, but it requires some channel to be setup, I tried to use Local, but unsuccess.
I also found that there are queues, but can't find a way to initiate call to queue from call file. I'm very new to asterisk.

如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。

扫码二维码加入Web技术交流群

发布评论

需要 登录 才能够评论, 你可以免费 注册 一个本站的账号。

评论(1

柏拉图鍀咏恒 2024-12-20 05:59:49

您尝试做的事情可能会从拨号计划中变得非常混乱。尝试按照以下方式进行操作:

[call_read_text]
exten => s,1,Dial(SIP/1,gG(read_text,s,1))
exten => s,n,Dial(SIP/2,gG(read_text,s,1))
exten => s,n,Goto(1)

[read_text]
exten => s,1,System(echo '${text}' | /usr/bin/espeak  --stdout |sox -t  wav - -r 8000  /tmp/voice.wav)
exten => s,n,Playback(/tmp/voice)
exten => s,n,System(rm /tmp/voice.wav)
exten => s,n,Hangup()
  • 在开始之前不要接听电话!
  • 如果呼叫无人应答,g 将继续在拨号方案中,并调用下一个分机
  • G() 将跳转到 read_text,s,1 如果呼叫已应答,并结束搜索
  • 您可以通过将第一个上下文与第二个上下文连接(将在应答时发生),使用呼叫文件快速启动所有这些操作。

大致如下:

Channel: Local/s@call_read_text
Context: read_text
Extension: s
Priority: 1

有关呼叫文件的更多信息,请参见:http:// www.voip-info.org/wiki/view/Asterisk+auto-dial+out。在调用文件中使用Set: foo=bar来设置${text}

What your trying to do can get pretty messy from the dialplan. Try something along these lines:

[call_read_text]
exten => s,1,Dial(SIP/1,gG(read_text,s,1))
exten => s,n,Dial(SIP/2,gG(read_text,s,1))
exten => s,n,Goto(1)

[read_text]
exten => s,1,System(echo '${text}' | /usr/bin/espeak  --stdout |sox -t  wav - -r 8000  /tmp/voice.wav)
exten => s,n,Playback(/tmp/voice)
exten => s,n,System(rm /tmp/voice.wav)
exten => s,n,Hangup()
  • Dont answer the call before you start!
  • g will continue in the dialplan if the call isn't answered, and call the next extension
  • G() will jump to read_text,s,1 if the call IS answered, and end the hunt
  • You can jumpstart all this with a call file, by connecting the first context with the second (will happen on answer).

Something along these lines:

Channel: Local/s@call_read_text
Context: read_text
Extension: s
Priority: 1

More on call files here: http://www.voip-info.org/wiki/view/Asterisk+auto-dial+out. Use Set: foo=bar in the call file to set ${text}

~没有更多了~
我们使用 Cookies 和其他技术来定制您的体验包括您的登录状态等。通过阅读我们的 隐私政策 了解更多相关信息。 单击 接受 或继续使用网站,即表示您同意使用 Cookies 和您的相关数据。
原文