asterisk App Dial 撥號 發起外呼

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參數會把成功的鏈接發送到被叫端
發表評論
所有評論
還沒有人評論,想成為第一個評論的人麼? 請在上方評論欄輸入並且點擊發布.
相關文章