In-depth introduction to asterisk (I): asterisk channel (channels)

Source: Internet
Author: User

Due to the need of VoIP projects at work, I recently got in close contact with the asterisk engineering code. As for the great Position and Role of Asterisk in VoIP, I will not talk about it. Please refer to the previous article: astersik + radius simple strategy.

The introduction of Asterisk materials in China, let alone the source code analysis of Asterisk, so I will share some of the information I usually remember with you, hoping to help my colleagues. The first article translates the channel concept in Asterisk. the original English text can be found:Http://www.asterisk.org/doxygen/1.4/

What is an asterisk channel?

The asterisk channel is a call established through the asterisk. All these calls contain an incoming connection and an outbound connection. Each phone is built through a channel driver, such as sip, zap, and iax2. Each type of channel driver has its own private channel data structure. These private structures belong to a common asterisk channel data structure, which is defined in the channel. H and channel. c.

 

Call scenario)

The following figure shows the situation when an incoming call arrives at asterisk:

  1. The arrival of a call is perceived by interfaces driven by a certain channel, such as sip socket;

  2. The channel driver creates a PBX channel for it and opens a PBX thread for the channel;

  3. Implement the dialing scheme;

  4. At this time, at least one of the following occurs:

A. Asterisk responds to this call and plays media data or reads media data, such as IVR services.

B. the dialing scheme prompts asterisk to create an external call through the dial application, such as connecting to the local gateway when calling a landline or mobile phone. (For details, see app_dial.c)

 

Bridging Channels)

The following figure shows the asterisk outbound dialing scenario:

  1. Dial creates an outbound PBX channel and requires the corresponding channel driver to create a call

  2. When the phone is connected, asterisk bridges the media stream so that the caller of the first channel can communicate with the caller of the second channel.

  3. In some cases, the inbound and outbound channels use the same technical solution and compatible codec technology. In this case, local bridging is used. In this local bridging scheme, the channel driver directly transmits incoming voice data to external streams without sending voice frames through the PBX.

  4. For the SIP protocol, there will be an "external native bridge", asterisk redirection endpoint, so that the voice is directly transmitted between the caller and the called. Signals are stored to provide correct CDR records.

 

Masquerading Channels)

In some cases, one channel may be implanted into another channel. This scenario is common in call transfer. When a new channel is implanted and takes over the bridge, the old channel becomes frozen and suspended.

 

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.