Difference between revisions of "FreePBX/mISDN"

From SME Server
Jump to navigationJump to search
m (Add how-to catagory)
 
(2 intermediate revisions by one other user not shown)
Line 4: Line 4:
 
mailto:daniel@firewall-services.com
 
mailto:daniel@firewall-services.com
  
===Description===
+
===Goal===
 
The goal of this how-to is to explain how to configure an hardware card supported by the [http://www.misdn.org/index.php/Main_Page mISDN] driver, in order to use it with [[FreePBX]]
 
The goal of this how-to is to explain how to configure an hardware card supported by the [http://www.misdn.org/index.php/Main_Page mISDN] driver, in order to use it with [[FreePBX]]
  
===Installation===
 
 
{{Note box|This has only be tested with a b410P card from Digium. It should be the same for other compatible hardware}}
 
{{Note box|This has only be tested with a b410P card from Digium. It should be the same for other compatible hardware}}
====Plug your card====
+
===Plug your card===
 
Of course, the first step here is to plug your card in a free PCI slot
 
Of course, the first step here is to plug your card in a free PCI slot
====Install mISDN driver====
+
===Install mISDN driver===
 
Now you need to install the mISDN driver. You can use the following command:
 
Now you need to install the mISDN driver. You can use the following command:
  yum --enablerepo=smecontribs install misdn misdnuser misdn-kmdl-$(uname -r)
+
  yum --enablerepo=smecontribs install misdn misdnuser misdn-kmdl-$(uname -r) asterisk-misdn
 
For this to work you  may need to update your server (at least, you should have the latest kernel available)
 
For this to work you  may need to update your server (at least, you should have the latest kernel available)
====Configure the driver====
+
===Configure the driver===
 
You can check the card is recognized and supported with this command:
 
You can check the card is recognized and supported with this command:
 
  /etc/init.d/mISDN scan
 
  /etc/init.d/mISDN scan
Line 29: Line 28:
 
  ln -s /etc/rc.d/init.d/e-smith-service /etc/rc6.d/K16mISDN
 
  ln -s /etc/rc.d/init.d/e-smith-service /etc/rc6.d/K16mISDN
  
====Install the channel for asterisk====
+
===Configure the channel===
For asterisk to work with mISDN, it needs a channel (chan_misdn). For now, you need to take this package from [[ATrpms]] repository (in the future, this package should be imported in smecontribs)
 
yum --enablerepo=atrpms install asterisk-misdn
 
 
 
This may also update asterisk, it shouldn't be a problem.
 
 
 
====Configure the channel====
 
 
Now, you can configure the channel. The config file is /etc/asterisk/misdn.conf
 
Now, you can configure the channel. The config file is /etc/asterisk/misdn.conf
 
Most of the config should be OK (at least, it was for me, in France).
 
Most of the config should be OK (at least, it was for me, in France).
 
You just need to change the mISDN config file:
 
You just need to change the mISDN config file:
  sed -i -e "s/\/etc\/misdn-init.conf/\/etc\/mISDN.conf/g"
+
  sed -i -e "s/\/etc\/misdn-init.conf/\/etc\/mISDN.conf/g" /etc/asterisk/misdn.conf
  
 
You may alos want to enable echo cancellation (default is disabled). Thee configuration file is well commented.
 
You may alos want to enable echo cancellation (default is disabled). Thee configuration file is well commented.
Line 51: Line 44:
 
This will configure a group of ports (from 1 to 4). The name of this group is "trunks". Any calls comming from one of these ports will be processed from the from-trunk context (the default context for trunks in [[FreePBX]]
 
This will configure a group of ports (from 1 to 4). The name of this group is "trunks". Any calls comming from one of these ports will be processed from the from-trunk context (the default context for trunks in [[FreePBX]]
  
====Create a trunk in FreePBX====
+
===Create a trunk in FreePBX===
 
Now log into FreePBX admin interface in the server-manager, a create a new trunk, type "custom".
 
Now log into FreePBX admin interface in the server-manager, a create a new trunk, type "custom".
 
Enter the common information, like any other trunk (caller ID, max call etc...)
 
Enter the common information, like any other trunk (caller ID, max call etc...)
Line 67: Line 60:
  
 
<noinclude>[[Category:Howto]]</noinclude>
 
<noinclude>[[Category:Howto]]</noinclude>
 +
<noinclude>[[Category:Asterisk]]</noinclude>

Latest revision as of 12:27, 18 January 2010

Maintainer

Daniel B.
Firewall Services
mailto:daniel@firewall-services.com

Goal

The goal of this how-to is to explain how to configure an hardware card supported by the mISDN driver, in order to use it with FreePBX


Important.png Note:
This has only be tested with a b410P card from Digium. It should be the same for other compatible hardware


Plug your card

Of course, the first step here is to plug your card in a free PCI slot

Install mISDN driver

Now you need to install the mISDN driver. You can use the following command:

yum --enablerepo=smecontribs install misdn misdnuser misdn-kmdl-$(uname -r) asterisk-misdn

For this to work you may need to update your server (at least, you should have the latest kernel available)

Configure the driver

You can check the card is recognized and supported with this command:

/etc/init.d/mISDN scan

Now, you can generate a basic configuration with:

/etc/init.d/mISDN config

The generated config file is /etc/mISDN.conf The default will configure all available ports in te mode. This is ok if you only want to use the ports as trunks. If you want to connect an ISDN phone, you'll have to change the corresponding port to nt mode.

Now, you need to configure this driver to be loaded automatically at system boot:

db configuration set mISDN service status enabed
ln -s /etc/rc.d/init.d/e-smith-service /etc/rc7.d/S09mISDN
ln -s /etc/rc.d/init.d/e-smith-service /etc/rc6.d/K16mISDN

Configure the channel

Now, you can configure the channel. The config file is /etc/asterisk/misdn.conf Most of the config should be OK (at least, it was for me, in France). You just need to change the mISDN config file:

sed -i -e "s/\/etc\/misdn-init.conf/\/etc\/mISDN.conf/g" /etc/asterisk/misdn.conf

You may alos want to enable echo cancellation (default is disabled). Thee configuration file is well commented.

The most important part is to configure group of ports, for example:

[trunks]
ports=1,2,3,4
context=from-trunk
msns=*

This will configure a group of ports (from 1 to 4). The name of this group is "trunks". Any calls comming from one of these ports will be processed from the from-trunk context (the default context for trunks in FreePBX

Create a trunk in FreePBX

Now log into FreePBX admin interface in the server-manager, a create a new trunk, type "custom". Enter the common information, like any other trunk (caller ID, max call etc...) Then, enter the following for the dialstring:

mISDN/g:trunks/$OUTNUM$

Here, g: means we send the call to a group of ports defined earlier in /etc/asterisk/misdn.conf (in this example, we have craeted a group called trunks, with all the four ports)

You could also define a trunk per port with something like:

mISDN/1/$OUTNUM$

This would only send calls via the port number 1 of the card

Now you can configure an outbound route to use this trunk and test if it's working.