Difference between revisions of "MOR and Trixbox"
(16 intermediate revisions by 2 users not shown) | |||
Line 1: | Line 1: | ||
MOR and Trixbox (FreePBX) can't work nicely on the same server, because they use same Asterisk .conf files, which makes a lot of mess. | |||
In order to integrate Trixbox with MOR you need to connect in following way: | In order to integrate Trixbox with MOR you need to connect in the following way: | ||
Line 9: | Line 9: | ||
=Connection diagram= | =Connection diagram= | ||
As an example we will configure one phone dialing. | As an example, we will configure one phone dialing. The phone is connected to Trixbox, which is connected to MOR: | ||
Line 15: | Line 15: | ||
Here for simplicity all devices are in same LAN: | Here, for simplicity, all the devices are in the same LAN: | ||
* MOR server has IP: '''10.10.1.10''' | * MOR server has IP: '''10.10.1.10'''. | ||
* Trixbox: '''10.10.1.20''' | * Trixbox: '''10.10.1.20'''. | ||
* Phone: '''10.10.1.30''' | * Phone: '''10.10.1.30'''. | ||
MOR and Trixbox are connected with following settings: | MOR and Trixbox are connected with the following settings: | ||
* username: '''mor_trixbox''' | * username: '''mor_trixbox'''. | ||
* password: '''mor_trixbox_psw''' | * password: '''mor_trixbox_psw'''. | ||
The phone to Trixbox is connected with: | |||
* username: '''201''' | * username: '''201'''. | ||
* password: '''201psw''' | * password: '''201psw'''. | ||
<br> | <br> | ||
=Dialing from phone to MOR= | =Dialing from the phone to MOR= | ||
Line 39: | Line 39: | ||
* Here device makes call to example destination 9999999999. | * Here the device makes a call to example destination 9999999999. | ||
* When call reaches Trixbox correct CallerID number for this phone is applied. In our example it is 1111111111. Then call is forwarded to MOR. | * When the call reaches Trixbox, the correct CallerID number for this phone is applied. In our example it is 1111111111. Then the call is forwarded to MOR. | ||
* When MOR gets | * When MOR gets the call, it sees that the call was sent by Trixbox. | ||
* | * MOR sees that Trixbox is Trunk with ANI. This means that MOR needs to check the CallerID of the call to find the real caller. | ||
* MOR checks for CallerID number (1111111111) and sees that this CallerID is assigned to phone device. | * MOR checks for the CallerID number (1111111111) and sees that this CallerID is assigned to a phone device. | ||
* | * MOR retrieves all info (LCR/Tariff/Rates/Providers/etc) that is necessary to send the call further. | ||
* When call is finished | * When the call is finished, it is logged in MOR, not for Trixbox, but for the phone's user/device. That is what we wanted from our configuration. | ||
<br> | <br> | ||
Line 51: | Line 51: | ||
==Trixbox configuration for phone== | ==Trixbox configuration for phone== | ||
Let's connect a phone to Trixbox. In FreePBX, create an extension for phone 201: | |||
[[Image:trixbox8.png]] | [[Image:trixbox8.png]] | ||
The most important details are: | |||
[[Image:trixbox9.png]] | [[Image:trixbox9.png]] | ||
Here we set CallerID number | Here we set the CallerID number that should be applied to the call from this device. The password and dial string are also here. | ||
Line 71: | Line 71: | ||
[[Image:trixbox10.png]] | [[Image:trixbox10.png]] | ||
Define | Define a route in Trixbox to use this Trunk (this is just an example): | ||
[[Image:trixbox11.png]] | [[Image:trixbox11.png]] | ||
Line 80: | Line 80: | ||
==Trixbox Trunk Troubleshooting== | ==Trixbox Trunk Troubleshooting== | ||
When passing multiple CallerIDs from multiple extensions in TrixBox through a single ANI-enabled trunk to MOR, | When passing multiple CallerIDs from multiple extensions in TrixBox through a single ANI-enabled trunk to MOR, be sure to define the outbound TrixBox PEER CallerID as empty, using '''callerid="" <>'''. | ||
If you don't include this, your MOR trunk will publish whichever CallerID was last passed to it. This will not allow you to correctly track different users' | If you don't include this, your MOR trunk will publish whichever CallerID was last passed to it. This will not allow you to correctly track different users' CallerIDs in MOR to provide them with separate call cost tracking. | ||
Also, be sure NOT to define the inbound USER | Also, be sure NOT to define the inbound USER CallerID on the same TrixBox trunk as the same empty entry. If you do, the CallerID will be stripped from all incoming calls. | ||
<br> | <br> | ||
Line 90: | Line 90: | ||
==MOR configuration for Trixbox== | ==MOR configuration for Trixbox== | ||
We need to create connection between MOR and Trixbox. In this example we will configure MOR-Trixbox connection using SIP. | We need to create a connection between MOR and Trixbox. In this example, we will configure the MOR-Trixbox connection by using SIP. | ||
We need to create user for Trixbox | We need to create a user for Trixbox: pbx_user. Put any details for it - it does not matter which: | ||
[[Image:trixbox3.png]] | [[Image:trixbox3.png]] | ||
Now we need to configure device for Trixbox: | Now we need to configure the device for Trixbox: | ||
[[Image:trixbox4.png]] | [[Image:trixbox4.png]] | ||
The main settings are: | |||
[[Image:trixbox5.png]] | [[Image:trixbox5.png]] | ||
* Mark this device as '''Trunk with ANI''' support | * Mark this device as '''Trunk with ANI''' support. | ||
* Username (by example): '''mor_trixbox''' | * Username (by example): '''mor_trixbox'''. | ||
* Password: '''mor_trixbox_psw''' | * Password: '''mor_trixbox_psw'''. | ||
* Host: '''10.10.1.20''' | * Host: '''10.10.1.20'''. | ||
* Make sure '''Dynamic?''' is unchecked and port is '''5060''' (for SIP) | * Make sure '''Dynamic?''' is unchecked and the port is '''5060''' (for SIP). | ||
<br> | <br> | ||
Line 114: | Line 114: | ||
==MOR configuration for phone== | ==MOR configuration for phone== | ||
To correctly bill phone calls you need to create separate user and device for it on MOR. | To correctly bill phone calls, you need to create a separate user and device for it on MOR. | ||
First | First, create a user for the phone (phone_user): | ||
[[Image:trixbox6.png]] | [[Image:trixbox6.png]] | ||
Make sure you configure this user correctly | Make sure you configure this user correctly by entering the password/LCR/Tariff and other necessary details. This user will be used for real dialing out. | ||
Next, create a virtual device for the phone: | |||
[[Image:trixbox7.png]] | [[Image:trixbox7.png]] | ||
The settings for this device are not at all important, but you should: | |||
# Make sure you marked this device as '''Trunk''' | |||
# Make sure you have good password for security | # Make sure you have marked this device as '''Trunk'''. This is important for receiving calls. | ||
# Make sure this | # Make sure you have a good password for security. | ||
# Make sure that this device's host = dynamic (for security reasons, you cannot enter the Trixbox IP here, because 201 is not Trixbox!) | |||
<br> | <br> | ||
Line 135: | Line 136: | ||
==CallerID for phone in MOR== | ==CallerID for phone in MOR== | ||
In order MOR to recognize device/phone we need to assign | In order for MOR to recognize a device/phone, we need to assign a CallerID to our phone's device: | ||
[[Image:trixbox12.png]] | [[Image:trixbox12.png]] | ||
NOTE: currently it is not possible to enter same | NOTE: currently it is not possible to enter a CallerID that is the same as the name of the device. That way, the call will fail. This happens because of the way Asterisk handles authentication. | ||
<br> | <br> | ||
=Dialing to phone using DID= | =Dialing to phone using DID= | ||
Line 150: | Line 149: | ||
* Here call is coming to DID | * Here a call is coming to DID 2222222222. | ||
* When it reaches MOR | * When it reaches MOR, MOR knows that 2222222222 should be forwarded to device 201. | ||
* Device 201 forwards call to Trixbox device | * Device 201 forwards the call to Trixbox device Dial (SIP/22222222222@mor_trixbox). | ||
* Trixbox receives call with destination 2222222222 | * Trixbox receives call with destination 2222222222. | ||
* Trixbox know that this call should be forwarded to phone SIP/201 | * Trixbox know that this call should be forwarded to phone SIP/201. | ||
* Phone rings | * Phone rings. | ||
* After call in MOR log call is in device's | * After the call, in the MOR log the call is in device 201's logs (CDR) - as it should be. | ||
Line 163: | Line 162: | ||
==MOR configuration== | ==MOR configuration== | ||
You need to create DID 2222222222 in MOR and assign | You need to create DID 2222222222 in MOR and assign the phone's user/device to this DID: | ||
[[Image:trixbox13.png]] | [[Image:trixbox13.png]] | ||
In this device's Call Flow, you need to forward the call to Trixbox: | |||
[[Image:trixbox14.png]] | [[Image:trixbox14.png]] | ||
Line 175: | Line 174: | ||
==Trixbox configuration== | ==Trixbox configuration== | ||
Now when call arrives in Trixbox, it should know how to route call to phone 201. | Now when the call arrives in Trixbox, it should know how to route the call to phone 201. | ||
We can configure this in | We can configure this in two ways: | ||
* Using Direct DID | * Using Direct DID. | ||
* Using Inbound Route | * Using the Inbound Route. | ||
<br> | <br> | ||
Line 198: | Line 197: | ||
==Final notes== | ==Final notes== | ||
In the example, we used DID 2222222222 and CallerID 1111111111. In real installations, these values are the same in most cases. This means that if the user is dialing out and his CallerID is (for example) 3333333333, he can receive calls by DID 3333333333. You can configure this in the same way using this manual. Different values for DID and CallerID are chosen here to make the example easier to understand. | |||
<br> | <br> | ||
=Configuring more phones= | =Configuring more phones= | ||
In order to configure more phones: | In order to configure more phones: | ||
# Connect phone to Trixbox | # Connect a phone to Trixbox. | ||
# Configure user/device in MOR for phone | # Configure user/device in MOR for the phone. | ||
# Make sure CallerID | # Make sure the phone's CallerID in Trixbox is the same as CallerID (CID) for the phone's device in MOR. | ||
# Create DID for phone on MOR, assign it to phone's device, forward | # Create a DID for the phone on MOR, assign it to the phone's device, and forward calls from the device to Trixbox in MOR. | ||
# Make sure Trixbox knows how to route | # Make sure Trixbox knows how to route calls from DID to the phone. | ||
<br> | <br> | ||
=Limitations= | =Limitations= | ||
Using this configuration to connect Trixbox (FreePBX | Using this configuration to connect Trixbox (actually, FreePBX) to MOR has some limitations: | ||
# MOR device's CallerID can't be the same as device's name | # The MOR device's CallerID can't be the same as the device's name. | ||
# Phones connected to Trixbox can't have similar CallerIDs. Actually they can | # Phones connected to Trixbox can't have similar CallerIDs. (Actually they can, but MOR will not be able to distinguish which device is making the call, so these devices with identical CallerIDs will be billed together using one account (user/device) in MOR). | ||
Line 224: | Line 225: | ||
===chan_sip.c:8373 check_auth: username mismatch, have <201>, digest has <mor_trixbox>=== | ===chan_sip.c:8373 check_auth: username mismatch, have <201>, digest has <mor_trixbox>=== | ||
This error may occur when configuring the connection between MOR and Trixbox. | |||
--note-- | --note-- | ||
This is not a connection problem. This happens when you have incorrect or no outbound | This is not a connection problem. This happens when you have an incorrect (or no) outbound CallerID set within Trixbox. Thus "201" (the display name) is being passed through to MOR. | ||
--VCCS | --VCCS |
Latest revision as of 01:34, 23 May 2010
MOR and Trixbox (FreePBX) can't work nicely on the same server, because they use same Asterisk .conf files, which makes a lot of mess.
In order to integrate Trixbox with MOR you need to connect in the following way:
Connection diagram
As an example, we will configure one phone dialing. The phone is connected to Trixbox, which is connected to MOR:
Here, for simplicity, all the devices are in the same LAN:
- MOR server has IP: 10.10.1.10.
- Trixbox: 10.10.1.20.
- Phone: 10.10.1.30.
MOR and Trixbox are connected with the following settings:
- username: mor_trixbox.
- password: mor_trixbox_psw.
The phone to Trixbox is connected with:
- username: 201.
- password: 201psw.
Dialing from the phone to MOR
- Here the device makes a call to example destination 9999999999.
- When the call reaches Trixbox, the correct CallerID number for this phone is applied. In our example it is 1111111111. Then the call is forwarded to MOR.
- When MOR gets the call, it sees that the call was sent by Trixbox.
- MOR sees that Trixbox is Trunk with ANI. This means that MOR needs to check the CallerID of the call to find the real caller.
- MOR checks for the CallerID number (1111111111) and sees that this CallerID is assigned to a phone device.
- MOR retrieves all info (LCR/Tariff/Rates/Providers/etc) that is necessary to send the call further.
- When the call is finished, it is logged in MOR, not for Trixbox, but for the phone's user/device. That is what we wanted from our configuration.
Trixbox configuration for phone
Let's connect a phone to Trixbox. In FreePBX, create an extension for phone 201:
The most important details are:
Here we set the CallerID number that should be applied to the call from this device. The password and dial string are also here.
Trixbox configuration for MOR
In Trixbox we need to define MOR as a Trunk:
Define a route in Trixbox to use this Trunk (this is just an example):
Trixbox Trunk Troubleshooting
When passing multiple CallerIDs from multiple extensions in TrixBox through a single ANI-enabled trunk to MOR, be sure to define the outbound TrixBox PEER CallerID as empty, using callerid="" <>.
If you don't include this, your MOR trunk will publish whichever CallerID was last passed to it. This will not allow you to correctly track different users' CallerIDs in MOR to provide them with separate call cost tracking.
Also, be sure NOT to define the inbound USER CallerID on the same TrixBox trunk as the same empty entry. If you do, the CallerID will be stripped from all incoming calls.
MOR configuration for Trixbox
We need to create a connection between MOR and Trixbox. In this example, we will configure the MOR-Trixbox connection by using SIP.
We need to create a user for Trixbox: pbx_user. Put any details for it - it does not matter which:
Now we need to configure the device for Trixbox:
The main settings are:
- Mark this device as Trunk with ANI support.
- Username (by example): mor_trixbox.
- Password: mor_trixbox_psw.
- Host: 10.10.1.20.
- Make sure Dynamic? is unchecked and the port is 5060 (for SIP).
MOR configuration for phone
To correctly bill phone calls, you need to create a separate user and device for it on MOR.
First, create a user for the phone (phone_user):
Make sure you configure this user correctly by entering the password/LCR/Tariff and other necessary details. This user will be used for real dialing out.
Next, create a virtual device for the phone:
The settings for this device are not at all important, but you should:
- Make sure you have marked this device as Trunk. This is important for receiving calls.
- Make sure you have a good password for security.
- Make sure that this device's host = dynamic (for security reasons, you cannot enter the Trixbox IP here, because 201 is not Trixbox!)
CallerID for phone in MOR
In order for MOR to recognize a device/phone, we need to assign a CallerID to our phone's device:
NOTE: currently it is not possible to enter a CallerID that is the same as the name of the device. That way, the call will fail. This happens because of the way Asterisk handles authentication.
Dialing to phone using DID
- Here a call is coming to DID 2222222222.
- When it reaches MOR, MOR knows that 2222222222 should be forwarded to device 201.
- Device 201 forwards the call to Trixbox device Dial (SIP/22222222222@mor_trixbox).
- Trixbox receives call with destination 2222222222.
- Trixbox know that this call should be forwarded to phone SIP/201.
- Phone rings.
- After the call, in the MOR log the call is in device 201's logs (CDR) - as it should be.
MOR configuration
You need to create DID 2222222222 in MOR and assign the phone's user/device to this DID:
In this device's Call Flow, you need to forward the call to Trixbox:
Trixbox configuration
Now when the call arrives in Trixbox, it should know how to route the call to phone 201.
We can configure this in two ways:
- Using Direct DID.
- Using the Inbound Route.
Direct DID configuration
Inbound Route configuration
Final notes
In the example, we used DID 2222222222 and CallerID 1111111111. In real installations, these values are the same in most cases. This means that if the user is dialing out and his CallerID is (for example) 3333333333, he can receive calls by DID 3333333333. You can configure this in the same way using this manual. Different values for DID and CallerID are chosen here to make the example easier to understand.
Configuring more phones
In order to configure more phones:
- Connect a phone to Trixbox.
- Configure user/device in MOR for the phone.
- Make sure the phone's CallerID in Trixbox is the same as CallerID (CID) for the phone's device in MOR.
- Create a DID for the phone on MOR, assign it to the phone's device, and forward calls from the device to Trixbox in MOR.
- Make sure Trixbox knows how to route calls from DID to the phone.
Limitations
Using this configuration to connect Trixbox (actually, FreePBX) to MOR has some limitations:
- The MOR device's CallerID can't be the same as the device's name.
- Phones connected to Trixbox can't have similar CallerIDs. (Actually they can, but MOR will not be able to distinguish which device is making the call, so these devices with identical CallerIDs will be billed together using one account (user/device) in MOR).
Errors
chan_sip.c:8373 check_auth: username mismatch, have <201>, digest has <mor_trixbox>
This error may occur when configuring the connection between MOR and Trixbox.
--note--
This is not a connection problem. This happens when you have an incorrect (or no) outbound CallerID set within Trixbox. Thus "201" (the display name) is being passed through to MOR.
--VCCS