Difference between revisions of "DUNDi configuration"
Line 2: | Line 2: | ||
([http://www.linuxplanet.com/linuxplanet/tutorials/6270/2/ Source]) | ([http://www.linuxplanet.com/linuxplanet/tutorials/6270/2/ Source]) | ||
− | Warm up your favorite text editor, because we're going to edit three Asterisk configuration files. The three files are dundi.conf, iax.conf, and extensions.conf. These are in /etc/asterisk/ on Asterisk@Home. dundi.conf controls peer authentication, iax.conf is our transport protocol, and extensions.conf contains your dialplans. | + | Warm up your favorite text editor, because we're going to edit three Asterisk configuration files. The three files are <tt>dundi.conf</tt>, <tt>iax.conf</tt>, and <tt>extensions.conf</tt>. These are in <tt>/etc/asterisk/</tt> on Asterisk@Home. <tt>dundi.conf</tt> controls peer authentication, <tt>iax.conf</tt> is our transport protocol, and <tt>extensions.conf</tt> contains your dialplans. |
− | This example connects two peers, MyHost and OtherHost. | + | This example connects two peers, ''MyHost'' and ''OtherHost''. |
− | First edit iax.conf. Add the following lines, except for any that are duplicated in the [general] section: | + | First edit <tt>iax.conf</tt>. Add the following lines, except for any that are duplicated in the <tt>[general]</tt> section: |
[dundi] | [dundi] | ||
Line 17: | Line 17: | ||
allow=g726 | allow=g726 | ||
− | Now edit dundi.conf. The default file is well commented and has lots of examples--you'll find definitions of all the directives in there. This is where your mapping contexts are defined, which follow this format: | + | Now edit <tt>dundi.conf</tt>. The default file is well commented and has lots of examples--you'll find definitions of all the directives in there. This is where your mapping contexts are defined, which follow this format: |
dundi_context => local_context,weight,technology,destination,[options] | dundi_context => local_context,weight,technology,destination,[options] | ||
Line 64: | Line 64: | ||
# /usr/sbin/astgenkey -n myhost.mynet.com | # /usr/sbin/astgenkey -n myhost.mynet.com | ||
− | This creates two keys: myhost.mynet.com.pub and myhost.mynet.com.key. The public key, myhost.mynet.com.pub, must be distributed to all servers you are peering with. Post it on your Web site if you like. The private key is unencrypted, and like all private encryption keys must be guarded carefully. Then the res_crypto.so line interface: | + | This creates two keys: <tt>myhost.mynet.com.pub</tt> and <tt>myhost.mynet.com.key</tt>. The public key, <tt>myhost.mynet.com.pub</tt>, must be distributed to all servers you are peering with. Post it on your Web site if you like. The ''private key'' is unencrypted, and like all private encryption keys '''must be guarded carefully'''. Then the <tt>res_crypto.so</tt> line interface: |
# asterisk -r | # asterisk -r | ||
Line 70: | Line 70: | ||
asterisk1*CLI># reload pbx_dundi.so | asterisk1*CLI># reload pbx_dundi.so | ||
− | From here you can also run the command show keys to see all of your RSA keys. Now go back to iax.conf and add the dundi user. | + | From here you can also run the command <tt>show keys</tt> to see all of your RSA keys. Now go back to <tt>iax.conf</tt> and add the dundi user. |
Here is a quick Linux tip: you don't have to exit the Asterisk CLI to return to the Linux command line. If you're logging in remotely, just open a second SSH session. If you're on the Asterisk server, switch to a second console with Alt+F2. | Here is a quick Linux tip: you don't have to exit the Asterisk CLI to return to the Linux command line. If you're logging in remotely, just open a second SSH session. If you're on the Asterisk server, switch to a second console with Alt+F2. | ||
Line 84: | Line 84: | ||
allow=g726 | allow=g726 | ||
− | dundi/secret is an encryption key automatically generated by Asterisk. You may view this key by running the database show command from the Asterisk CLI. | + | <tt>dundi/secret</tt> is an encryption key automatically generated by Asterisk. You may view this key by running the <tt>database show</tt> command from the Asterisk CLI. |
− | Finally, edit extensions.conf; this is where you define what numbers to share and what to do with them. Telephone numbers must follow this format: | + | Finally, edit <tt>extensions.conf</tt>; this is where you define what numbers to share and what to do with them. Telephone numbers must follow this format: |
− | country_code area_code prefix number | + | country_code area_code prefix number |
− | This is a simple example that answers incoming calls, directs them via the SIP protocol to extension 200, which is the digital assistant, sends the caller to voicemail if there is no answer, then hangs up. | + | This is a simple example that answers incoming calls, directs them via the ''SIP'' protocol to extension ''200'', which is the digital assistant, sends the caller to voicemail if there is no answer, then hangs up. |
[dundi-priv-local] | [dundi-priv-local] |
Revision as of 12:53, 10 February 2007
Configuring DUNDi
(Source)
Warm up your favorite text editor, because we're going to edit three Asterisk configuration files. The three files are dundi.conf, iax.conf, and extensions.conf. These are in /etc/asterisk/ on Asterisk@Home. dundi.conf controls peer authentication, iax.conf is our transport protocol, and extensions.conf contains your dialplans.
This example connects two peers, MyHost and OtherHost.
First edit iax.conf. Add the following lines, except for any that are duplicated in the [general] section:
[dundi] type=user dbsecret=dundi/secret context=dundi-local disallow=all allow=ulaw allow=alaw allow=g726
Now edit dundi.conf. The default file is well commented and has lots of examples--you'll find definitions of all the directives in there. This is where your mapping contexts are defined, which follow this format:
dundi_context => local_context,weight,technology,destination,[options]
The following configuration creates two DUNDi mapping contexts:
[general] ;put your own information here department=Boss's office organization=Alrac, Inc. locality=Portland stateprov=OR country=US email=hrh@alrac.com phone=15035551212 ; bindaddr=0.0.0.0 port=4520 ; ;use the server's MAC address for the entityid entityid=11.22.33.44.55.66 cachetime=3600 ttl=32 autokill=yes secretpath=dundi ; [mappings] ;copy this as shown, substituting your own server and hostname ;this should be one long unbroken line dundi-peer1 => dundi-priv-local,0,IAX2,dundi:${SECRET}@myhost.mynet.com ${NUMBER},nounsolicited,nocomunsolicit,nopartial ;our OtherHost peer is configured here ;and is allowed access only to dundi-peer1 [aa:bb:cc:dd:ee:ff] ;MAC address of otherhost.elsewhere.com model = symmetric host = otherhost.elsewhere.com inkey = otherhost.elsewhere.com outkey = myhost.mynet.com include = dundi-peer1 permit = dundi-peer1 qualify = yes dynamic=yes
You need to create RSA authentication keys for your server. You may name them anything you want; a good naming convention is to use your server's fully-qualified domain name. Create keys with these commands:
# cd /var/lib/asterisk/keys # /usr/sbin/astgenkey -n myhost.mynet.com
This creates two keys: myhost.mynet.com.pub and myhost.mynet.com.key. The public key, myhost.mynet.com.pub, must be distributed to all servers you are peering with. Post it on your Web site if you like. The private key is unencrypted, and like all private encryption keys must be guarded carefully. Then the res_crypto.so line interface:
# asterisk -r asterisk1*CLI># reload res_crypto.so asterisk1*CLI># reload pbx_dundi.so
From here you can also run the command show keys to see all of your RSA keys. Now go back to iax.conf and add the dundi user.
Here is a quick Linux tip: you don't have to exit the Asterisk CLI to return to the Linux command line. If you're logging in remotely, just open a second SSH session. If you're on the Asterisk server, switch to a second console with Alt+F2.
This allows remote access to your server:
[dundi] type=user dbsecret=dundi/secret context=dundi-priv-local disallow=all allow=ulaw allow=g726
dundi/secret is an encryption key automatically generated by Asterisk. You may view this key by running the database show command from the Asterisk CLI.
Finally, edit extensions.conf; this is where you define what numbers to share and what to do with them. Telephone numbers must follow this format:
country_code area_code prefix number
This is a simple example that answers incoming calls, directs them via the SIP protocol to extension 200, which is the digital assistant, sends the caller to voicemail if there is no answer, then hangs up.
[dundi-priv-local] exten => 15035551212,1,Answer( ) exten => 15035551212,n(call),Dial(SIP/200) exten => 15035551212,n,Voicemail(u200) exten => 15035551212,n,Hangup( )
Alternatives to DUNDi
You can also try the TDMoE zaptel driver. This is similar to the ztdummy driver in some ways but it will link 2 or more PBX's on the same physical network with zap channels. So on a 100Mb ethernet interface you could potentially get the equivalent of about 50 PRI lines. Overkill maybe, but you can set the number of channels you want. This should be good for interconnecting a voicemail only Trixbox with another tribox handling the calls. In larger installs this would be useful as it offloads the voicemail agi scripts and transcoding to another box. TDMoE is also much simpler to configure in comparison to DUNDI.
you get many of the same features as you do with normal zap channels. It is also very efficient on bandwidth and cpu.
DUNDI is a good solution for remote PBX's. (Source)