C.7. CHANNEL()

CHANNEL(field)
(beginning Asterisk 1.4)
Reads/sets specific channel parameters. The field is one of the following (only reading is possible unless otherwise noted):
audioreadformat
The format for incoming audio on the channel
audionativeformat
The native audio format of the channel
audiowriteformat
The format for outgoing audio on the channel
callgroup
Extensions in Asterisk can be sorted into call groups numbered from 0 - 63, e.g. as a client number.[84]
channeltype
The channel driver, or "technology" of the current channel, e.g.: IAX or SIP
language
The language for voice prompts. May be set as well as read
musicclass
The music-on-hold class, as defined in musiconhold.conf. May be set as well as read
state
State of the channel (Down, Rsrvd, OffHook, Dialing, Ring, Ringing, Up, Busy, Dialing Offhook, Pre-ring, Unknown)
tonezone
The "tone zone" defines the standard tone indications (dialing, ringing, busy, etc.) for specific regions and countries. This is set in the configuration file for the channel driver (e.g. zaptel.conf) with the parameters loadzone and defaultzone. Possible values are (as defined in indications.conf): at, au, be, br, ch, cl, cn, cz, de, dk, ee, es, fi, fr, gr, hu, it, lt, mx, ml, no, nz, pl, pt, ru, se, sg, uk, us, us-old, tw, ve, za.
videonativeformat
The native video format of the channel
In addition to the field described above, specific channel drivers can make others available. To learn more about these, look in the documentation for the specific channel driver. Fields which are unavailable on the current channel will return an empty string.
; Query the channel type:
exten => 123,1,Set(foo=${CHANNEL(channeltype)})

; Change language to English:
exten => 123,1,Set(CHANNEL(language)=en)

Note

Internal help for this application in Asterisk 1.4:
  -= Info about function 'CHANNEL' =- 

[Syntax]
CHANNEL(item)

[Synopsis]
Gets/sets various pieces of information about the channel.

[Description]
Gets/set various pieces of information about the channel.
Standard items (provided by all channel technologies) are:
R/O  audioreadformat     format currently being read
R/O  audionativeformat   format used natively for audio
R/O  audiowriteformat    format currently being written
R/W  callgroup           call groups for call pickup
R/O  channeltype         technology used for channel
R/W  language            language for sounds played
R/W  musicclass          class (from musiconhold.conf) for hold music
R/W  rxgain              set rxgain level on channel drivers that support it
R/O  state               state for channel
R/W  tonezone            zone for indications played
R/W  txgain              set txgain level on channel drivers that support it
R/O  videonativeformat   format used natively for video

Additional items may be available from the channel driver providing
the channel; see its documentation for details.

Any item requested that is not available on the current channel will
return an empty string.
diff output to internal help in Asterisk 1.2:
-- not available in Version 1.2 --


This limit of 64 call groups appears to be completely arbitrary and may not be sufficient for all users.