Page 132 - Asterisk™: The Future of Telephony
P. 132
*CLI> -- Saved useragent "Asterisk PBX" for peer toronto
You should see the status of the Host change from (Unspecified) to the IP address of
the remote box when you run sip show peers:
*CLI> sip show peers
Name/username Host Dyn Nat ACL Port Status
toronto/osaka 192.168.2.202 D 5060 Unmonitored
You can verify that your own registration was successful by running sip show
registry from the Asterisk console:
*CLI> sip show registry
Host Username Refresh State Reg.Time
192.168.1.101:5060 osaka 105 Registered Sun, 22 Apr 2007 19:13:20
Now that our Asterisk boxes are happy with each other, let’s configure a couple of SIP
phones so we can call between the boxes.
SIP Phone Configuration
See the “Configuring an FXS Channel for an Analog Telephone” section of this chapter
for more information about configuring SIP phones with Asterisk. Below is the con-
figuration for two SIP phones in the sip.conf file for each server, which we’ll be
referencing from the dialplan in the next section, thereby giving us two endpoints to
call between. Append this configuration to the end of the sip.conf file on each respective
server.
Toronto sip.conf:
[1000]
type=friend
host=dynamic
context=phones
Osaka sip.conf:
[1001]
type=friend
host=dynamic
context=phones
You should now have extension 1000 registered to Toronto, and extension 1001 reg-
istered to Osaka. You can verify this with the sip show peers the
to
call between the extensions.
Configuring the Dialplan
Now we can configure a simple dialplan for each server allowing us to call between the
two phones we have registered: one to Toronto, the other to Osaka. In the “Working
with Interface Configuration Files” section of this chapter, we asked you to create a
104 | Chapter 4: Initial Configuration of Asterisk