Page 339 - Asterisk™: The Future of Telephony
P. 339
Defining DUNDi peers
DUNDi peers are defined in the dundi.conf file. Peers are identified by the unique layer-
two MAC address of an interface on the remote system. The dundi.conf file is where
we define what context to search for peers requesting a lookup and which peers we
want to use when doing a lookup for a particular network:
[00:00:00:00:00:00] ; Remote Office
model = symmetric
host = montreal.example.com
inkey = montreal
outkey = toronto
include = dundi-test
permit = dundi-test
qualify = yes
dynamic=yes
The remote peer’s identifier (MAC address) is enclosed in square brackets ([]). The
inkey and outkey are the public/private key pairs that we use for authentication. Key
pairs are generated with the astgenkey script, located in the ./asterisk/contrib/scripts/
source directory. Be sure to use the -n flag so that you don’t have to initialize passwords
every time you start Asterisk:
# cd /var/lib/asterisk/keys
# /usr/src/asterisk/contrib/scripts/astgenkey -n toronto
The resulting keys, toronto.pub and toronto.key, will be placed in your /var/lib/asterisk/
keys/ directory. The toronto.pub file is the public key, which you should post to a web
server so that it is easily accessible for anyone with whom you wish to peer. When you
peer, you can give your peers the HTTP-accessible public key, which they can then
place in their /var/lib/asterisk/keys/ directories.
After you have downloaded the keys, you must reload the res_crypto.so and pbx_dun
di.so modules in Asterisk:
*CLI> module reload res_crypto.so
-- Reloading module 'res_crypto.so' (Cryptographic Digital Signatures)
-- Loaded PRIVATE key 'toronto'
-- Loaded PUBLIC key 'toronto'
*CLI> module reload pbx_dundi.so
-- Reloading module 'pbx_dundi.so' (Distributed Universal Number
Discovery
(DUNDi))
== Parsing '/etc/asterisk/dundi.conf': Found
Then, create the dundi user in the iax.conf file to allow connections into your Asterisk
system. When a call is authenticated, the extension number being requested is passed
to the dundi-local context in the extensions.conf file, where the call is then handled by
Asterisk.
DUNDi | 311