M-N
From AstriPedia
- Index M-N of Asterisk Applications
Contents |
Macro
Synopsis
Macro Implementation
Description
Macro(macroname|arg1|arg2...):
Executes a macro using the context 'macro-<macroname>', jumping to the 's' extension of that context and executing each step, then returning when the steps end. The calling extension, context, and priority are stored in ${MACRO_EXTEN}, ${MACRO_CONTEXT} and ${MACRO_PRIORITY} respectively.
Arguments become ${ARG1}, ${ARG2}, etc in the macro context. If you Goto out of the Macro context, the Macro will terminate and control will be returned at the location of the Goto.
If ${MACRO_OFFSET} is set at termination, Macro will attempt to continue at priority MACRO_OFFSET + N + 1 if such a step exists, and N + 1 otherwise.
Extensions: While a macro is being executed, it becomes the current context.
- This means that if a hangup occurs, for instance, that the macro
- will be searched for an 'h' extension, NOT the context from which
- the macro was called. So, make sure to define all appropriate
- extensions in your macro! (you can use 'catch' in AEL)
WARNING: Because of the way Macro is implemented (it executes the priorities
- contained within it via sub-engine), and a fixed per-thread
- memory stack allowance, macros are limited to 7 levels
- of nesting (macro calling macro calling macro, etc.); It
- may be possible that stack-intensive applications in deeply nested
- macros could cause asterisk to crash earlier than this limit.
MacroExit
Synopsis
Exit From Macro
Description
MacroExit():
Causes the currently running macro to exit as if it had ended normally by running out of priorities to execute. If used outside a macro, will likely cause unexpected behavior.
MacroIf
Synopsis
Conditional Macro Implementation
Description
MacroIf(<expr>?macroname_a[|arg1][:macroname_b[|arg1]]) Executes macro defined in <macroname_a> if <expr> is true (otherwise <macroname_b> if provided) Arguments and return values as in application macro()
MailboxExists
Synopsis
Check to see if Voicemail mailbox exists
Description
MailboxExists(mailbox[@context][|options]):
Check to see if the specified mailbox exists. If no voicemail context is specified, the 'default' context will be used. This application will set the following channel variable upon completion:
- VMBOXEXISTSSTATUS - This will contain the status of the execution of the
- MailboxExists application. Possible values include:
- SUCCESS | FAILED
Options:
- j - Jump to priority n+101 if the mailbox is found.
Math
[Synopsis
Performs Mathematical Functions
Description
Math(returnvar,<number1><op><number 2>
Perform floating point calculation on number 1 to number 2 and store the result in returnvar. Valid ops are:
+,-,/,*,%,<,>,>=,<=,==
and behave as their C equivalents. This application has been deprecated in favor of the MATH function.
MD5
Synopsis
Calculate MD5 checksum
Description
MD5(=<string>): Calculates a MD5 checksum on <string>. Returns hash value in a channel variable.
MD5Check
Synopsis
Check MD5 checksum
Description
MD5Check(<md5hash>|<string>[|options]):
Calculates a MD5 checksum on <string> and compares it with the hash. Returns 0 if <md5hash> is correct for <string>. The option string may contain zero or more of the following characters:
- 'j' -- jump to priority n+101 if the hash and string do not match
This application sets the following channel variable upon completion:
- CHECKMD5STATUS The status of the MD5 check, one of the following
- MATCH | NOMATCH
- CHECKMD5STATUS The status of the MD5 check, one of the following
MeetMe
Synopsis
MeetMe conference bridge
Description
MeetMe([confno][,[options][,pin]]):
Enters the user into a specified MeetMe conference. If the conference number is omitted, the user will be prompted to enter one. User can exit the conference by hangup, or if the 'p' option is specified, by pressing '#'.
Please note: The Zaptel kernel modules and at least one hardware driver (or ztdummy)
- must be present for conferencing to operate properly. In addition, the chan_zap
- channel driver must be loaded for the 'i' and 'r' options to operate at all.
The option string may contain zero or more of the following characters:
'a' -- set admin mode
'A' -- set marked mode
'b' -- run AGI script specified in ${MEETME_AGI_BACKGROUND}
Default: conf-background.agi
(Note: This does not work with non-Zap channels in the same conference)
'c' -- announce user(s) count on joining a conference
'd' -- dynamically add conference
'D' -- dynamically add conference, prompting for a PIN
'e' -- select an empty conference
'E' -- select an empty pinless conference
'i' -- announce user join/leave
'm' -- set monitor only mode (Listen only, no talking)
'M' -- enable music on hold when the conference has a single caller
'p' -- allow user to exit the conference by pressing '#'
'P' -- always prompt for the pin even if it is specified
'q' -- quiet mode (don't play enter/leave sounds)
'r' -- Record conference (records as ${MEETME_RECORDINGFILE}
using format ${MEETME_RECORDINGFORMAT}). Default filename is
meetme-conf-rec-${CONFNO}-${UNIQUEID} and the default format is wav.
's' -- Present menu (user or admin) when '*' is received ('send' to menu)
't' -- set talk only mode. (Talk only, no listening)
'T' -- set talker detection (sent to manager interface and meetme list)
'w[(<secs>)]'
-- wait until the marked user enters the conference
'x' -- close the conference when last marked user exits
'X' -- allow user to exit the conference by entering a valid single
digit extension ${MEETME_EXIT_CONTEXT} or the current context
if that variable is not defined.
MeetMeAdmin
Synopsis
MeetMe conference Administration
Description
MeetMeAdmin(confno,command[,user]): Run admin command for conference
'e' -- Eject last user that joined
'k' -- Kick one user out of conference
'K' -- Kick all users out of conference
'l' -- Unlock conference
'L' -- Lock conference
'm' -- Unmute conference
'M' -- Mute conference
'n' -- Unmute entire conference (except admin)
'N' -- Mute entire conference (except admin)
MeetMeCount
Synopsis
MeetMe participant count
Description
MeetMeCount(confno[|var]):
Plays back the number of users in the specified MeetMe conference. If var is specified, playback will be skipped and the value will be returned in the variable. Upon app completion, MeetMeCount will hangup the channel, unless priority n+1 exists, in which case priority progress will continue. A ZAPTEL INTERFACE MUST BE INSTALLED FOR CONFERENCING FUNCTIONALITY.
Milliwatt
Synopsis
Generate a Constant 1000Hz tone at 0dbm (mu-law)
Description
Milliwatt(): Generate a Constant 1000Hz tone at 0dbm (mu-law)
misdn_check_l2l1
Synopsis
misdn_check_l2l1
Description
misdn_check_l2l1(<port>||g:<groupname>,timeout)Checks if the L2 and L1 are up on either the given <port> or on the ports in the group with <groupname> If the L1/L2 are down, check_l2l1 gets up the L1/L2 and waits for <timeout> seconds that this happens. Otherwise, nothing happens
This application, ensures the L1/L2 state of the Ports in a group it is intended to make the pmp_l1_check option redundant and to fix a buggy switch config from your provider
a sample dialplan would look like:
exten => _X.,1,misdn_check_l2l1(g:out|2)
exten => _X.,n,dial(mISDN/g:out/${EXTEN})
misdn_facility
Synopsis
misdn_facility
Description
misdn_facility(<FACILITY_TYPE>|<ARG1>|..) Sends the Facility Message FACILITY_TYPE with the given Arguments to the current ISDN Channel Supported Facilities are:
- type=calldeflect args=Nr where to deflect
misdn_set_opt
Synopsis
misdn_set_opt
Description
misdn_set_opt(:<opt><optarg>:<opt><optarg>..): Sets mISDN opts. and optargs
The available options are:
d - Send display text on called phone, text is the optparam
n - don't detect dtmf tones on called channel
h - make digital outgoing call
c - make crypted outgoing call, param is keyindex
e - perform echo cancelation on this channel,
takes taps as arguments (32,64,128,256)
s - send Non Inband DTMF as inband
vr - rxgain control
vt - txgain control
MixMonitor
Synopsis
Record a call and mix the audio during the recording
Description
MixMonitor(<file>.<ext>[|<options>[|<command>]])
Records the audio on the current channel to the specified file. If the filename is an absolute path, uses that path, otherwise creates the file in the configured monitoring directory from asterisk.conf.
Valid options:
a - Append to the file instead of overwriting it.
b - Only save audio to the file while the channel is bridged.
Note: Does not include conferences or sounds played to each bridged
party.
v(<x>) - Adjust the heard volume by a factor of <x> (range -4 to 4)
V(<x>) - Adjust the spoken volume by a factor of <x> (range -4 to 4)
W(<x>) - Adjust the both heard and spoken volumes by a factor of <x>
(range -4 to 4)
<command> will be executed when the recording is over Any strings matching ^{X} will be unescaped to ${X}. All variables will be evaluated at the time MixMonitor is called. The variable MIXMONITOR_FILENAME will contain the filename used to record.
Monitor
Synopsis
Monitor a channel
Description
Monitor([file_format[:urlbase]|[fname_base]|[options]]):
Used to start 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.
file_format optional, if not set, defaults to "wav"
fname_base if set, changes the filename used to the one specified.
options:
m - when the recording ends mix the two leg files into one and
delete the two 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 3 arguments, the two leg files
and a target mixed file name which is the same as the leg file names
only without the in/out designator.
If MONITOR_EXEC_ARGS is set, the contents will be passed on as
additional arguements to MONITOR_EXEC
Both MONITOR_EXEC and the Mix flag can be set from the
administrator interface
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, otherwise 0.
MP3Player
Synopsis
Play an MP3 file or stream
Description
MP3Player(location) Executes mpg123 to play the given location, which typically would be a filename or a URL. User can exit by pressing any key on the dialpad, or by hanging up.
MusicOnHold
Synopsis
Play Music On Hold indefinitely
Description
MusicOnHold(class):
Plays hold music specified by class. If omitted, the default music source for the channel will be used. Set the default class with the SetMusicOnHold() application. Returns -1 on hangup. Never returns otherwise.
NBScat
Synopsis
Play an NBS local stream
Description
NBScat: Executes nbscat to listen to the local NBS stream. User can exit by pressing any key
NoCDR
Synopsis
Tell Asterisk to not maintain a CDR for the current call
Description
NoCDR(): This application will tell Asterisk not to maintain a CDR for the current call.
NoOp
Synopsis
Do Nothing
Description
NoOp(): This applicatiion does nothing. However, it is useful for debugging purposes. Any text that is provided as arguments to this application can be viewed at the Asterisk CLI. This method can be used to see the evaluations of variables or functions without having any effect.
