System information

When you create a peer, you need to define which mapping contexts you will allow
this peer to search. You do this with the permit statement (each peer may contain
multiple permit statements). Mapping contexts are related to dialplan contexts in the
sense that they are a security boundary for your peers. We’ll enable our mapping in the
next section.
All DUNDi mapping contexts take the form of:
dundi_context => local_context,weight,technology,destination[,options]]
The following configuration creates a DUNDi mapping context that we’ll use to ad-
vertise our local extension numbers to the group. We’ll add this configuration to the
dundi.conf file on the Toronto system under the [mappings] header. Note that this
should all appear on one line:
[mappings]
; All on a single line
;
extensions => RegisteredDevices,0,SIP,dundi:very_secret_secret@toronto.example.com/
${NUMBER},nopartial
The configuration on the Vancouver system will look like this:
[mappings]
; All on a single line
;
extensions => RegisteredDevices,0,SIP,dundi:very_secret_secret@vancouver.example.com/
${NUMBER},nopartial
In this example, the mapping context is extensions, which points to the RegisteredDe
vices context within extensions.conf (providing a listing of extension numbers to reply
with: our phone book). Numbers that resolve to the PBX should be advertised with a
weight of zero (directly connected). Numbers higher than zero indicate an increased
number of hops or paths to reach the final destination. This is useful when multiple
replies for the same lookup are received at the end that initially requested the number;
a path with a lower weight will be preferred. We’ll look at how to control responses in
“Controlling Responses” on page 516.
If we can reply to a lookup, our response will contain the method by which the other
end can connect to the system. This includes the technology to use (such as IAX2, SIP,
H323, and so on), the username and password with which to authenticate, which host
to send the authentication to, and finally the extension number.
Asterisk provides some shortcuts to allow us to create a “template” with which we can
build our responses. The following channel variables can be used to construct the
template:
${SECRET}
Replaced with the password stored in the local AstDB. Only used with iax.conf.
Configuring Asterisk for Use with DUNDi | 511