`
sun4love
  • 浏览: 226288 次
  • 性别: Icon_minigender_1
  • 来自: 上海
社区版块
存档分类
最新评论

asterisk App Dial 拨号 发起外呼

    博客分类:
  • VOIP
阅读更多

Synopsis

Attempts to establish a new outgoing connection on a channel, and then link it to the existing input channel.
尝试在通道上建立一个外呼的连接,并与现有通道桥接

Description

Dial(type/identifier, timeout, options, URL)
Dial(type1/identifier1[&type2/identifier2[&type3/identifier3... ] ], timeout, options, URL)
RetryDial(announce|sleep|loops|Technology/resource[&Technology2/resource2...][|[timeout][|[options][|URL]]])

Attempts to "dial out" on all the specified channels (each specified by a type and identifier) simultaneously. The first channel that answers "wins", and all the other outgoing channels are hung up. The originating channel that triggered this Dial command is then Answered, if necessary, and the two channels are connected together ("bridged") allowing a conversation to take place between them. When the channel that triggered the Dial command hangs up, the Dial command exits.
尝 试在所有定义的通道上(线路类型和可识别的号码、符号、分机等)同时发起外呼,首先应答的通道被桥接,其它外呼通道挂机。拨号命令产生的通道触发应答,如 果必需,2个通道将被连接在一起(桥接),并允许2通道之间进行通话。当被拨号命令触发的通道挂机,拨号命令将退出,执行完毕。

RetryDial was added in Asterisk v1.2 together with the 'd' flag.

Parameters

  • Jumping in Asterisk v1.2.14: In [general] you can set priorityjumping=yes/no. The default as of 1.2.14 is "yes". When set to "yes", the dialplan will jump to priority +101 on busy, congested, and channel unavailable. The wiki "used" to imply that the default was "no" if priorityjumping was not set. This does not appear to be the case in 1.2.14.
    跳转:可以在[general]中设置priorityjumping=yes/no,缺省设置是yes,当设置为yes时,拨号方案在遇忙、拥塞、通道不可用情况下,会跳转到n+101上执行,
  • New in Asterisk 1.2.0: If you don't want to modify options on each app that used to have jumping behavior, you can set "priorityjumping=yes" in the [general] section of extensions.conf which will enforce the old behavior globally. As far as the Dial() application is concerned you can control the behavior with the 'j' option (see below).
    如果不想在常用于有跳跃行为的每个应用上修改他们的选项,可以在extensions.conf的[general]中设置 priorityping=yes,从而强制执行,直到Dial()应用连接。可以通过'j'选项来控制这种行为
  • New in Asterisk v1.2.0: The Caller*ID of the outbound leg is now the extension that was called, rather than the Caller*ID of the inbound leg of the call. The "o" flag for Dial can be used to restore the original behavior if desired. Note that if you are looking for the originating callerid from the manager event, there is a new manager event "Dial" which provides the source and destination channels and callerid.
    外呼的Caller*ID,1.2版本中为被呼的分机号码,而不是呼入的主叫号码。如果需要的话,'o'选项可以用于恢复原有行为模式,如果在控制台信息上查找原始主叫,有事件"Dial"可以提供显示原始通道,目的通道和主叫号码.
  • type specifies the channel type. It should be one of the registered channel types, such as "Zap", "SIP", "IAX2", and so on.
    通道类型必须是可注册的通道类型,例如'zap/sip/iax2等等
  • identifier specifies the "phone number" to dial on that channel. The format of the "phone number" depends on the channel, and may contain additonal parameters (e.g. a distinctive ring parameter) specific to the channel module in question; the Dial command simply passes identifier to the channel module to process in whatever way is appropriate. See the documentation for the individual channel modules to learn about the correct format for specifying the identifier for the Dial command, and the options available to you when doing so. If you need a .5 second pause while dialing a number you can insert a w in the appropriate place.
    在通道上鉴别定义呼叫的'phone number'。'phone number'格式依赖于通道,通常包含附加参数(振铃参数)定义到通道模块问题上,不管怎么说,这样是合适的。
  • If you wish to specify more than one channel for the Dial command to try — remembering that it will dial out on all of them simultaneously — separate them with the & symbol (there must not be a space before and after the ampersand). The channels can be different types; see Examples, below. Note that call progress information is not consistantly handled with multiple channels.. consider using the 'r' option.
    如果希望定义不止一个通道用于尝试拨号命令,这会引起在所有的通道上同时发起呼叫,解决方法是通过&符号来分隔这些通道,&前后不能有空格。通道可以是不同的类型。呼叫处理不能在多通道上混合处理信息,用'r'选项照顾到这一点。
  • The timeout parameter is optional. If not specifed, the Dial command will wait indefinitely, exiting only when the originating channel hangs up, or all the dialed channels return a busy or error condition. Otherwise it specifies a maximum time, in seconds, that the Dial command is to wait for a channel to answer.
    超时时间参数是可选的,如果没有定义,Dial命令等待时间不确定,仅仅在主叫挂机才会退出Dial命令,或者所有的可呼叫通道返回忙或错误信号。然而定义了最大时间,几秒钟之内,Dial命令就会等待通道应答。
  • The options parameter, which is optional, is a string containging zero or more of the following flags and parameters:
  •  
    • t: Allow the called user to transfer the call by hitting the blind xfer keys (features.conf)
      允许被叫用户通过在features.conf中定义的按键转接电话
      • If you have set the variable GOTO_ON_TRANSFER then the transferrer will be sent to the context|exten|pri (you can use ^ to represent | to avoid escapes), example: SetVar(GOTO_ON_TRANSFER=woohoo^s^1); works with both t and T
        如果定义了变量GOTO_ON_TRANSFER,流程将跳转到相应的context/exten/pri优先级(可以用^来表示,\来取消)
      • WARNING: GOTO_ON_TRANSFER does not exist in any version of ASTERISK and will not! the variable is called GOTO_ON_BLINDXFR see http://svn.digium.com/view/asterisk?rev=5495&view=rev and http://bugs.digium.com/view.php?id=4056 for details. THX to the person who shared the information above!
    • T: Allow the calling user to transfer the call by hitting the blind xfer keys (features.conf)
      允许主叫通过features.conf设定的按键转接电话
    • r: Generate a ringing tone for the calling party, passing no audio from the called channel(s) until one answers. Without this option, Asterisk will generate ring tones automatically where it is appropriate to do so; however, "r" will force Asterisk to generate ring tones, even if it is not appropriate. For example, if you used this option to force ringing but the line was busy the user would hear "RING RIBEEP BEEP BEEP" (thank you tzanger), which is potentially confusing and/or unprofessional. However, the option is necessary in a couple of places. For example, when you're dialing multiple channels, call progress information is not consistantly passed back.
      对 主叫产生振铃音,在被叫应答前不传送被叫通道任何彩铃等声音,如果没有这个选项,Asterisk自动在合适的地方产生振铃音。'r'可以强制产生振铃 音,尽管可能不合时宜。例如在线路忙时,强制给用户提供振铃等待音,这有可能使人困惑或者不专业。然而这个选项在成对的地方是必须的,例如,当在多通道上 拨号的时候,不同通道上反馈的声音不一致。
    • R: Indicate ringing to the calling party when the called party indicates ringing, pass no audio until answered. This is available only if you are using kapejod's Bristuff.
      在被叫振铃过程中,给主叫提示振铃音(不会传送彩铃等声音)直到应答。这仅仅在采用'kpejod's Bristuff'时才有效。
    • m: Provide Music on Hold to the calling party until the called channel answers. This is mutually exclusive with option 'r', obviously. Use m(class) to specify a class for the music on hold.
      在通道应答之前,给主叫方提供背景音乐,这个参数与'r'参数相互排斥。
    • n: (Asterisk 1.1 and later) July 2005 bug 752 was included in CVS (Asterisk 1.1) and enhances the privacy manager considerably. As part of this patch, the 'n' flag to Dial got changed to be used as part of the privacy features, instead of being the 'dont jump to +101' flag. That flag is now 'j'.
      增强了私密管理。
    • o: Restore the Asterisk v1.0 CallerId behaviour (send the original caller's ID) in Asterisk v1.2 (default: send this extension's number)
      恢复了在1.0版本中的源主叫属性。
    • j: Asterisk 1.2 and later: Jump to priority n+101 if all of the requested channels were busy (just like behaviour in Asterisk 1.0.x)
      遇忙跳转n+101
    • M(x): Executes the macro (x) upon connect of the call (i.e. when the called party answers)
      在通话过程中执行宏(被叫应答开始)
    • h: Allow the callee to hang up by dialing *
      允许被叫通过按键*挂机
    • H: Allow the caller to hang up by dialing *
      允许主叫通过按键*挂机
    • i: Asterisk will ignore any forwarding requests it may receive on this dial attempt. (new in 1.4) Useful if you are ringing a group of people and one person has set their phone to forwarded direct to voicemail on their cell or something which normally prevents any of the other phones from ringing.
      Asterisk会忽略在拨号执行中可能接收到的前转请求。这非常有用,例如当呼叫一个振铃组时,其中一个分机设置了前转至语音信箱,或者其他阻止电话正常振铃的情况。
    • C: Reset the CDR (Call Detail Record) for this call. This is like using the NoCDR command
      重置呼叫的详单记录,用法类似NoCDR
    • p: This option enables screening mode. This is basically Privacy mode without memory of how to handle the caller. It looks for the file sounds/priv-callerintros/${IF($[ "${CALLERID(num)}" != "" ]?${CALLERID(num)}:NOCALLERID_${EXTEN}${CUT(CHANNEL,/,1)}=${CUT(CHANNEL,/,2)})}.gsm and if it is not found, prompts the caller to say his name. It then rings the called party and plays sounds/priv-callpending, sounds/priv-callerintros/<see-above>, and sounds/screen-callee-options. If the called party enters 1, the call is accepted, 2, the DIAL command exits with ${DIALSTATUS} set to NOANSWER, 3, set to TORTURE and 4, set to DONTCALL. If no valid entry is made, the DIAL command exits with ${DIALSTATUS} set to ANSWER. The check for pre-existence of the name recording may not be what you want. For example, everyone from the same number is not necessarily the same person, especially if the number is OUTOFAREA, but if the file is there, no new name will be recorded. Since the files are never removed, you may wish to remove them with a System(rm /var/lib/asterisk/sounds/priv-callerintros/${IF($[ "${CALLERID(num)}" != "" ]?${CALLERID(num)}:NOCALLERID_${EXTEN}${CUT(CHANNEL,/,1)}=${CUT(CHANNEL,/,2)})}.*) right before the Dial command and clean up old ones with a cron job.
      选 项启用了筛选模式,是一个基本的私有模式,无记忆处理主叫。他会寻找相应的.gsm(主叫信息)语音文件,如果不存在,提示主叫说出姓名并录音,然后振铃 被叫,并播放相应的主叫录音信息语音,同时给被叫提供选择,如被叫按1,开始通话,按2-Noanswer,3-Torture,4-Dontcall, 如果没有有效按键,呼叫终止,dialstaturs设置为应答。
      检查主叫的个人信息语音文件可能是不需要的,因为存在多人用同一个电话的情况,特别是外线号码。但是只要文件存在,就不会重新录音,可以通过使用系统命令 system()在通话结束后清理删除录音文件。
    • P(x): Use the PrivacyManager, using x as the database (x is optional)
      使用PrivacyManager,对主叫进行甄别,如果主叫号码没有传送,要求主叫3次机会输入主叫号码。
    • g: When the called party hangs up, exit to execute more commands in the current context.
      通话过程中,被叫挂机时,主叫能跳回当前的context,Asterisk取得控制权,继续执行流程。
    • G(context^exten^pri): If the call is answered, transfer both parties to the specified context and extension. The calling party is transferred to priority x, and the called party to priority x+1. This allows the dialplan to distinguish between the calling and called legs of the call (new in v1.2).
      如果呼叫应答,主被叫双方都被转移到指定的Context和extensions,主叫的优先级为x,被叫的优先级为x+1,这允许拨号方案区分呼叫中主被叫路径。
    • A(x): Play an announcement (x.gsm) to the called party.
      播放引导词给被叫
    • S(n): Hangup the call n seconds AFTER called party picks up.
      被叫摘机n秒后,挂机
    • d: This flag trumps the 'H' flag and intercepts any dtmf while waiting for the call to be answered and returns that value on the spot. This allows you to dial a 1-digit exit extension while waiting for the call to be answered - see also RetryDial
      这个标志优于'H'选项,在等待被叫应答过程中打断DTMF按键并立即返回值,这允许在等待应答过程中直接呼入1个数字的分机流程。
    • D(digits): After the called party answers, send digits as a DTMF stream, then connect the call to the originating channel. (You can also use 'w' to produce .5 second pauses.)
      被叫方应答后,传送数字DTMF流给被叫,然后接通主叫(可以用w产生0.5秒的暂停)
    • L(x[:y][:z]): Limit the call to 'x' ms, warning when 'y' ms are left, repeated every 'z' ms) Only 'x' is required, 'y' and 'z' are optional. The following special variables are optional for limit calls: (pasted from app_dial.c)
      x最大呼叫时长,y剩余报警时间,z报警周期,x是必须的,其他可选。
      • LIMIT_PLAYAUDIO_CALLER - yes|no (default yes) - Play sounds to the caller. 播放提示音给主叫,被叫听不到
      • LIMIT_PLAYAUDIO_CALLEE - yes|no - Play sounds to the callee.
      • LIMIT_TIMEOUT_FILE - File to play when time is up.
      • LIMIT_CONNECT_FILE - File to play when call begins.
      • LIMIT_WARNING_FILE - File to play as warning if 'y' is defined. If LIMIT_WARNING_FILE is not defined, then the default behaviour is to announce ("You have [XX minutes] YY seconds").
    • f: forces callerid to be set as the extension of the line making/redirecting the outgoing call. For example, some PSTNs don't allow callerids from other extensions than the ones that are assigned to you.
      强制外呼时设定主叫号码为外线号码,因为很多时候PSTN只允许使用分配给的市话号码作为主叫号码
    • w: Allow the called user to start recording after pressing *1 or what defined in features.conf (Asterisk v1.2.x); requires Set(DYNAMIC_FEATURES=automon)
      允许被叫按键*1后,开始录音,需要在feature.conf中定义
    • W: Allow the calling user to start recording after pressing *1 or what defined in features.conf (Asterisk v1.2.x); requires Set(DYNAMIC_FEATURES=automon)
      允许主叫用户按键*1后,开始录音,需要在feature.conf中配置
    • k: Allow the called party to enable parking of the call by sending the DTMF sequence defined for call parking in features.conf (Asterisk v1.4.x)
      允许被叫通过在feature.conf中定义的dtmf按键序列启用呼叫停泊
    • K: Allow the calling party to enable parking of the call by sending the DTMF sequence defined for call parking in features.conf (Asterisk v1.4.x)
      允许主叫通过在feature.conf中定义的dtmf按键序列启用呼叫停泊
  • The optional URL parameter will also be sent to the called party upon successful connection, if the channel technology supports the sending of URLs in this way.
    如果通道技术支持,URL参数会把成功的链接发送到被叫端
分享到:
评论
1 楼 newLinuxJava 2014-10-28  
http://www.voip-info.org/wiki/view/Asterisk+cmd+Dial

相关推荐

Global site tag (gtag.js) - Google Analytics