[Asterisk-Users] Re: caller anounce

Steven Job steve at wwwcrazy.com
Sun Apr 2 20:32:32 MST 2006


OK, enough of this......  No reason to bicker about something like this.....

Here is the URL. 
http://www.voip-info.org/tiki-pagehistory.php?page=Asterisk+cmd+Dial&diff=57

For those of you that do not have a working web browser or cand find it with 
Google here is the text.

Dial macros
Introduced in/for Asterisk 1.2, see bug/patch 2905

You can now add args to the macro by using a '^' char

 Dial(Zap/1|60|M(mymacro^cat^dog^bark))

Also, the macro can set the MACRO_RESULT variable to do the following:

 ABORT - Hangup both legs of the call
 BUSY
 CONTINUE - Hangup the called party and continue on in the dialplan from 
where you called Dial
 GOTO:<context>^<exten>^<priority> - Transfer the call.

Note: If you want the call to be bridged upon completion of the macro, you 
should NOT set the MACRO_RESULT variable to anything. IF MACRO_RESULT is not 
defined, the thread of execution falls off the end of the macro and bridges 
the call. Setting it to CONTINUE causes the call NOT to be bridged, and 
execution to resume at n+1 priority in the calling context. Of course 
setting it to BUSY or GOTO has the implied results (and of course the call 
is not bridged).
(I found this a bit confusing because my mental model expected some kind of 
explicit case for "bridge the call", such as setting MACRO_RESULT to 
"BRIDGE" or "CONNECT" or something like that. It's the ABSENCE of any value 
that causes the call to be bridged.)

Example 2: Dial macro

screen-record: Please record your name press pound when finished.
screen-from: You have a call from
screen-accept: Press 1 to accept this call or any other key to reject.

exten => 890,1,Wait(0.2)
exten => 890,2,Playback(screen-record)
exten => 890,3,SetVar(SCREEN_FILE=/tmp/${CALLERIDNUM}-${EPOCH})
exten => 890,4,Record(${SCREEN_FILE}.gsm|6|25)
exten => 890,5,Dial(SIP/16|60|gM(screen^${SCREEN_FILE}))
exten => 890,6,Voicemail(10 at default)

[macro-screen]
exten => s,1,Wait(0.2)
exten => s,2,Playback(screen-from)
exten => s,3,Playback(${ARG1})
exten => s,4,Read(ACCEPT|screen-accept|1)
exten => s,5,GotoIf($[${ACCEPT} = 1 ] ?7:6)
exten => s,6,SetVar(MACRO_RESULT=CONTINUE)
exten => s,7,System(/bin/rm ${ARG1})


Notes:

  a.. Do not put spaces between the arguments to the Dial command, it will 
not work.
  b.. When options t, T", "h", "H", "w", "W" or "L" (with multiple 
arguments) are applied, Asterisk will remain in the media path, even if 
canreinvite=yes'' (a SIP channel option) has been specified.



Return codes

Dial sets DIALSTATUS to indicate its success. However, under some 
circumstances, execution will jump to priority n+101 in the current context. 
This happens when:


  a.. All channels dialed were busy
  b.. There is exists something at n+101 in the current context
  c.. You are running asterisk 1.0.x, priorityjumping=yes is set in 
extensions.conf, or the j option is specificed in the dial command

Note that in Asterisk v1.2+ priorityjumping is considered "off" by default, 
which is a change from previous versions.

If the g option is specified, and the called party hangs up before the 
calling party, then Dial continues execution at priority n+1.

Note: The bristuff patches change the dial behaviour slightly and jump to 
n+201 if the dialed destination isn't connected (e.g. a SIP softphone is not 
up and running, or hasn't registered).





More information about the asterisk-users mailing list