OCS 2007 R2 co-existing scenario with Asterisk 1.8 PBX

The Microsoft Office Communications Server (OCS) is able to provide for calls to and from the public switched telephone network (PSTN). There are many solutions existing with the telephony integration and one of them is the co-existing scenario. The co-existing scenario consists a Private Branch Exchange (PBX), and the OCS at the same time. It means that a user reachable on PBX phone or OCS or both of them.

I built my environment with Asterisk PBX which connects to the OCS system via Direct SIP. When the Microsoft Unified Communications arrived with Exchange UM, the problem was in the transport layer. The Asterisk used UDP, and the Microsoft used TCP for SIP. I needed a little trick to connect Exchange with Asterisk – converted SIP UDP to SIP TCP. Asterisk has supported TCP SIP since 1.6, so the problem no longer exists. The OCS also uses TCP SIP (and TLS of course). In my previous post you could read about the Asterisk PBX installation on Ubuntu Server, and I enabled the TCP SIP in the configuration file.

My environment consists the following servers:

  • DC, containing the ADDS, ADCS, and the DNS roles
  • OCS, containing an OCS 2007 R2 Standard Edition Pool
  • Mediation, containing the OCS 2007 R2 Mediation Server
  • PBX, a soft PBX on Ubuntu 10.10 with Asterisk 1.8.3.2

The telephony side consist two phone number ranges. The 1XXX located on the PBX, and the 2XXX located on the OCS side.

The domain contains two test users, User One and User Two. User One has two phone numbers, 1001 on the PBX, 2001 on the OCS. User Two has 1002 on the PBX, and 2002 on the OCS.

Let me show you how to configure your environment.

Asterisk configuration

We need to configure two files on the Asterisk, the sip.conf, and the extensions.conf

Here is my sip.conf file:

 
[general]
context = default 
bindport = 5060 
bindaddr = 0.0.0.0 
tcpbindaddr = 0.0.0.0 
tcpenable = yes 

[OCS_SIP_TRUNK] 
type = peer 
host = 192.168.73.95 
qualify = yes 
transport = tcp 

[1001] 
type = friend 
callerid = User One 
secret = 1001 
host = dynamic 
canreinvite = no 
dtmfmode = rfc2833 
mailbox = 1001 
disallow = all 
allow = ulaw 
transport = udp 

[1002] 
type = friend 
callerid = User Two 
secret = 1002 
host = dynamic 
canreinvite = no 
dtmfmode = rfc2833 
mailbox = 1002 
disallow = all 
allow = ulaw 
transport = udp 

This config means that the Asterisk listen all IP, port 5060, and the TCP is enabled. The TCP is really important, because the Mediation Server is able to communicate in TCP and TLS. It has a TCP SIP trunk to the Mediation Server, and two extensions defined for User One and User Two.

Here is my extensions.conf file:

 
[general]
static=yes 
writeprotect=no 

[default] 
exten => _+1XXX,1,Answer() 
exten => _+1XXX,n,Set(CALLERID(num)=${CALLERID(num):1}) 
exten => _+1XXX,n,Goto(${EXTEN:1},1) 

exten => _+2XXX,1,Set(EXT=${EXTEN})
exten => _+2XXX,n,Dial(SIP/OCS_SIP_TRUNK/${EXT}) 
exten => _+2XXX,n,Busy 
exten => _100X,1,Answer() 
exten => _100X,n,Dial(SIP/${EXTEN},20,tr) 
exten => _100X,n,Hangup 

#exten => 1001,1,Answer() 
#exten => 1001,n,Dial(SIP/1001,20,tr) 
#exten => 1001,n,Hangup 

#exten => 1002,1,Answer() 
#exten => 1002,n,Dial(SIP/1002,20,tr) 
#exten => 1002,n,Hangup. 

This config means that all dialed number which begins with number 2 forwarded into the SIP trunk, and all number started with number 1 is a local extension.

I use X-Lite to connect to the soft PBX. Let’s configure the X-Lite!

If you try to call from User One to User Two, you should see this on the desktop of the User Two.

OCS configuration

We need to configure the OCS pool for voice. It needs location profile, normalization rule, and voice route defined. In the Voice Properties of the forest add a location profile, and you need to add a normalization rule inside. In my Phone Number Normalization Rule I normalize all four number contained dialed numbers, transformed to E.164 format.

My Location Profile contains only one normalization rule.

On the Routes tab, we need to configure the dialing routes. The PBX is the main exchanger in my test system, so I routed all E.164 formatted dialed numbers to the mediation server.

We also need to configure the Mediation server. Open the properties of the Mediation Server in the Computer Management. In the General tab, you need to configure the LAN configuration of the Mediation Server, and the default location profile.

In the Next Hop Connections we need to specify the OCS side and the PBX side also.

Continue the voice configuration on the OCS pool. Open the Front End Properties, and configure the location profile on the Voice tab.

If the Mediation Server is a fresh install, we need to start the service of the Mediation Server. The name of the Mediation service is RTCMEDSRV.

 
Start-Service RTMEDSRV 
Get-Service RTMEDSRV |fl 

After the Mediation Server configured, the SIP trunk is established. Let’s check the PBX side. Connect the asterisk CLI, and get all SIP peers.

 
asterisk –vvr sip show peers 

AD User configuration

We need to configure the phone number information in the AD. On the General tab, we need to add the PBX number to the Telephone number field.

We need to configure the OCS to Enterprise Voice. On the Communications tab we need to configure the Telephony settings.

Testing the Communicator Call

After you successfully log in to the Office Communicator (OC), you are able to call. You will see this on the caller side:

And this on the receiver side:

Testing the Enterprise Voice call

If you try to call from X-Lite to OC, you will see this.

It shows that the PBX extension calls.

Try to call OC to PBX.

Troubleshooting

We can troubleshoot on both sides. In the Asterisk side use the Asterisk CLI.

 
asterisk –vvvvr 

I prefer Wireshark on OCS side, because it has an useful telephony part.

You can visualize VoIP Calls with it.

Next time I will publish about the Lync Server 2010 and the Asterisk integration. C U soon!

3 thoughts on “OCS 2007 R2 co-existing scenario with Asterisk 1.8 PBX”

    1. Hi Jeff, I have no time to publish it. May I wait for requests, to allocate more timeslot for Lync related articles. 🙂

  1. Very interesting article, we have Lync now but without any PBX /Enterprise Voice features… so I hope to see another article about Lync ! 🙂

Leave a Reply

Fill in your details below or click an icon to log in:

WordPress.com Logo

You are commenting using your WordPress.com account. Log Out / Change )

Twitter picture

You are commenting using your Twitter account. Log Out / Change )

Facebook photo

You are commenting using your Facebook account. Log Out / Change )

Google+ photo

You are commenting using your Google+ account. Log Out / Change )

Connecting to %s