Hardware Reference
In-Depth Information
To add an account for your SIP softphone, add the following lines to the very bottom
of
/etc/asterisk/sip.conf
:
[one]
type=friend
host=dynamic
secret=cHaNgEmEpLeAsE!
context=raspi-demo
The first line (in square brackets) is the name of the account. The
type
line tells it what
kind of a device you're talking to. This example uses the
friend
type, because that
means that the softphone can call Asterisk and that Asterisk can also call the soft-
phone.
The
host
line says that the IP address assigned to the softphone isn't known (or might
change at any moment), so instead of hardcoding an IP address, the softphone will
periodically tell Asterisk where it is. This is called
registration
(covered in more detail
in the next section).
The
secret
setting is the password on this account. Pick a different password, and
make it long and difficult to guess. Last, the
context
setting tells the system which
part of the dialplan to execute when a call comes from the softphone.
Once you've added these lines to the
sip.conf
configuration file, you'll need to tell
Asterisk to reload that configuration file. From the Asterisk CLI, type:
$*CLI> sip reload
You can then use the
sip show peers
command to see which SIP accounts you have
configured:
hockey*CLI> sip show peers
Name/username Host Dyn
Forcerport ACL Port Status
one (Unspecified) D
N 0 Unmonitored
1 sip peers [Monitored: 0 online, 0 offline Unmonitored: 0 online, 1 off
line]
Did you notice that the host says
(Unspecified)
? This means that the softphone hasn't
registered with Asterisk yet, so we don't know where to find the softphone to send
messages to it. We'll rectify that shortly.
Register your SIP client
Next, you'll need to use a SIP softphone to be able to connect to Asterisk for test-
ing. There are a number of free SIP softphones available. I prefer Blink for Mac and
Windows, Twinkle on Linux, and CSipSimple on Android.