Hardware Reference
In-Depth Information
While configuring each of these softphones is beyond the scope of this hack, the ba-
sics are the same. Simply configure the softphone with one as the username (and auth
username , if it's required by your softphone), cHaNgEmEpLeAsE! as the password (or the
new password you entered in the secret setting in sip.conf ), and the IP address of
your Raspberry Pi for the SIP server, registrar, domain, proxy, and/or outbound proxy
settings.
Once your softphone has registered, you should be able to run sip show peers from
the Asterisk CLI again and see that the Host field now shows an IP address, like this:
hockey*CLI> sip show peers
Name/username Host Dyn
Forcerport ACL Port Status
one/one 192.168.55.187 D
N 7060 Unmonitored
1 sip peers [Monitored: 0 online, 0 offline Unmonitored: 1 online, 0 off
line]
If you're having problems getting your softphone to register, double-check that you've
(temporarily) disabled the firewall on the Raspberry Pi. For simplicity's sake, you
should use a softphone within the same network as your Raspberry Pi, as the SIP
protocol is notoriously difficult to use when it has to pass through a firewall or router.
You can also watch the Asterisk CLI closely when the softphone attempts to register,
as it will often give you useful information (such as telling you that the password pro-
vided by the softphone doesn't match the password in the sip.conf configuration file).
Set up an extension in the dialplan
The final step is to set up one or more extensions in the dialplan to execute when that
extension is dialed by the softphone. If you were to dial extension 100 on the softphone
at this point, you would likely get back a 404: Extension not found error. The Asterisk
CLI would report something like this:
NOTICE[24237]: chan_sip.c:23437 handle_request_invite: Call from 'one'
(192.168.55.187:7060) to extension '100' rejected because extension not
found in context 'raspi-demo'.
In order to make extension 100 do something a bit more useful, you need to add a new
section to the /etc/asterisk/extensions.conf configuration file. This section name
needs to match the context setting from our account in the sip.conf configuration
file. In this case, call it [raspi-demo] .
Add the following lines to the end of /etc/asterisk/extensions.conf :
[raspi-demo]
exten => 100,1,Answer()
Search WWH ::




Custom Search