Now that you know about the various modules that Asterisk uses, let's talk about the ways that calls flow through an Asterisk system. To explain this clearly, let's say that Alice wants to talk to Bob, and they both have SIP phones connected to their Asterisk system. Let's see what happens!
Should we add a graphic to help explain the call flow model?
- Alice dials extension 6002, which is Bob's extension on the Asterisk system.
- A SIP message goes from Alice's phone to the SIP channel driver in Asterisk
- The SIP channel driver authenticates the call. If Alice's phone does not provide the proper credentials, Asterisk rejects the call.
- At this point, we have Alice's phone communicating with Asterisk.
- Now the call goes from the SIP channel driver into the core of Asterisk. Asterisk looks for a set of instructions to follow for extension 6002 in the dialplan.
- Extension 6002 in the dialplan tells Asterisk to call Bob's phone
- Asterisk makes a call out through the SIP channel driver to Bob's phone.
- Bob answers his phone.
- Now we have two independent calls on the Asterisk system: one from Alice, and to Bob. Asterisk now bridges the audio between these two calls (known as channels in Asterisk parlance).
- When one channel hangs up, Asterisk signals the other channel to hang up.
And there we have it! We've shown how calls flow from external devices, through the channel drivers to the core of Asterisk, and back out through the channel drivers to external devices.