Page 111 - Asterisk™: The Future of Telephony
P. 111
[1000]
type=friend
context=phones
host=dynamic
Not pretty, not secure, not flexible, not fully-featured, but this will work.
Even though we have named this SIP device 1000, and we are probably going to assign
it that extension number, you should note that we could have named it whatever we
wanted. Names such as mysipset, john, 0004f201ab0c are all valid, popular, and may
#
suit your needs better. What we are doing is assigning a unique identifier to a device,
which will form part of the credentials when a call is placed using the SIP channel.
Since we want to be able to both send calls to the softphone and allow the client to
place calls, we have defined the type as friend. The other two types are user and
peer. From the viewpoint of Asterisk, a user is configured to enter the dialplan, and a
peer is created for calls leaving the dialplan (via the Dial() application). A friend is
simply a shortcut that defines both a user and a peer. If in doubt, define the type as
friend.
The host option is used to define where the client exists on the network when Asterisk
needs to send a call to it. This can either be defined statically by defining something
like host=192.168.1.100, or if the client has a dynamic IP address, then we set
host=dynamic. When the host option is set as dynamic, and the client is configured to
register, Asterisk will receive a REGISTER packet from the endpoint (i.e., telephone
set or softphone), telling Asterisk which IP address the SIP peer is using.
If you do not trust your network, you should probably also force the use of a password
by adding the following to the device definition. This is one of those things that is not
technically necessary, but is probably a good idea:
secret=guessthis
Configuring the Device Itself
In the configuration menus of the phone itself (which could be via a web GUI, through
menus on the phone itself, or possibly using configuration files that are stored on a
server), the unique identifier (which in this case is 1000) again forms part of the cre-
dentials for the authentication process. Naturally, for a connection to be successful,
this has to match in both Asterisk and in the set itself. The fun begins when you realize
that there is no set rule as to what this identifier is formally called. We have elected
simply to call it the Unique Identifier.
# The maximum length of a username is 255 characters.
Configuring SIP Telephones | 83