星号 - 拨打电话时播放音乐 [英] Asterisk - playing music whilst originating a call

查看:25
本文介绍了星号 - 拨打电话时播放音乐的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我使用基于云的 Asterisk 服务器作为我的 PBX.在我目前的位置,互联网相当不稳定,但手机是可靠和司空见惯的.但是,国际手机通话价格昂贵,VOIP 通话要便宜得多.

I'm using a cloud-based Asterisk server as my PBX. At my current location, the Internet is rather shaky, but cell phones are reliable and commonplace. However, international cell calls are expensive, VOIP calls are much cheaper.

所以,我想出了一个用 Asterisk 拨打本地手机的脚本:

So, I came up with a script in Asterisk which dials my local cell phone:

exten => _abcd.,1,NoOp(-- Making outbound call to number ${EXTEN:4} --)
same  => n,Answer()
same  => n,Wait(1)
same  =>  n,Originate(SIP/+86[my_cell_no]@[voip_provider],exten,incoming_remote,##${EXTEN:4})
same  => n,Hangup()

假设我想拨打英国的手机号码,+4477something.我会用我的软电话拨打 abcd+4477something.上面的脚本运行,拨打我当地的手机.我一回答,它就会跳到另一个扩展名_##.拨打出站号码,并将两者连接在一起.

Let's say I want to call a UK mobile number, +4477something. I would use my softphone to dial abcd+4477something. The script above runs, makes a call into my local cell phone. As soon as I answer, it jumps into another extension _##. which dials the outbound number, and connects the two together.

它完美地工作.然而,当我在等待本地单元连接时,我的线路上一直处于沉默状态.我很想播放音乐......但我不能使用 MusicOnHold() 应用程序,因为它只是坐在那里 &在我挂断之前什么都不做!

It works perfectly. However, whilst I'm waiting for the local cell to connect, I've got silence on the line. I'd quite like to play music... but I can't use the MusicOnHold() application, because it just sits there & does nothing until I hang up!

我无法向 Originate 命令添加任何DIAL"样式命令(即m"),因为它不支持它们.

I can't add any "DIAL" style commands (i.e. "m") to the Originate command because it doesn't support them.

是否有任何已知的方法可以异步播放(其中一个)MusicOnHold 频道,而我的拨号计划的其余部分继续播放?

Is there any known way of playing (one of) the MusicOnHold channels asynchronously whilst the rest of my dialplan gets on with it?

AGI 命令 SET MUSIC 会做我想要的吗?

Would the AGI command SET MUSIC do what I wanted?

例如

exten => _abcd.,1,NoOp(-- Making outbound call to number ${EXTEN:4} --)
same  => n,AGI(turn_music_on.sh)
same  => n,Answer()
.....etc.

我使用的是 Asterisk 1.8,如果较新的版本修复/更改了 MusicOnHold 行为,那么这将是公认的答案(但文档似乎表明它是相同的).

I'm using Asterisk 1.8, if a newer version fixes/changes the MusicOnHold behaviour, then that will be the accepted answer (but the documentation seems to suggest it's the same).

推荐答案

您可以拨打本地频道(拨号方案).之后在拨号方案中你可以使用拨号命令的 m.

You can call to Local channel(dialplan). After that in dialplan you can use m of dial command.

https://www.voip-info.org/wiki/view/Asterisk+local+channels

same  =>  n,Originate(Local/[my_cell_no]@out/n,exten,incoming_remote,##${EXTEN:4})

[out]
exten => _X.,1,Dial(SIP/+86${EXTEN}@[voip_provider],,m)

这篇关于星号 - 拨打电话时播放音乐的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆