Asterisk With Office Communications Server 2007

Tom Keating : VoIP & Gadgets Blog
Randy Savicky
| VoIP & Gadgets blog - Latest news in VoIP & gadgets, wireless, mobile phones, reviews, & opinions

Asterisk With Office Communications Server 2007

Asterisk logoOCS 2007 logoAsterisk integration with Office Communications Server 2007 is a popular topic in the unified communications community. You wouldn't think integrating an open source Linux-based solution (Asterisk) with Microsoft's proprietary OCS 2007 UC platform would be popular, but it is. In fact, I have my ear to both the Microsoft OCS 2007 community and the Asterisk community and the integration of these two worlds is something I hear all the time. Some within the Asterisk community poo-poo the thought of integrating with Microsoft OCS 2007. Now, whether it's because of some anti-Microsoft zeal or that Asterisk "can do anything - just give the open source community time to build it" mentality, I have to respond that OCS 2007 is here to stay and is doing very well. I am aware of several Fortune 1000 companies, including security-conscious major banks, that have deployed OCS 2007.

Fortunately, not all within the Asterisk community have such blind hatred for Microsoft that they're willing to try and integrate with Microsoft OCS 2007, arguably the best UC platform on the market today. There are some features that Asterisk just doesn't have, such as a feature rich softphone client with video support. The Office Communicator client integrates presence, call control, IM, collaboration, video, and more. Here's a sample of me using it.

OCS Communicator video call

Of course, you can use X-Lite, a free SIP client, with Asterisk, but it's functionality and integration isn't as feature-rich as the whole OCS platform. Though if price is your only concern, Microsoft's OCS licensing may be too much for some.

So in any event, what's the difficulty in integrating Asterisk with OCS 2007? Well, as I have written previously, the main issue is that Asterisk uses SIP over UDP and OCS 2007 requires SIP over TCP.

There are some workarounds however. One is to install an unsupported patch onto Asterisk that adds SIP over TCP support. Personally, I'd avoid this though, since any future updates could negate the patch and potentially break the "official" Asterisk. Further, SIP over TCP isn't very common (except in OCS 2007 environments). A better alternative is to install sipX, an open-source SIP proxy which handles both SIP/TCP and SIP/UDP and acts as a gateway between Asterisk and OCS 2007. You can use OpenSER as a SIP UDP to SIP TCP gateway as well. Basically it looks like this:
Asterisk < SIP/UDP > OpenSER < SIP/TCP > OCS Mediation Server < uaCSTA:TLS|TCP > OCS Server

On a related note, pbxnsip, a Linux-based IP-PBX platform offers nice & easy integration with OCS 2007. Check out the pbxnsip with OCS 2007 wiki. You can also use the low-cost pbxnsip appliance as an inexpensive SIP UDP to SIP TCP gateway if you want and use this in conjunction with Asterisk. In fact, pbxnsip can be easily integrated OCS 2007 and with Exchange 2007 UM (Unified Messaging). Check out my full review of pbxnsip for some background on the product.

A new project (Asterisk LCS gateway) to OCS 2007 claims to offer Asterisk to OCS integration, but it seems like a work in progress.

This is strictly from the rumor-mill, but I heard that SIP over UDP support "may" be coming in the next release of OCS 2007 - rumored to be called OCS 2007 R2. That would negate the need for a TCP-to-UDP SIP gateway and allow for direct Asterisk to OCS integration. Further, Asterisk 1.6 (still beta) has SIP TCP built in - and some have successfully gotten it to work directly with OCS Mediation server. So even if Microsoft doesn't offer SIP over UDP support in the next release, it looks like Asterisk is adding SIP over TCP support.

I should mention that Asterisk lacks CSTA support and unfortunately OpenSER doesn't support it either. While CSTA isn't required for OCS 2007 to Asterisk integration, CSTA provides tighter integration and advanced features such as RCC (Remote Call Control), presence integration, and dual-forking with presence gateways. Further, CSTA provides for 3rd party CTI applications, including predictive dialers, advanced ACD, and IVRs that leverage CSTA for communicating with the PBX.

One solution I discovered that adds rudimentary CSTA capabilities to Asterisk is offered by M-Networks. Their solution, called the Unified Call Control Gateway, functions as an intermediary that allows the Microsoft Live Communications Server (LCS 2005) and Asterisk PBX to communicate. In addition to remote call control, the software provides for PC to phone calling that allows users to use their computer as a phone. While it was designed for LCS 2005, in theory the software could work on its successor, OCS 2007. Here's some of its features:
  • TCP <-> UDP SIP Proxy - Allows PC to Phone calls from Communicator 2005 without the need for additional software (ie. OpenSER)
  • SIP URI normalization - Converts sip: or tel: URI's to Asterisk extensions. Also allows for proper caller id presentation for PC to internal extension calls.
  • e.164 support - Full support for the e.164 numbering standard
Though, if I understand this product correctly it runs silently in the background as a Windows service processing CSTA requests from Office Communicator to control your Asterisk PBX. Thus, EACH desktop would have to install this software, which is a deal-breaker for me. I'd rather have a server-based software or hardware solution.

Office Communicator It's important to point out that the CSTA standard provides for 3rd party CTI applications including advanced ACDs and IVRs which uses CSTA for communicating with a PBX. This is critical in large call centers. Asterisk not providing CSTA functionality certainly isn't the death knell for providing integration with other application. Asterisk supports their AGI/Fast AGI (Asterisk Gateway Interface) which allows developers to write applications.

Further, the Asterisk Manager API adds third-party call control and can be thought of as a CSTA/TSAPI equivalent. Some Asterisk-based solutions offer TAPI-based desktop call control as well, but TAPI won't help you with OCS 2007 integration - specifically with the OCS Communicator presence/VoIP client (shown to the right).

Let's look at the routing once more:
Asterisk < SIP/UDP > OpenSER < SIP/TCP > OCS Mediation Server < uaCSTA:TLS|TCP > OCS Server

I think rather than this convoluted approach developing a CSTA-to-AMI (Asterisk Manager Interface) could offer better integration with Asterisk. Since OpenSER is not dialog stateful, you cannot send the status of the SIP clients to OCS needed for presence and other functionality. It cannot for instance know when a particular session has been terminated. Asterisk on the other hand is dialog stateful and is aware of all sessions at all times. With uaCSTA interaction between OCS 2007 and Asterisk the user-state and the VoIP-phone-state can be exchanged.The big question is will anyone in the Asterisk community write the code to do CSTA-to-AMI? Anyone?

Of course, if you must have CSTA for the advanced telephony features today, you could look into a SIP/CSTA gateway. There are several on the market. UniGone TelServer offers one. Mitel built one specifically with OCS 2007 in mind but I believe it works specifically with their IP-PBX - same goes for Nortel. I believe SIP/CSTA solutions that are "IP-PBX agnostic" are also available from Audiocodes, Dialogic, and Quintum.

I should point out that OCS actually uses uaCSTA (user agent CSTA) which refers to transporting ECMA-323 (CSTA XML) messages over a SIP session. uaCSTA leverages SIP mechanisms to provide an extensible set of features to support applications. uaCSTA can be implemented by several different types of SIP user agents, including directly by a SIP user agent on a SIP phone. uaCSTA can also be implemented by a SIP B2BUA to augment third-party call control functionality or by a proxy server that is front-ending a PBX.

I also happened across a Microsoft TechNet thread that said, "I work at a company that's developed a SIP/CSTA gateway for Asterisk and MS OCS. It's a standards compliant TR/87 gateway that uses the Manager API in Asterisk and SIP to MS OCS. It can be used for remote call control (CTI integration), location based forwarding and device monitoring." The poster is from, a company that Rich Tehrani wrote about as well as other TMCnet writers. So this is another potential SIP/CSTA solution. I sent an email to LiteScape for more info but am waiting for their reply.

Asterisk integration with OCS 2007 is happening today, but you have to jump through hoops to get it to work. Further, if you want advanced features like RCC and dual-forking, you'll need a SIP/uaCSTA gateway -- some solutions of which I previously mentioned. SIP over UDP support "may" be coming in the next release of OCS 2007 which would negate the need for a TCP-to-UDP SIP gateway and allow for direct Asterisk to OCS integration. Also, Asterisk 1.6 beta has SIP TCP built in and some have successfully gotten it to work directly with OCS Mediation server. You'll still need a SIP/uaCSTA gateway of some sort unless some entrepreneurial Asterisk guru writes a CSTA-to-AMI add-on for Asterisk.

Lastly, I'm told that pbxnsip will have uaCSTA support very shortly. Although pbxnsip isn't Asterisk, it is another open source IP-PBX solution and a very feature-rich one at that. It's very easy to integrate with OCS 2007 simply by adding a SIP trunk. The pbxnsip wiki explains the steps very well.

[Correction: I mentioned pbxnsip was open source. This was due to a conversation I had with pbxnsip about them 'potentially' making their solution open source. They are currently not open source, however, I should point out that it is developed in C++ and is therefore easily compiled to run on multiple operating systems, including Windows, Linux, etc.]

Here's a screenshot of the main step performed via the pbxnsip web admin:

OCS Mediation Trunk

Related Articles to 'Asterisk With Office Communications Server 2007'
Microsoft Live Messenger 8.5

Featured Events