DUNDi

From KlavoWiki
Jump to navigationJump to search

DUNDi™ is a peer to peer system for locating Internet gateways to telephony services. Unlike traditional centralized services (such as the remarkably simple and concise ENUM standard), DUNDi is fully distributed with no centralized authority whatsoever.

DUNDi is not itself a Voice over IP signalling or media protocol. Instead, it publishes routes which are in turn accessed via industry standard protocols such as IAX™, SIP and H.323

DUNDi can be used within an enterprise to create a fully federated PBX with no central point of failure and the ability to arbitrarily add new extensions, gateways and other resources to a trusted web of communication servers, where any adds, moves, changes, failures or new routes are automatically absorbed within the cloud with no additional configuration.

There are several components of a DUNDi installation that must be configured before the routing will work properly. The configuration files that need to be modified are dundi.conf, extensions.conf and extensions_dundi.conf. Follow the instructions below to generate the required configuration.

The file extensions_dundi.conf is an additional file that we create so that any DUNDi edits can be accomplished quickly just by edited this file. The file extensions.conf has an include to include the file extensions_dundi.conf. You could take the contents of the file extensions_dundi.conf and place it into the extensions.conf rather than creating the suggested additional file.


Keys

On both of your PBX servers use the following commands to create the required keys.

cd /var/lib/asterisk/keys
astgenkey –n <hostname>

This will create two files in the /var/lib/asterisk/keys directory called hostname.pub and hostname.key. You must copy the .pub file from your local server to the DUNDi peer server and vice versa. To easily do this, enter the following command (replacing the values where appropriate for the hostname). You will be prompted to accept the security key for the SSH connection and enter the root password.

scp /var/lib/asterisk/keys/hostname.pub root@remote_peer_hostname:/var/lib/asterisk/keys/
scp root@remote_peer_hostname:/var/lib/asterisk/keys/remote_peer_hostname.pub /var/lib/asterisk/keys/

Load the new key into Asterisk

reload res_crypto.so

DUNDi Configuration

Administrator

This section is not required but it would be a good idea to fill out the details of the DUNDi contact information so that if someone finds an error they can query DUNDi for the details of the person who created/administers DUNDi on a particular server.

Edit the file /etc/asterisk/dundi.conf

department=ABC Division
organization=ABC PTY LTD
locality=Suburb
stateprov=State
country=AU
email=myemailaddress@somewhere.com
phone=+61712341234

Creating Priorities

At the bottom of the file /etc/asterisk/dundi.conf, add the following 3 lines

priv => dundi-priv-canonical,0,IAX,priv:${SECRET}@FQDN/${NUMBER},nopartial
priv => dundi-priv-customers,100,IAX,priv:${SECRET}@FQDN/${NUMBER},nopartial
priv => dundi-priv-via-pstn,400,IAX,priv:${SECRET}@FQDN/${NUMBER},nopartial

Replace HOSTNAME with the FQDN of your server. After these entries you must add the DUNDi partner that your Asterisk server will be connecting to. The format of this entry is as follows.

/etc/asterisk/dundi.conf

[PEER_MAC_ADDRESS]
model = symmetric
host = FQDN
inkey = HOSTNAME_OF_PEER
outkey = HOSTNAME_OF_LOCALPC
include = all
permit = all
qualify = yes
order = primary

Be careful to put the remote servers MAC address as the identifier. On the Asterisk peer you are connecting to, add an entry as well which is a reverse of the above for your local PBX.

extensions_dundi.conf

/etc/asterisk/extensions_dundi.conf

This file is used to advertise to the DUNDi network with the required routes for your PBX server is responsible for. Populate this file with the following basic configuration information.

Note the section in macro-dundi-priv. This is changing the caller ID information to be that of an IDD standard. This way when a call is placed over the network a missed call can esaily be placed.

[dundi-priv-canonical]

[dundi-priv-customers]

[dundi-priv-via-pstn]

[dundi-priv-local]
include => dundi-priv-canonical
include => dundi-priv-customers
include => dundi-priv-via-pstn

[dundi-priv-switch]
switch => DUNDi/priv

[dundi-priv-lookup]
include => dundi-priv-local
include => dundi-priv-switch

[macro-dundi-priv]
exten => s,1,GotoIf($[${LEN(${CALLERID(number)})} != 4]?Continue)
exten => s,n,Set(CALLERID(num)=6171234${CALLERID(num)})
exten => s,n(Continue),Goto(${ARG1},1)
include => dundi-priv-lookup

To advertise your routes, place your advertisements under the required section. dundi-priv-canonical, dundi-priv-customers and dundi-priv-via-pstn. Each section has a loading of 0, 100 and 400 respectively.

dundi-priv-canonical should contain the numbers stored locally on the PBX or numbers that are free of charge to terminate.

[dundi-priv-canonical]
; Direct numbers (dundi priority 0)
exten => _617123412XX,1,Macro(stdexten,${EXTEN:7},${EXTEN:7})
exten => _617*9X,1,Goto(internal,${EXTEN:3},1)

dundi-priv-customers should contain numbers that either terminate to customers via SIP/IAX or numbers that you would like to have a termination weight of 100.

[dundi-priv-customers]
; If you are an ITSP or Reseller, list your customers here.  (dundi priority 100)
exten => _614XXXXXXXX,1,Dial(Zap/g1/${vodafone}0${EXTEN:2},${RINGER})

dundi-priv-via-pstn should contain numbers that can be terminated to a telecommunication company. Usually local numbers for that area so that other servers in the DUNDi clued can route what normally would be long distance numbers for a local PBX to place local calls.

[dundi-priv-via-pstn]
; If you are freely delivering calls to the PSTN, list them here (dundi priority 400)
exten => _6173XXXXXXX,1,Dial(Zap/g1/0${EXTEN:2},${RINGER})

extensions.conf

/etc/asterisk/extensions.conf

We have to make several changes to the way outbound dialling is handled in our extensions.conf file now that we need to do a DUNDi lookup before dialling. To perform this we create anew context called outbound-routes. In addition to the new context we must also add an inclusion to include extension_dundi.conf and create an inclusion in the internal context for outbound-routes.

Here is the inclusion parts of the extensions.conf file.

[internal]
; You would have all your existing dialing information here, at the end of the information put in this line

include => outbound-routes

In the general section of extensions.conf there is a section that includes additional files. In that section include the extensions_dundi.conf file.

#include extensions_dundi.conf

Add the outbound-routes context to your internal context.

[outbound-routes]
exten => _X.,1,Macro(dundi-priv,${EXTEN})
exten => _X.,2,Goto(outbound-routes-direct,${EXTEN},1)

You must now reload the new configuration information for each PBX server.

reload pbx_config.so
reload pbx_dundi.so

You can then see each DUNDi peer you have by typing;

dundi show peers
EID                  Host                Model      AvgTime  Status
00:13:72:fc:e1:3f    192.168.22.251  (S) Symmetric  Unavail  OK (25 ms)
00:c0:a8:8e:d8:0d    192.168.29.50   (S) Symmetric  Unavail  OK (61 ms)
2 dundi peers [2 online, 0 offline, 0 unmonitored]

IAX

We use IAX to deliver calls between Asterisk servers. To tie the whole thing together we need to include the IAX technology to deliver the call.

/etc/asterisk/iax.conf

[priv]
type=user
dbsecret=dundi/secret
context=dundi-priv-local
disallow=all
allow=g729

NOTE: The codec used here is G729. Make sure that the codec module is loaded in Asterisk.