System information
handled through numerical IP addresses, it can be very helpful to associate a name
(such as www.google.com) with what may in fact be multiple IP addresses.
In the case of VoIP, the use of a domain name can take something like
100@192.168.1.1 (extension@server) and make it available as leif@shifteight.org
(which looks so much sexier on a business card).
The SIP URI
A SIP URI generally looks like sip:endpoint@domain.tld. Depending on your SIP client,
you may be able to dial a SIP URI as endpoint@domain.tld, or even just as endpoint (if
you have a proxy server and the endpoint you are calling is part of your domain).
For a SIP telephone, which often only has a numerical dialpad, it can be problematic
to dial a SIP URI by name,
†
so it has become common to use numerical dialing to reach
external resources. We are also used to making “phone calls” using “phone numbers.”
The SIP protocol itself, however, only understands resource@address, so whatever you
dial must ultimately be converted to this format before SIP can do anything with it.
Usually the only reason you can dial something by “phone number” from your SIP
phone is because you are registered to a resource that understands how to convert the
numerical strings you dial into SIP URIs.
In Asterisk, the resource part of the URI (the part before the @) must match an extension
in the dialplan.
‡
The address portion will be the address (or hostname) of the Asterisk
server itself. So, a URI of sip:100@shifteight.org will end up at an extension called
100, somewhere in the dialplan of the server that provides SIP service for
shifteight.org.
What is dialed (100) may not in any way relate to the actual identifier of the endpoint
being connected to. For example, we might have a user named Leif whose phone may
be a device that registers itself by its MAC address, and therefore could be something
like 0000FFFF0001@192.168.1.99.
§
Much of the purpose of the Asterisk dialplan is to
simplify addressing for users and to handle the complexities of the various protocols
that Asterisk supports.
SRV Records
A Service Record (SRV) is a somewhat new type of DNS record that provides informa-
tion about available services. Defined in RFC 2782, it is often used by newer protocols
† Do you know where the @ symbol is on your dialpad?
‡ Bear in mind that an extension in Asterisk can be any alphanumeric string, such as leif or 100.
§ You could actually dial this URI directly from your phone and bypass the Asterisk server, but you can see
how dialing 100 is going to be a lot more popular than trying to figure out how to type
0004f2a1b2c3@192.168.1.99 into your phone using just the numeric dialpad (it can be done, by the way).
238 | Chapter 12: Internet Call Routing