Sunday, April 29, 2007

------------------------------------------------------ Update: 28/7/2007 Updated with new screen shots, instructions for using Exchange UM for Voicemail and for more appropriately enabling two way communication between Exchange, sipX and Asterisk

Update: 4/10/2007 Changed SIP type definition in extensions from 'friend' to 'peer' to allow Play on Phone to work correctly ------------------------------------------------------

Initial Configuration

Start your Trixbox VMWare virtual machine. Log in as root, with the password trixbox (or password for an older Trixbox 2.0 VM) and change the root password by typing passwd at the command line. Remember this password, as you will not be able to log into the server without it. Unlike with the sipX server, you are not prompted to configure the network card at system start up. Instead, you will need to type netconfig at the command line. When prompted if you want to setup networking, choose Yes and assign a manual IP address to this PC.

You should now check for operating system and package updates by typing the following at the command line.

yum –y update

This may take some time depending on how many updates are needed. There are significantly fewer packages in this distribution, and the update process should only take a few minutes. Once the packages have been updated, restart the server using the following command:

reboot

After the server reboots, open your browser and navigate to the Trixbox server i.e http://asterisk.lithnet.local. You should now see the screen below

To get into administrative mode, click switch up in the top right corner. Enter the username maint and the password password when prompted.

Configuring Voicemail

The first thing you will want to do is configure Trixbox to use Exchange UM for voicemail, rather than its internal systems. To do this we need to install the voicemail module.

Once you have logged into the admin mode, click Asterisk in the top menu bar, and then click on FreePBX. Click Tools on the top menu of FreePBX, then on the left hand side, click Module Admin. Scroll down to the Basic section, and click on Voicemail. Select Install as the action, and press the Process button at the bottom of the screen. When the module has installed, click Setup at the top of the FreePBX menu to return to the main configuration screen.

Now we need to modify the Asterisk configuration file extensions.conf, and we can do this from the Trixbox Admin mode web page by clicking Asterix then Config Edit, followed by extensions.conf on the left hand side.

Locate the [macro-exten-vm] section and comment out the line:

exten => s,n,Macro(vm,${VMBOX},${DIALSTATUS})

so that it reads:

;exten => s,n,Macro(vm,${VMBOX},${DIALSTATUS})

Beneath the newly commented-out line, add the following two lines, replacing 222 and sipx.lithnet.local with the Exchange Subscriber Access number and your sipX FQDN respectively (note the following text has wrapped because of my blog's template, but it should be all on one line in your config file):

Thanks to James Brooks for providing us with these voicemail configuration steps.

Configure the sipX Trunk

When talking about telephony, a trunk is basically a connection between two separate systems. In a traditional PBX, a trunk line is an external line to the PSTN, and an extension is an internal line to a handset. Trunks can be one way, or bidirectional. We need to configure a trunk for each connection we make to another system. In this guide, we will configure a trunk to the sipX system, as well as a trunk to our VoIP provider. Once we have our trunks setup and in place, we can then create routes, which tell the IP-PBX which trunk to use for various types of calls.

Once you have logged into the admin mode, click Asterisk in the top menu bar, and then click on FreePBX. In the FreePBX screen, click Setup in the top menu bar, followed by Trunks on the left hand side. The right hand side has a list of the trunks configured on the system. Click Add SIP Trunk. Enter the details shown below.

Please note that while we are leaving the 'incoming settings' section blank, setting the value 'type=peer' above, allows the trunk to be used for both incoming and outgoing calls.

There is a default trunk ZAP/g0 that we do not need. Click on ZAP/g0, and click Delete Trunk g0 on the next screen

Note that after every change you make to the Asterisk configuration, a red box will appear at the top that you click to Apply Configuration Changes. Before testing any call to Asterisk, please make sure you press this button. You don't have to press it after every single change, but the changes you made since you last 'Applied Changes' won't take effect until you do. I'm not going to tell you every time you make a change to press this, so I'll leave it up to you to do this as appropriate.

Configure the sipX Outbound Route

Now we have our trunk (connection) to the sipX server setup, we need to tell Asterisk what type of calls it should forward to it. We do this by means of an outbound route. On the left hand menu, click Outbound Routes, followed by Add Route on the right of the screen. Enter the following information

TypesipXRoute for the Route Name Leave Route Password blank Leave Emergency Dialing unticked Leave Intra company route unticked In the Dial Patterns box, type [2-3]XX, which tells Asterisk to use this route for any 3 digit numbers starting with 2 or 3. Select SIP/sipXTrunk in the first Trunk Sequence drop down box. Click Submit Changes, and we are done.

Add an Extension

Now we create the extension we will use. On the left hand menu, click Extensions, then select Generic SIP Device and click Submit. Enter the following information.

Configure X-Lite to log onto the Asterisk server

Now that Asterisk is configured, we can change X-Lite to log onto the Asterisk server, and test the new routes we configured. At the top of the X-Lite screen, there are 3 buttons. The left button shows a drop down menu, which gives us the SIP Account settings option. Press the Properties button, and change the username to 400, and enter the password you entered above. Change the domain to asterisk.lithnet.local, and ensure the option to Register with domain and receive incoming calls is selected.

Press OK when done, and return to the main screen. The phone will now register with the Asterisk server, and be ready to make and receive calls. Make a test call to the OVA number (222) to make sure the routing works fine. When you have confirmed that is working, call the Auto Attendant, and when asked who you wish to contact, say your name. The Auto Attendant will then transfer your call to your extension, and X-Lite should start ringing on Line 2.

Trix can handle sip too..wouldn't using Sipx simply be complicating things? Just make an extension on the Trxibox for the Xlite - and a siptrunk to for the zap - then point UM at it?Am I missing something here?

Can you have voicemail just for a certain number of users to be forward to exchange or is it a all or nothing? We like to migrate users but some still like asterisk mainly for access to light up the light on the phones when user gets a voicemail.

Short answer: Not using trixbox as it stands. We have to hack it to make it use an external email system rather than its internal systems.

Long Answer: Its possible to do. You would need to configure a different voicemail macro for both groups of users. I dont think freepbx would like it very much, and you would need some asterisk experts to be able to do it.

HelloFirst I would say thanks a lot for this great integration notes. I have one question. If I use the follow me option on the trixbox, I still get in to the tb voicemail and not to the um. Any idea? Thanks Yves

We have two asterisk servers in a same LAN , we can able to make calls using both the asterisk servers individually . But we need to communicate between two asterisk servers and to make call to the number exist in the another server. i.e. if Server A has number 1111 and server B has number 2222, i have to make call from 1111 to 2222 .I have searched online for several times and tried the options given , but nothing seems to be working. Please guide me in this issue

when i test with 300 client on sipx everything works 222, 299, missed call no problem but when i use 400 on asterisk i can register and dial the 222 i get call established but i cannot hear anything same with 299, but when i go into owa and use play on phone and but the 400 extension on the asterisk i receive the call and hear the exchange.

the problem is i cannot dial to the exchange from asterisk but exchange can dial the extensions on asterisk.

I finally was able to connect the trixbox to my voip provider and to the exchange.

When i call from an internal extension to the exchange and wait i am redirected to the voicemail and can leave my message but when i call from an pstn number i also get redirected but after 1 sec i get disconected , but i see in outlook the missed call.

It's hard to say without a SIP capture, but it could be a reinvite problem. Ensure canreinvite=no is set in the trunk connected to the provider, and make sure compatible voice codecs are used (alaw and ulaw are pretty safe)