Asterisk Extension中的Application命令详解五

Math( )        Performs mathematical operations and returns the result
                执行数学操作并返回结果

Math(returnvar,number1  operator  number2)
Performs a floating-point calculation on number1  to number2, and assigns the result to the variable named returnvar. Valid operators are +, -, /, *, %, <, >, >=, <=, and ==, and they behave as their C equivalents.
在数字1和数字2之间执行浮点操作并将指定结果保存在变量returnvar中。缺省操作符号为:+,-,/,*,%,<,>,>=,<=,和==,并且其等同于C语言中的符号.

Always returns 0. 总是返回0.

; add two numbers, and say the result   添加两个数字,并返回结果.
exten => 123,1,Math(SUM,2+2)
exten => 123,2,SayNumber(${SUM})

; subtract two numbers, and say the difference    两数字相减,返回结果.
exten => 124,1,Math(DIFFERENCE,5-3)
exten => 124,2,SayNumber(${DIFFERENCE})

MeetMe( )        Puts the caller into a MeetMe conference bridge
        将呼叫放置于MeetMe会议网桥.

MeetMe([confno][,[options][,pin])

Joins the caller on the current channel into the MeetMe conference specified by the confno
argument. If the conference number is omitted, the user will be prompted to enter one. The options string may contain zero or more of the characters in the following list.
通过会议参数将当前呼叫者加入当前正在进行的MeetMe会议,如果会议号码缺省,将提示用户输入一个。字符选项可能包含0或者下面列表中的其它字符。
m        Sets monitor-only mode (listen only, no talking). 设置为监控模式(只能听不能交谈)
t        Sets talk-only mode (talk only, no listening). 设置为交谈模式(只能交谈不能听)
T        Sets talker detection (sent to Manager interface and MeetMe list). 设置交谈检测(发送管理端口和MeetMe列表)
i        Announces user join/leave. 通告用户加入/离开
p        Allows user to exit the conference by pressing #.允许用户按#键离开会议
X        Allows user to exit the conference by entering a valid single-digit extension (set via the variable  ${MEETME_EXIT_CONTEXT}),  or  the  number  of  an  extension  in  the  current context if that variable is not defined.
允许用户通过输入一个合法的数字范围离开会议(通过设置变量${MEETME_EXIT_CONTEXT}),    如果变量未定义则从当前环境来确定数字范围.
d        Dynamically adds conference. 动态添加会议
D        Dynamically adds conference, prompting for a PIN. 动态添加会议并提示PIN
e        Selects an empty conference. 选择一个空闲的会议
E        Selects an empty pinless conference. 选择一个空闲的无人的会议
v        Sets video mode. 设置视频模式
r        Records        conference        (as        ${MEETME_RECORDINGFILE}        using        format        ${MEETME_ RECORDINGFORMAT}).  The  default  filename  is  meetme-conf-rec-${CONFNO}-${UNIQUEID} and the default format is .wav. 会议记录(作为${MEETME_RECORDINGFILE} 使用格式${MEETME_RECORDINGFORMAT}),缺省文件     名是.....${(CONFNO)-${UNIQUEID}缺省的格式是.....
q        Sets quiet mode (don’t play enter/leave sounds). 设置静音模式(不能播放输入/输出声音)
M        Enables Music on Hold when the conference has a single caller. 当会议中只有一个人的时候能够开启音乐
x        Closes the conference when the last marked user exits. 当最后一个用户离开的时候关闭会议室
w        Waits until the marked user enters the conference. 等待标识用户进入会议室才开始会议
b        Runs the AGI script specified in ${MEETME_AGI_BACKGROUND}. Default: conf-background.agi.
(Note: this does not work with non-Zap channels in the same conference.)
运行在${MEETME_AGI_BACKGROUND}变量中指定的AGI脚本,缺省......(注意:在相同的会议中     不能工作在non-Zap信道)
s        Presents the menu (user or admin) when * is received (“send” to menu). 当收到*符号时出现菜单( 用户或者管理员)
a        Sets admin mode. 设置管理模式
A        Sets marked mode. 设置标识模式
If the pin  argument is passed, the caller must enter that pin number to successfully enter the conference. 如果pin变量通过的话,用户必须输入pin号码才能成功进入会议室。

MeetMe( ) returns 0 if the caller presses # to exit (see option p); otherwise, it returns -1.
如果用户按#号键离开则MeetMe()返回0,否则返回-1

A suitable Zaptel timing interface must be installed for MeetMe con- ferencing to work.
要想MeetMe会议工作的话你必须安装一个适当的Zaptel计时器端口。

exten => 123,1,Answer( )
; add the caller to conference number 501 with pin 1234
exten => 123,2,MeetMe(501,DpM,1234)

See Also

MeetMeAdmin( ), MeetMeCount( )
MeetMeAdmin( )        Performs MeetMe conference administration
                执行MeetMe会议管理

MeetMeAdmin(confno,command[,pin])
Runs  the  specified  MeetMe  administration  command   on  the  specified  conference.  The command  may  be  one  of  the  following  (note  that  the  pin  argument  is  used  only  for  the  k option):
在指定的会议中执行指定的MeetMe管理命令。命令可能包含以下的其中之一(注意pin参数仅仅用于K选项)

K        Kicks all users out of the conference将所有用户踢出会议
k        Kicks one user (with the specified PIN as the third argument) out of the conference
     将某一用户踢出(指定的PIN号码做为第三方参数)
e        Ejects the last user that joined  将最后加入的用户踢出
L        Locks the conference  锁定会议
l        Unlocks the conference  解除会议锁定
M        Mutes the conference  将会议设置为静音
m        Unmutes the conference  将会议的静音设置解除
N        Mutes the entire conference (except admin)  将整个会议静音(管理员除外)
n        Unmutes the entire conference (except admin) 将整个会议静音解除(管理除外)
; mute conference 501  将501会议设置为静音
exten => 123,1,MeetMeAdmin(501,M)

; kick user with PIN number 1234 from conference 501  从501会议将PIN号码为1234的用户踢出去
exten => 124,1,MeetMeAdmin(501,k,1234)

See Also

MeetMe( ), MeetMeCount( )

MeetMeCount( )        Counts the number of participants in a MeetMe conference
        计算参加MeetMe会议的人的数量

MeetMeCount(confno[,variable])
Plays back the number of users in the MeetMe conference identified by confno. If a variable is  specified  by  the  variable  argument,  playback  will  be  skipped  and  the  count  will  be assigned to variable.
程序返回通过confno标识的在MeetMe会议中的人的数量。如果变量参数被指定,该程序将被跳过并将数量保存到指定变量中。
Returns 0 on success or -1 on a hangup.  
成功返回0否则返回-1

; count the number of users in conference 501, and assign that number to ${COUNT}
统计在会议501中的用户数量,并将值保存到${count}
exten => 123,1,MeetMeCount(501,COUNT)

See Also

MeetMe( ), MeetMeAdmin( )

Milliwatt( )        Generates a 1,000-Hz tone
        产生1000Hz声音

Milliwatt( )
Generates a constant 1,000-Hztone at 0 dbm (mu-law). This application is often used for testing the audio properties of a particular channel.
在0dbm(mu-law)生成一个1000Hz声音。该程序经常用来测试指定通道的音频属性

; generate a milliwatt tone for testing  生成一个milliwatt声音用于测试
exten => 123,1,Milliwatt( )

See Also

Echo( )

Monitor( )        Monitors (records) the audio on the current channel
        监控当前通道中的音频

Monitor([file_format[:urlbase][,fname_base][,options]])
Starts monitoring a channel. The channel’s input and output voice packets are logged to files until the channel hangs up or monitoring is stopped by the StopMonitor( ) application. Monitor( ) takes the following arguments:
开始监控信道。信道的输入和输出语音将被保存到文件直到信道被挂起或者信道被StopMonitor()程序停止掉。Monitor()使用如下参数:

file_format
Specifies the file format. If not set, defaults to wav.
指定保存文件格式,如果没有设置,则缺省为wav.
fname_base
If set, changes the filename used to the one specified.
如果被设置,则用指定的参数来改变文件名称
options
One of two options can be specified:
一到两个选项被指定
m
When  the  recording  ends,  mix  the  two  leg  files  into  one  and  delete  the  original  leg files.  If  the  variable  ${MONITOR_EXEC}  is  set,  the  application  referenced  in  it  will  be executed  instead  of  soxmix,  and  the  raw  leg  files  will  not  be  deleted  automatically. soxmix (or ${MONITOR_EXEC}) is handed three arguments: the two leg files and the file- name for the target mixed file, which is the same as the leg filenames but without the in/out  designator.  If  ${MONITOR_EXEC_ARGS}  is  set,  the  contents  will  be  passed  on  as additional arguments to ${MONITOR_EXEC}. Both ${MONITOR_EXEC} and the m flag can be set from the administrator interface
当记录结束后,将两个文件合并为一个并删除原始文件。如果变量${MONITOR_EXEC}被指定,the application referenced in it will be executed instead of....并且原始文件将被自动删除
(或者${MONITOR_EXEC})有三个参数:the two leg files and the filename
for the target mixed file, which is the same as the leg filenames but without the
in/out designator.如果${MONITOR_EXEC_ARGS}被设置,相关内容将被做为附加参数输出到变量${MONITOR_EXEC}并通过.${MONITOR_EXEC}和m标识可以通过管理端口来设置.
b
Don’t begin recording unless a call is bridged to another channel.
Returns -1  if monitor files can’t be opened or if the channel is already monitored; other- wise, returns 0.
除非调用被桥接到另一个信道否则不开始记录,如果监控文件未被打开或者信道已经被监控则返回-1,其它情况则返回0

exten => 123,1,Answer( )
; record the current channel, and mix the audio channels at the end of
记录当前信道,并且在语音记录结束时合并文件。
; recording
exten => 123,2,Monitor(wav,monitor_test,mb) exten => 123,3,SayDigits(12345678901234567890) exten => 123,4,StopMonitor( )

See Also

ChangeMonitor( ), StopMonitor( )

 

MP3Player( )        Plays an MP3 file or stream
        播放MP3文件或流

MP3Player(location)

Uses the mpg123 program to play the given location to the caller. The specified location
can be either a filename or a valid URL. The caller can exit by pressing any key.
使用.....程序播放给定的呼叫。指定的呼叫可以是文件名称或者有效的URL。通过按任意键退出

The correct version of mpg123 must be installed for this application to work properly. Asterisk currently works best with mpg123-0.59r.


Returns -1 on hangup; otherwise, returns 0. 如果挂起则返回-1,否则返回0

exten => 123,1,Answer( )
exten => 123,2,MP3Player(test.mp3)
exten => 123,1,Answer( )
exten => 123,2,MP3Player(http://server.tld/test.mp3)

MusicOnHold( )        Plays Music on Hold indefinitely
        播放音乐通过不确定的句柄

MusicOnHold(class)
Plays  hold  music  specified  by  class,  as  configured  in  musiconhold.conf.  If  omitted,  the default music class for the channel will be used. You can use the SetMusicOnHold( ) applica- tion to set the default music class for the channel.

Returns -1 on hangup; otherwise, does not return.
通过类来播放指定的句柄音乐。as configured in.........如果忽略,将使用系统缺省的音乐。可以通过SetMusicOnHold()应用程序为信道设置缺省的音乐类。如果挂起则返回-1,否则没有返回值。
; transfer telemarketers to this extension to keep them busy

exten => 123,1,Answer( )
exten => 123,2,Playback(tt-allbusy)
exten => 123,3,MusicOnHold(default)

See Also

SetMusicOnHold( ), WaitMusicOnHold( )

NBScat( )        Plays an NBS local stream
        播放NBS本地流

NBScat( )

Uses the nbscat8k program to listen to the local Network Broadcast Sound (NBS) stream.
(For more information, see the nbs module in Digium’s CVS server.) The caller can exit by pressing any key.
使用nbscat8k程序监控本地网络广播声音(NBS)流。(更多信息请参见...module in Digium's CVS server).按任意键退出。
Returns -1 on hangup; otherwise, does not return. 如果挂起则返回-1,否则没有返回值。

exten => 123,1,Answer( )
exten => 123,2,NBScat( )


NoCDR( )        Disables Call Detail Records for the current call
        禁止当前呼叫使用CDR

NoCDR( )

Disables CDRs for the current call. 禁止当前呼叫使用CDR
; don't log calls to 555-1212 不要记录555-1212的呼叫
exten => 5551212,1,Answer( )
exten => 5551212,2,NoCDR( )
exten => 5551212,3,Dial(Zap/4/5551212)

See Also

AppendCDRUserField( ), ForkCDR( ), SetCDRUserField


NoOp( )        Does nothing
        没有任何操作

NoOp(text)
Does  nothing—this  application  is  simply  a  placeholder.  As  a  side  effect,  the  application evaluates text and prints the result to the Asterisk command-line interface, which can be useful for debugging.
Does nothing--该应用只是一个简单的占位符。另外,该应用对文本进行求值并打印结果到Asterisk命令行端口,而且可以通过debugging来调用。
You don’t have to place quotes around the text. If quotes are placed within the brackets, they will show up on the console.
不要在文本上加“”,如果引号加到方括号中,则引号将显示在控制台中。


exten => 123,1,NoOp(CallerID is ${CALLERID})

Park( )        Parks the current call
        停放当前呼叫

Park(exten)
Parks the current call (typically in combination with a supervised transfer to determine the parking space number). This application is always registered internally and does not need to  be  explicitly  added  into  the  dialplan,  although  you  should  include  the  parkedcalls context. Parking configuration is set in features.conf.
停放当前呼叫(typically in combination with a supervised transfer to determine the parking space number).该应用总是在中心注册并且不需要明确的添加到拨号盘中,虽然应该包含在归位环境中。

; park the caller in parking space 701  停放呼叫到701
include => parkedcalls exten => 123,1,Answer( ) exten => 123,2,Park(701)

See Also

ParkAndAnnounce, ParkedCall( )

 

转自 http://www.asteriskcn.com/index.php?q=content/asterisk-extension%E4%B8%AD%E7%9A%84application%E5%91%BD%E4%BB%A4%E8%AF%A6%E8%A7%A3%E4%BA%94

 

你可能感兴趣的:(PHP,网络应用,UP,cvs,音乐)