Page 110 - Asterisk™: The Future of Telephony
P. 110
where the request is destined for, and forward it on. Once the two user agents have
negotiated a successful call setup, the media is transported via the RTP protocol and
sent directly between the two user agents. SIP proxies do not handle media; they simply
deal with the SIP packets.
Asterisk, on the other hand, is called a Back-To-Back User Agent (B2BUA). This means
that Asterisk acts like a user agent in either the server (receiving) or client (sending)
role. So when our softphone dials an extension number, the call is set up between the
softphone and Asterisk directly. If the logic we’ve built into Asterisk determines that
you mean to call another user agent, then Asterisk acts as a user agent client and sets
up another connection (known as a channel) to the other phone. The media between
‖
the two phones then flows directly through Asterisk. From the viewpoint of the
phones, they are talking with Asterisk directly.
Basic SIP Telephone Configuration in Asterisk
Configuring a SIP phone to work with Asterisk does not require much. However, be-
cause there are so many options possible in both Asterisk and the configuration of the
particular telephone set or softphone, things can get confusing. Add to this the fact that
similar things can have different names, and you have a recipe for frustration. What we
are going to do, therefore, is give you the bare-bones basics. If you follow our advice,
you should be able to get the sets we cover working (and be well on your way to getting
a phone that we have not covered to work as well). We are not saying that this is the
best way, or even the right way, but it is the simplest way, and from a working foun-
dation, it is much easier to take a basic configuration and tweak things until you get
the solution you need.
Just as we did with the extensions.conf file; run the following commands
in your bash shell:
# mv sip.conf sip.conf.sample
# touch sip.conf
Defining the SIP device in Asterisk
If you put the following in a sip.conf file, you will be able to register a phone to the
system.
[general]
§ An excellent open source SIP proxy is OpenSER, available at http://www.openser.org.
‖ Yes, there are ways to making the media flow directly between the phones once the call is set up. This is done
in the sip.conf file using either directrtpsetup=yes (an experimental option allowing the media to be
redirected in the initial call setup) or canreinvite=yes (where media initially goes through Asterisk until a re-
INVITE happens, at which point the media can be sent directly between the phones).
82 | Chapter 4: Initial Configuration of Asterisk