Versions Compared

Key

  • This line was added.
  • This line was removed.
  • Formatting was changed.
Comment: final tweaks and removing construction sign
Warning

Under Construction

...

Topics

...

Asterisk Channels

...

...

Other topics:

Inbound versus Outbound
Children

Asterisk Channels

Almost nothing happens in Asterisk without a channel being involved. A channel is an entity inside Asterisk that acts as a channel of communication between Asterisk and another device. That is, a phone, a PBX, another Asterisk system, or even Asterisk itself (in the case of a local channel).

Our documentation and many Asterisk users speak about channels in terms of "calls". A call can be one or more channels creating a path of communication or activity through the Asterisk system.

...

  • A SIP channel driver such as chan_sip or chan_pjsip.A Hardware interface driver such as
  • DAHDI channels provided by chan_dahdi.
  • Virtual Local channels such as provided by chan_local. (This was moved into the core in Asterisk 12)

SIP channels are used to interface with SIP capable VOIP devices, such as phones, channel banks, other PBXs or Internet Telephony Service Providers.

DAHDI channels are used to interface with DAHDI drivers and PRI libraries. In this case chan_dahdi allows you to use any DAHDI capable devices, such as Digium's line of T1/E1/J1 interface cards.

Local channels are used for dialing inward to the system itself, allowing any Asterisk component that can dial to call directly into dialplan. This provides a sort of "fake" call that still executes real instructions.

Configuring Channels

Text File Configuration

...

The primary exception is with Local Channels. In the case of local channels, you'll typically have two local channel legs, one that is treated as outbound and the other as inbound. In this case both are really inside Asterisk, but one is executing dialplan and the other is not. The leg executing dialplan is the one treated as inbound.

Below we'll diagram some examples to make things cleara few examples for clarity.

 

Gliffy Diagram
nameInboundOutboundChannels
Example explanations:

The figures have been kept somewhat generic and should apply to most channel types. Each figure shows the final state of the call, rather than a sequence of events.

Below are explanations of the various figures.

Fig 1

One phone dials another phone; about as simple as it gets.

The inbound channel is created from Alice's phone calling Asterisk. Asterisk then calls the extension dialed by Alice by creating an outbound channel to talk to Bob. Once the call is established the two channels are put into a bridge.

Fig 2

A user runs the originate command from AMI, or maybe something like "channel originate SIP/Alice application playback demo-congrats" from the CLI. Asterisk creates an outbound channel to call the device specified (SIP/Alice). When answered, Asterisk begins treating the channel like an inbound channel and connects it to the specified dialplan application.

...

Perhaps a user runs originate again - but this time "channel originate SIP/Alice extension [email protected]" from the CLI. Where [email protected] tells contains dialplan telling Asterisk to dial outbound to SIP/Bob. At first, the created outbound channel would look like Fig 2 where it begins to be treated as inbound after the device answers the call. At that point, a number of things happen:

...

For this example demonstrating relationships between channels and other elements we used non-optimized local channels. If the local channels are optimized, then they will optimize themselves out of this mix and Alice and Bob's channels would be bridged together directly.

...

Channel Variable Inheritance

When working with channels you'll almost certainly be touching channel variables. It is useful to note that upon setting a channel variable the level of inheritance between channels can be defined. This is discussed in the Channel Variables sub-section Variable Inheritance.

...