Skip to end of metadata
Go to start of metadata

CHANNEL()

Synopsis

Gets/sets various pieces of information about the channel.

Description

Gets/sets various pieces of information about the channel, additional item may be available from the channel driver; see its documentation for details. Any item requested that is not available on the current channel will return an empty string.

Syntax

CHANNEL(item)
Arguments
  • item - Standard items (provided by all channel technologies) are:
    • amaflags - R/W the Automatic Message Accounting (AMA) flags on the channel. When read from a channel, the integer value will always be returned. When written to a channel, both the string format or integer value is accepted.
      • 1 - OMIT
      • 2 - BILLING
      • 3 - DOCUMENTATION
    • accountcode - R/W the channel's account code.
    • audioreadformat - R/O format currently being read.
    • audionativeformat - R/O format used natively for audio.
    • audiowriteformat - R/O format currently being written.
    • callgroup - R/W numeric call pickup groups that this channel is a member.
    • pickupgroup - R/W numeric call pickup groups this channel can pickup.
    • namedcallgroup - R/W named call pickup groups that this channel is a member.
    • namedpickupgroup - R/W named call pickup groups this channel can pickup.
    • channeltype - R/O technology used for channel.
    • checkhangup - R/O Whether the channel is hanging up (1/0)
    • hangup_handler_pop - W/O Replace the most recently added hangup handler with a new hangup handler on the channel if supplied. The assigned string is passed to the Gosub application when the channel is hung up. Any optionally omitted context and exten are supplied by the channel pushing the handler before it is pushed.
    • hangup_handler_push - W/O Push a hangup handler onto the channel hangup handler stack. The assigned string is passed to the Gosub application when the channel is hung up. Any optionally omitted context and exten are supplied by the channel pushing the handler before it is pushed.
    • hangup_handler_wipe - W/O Wipe the entire hangup handler stack and replace with a new hangup handler on the channel if supplied. The assigned string is passed to the Gosub application when the channel is hung up. Any optionally omitted context and exten are supplied by the channel pushing the handler before it is pushed.
    • language - R/W language for sounds played.
    • musicclass - R/W class (from musiconhold.conf) for hold music.
    • name - The name of the channel
    • parkinglot - R/W parkinglot for parking.
    • rxgain - R/W set rxgain level on channel drivers that support it.
    • secure_bridge_signaling - Whether or not channels bridged to this channel require secure signaling
    • secure_bridge_media - Whether or not channels bridged to this channel require secure media
    • state - R/O state for channel
    • tonezone - R/W zone for indications played
    • transfercapability - R/W ISDN Transfer Capability, one of:
      • SPEECH
      • DIGITAL
      • RESTRICTED_DIGITAL
      • 3K1AUDIO
      • DIGITAL_W_TONES
      • VIDEO
    • txgain - R/W set txgain level on channel drivers that support it.
    • videonativeformat - R/O format used natively for video
    • trace - R/W whether or not context tracing is enabled, only available if CHANNEL_TRACE is defined.
      chan_sip provides the following additional options:
    • peerip - R/O Get the IP address of the peer.
    • recvip - R/O Get the source IP address of the peer.
    • from - R/O Get the URI from the From: header.
    • uri - R/O Get the URI from the Contact: header.
    • useragent - R/O Get the useragent.
    • peername - R/O Get the name of the peer.
    • t38passthrough - R/O 1 if T38 is offered or enabled in this channel, otherwise 0
    • rtpqos - R/O Get QOS information about the RTP stream
      This option takes two additional arguments:
      Argument 1:
      audio Get data about the audio stream
      video Get data about the video stream
      text Get data about the text stream
      Argument 2:
      local_ssrc Local SSRC (stream ID)
      local_lostpackets Local lost packets
      local_jitter Local calculated jitter
      local_maxjitter Local calculated jitter (maximum)
      local_minjitter Local calculated jitter (minimum)
      {{local_normdevjitter}}Local calculated jitter (normal deviation)
      local_stdevjitter Local calculated jitter (standard deviation)
      local_count Number of received packets
      remote_ssrc Remote SSRC (stream ID)
      {{remote_lostpackets}}Remote lost packets
      remote_jitter Remote reported jitter
      remote_maxjitter Remote calculated jitter (maximum)
      remote_minjitter Remote calculated jitter (minimum)
      {{remote_normdevjitter}}Remote calculated jitter (normal deviation)
      {{remote_stdevjitter}}Remote calculated jitter (standard deviation)
      remote_count Number of transmitted packets
      rtt Round trip time
      maxrtt Round trip time (maximum)
      minrtt Round trip time (minimum)
      normdevrtt Round trip time (normal deviation)
      stdevrtt Round trip time (standard deviation)
      all All statistics (in a form suited to logging, but not for parsing)
    • rtpdest - R/O Get remote RTP destination information.
      This option takes one additional argument:
      Argument 1:
      audio Get audio destination
      video Get video destination
      text Get text destination
      Defaults to audio if unspecified.
    • rtpsource - R/O Get source RTP destination information.
      This option takes one additional argument:
      Argument 1:
      audio Get audio destination
      video Get video destination
      text Get text destination
      Defaults to audio if unspecified.
      chan_iax2 provides the following additional options:
    • osptoken - R/O Get the peer's osptoken.
    • peerip - R/O Get the peer's ip address.
    • peername - R/O Get the peer's username.
    • secure_signaling - R/O Get the if the IAX channel is secured.
    • secure_media - R/O Get the if the IAX channel is secured.
      chan_dahdi provides the following additional options:
    • dahdi_channel - R/O DAHDI channel related to this channel.
    • dahdi_span - R/O DAHDI span related to this channel.
    • dahdi_type - R/O DAHDI channel type, one of:
      • analog
      • mfc/r2
      • pri
      • pseudo
      • ss7
    • keypad_digits - R/O PRI Keypad digits that came in with the SETUP message.
    • reversecharge - R/O PRI Reverse Charging Indication, one of:
      • -1 - None
      • {{ 1}} - Reverse Charging Requested
    • no_media_path - R/O PRI Nonzero if the channel has no B channel. The channel is either on hold or a call waiting call.
    • buffers - W/O Change the channel's buffer policy (for the current call only)
      This option takes two arguments:
      Number of buffers,
      Buffer policy being one of:
      full
      immediate
      half
    • echocan_mode - W/O Change the configuration of the active echo canceller on the channel (if any), for the current call only.
      Possible values are:
      {{on}}Normal mode (the echo canceller is actually reinitalized)
      {{off}}Disabled
      {{fax}}FAX/data mode (NLP disabled if possible, otherwise completely disabled)
      {{voice}}Voice mode (returns from FAX mode, reverting the changes that were made)
      chan_ooh323 provides the following additional options:
    • faxdetect - R/W Fax Detect
      Returns 0 or 1
      Write yes or no
    • t38support - R/W t38support
      Returns 0 or 1
      Write yes or no
    • h323id_url - R/0 Returns caller URL
    • caller_h323id - R/0 Returns caller h323id
    • caller_dialeddigits - R/0 Returns caller dialed digits
    • caller_email - R/0 Returns caller email
    • callee_email - R/0 Returns callee email
    • callee_dialeddigits - R/0 Returns callee dialed digits
    • caller_url - R/0 Returns caller URL

See Also

Import Version

This documentation was imported from Asterisk Version GIT-11-3e0eafa

  • No labels

2 Comments

  1. Some channel var names have been updated and need to be updated for this version of Asterisk.  Credit to Leandro for pulling from src:

     

    On Mon, Sep 5, 2011 at 10:58 PM, Leandro Dardini <ldardini at gmail.com> wrote:

    > It is really simple, a patch of few months ago renamed the vars, but
    > forget to update the documentation. You have to "use the source" for finding
    > the new variable names. I paste here the part of the code for your easy
    > viewing...
    >
    > { "txcount", INT, { .i4 =
    > &stats.txcount, }, },
    > { "rxcount", INT, { .i4 =
    > &stats.rxcount, }, },
    > { "txjitter", DBL, { .d8 =
    > &stats.txjitter, }, },
    > { "rxjitter", DBL, { .d8 =
    > &stats.rxjitter, }, },
    > { "remote_maxjitter", DBL, { .d8 =
    > &stats.remote_maxjitter, }, },
    > { "remote_minjitter", DBL, { .d8 =
    > &stats.remote_minjitter, }, },
    > { "remote_normdevjitter", DBL, { .d8 =
    > &stats.remote_normdevjitter, }, },
    > { "remote_stdevjitter", DBL, { .d8 =
    > &stats.remote_stdevjitter, }, },
    > { "local_maxjitter", DBL, { .d8 =
    > &stats.local_maxjitter, }, },
    > { "local_minjitter", DBL, { .d8 =
    > &stats.local_minjitter, }, },
    > { "local_normdevjitter", DBL, { .d8 =
    > &stats.local_normdevjitter, }, },
    > { "local_stdevjitter", DBL, { .d8 =
    > &stats.local_stdevjitter, }, },
    > { "txploss", INT, { .i4 =
    > &stats.txploss, }, },
    > { "rxploss", INT, { .i4 =
    > &stats.rxploss, }, },
    > { "remote_maxrxploss", DBL, { .d8 =
    > &stats.remote_maxrxploss, }, },
    > { "remote_minrxploss", DBL, { .d8 =
    > &stats.remote_minrxploss, }, },
    > { "remote_normdevrxploss", DBL, { .d8 =
    > &stats.remote_normdevrxploss, }, },
    > { "remote_stdevrxploss", DBL, { .d8 =
    > &stats.remote_stdevrxploss, }, },
    > { "local_maxrxploss", DBL, { .d8 =
    > &stats.local_maxrxploss, }, },
    > { "local_minrxploss", DBL, { .d8 =
    > &stats.local_minrxploss, }, },
    > { "local_normdevrxploss", DBL, { .d8 =
    > &stats.local_normdevrxploss, }, },
    > { "local_stdevrxploss", DBL, { .d8 =
    > &stats.local_stdevrxploss, }, },
    > { "rtt", DBL, { .d8 =
    > &stats.rtt, }, },
    > { "maxrtt", DBL, { .d8 =
    > &stats.maxrtt, }, },
    > { "minrtt", DBL, { .d8 =
    > &stats.minrtt, }, },
    > { "normdevrtt", DBL, { .d8 =
    > &stats.normdevrtt, }, },
    > { "stdevrtt", DBL, { .d8 =
    > &stats.stdevrtt, }, },
    > { "local_ssrc", INT, { .i4 =
    > &stats.local_ssrc, }, },
    > { "remote_ssrc", INT, { .i4 =
    > &stats.remote_ssrc, }, },
    >
    > Leandro