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- OMIT2- BILLING3- 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.dtmf_features- R/W The channel's DTMF bridge features. May include one or more of 'T' 'K' 'H' 'W' and 'X' in a similar manner to options in theDialapplication. When setting it, the features string must be all upper case.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)after_bridge_goto- R/W the parseable goto string indicating where the channel is expected to return to in the PBX after exiting the next bridge it joins on the condition that it doesn't hang up. The parseable goto string uses the same syntax as theGotoapplication.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 channelparkinglot- 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 signalingsecure_bridge_media- Whether or not channels bridged to this channel require secure mediastate- R/O state for channeltonezone- R/W zone for indications playedtransfercapability- R/W ISDN Transfer Capability, one of:SPEECHDIGITALRESTRICTED_DIGITAL3K1AUDIODIGITAL_W_TONESVIDEO
txgain- R/W set txgain level on channel drivers that support it.videonativeformat- R/O format used natively for videotrace- 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/O1if T38 is offered or enabled in this channel, otherwise0rtpqos- R/O Get QOS information about the RTP stream
This option takes two additional arguments:
Argument 1:
audioGet data about the audio stream
videoGet data about the video stream
textGet data about the text stream
Argument 2:
local_ssrcLocal SSRC (stream ID)
local_lostpacketsLocal lost packets
local_jitterLocal calculated jitter
local_maxjitterLocal calculated jitter (maximum)
local_minjitterLocal calculated jitter (minimum)
{{local_normdevjitter}}Local calculated jitter (normal deviation)
local_stdevjitterLocal calculated jitter (standard deviation)
local_countNumber of received packets
remote_ssrcRemote SSRC (stream ID)
{{remote_lostpackets}}Remote lost packets
remote_jitterRemote reported jitter
remote_maxjitterRemote calculated jitter (maximum)
remote_minjitterRemote calculated jitter (minimum)
{{remote_normdevjitter}}Remote calculated jitter (normal deviation)
{{remote_stdevjitter}}Remote calculated jitter (standard deviation)
remote_countNumber of transmitted packets
rttRound trip time
maxrttRound trip time (maximum)
minrttRound trip time (minimum)
normdevrttRound trip time (normal deviation)
stdevrttRound trip time (standard deviation)
allAll 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:
audioGet audio destination
videoGet video destination
textGet text destination
Defaults toaudioif unspecified.rtpsource- R/O Get source RTP destination information.
This option takes one additional argument:
Argument 1:
audioGet audio destination
videoGet video destination
textGet text destination
Defaults toaudioif unspecified.
Technology: PJSIP
rtp - R/O Retrieve media related information.
-
type- When rtp is specified, thetypeparameter must be provided. It specifies which RTP parameter to read.src- Retrieve the local address for RTP.dest- Retrieve the remote address for RTP.direct- If direct media is enabled, this address is the remote address used for RTP.secure- Whether or not the media stream is encrypted.0- The media stream is not encrypted.1- The media stream is encrypted.
hold- Whether or not the media stream is currently restricted due to a call hold.0- The media stream is not held.1- The media stream is held.
media_type- When rtp is specified, themedia_typeparameter may be provided. It specifies which media stream the chosen RTP parameter should be retrieved from.audio- Retrieve information from the audio media stream.video- Retrieve information from the video media stream.
rtcp- R/O Retrieve RTCP statistics.
statistic- When rtcp is specified, thestatisticparameter must be provided. It specifies which RTCP statistic parameter to read.all- Retrieve a summary of all RTCP statistics.
The following data items are returned in a semi-colon delineated list:ssrc- Our Synchronization Source identifierthemssrc- Their Synchronization Source identifierlp- Our lost packet countrxjitter- Received packet jitterrxcount- Received packet counttxjitter- Transmitted packet jittertxcount- Transmitted packet countrlp- Remote lost packet countrtt- Round trip time
all_jitter- Retrieve a summary of all RTCP Jitter statistics.
The following data items are returned in a semi-colon delineated list:minrxjitter- Our minimum jittermaxrxjitter- Our max jitteravgrxjitter- Our average jitterstdevrxjitter- Our jitter standard deviationreported_minjitter- Their minimum jitterreported_maxjitter- Their max jitterreported_avgjitter- Their average jitterreported_stdevjitter- Their jitter standard deviation
all_loss- Retrieve a summary of all RTCP packet loss statistics.
The following data items are returned in a semi-colon delineated list:minrxlost- Our minimum lost packetsmaxrxlost- Our max lost packetsavgrxlost- Our average lost packetsstdevrxlost- Our lost packets standard deviationreported_minlost- Their minimum lost packetsreported_maxlost- Their max lost packetsreported_avglost- Their average lost packetsreported_stdevlost- Their lost packets standard deviation
all_rtt- Retrieve a summary of all RTCP round trip time information.
The following data items are returned in a semi-colon delineated list:minrtt- Minimum round trip timemaxrtt- Maximum round trip timeavgrtt- Average round trip timestdevrtt- Standard deviation round trip time
txcount- Transmitted packet countrxcount- Received packet counttxjitter- Transmitted packet jitterrxjitter- Received packet jitterremote_maxjitter- Their max jitterremote_minjitter- Their minimum jitterremote_normdevjitter- Their average jitterremote_stdevjitter- Their jitter standard deviationlocal_maxjitter- Our max jitterlocal_minjitter- Our minimum jitterlocal_normdevjitter- Our average jitterlocal_stdevjitter- Our jitter standard deviationtxploss- Transmitted packet lossrxploss- Received packet lossremote_maxrxploss- Their max lost packetsremote_minrxploss- Their minimum lost packetsremote_normdevrxploss- Their average lost packetsremote_stdevrxploss- Their lost packets standard deviationlocal_maxrxploss- Our max lost packetslocal_minrxploss- Our minimum lost packetslocal_normdevrxploss- Our average lost packetslocal_stdevrxploss- Our lost packets standard deviationrtt- Round trip timemaxrtt- Maximum round trip timeminrtt- Minimum round trip timenormdevrtt- Average round trip timestdevrtt- Standard deviation round trip timelocal_ssrc- Our Synchronization Source identifierremote_ssrc- Their Synchronization Source identifier
media_type- When rtcp is specified, themedia_typeparameter may be provided. It specifies which media stream the chosen RTCP parameter should be retrieved from.audio- Retrieve information from the audio media stream.video- Retrieve information from the video media stream.
endpoint- R/O The name of the endpoint associated with this channel. Use the PJSIP_ENDPOINT function to obtain further endpoint related information.
pjsip- R/O Obtain information about the current PJSIP channel and its session.
type- When pjsip is specified, thetypeparameter must be provided. It specifies which signalling parameter to read.secure- Whether or not the signalling uses a secure transport.0- The signalling uses a non-secure transport.1- The signalling uses a secure transport.
target_uri- The request URI of theINVITErequest associated with the creation of this channel.local_uri- The local URI.remote_uri- The remote URI.t38state- The current state of any T.38 fax on this channel.DISABLED- T.38 faxing is disabled on this channel.LOCAL_REINVITE- Asterisk has sent are-INVITEto the remote end to initiate a T.38 fax.REMOTE_REINVITE- The remote end has sent are-INVITEto Asterisk to initiate a T.38 fax.ENABLED- A T.38 fax session has been enabled.REJECTED- A T.38 fax session was attempted but was rejected.
local_addr- On inbound calls, the full IP address and port number that theINVITErequest was received on. On outbound calls, the full IP address and port number that theINVITErequest was transmitted from.remote_addr- On inbound calls, the full IP address and port number that theINVITErequest was received from. On outbound calls, the full IP address and port number that theINVITErequest was transmitted to.
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:analogmfc/r2pripseudoss7
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
halfechocan_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 not38support- R/W t38support
Returns 0 or 1
Write yes or noh323id_url- R/0 Returns caller URLcaller_h323id- R/0 Returns caller h323idcaller_dialeddigits- R/0 Returns caller dialed digitscaller_email- R/0 Returns caller emailcallee_email- R/0 Returns callee emailcallee_dialeddigits- R/0 Returns callee dialed digitscaller_url- R/0 Returns caller URL
See Also
Import Version
This documentation was imported from Asterisk Version SVN-branch-12-r403680