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

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

问题描述

我正在使用基于云的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()

假设我要拨打英国手机号码+4477.我会用我的网络电话拨打abcd + 4477.上面的脚本运行,打入我的本地手机.我一回答,就会跳到另一个扩展名_ ##.会拨出电话号码,然后将两者连接起来.

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!

我无法在原始"命令中添加任何"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).

推荐答案

您可以拨打本地频道(dialplan).之后,您可以在Dialplan中使用Dial命令中的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天全站免登陆