Playback(1.0+)

本文介绍了一个能够播放声音或视频文件的多语言应用。应用支持播放指定文件,提供多种播放选项如跳过未应答播放、不先应答播放等,并能根据当前语言选择合适的播放文件。此外,应用与Background命令不同之处在于,它在播放结束后才返回控制权。

摘要生成于 C知道 ,由 DeepSeek-R1 满血版支持, 前往体验 >

Playback: Play a sound file. (1.0)

功能:

Play a sound and/or video file

播放一个声音或视频文件

语法:

 Playback(filename1[&filename2...][,options])

描述:

播放指定的声音或视频文件(你需要省略文件拓展名)。声音文件默认被保存在/var/lib/asterisk/sounds目录下(该目录路径可以在asterisk.conf被改变)

 

Plays the specified sound or video file(s) (you need to omit the filename extension). Sound files are stored in the /var/lib/asterisk/sounds directory by default (the directory path can be changed in asterisk.conf). 

Playback是一个可以多国语言选择的应用。它将寻找与当前语言相符的子文件夹,(就是使用SetLanguage命令或通道的默认语言编码。如果失败,它将播放没有语言指定的部分)

Playback is Multi-Language-compliant. It will look in a subdirectory corresponding with the current language code (as set by the SetLanguage command, or the channel's default language code. Failing that, it will play the non-language-specific edition. 
Playback
将播放整个语音文件,只有播放结束才把控制权归还给。对Background相比,Background不仅播放语音文件还可以立即返回控制权,允许asterisk在当前通道播放语音文件时,执行其他的命令。

Playback will play the whole sound file(s), and when complete, return control. Compare with the Background command, which plays a sound file but returns control immediately, allowing Asterisk to perform other commands on this channel while the sound file is playing. 

参数

[options]有如下选项:

Skip:只有当通道被应答了才可播放声音文件。如果通道还没有被应答,Playback命令将不做任何操作,直接返回

skip: Play the sound file only if the channel has already been answered. If the channel has not yet been answered, the Playback command will return immediately without playing anything.

 

Noanswer:播放声音文件,但是不用事先应答(如果还没有应答)。不是所有的通道支持在通道还没有被应答时播放声音文件的。

noanswer: Play the sound file, but don't answer the channel first (if hasn't been answered already). Not all channels support playing messages while still on hook.

 

J:如果该选项被指定了,当指定声音文件不存在,该应用将跳转到n+101处(如果存在优先级n+101

j: If option is specified, the application will jump to priority n+101 if present when a file specified to be played does not exist.

 

Say:使用say.conf来说明当前字符串。

say: Use say.conf to interpret the string

 

如果skipnoasnwer选项两者都没有指定, Playback命令将首先应答通道(如果当前通道还没有被应答),才会播放声音文件。

If neither skip nor noanswer options are specified, then the Playback command will first answer the channel (if it hasn't been answered already) and then play the sound file.

 

Note: The options wont work if there are spaces between the filename, the comma and the option(s). 

示例1

   exten => 500,1,Playback(tt-weasels,skip)

 

返回值

一旦结束, ${PLAYBACKSTATUS}会被设置成"FAILED"或者"SUCCESS"

On completion, ${PLAYBACKSTATUS} contains either "FAILED" or "SUCCESS".

 

Playback不会被时间影响,除非internal_timingasterisk.conf中被开启。

Playback is not affected by timing, unless internal_timing is turned on in asterisk.conf.

 

评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值