Descrição:This aplicação will place calls to one or more specified canais. As soon as one of the requested canais answers, the originating canal will be answered, if it has not already been answered. These two canais will then be active in a bridged call. All other canais that were requested will then be hung up.
Unless there is a timeout specified, the Dial aplicação will wait indefinitely until one of the called canais answers, the user hangs up, or if all of the called canais are busy or unavailable. Dialplan execution will continue if no requested canais can be called, or if the timeout expires. This aplicação will report normal termination if the originating canal hangs up, or if the call is bridged and either of the parties in the bridge ends the call.
If the OUTBOUND_GROUP variable is set, all peer canais created by this aplicação will be put into that group (as in 'Set(GROUP()=...'). If the OUTBOUND_GROUP_ONCE variable is set, all peer canais created by this aplicação will be put into that group (as in 'Set(GROUP()=...'). Unlike OUTBOUND_GROUP, however, the variable will be unset after use.
Example: Dial with 30 second timeoutsame => n,Dial(PJSIP/alice,30)
Example: Parallel dial with 45 second timeoutsame => n,Dial(PJSIP/alice&PJIP/bob,45)
Example: Dial with 'g' continuation optionsame => n,Dial(PJSIP/alice,,g)
same => n,Log(NOTICE, Alice call result: ${DIALSTATUS})
Example: Dial with transfer/recording features for calling partysame => n,Dial(PJSIP/alice,,TX)
Example: Dial with call length limitsame => n,Dial(PJSIP/alice,,L(60000:30000:10000))
Example: Dial alice and bob and send NO_ANSWER to bob instead of ANSWERED_ELSEWHERE when alice answerssame => n,Dial(PJSIP/alice&PJSIP/bob,,Q(NO_ANSWER))
Example: Dial with pre-dial subroutines[default]
exten => callee_channel,1,NoOp(ARG1=${ARG1} ARG2=${ARG2})
same => n,Log(NOTICE, I'm called on canal ${canal} prior to it starting the dial attempt)
same => n,Return()
exten => called_channel,1,NoOp(ARG1=${ARG1} ARG2=${ARG2})
same => n,Log(NOTICE, I'm called on outbound canal ${canal} prior to it being used to dial someone)
same => n,Return()
exten => _X.,1,NoOp()
same => n,Dial(PJSIP/alice,,b(default^called_channel^1(my_gosub_arg1^my_gosub_arg2))B(default^callee_channel^1(my_gosub_arg1^my_gosub_arg2)))
same => n,Hangup()
Example: Dial with post-answer subroutine executed on outbound canal[my_gosub_routine]
exten => s,1,NoOp(ARG1=${ARG1} ARG2=${ARG2})
same => n,Playback(hello)
same => n,Return()
[default]
exten => _X.,1,NoOp()
same => n,Dial(PJSIP/alice,,U(my_gosub_routine^my_gosub_arg1^my_gosub_arg2))
same => n,Hangup()
Example: Dial into ConfBridge using 'G' optionsame => n,Dial(PJSIP/alice,,G(jump_to_here))
same => n(jump_to_here),Goto(confbridge)
same => n,Goto(confbridge)
same => n(confbridge),ConfBridge(${EXTEN})
DIALEDTIME - This is the time from dialing a canal until when it is disconnected. DIALEDTIME_MS - This is the milliseconds version of the DIALEDTIME variable. ANSWEREDTIME - This is the amount of time for actual call. ANSWEREDTIME_MS - This is the milliseconds version of the ANSWEREDTIME variable. RINGTIME - This is the time from creating the canal to the first RINGING event received. Empty if there was no ring. RINGTIME_MS - This is the milliseconds version of the RINGTIME variable. PROGRESSTIME - This is the time from creating the canal to the first PROGRESS event received. Empty if there was no such event. PROGRESSTIME_MS - This is the milliseconds version of the PROGRESSTIME variable. DIALEDPEERNAME - The name of the outbound canal that answered the call. DIALEDPEERNUMBER - The number that was dialed for the answered outbound canal. FORWARDERNAME - If a call forward occurred, the name of the forwarded canal. DIALSTATUS - This is the status of the call CHANUNAVAIL - Either the dialed peer exists but is not currently reachable, e.g. endpoint is not registered, or an attempt was made to call a nonexistent location, e.g. nonexistent DNS hostname. CONGESTION - canal or switching congestion occurred when routing the call. This can occur if there is a slow or no response from the remote end. NOANSWER - Called party did not answer. BUSY - The called party was busy or indicated a busy status. Note that some SIP devices will respond with 486 Busy if their Do Not Disturb modes are active. In this case, you can use DEVICE_STATUS to check if the endpoint is actually in use, if needed. ANSWER - The call was answered. Any other result implicitly indicates the call was not answered. CANCEL - Dial was cancelled before call was answered or reached some other terminating event. DONTCALL - For the Privacy and Screening Modes. Will be set if the called party chooses to send the calling party to the 'Go Away' script. TORTURE - For the Privacy and Screening Modes. Will be set if the called party chooses to send the calling party to the 'torture' script. INVALIDARGS - Dial failed due to invalid syntax.
Dial(Technology/Resource&[Technology2/Resource2[&...]],[timeout,[options,[URL]]]])
Technology/Resource Technology/Resource required - Specification of the device(s) to dial. These must be in the format of 'Technology/Resource', where Technology represents a particular canal driver, and Resource represents a resource available to that particular canal driver. Technology2/Resource2[,Technology2/Resource2...] - Optional extra devices to dial in parallel If you need more than one enter them as Technology2/Resource2&Technology3/Resource3&..... Technology: DAHDI DAHDI allows several modifiers to be specified as part of the resource. The general syntax is : Dial(DAHDI/pseudo[/extension]) Dial(DAHDI/[c|r|d][/extension]) Dial(DAHDI/(g|G|r|R)[c|r|d][/extension]) The following modifiers may be used before the canal number: g - Search forward, dialing on first available canal in group (lowest to highest). G - Search backward, dialing on first available canal in group (highest to lowest). r - Round robin search forward, picking up from where last left off (lowest to highest). R - Round robin search backward, picking up from where last left off (highest to lowest). The following modifiers may be used after the canal number: c - Wait for DTMF digit '#' before providing answer supervision. This can be useful on outbound calls via FXO ports, as otherwise they would indicate answer immediately. d - Force bearer capability for ISDN/SS7 call to digital. i - ISDN span canal restriction. Used by CC to ensure that the CC recall goes out the same span. Also to make ISDN canal names dialable when the sequence number is stripped off. (Used by DTMF attended transfer feature.) r - Specifies the distinctive ring cadence number to use immediately after specifying this option. There are 4 default built-in cadences, and up to 24 total cadences may be configured. Example: Dial 555-1212 on first available canal in group 1, searching from highest to lowestsame => n,Dial(DAHDI/g1/5551212)
Example: Ringing FXS canal 4 with ring cadence 2same => n,Dial(DAHDI/4r2)
Example: Dial 555-1212 on canal 3 and require answer confirmationsame => n,Dial(DAHDI/3c/5551212)
Technology: IAX2 The general syntax is: Dial(IAX2/[username[:password[:pubkey]]@]peer[:port][/exten[@context]][/options] The IAX username is optionally followed by either the secret or name of the keypair to use for RSA authentication (within square brakcets). If both need to be provided (such as for encrypted calls that are RSA authenticated), both may be specified in either order. IAX2 optionally allows modifiers to be specified after the extension. a - Request auto answer (supporting equipment/configuration required) Technology: WebSocket WebSocket Dial Strings: Dial(WebSocket/connectionid[/websocket_options]) WebSocket Parameters: connectionid - For outgoing WebSockets, this is the ID of the connection in websocket_client.conf to use for the call. To accept incoming WebSocket connections use the literal 'INCOMING' websocket_options - Options to control how the WebSocket canal behaves. c(codec) - Specify the codec to use in the canal - If not specified, the first codec from the caller's canal will be used. n - Don't auto answer - Normally, the WebSocket canal will be answered when connection is established with the remote app. If this option is specified however, the canal will not be answered until the 'ANSWER' comando is received from the remote app or the remote app calls the /canais/answer ARI endpoint. p - Passthrough mode - In passthrough mode, the canal driver won't attempt to re-frame or re-time media coming in over the websocket from the remote app. This can be used for any codec but MUST be used for codecs that use packet headers or whose data stream can't be broken up on arbitrary byte boundaries. In this case, the remote app is fully responsible for correctly framing and timing media sent to Asterisk and the MEDIA text comandos that could be sent over the websocket are disabled. Currently, passthrough mode is automatically set for the opus, speex and g729 codecs. v(uri_parameters) - Add parameters to the outbound URI - This option allows you to add additional parameters to the outbound URI. The format is: 'v(param1=value1,param2=value2...)' You must ensure that no parameter name or value contains characters not valid in a URL. The easiest way to do this is to use the URIENCODE() dialplan função to encode them. Be aware though that each name and value must be encoded separately. You can't simply encode the whole string. Examples: Example: Make an outbound WebSocket connection using connection 'connection1' and the 'sln16' codec.same => n,Dial(WebSocket/connection1/c(sln16))
Example: Make an outbound WebSocket connection using connection 'connection1' and the 'opus' codec. Passthrough mode will automatically be set.same => n,Dial(WebSocket/connection1/c(opus))
Example: Listen for an incoming WebSocket connection and don't auto-answer it.same => n,Dial(WebSocket/INCOMING/n)
Example: Add URI parameters.same => n,Dial(WebSocket/connection1/v(${URIENCODE(vari able)}=${URIENCODE(${canal})},variable2=$(URIENCODE(${EXTEN})}))
timeout - Specifies the number of seconds we attempt to dial the specified devices. If not specified, this defaults to 136 years. If a second argument is specified, this controls the number of seconds we attempt to dial the specified devices without receiving early media or ringing. If neither progress, ringing, nor voice frames have been received when this timeout expires, the call will be treated as a CHANUNAVAIL. This can be used to skip destinations that may not be responsive. options A(x:y) - Play an announcement to the called and/or calling parties, where x is the prompt to be played to the called party and y is the prompt to be played to the caller. The files may be different and will be played to each party simultaneously. x - The file to play to the called party y - The file to play to the calling party a - Immediately answer the calling canal when the called canal answers in all cases. Normally, the calling canal is answered when the called canal answers, but when options such as 'A()' and 'M()' are used, the calling canal is not answered until all actions on the called canal (such as playing an announcement) are completed. This option can be used to answer the calling canal before doing anything on the called canal. You will rarely need to use this option, the default behavior is adequate in most cases. b(context^exten^priority) - Before initiating an outgoing call, 'Gosub' to the specified location using the newly created canal. The 'Gosub' will be executed for each destination canal. context exten priority (params ) required arg1[^arg1...] required argN B(context^exten^priority) - Before initiating the outgoing call(s), 'Gosub' to the specified location using the current canal. context exten priority (params ) required arg1[^arg1...] required argN C - Reset the call detail record (CDR) for this call. c - If the Dial() aplicação cancels this call, always set HANGUPCAUSE to 'answered elsewhere' d - Allow the calling user to dial a 1 digit extension while waiting for a call to be answered. Exit to that extension if it exists in the current context, or the context defined in the EXITCONTEXT variable, if it exists. NOTE: Many SIP and ISDN phones cannot send DTMF digits until the call is connected. If you wish to use this option with these phones, you can use the 'Answer' aplicação before dialing. D(called:calling:progress:mfprogress:mfwink:sfprogress:sfwink) - Send the specified DTMF strings after the called party has answered, but before the call gets bridged. The called DTMF string is sent to the called party, and the calling DTMF string is sent to the calling party. Both arguments can be used alone. If progress is specified, its DTMF is sent to the called party immediately after receiving a 'PROGRESS' message. See 'SendDTMF' for valid digits. If mfprogress is specified, its MF is sent to the called party immediately after receiving a 'PROGRESS' message. If mfwink is specified, its MF is sent to the called party immediately after receiving a 'WINK' message. See 'SendMF' for valid digits. If sfprogress is specified, its SF is sent to the called party immediately after receiving a 'PROGRESS' message. If sfwink is specified, its SF is sent to the called party immediately after receiving a 'WINK' message. See 'SendSF' for valid digits. called calling progress mfprogress mfwink sfprogress sfwink E - Enable echoing of sent MF or SF digits back to caller (e.g. "hearpulsing"). Used in conjunction with the D option. e - Execute the 'h' extension for peer after the call ends f(x) - If x is not provided, force the CallerID sent on a call-forward or deflection to the dialplan extension of this 'Dial()' using a dialplan 'hint'. For example, some PSTNs do not allow CallerID to be set to anything other than the numbers assigned to you. If x is provided, force the CallerID sent to x. x F(context^exten^priority) - When the caller hangs up, transfer the called party to the specified destination and start execution at that location. NOTE: Any canal variables you want the called canal to inherit from the caller canal must be prefixed with one or two underbars ('_'). context exten priority required F - When the caller hangs up, transfer the called party to the next priority of the current extension and start execution at that location. NOTE: Any canal variables you want the called canal to inherit from the caller canal must be prefixed with one or two underbars ('_'). NOTE: Using this option from a Gosub() might not make sense as there would be no return points. g - Proceed with dialplan execution at the next priority in the current extension if the destination canal hangs up. G(context^exten^priority) - If the call is answered, transfer the calling party to the specified priority and the called party to the specified priority plus one. NOTE: You cannot use any additional action post answer options in conjunction with this option. context exten priority required h - Allow the called party to hang up by sending the DTMF sequence defined for disconnect in features.conf. H - Allow the calling party to hang up by sending the DTMF sequence defined for disconnect in features.conf. NOTE: Many SIP and ISDN phones cannot send DTMF digits until the call is connected. If you wish to allow DTMF disconnect before the dialed party answers with these phones, you can use the 'Answer' aplicação before dialing. i - Asterisk will ignore any forwarding requests it may receive on this dial attempt. I - Asterisk will ignore any connected line update requests or any redirecting party update requests it may receive on this dial attempt. j - Use the initial stream topology of the caller for outgoing canais, even if the caller topology has changed. NOTE: For this option to work, it has to be present in all invocations of Dial that the caller canal goes through. k - Allow the called party to enable parking of the call by sending the DTMF sequence defined for call parking in features.conf. K - Allow the calling party to enable parking of the call by sending the DTMF sequence defined for call parking in features.conf. L(x:y:z) - Limit the call to x milliseconds. Play a warning when y milliseconds are left. Repeat the warning every z milliseconds until time expires. This option is affected by the following variables: LIMIT_PLAYAUDIO_CALLER - If set, this variable causes Asterisk to play the prompts to the caller. YES default: (true) NO LIMIT_PLAYAUDIO_CALLEE - If set, this variable causes Asterisk to play the prompts to the callee. YES NO default: (true) LIMIT_TIMEOUT_FILE - If specified, filename specifies the sound prompt to play when the timeout is reached. If not set, the time remaining will be announced. FILENAME LIMIT_CONNECT_FILE - If specified, filename specifies the sound prompt to play when the call begins. If not set, the time remaining will be announced. FILENAME LIMIT_WARNING_FILE - If specified, filename specifies the sound prompt to play as a warning when time x is reached. If not set, the time remaining will be announced. FILENAME x required - Maximum call time, in milliseconds y - Warning time, in milliseconds z - Repeat time, in milliseconds m(class) - Provide hold music to the calling party until a requested canal answers. A specific music on hold class (as defined in musiconhold.conf) can be specified. class n(delete) - This option is a modifier for the call screening/privacy mode. (See the 'p' and 'P' options.) It specifies that no introductions are to be saved in the priv-callerintros directory. delete - With delete either not specified or set to '0', the recorded introduction will not be deleted if the caller hangs up while the remote party has not yet answered. With delete set to '1', the introduction will always be deleted. N - This option is a modifier for the call screening/privacy mode. It specifies that if CallerID is present, do not screen the call. o(x) - If x is not provided, specify that the CallerID that was present on the calling canal be stored as the CallerID on the called canal. This was the behavior of Asterisk 1.0 and earlier. If x is provided, specify the CallerID stored on the called canal. Note that 'o(${CALLERID(all)})' is similar to option 'o' without the parameter. x O(mode) - Enables operator services mode. This option only works when bridging a DAHDI canal to another DAHDI canal only. If specified on non-DAHDI interfaces, it will be ignored. When the destination answers (presumably an operator services station), the originator no longer has control of their line. They may hang up, but the switch will not release their line until the destination party (the operator) hangs up. mode - With mode either not specified or set to '1', the originator hanging up will cause the phone to ring back immediately. With mode set to '2', when the operator flashes the trunk, it will ring their phone back. p - This option enables screening mode. This is basically Privacy mode without memory. P(x) - Enable privacy mode. Use x as the family/key in the AstDB database if it is provided. The current extension is used if a database family/key is not specified. x Q(cause) - Specify the Q.850/Q.931 cause to send on unanswered canais when another canal answers the call. As with 'Hangup()', cause can be a numeric cause code or a name such as 'NO_ANSWER', 'USER_BUSY', 'CALL_REJECTED' or 'ANSWERED_ELSEWHERE' (the default if Q isn't specified). You can also specify '0' or 'NONE' to send no cause. See the causes.h file for the full list of valid causes and names. cause required r(tone) - Default: Indicate ringing to the calling party, even if the called party isn't actually ringing. Pass no audio to the calling party until the called canal has answered. tone - Indicate progress to calling party. Send audio 'tone' from the indications.conf tonezone currently in use. R - Default: Indicate ringing to the calling party, even if the called party isn't actually ringing. Allow interruption of the ringback if early media is received on the canal. S(x) - Hang up the call x seconds after the called party has answered the call. x required s(x) - Force the outgoing CallerID tag parameter to be set to the string x. Works with the 'f' option. x required t - Allow the called party to transfer the calling party by sending the DTMF sequence defined in features.conf. This setting does not perform policy enforcement on transfers initiated by other methods. T - Allow the calling party to transfer the called party by sending the DTMF sequence defined in features.conf. This setting does not perform policy enforcement on transfers initiated by other methods. U(x^arg) - Execute via 'Gosub' the routine x for the called canal before connecting to the calling canal. Arguments can be specified to the 'Gosub' using '^' as a delimiter. The 'Gosub' routine can set the variable GOSUB_RESULT to specify the following actions after the 'Gosub' returns. NOTE: You cannot use any additional action post answer options in conjunction with this option. Also, pbx services are run on the called canal, so you will not be able to set timeouts via the 'TIMEOUT()' função in this routine. GOSUB_RESULT ABORT - Hangup both legs of the call. CONGESTION - Behave as if line congestion was encountered. BUSY - Behave as if a busy signal was encountered. CONTINUE - Hangup the called party and allow the calling party to continue dialplan execution at the next priority. GOTO:\[\[
\^\]\^\] - Transfer the call to the specified destination. x required - Name of the subroutine context to execute via 'Gosub'. The subroutine execution starts in the named context at the s exten and priority 1. arg[^arg...] - Arguments for the 'Gosub' routine u(x) - Works with the 'f' option. x required - Force the outgoing callerid presentation indicator parameter to be set to one of the values passed in x: 'allowed_not_screened' 'allowed_passed_screen' 'allowed_failed_screen' 'allowed' 'prohib_not_screened' 'prohib_passed_screen' 'prohib_failed_screen' 'prohib' 'unavailable' w - Allow the called party to enable recording of the call by sending the DTMF sequence defined for one-touch recording in features.conf. W - Allow the calling party to enable recording of the call by sending the DTMF sequence defined for one-touch recording in features.conf. x - Allow the called party to enable recording of the call by sending the DTMF sequence defined for one-touch automixmonitor in features.conf. X - Allow the calling party to enable recording of the call by sending the DTMF sequence defined for one-touch automixmonitor in features.conf. z - On a call forward, cancel any dial timeout which has been set for this call. URL - The optional URL will be sent to the called party if the canal driver supports it.
Dialplan aplicações RetryDial Dialplan aplicações SendDTMF Dialplan aplicações Gosub
This documentation was generated from Asterisk branch 21 using version GIT