My Demo environment – Part 2 OCS 2007 and Mediation Server

Firstly when I started writing this I did not think it would be so long – it is only now that I have finished it I realised – Anyway hopefully it will be of use –

In Part one I installed 2007 and got UM working with my Audiocodes box, fine but I now want to integrate OCS into the mix so that I can do IM/Presence/Voice and Video.

I am not going to spend anytime on explaining the OCS install – the wizard is excellent and will if you take time to follow it you will have no problems. 

This post is more about the mediation server, this is the OCS server role that provides the link between your OCS environment and traditional telephony. My “traditional telephony will be provided by the Audiocodes mp114 (this doubles as a traditional pbx and a Basic Gateway).

My OCS 2007 set up is a Standard Edition Server with 5 users on it, They have the ability to IM Voice and Video, if this is all working OK then carry on, if not get this piece working first.

Mediation Server needs to be on a separate server, it needs two network cards for to OCS and to gateway connections. I run this all on a VPC and it works fine.

Installing, Activating and Configuring the Mediation Server

The three main steps are Install, Activate and Configure. The first two are just following the wizard. Configuring is straight forward, you just need the data.

In OCS MC go to Mediation Server and open up the properties. This is what you will seeGeneral

Leave AV edge to none and you will not have a Default location profile yet.

The Next tab is like this


The first box is the the OCS server and the second is the IP address of the AudioGateway

Certificates for the Mediation Server

The last step for configuration is to get a certificate for the Mediation Server. Logon to the certsrv – https://servername/cerv


Download a CA certificate chain or CRL


Download CA Certificate

Then just save as a p7b file


Ok so once you have this all you need to do is go and run the Mediation server wizard and firstly Configure Certificate and import the p7b file. Once done rerun the wizard and configure cert option. Once in the wizard chose create a new certificate and follow the instruction. The only word of warning is to make sure the the subject name is the fqdn of the mediation server. Assign this cert and your done for certs

Restart the OCS Mediation server service for good measure.

Configuring the Audiocodes MP114

So I have added my ini file here from my mp114 – The numbers I use are all 4 digit, so if I dial 2003 from a traditional phone attached to my mp114 it will submit 441xxxxx2003 to the mediation server and onwards – remember OCS only deals in E164 formatted numbers.

You can configure this all in the GUI of audiocodes – but if I started taking screen shots of this then the post would be even longer than it is 

;** Ini File **

;Board: MP-114 FXS_FXO
;Serial Number: 850373
;Slot Number: 1
;Software Version: 5.00A.035.003
;DSP Software Version: 204IM => 209.16
;Board IP Address:
;Board Subnet Mask:
;Board Default Gateway:
;Ram size: 32M   Flash size: 8M
;Num DSPs: 1  Num DSP channels: 4
;Profile: NONE

[SYSTEM Params]

SyslogServerIP =

[BSP Params]

PCMLawSelect = 3
EnableDetectRemoteMACChange = 2
RoutingTableHopsCountColumn = 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0

[ATM Params]

[Analog Params]

FXSLoopCharacteristicsFilename = ‘MP11x-02-1-FXS_16KHZ.dat’

[ControlProtocols Params]

[MGCP Params]

[MEGACO Params]

EP_Num_0 = 0
EP_Num_1 = 1
EP_Num_2 = 0
EP_Num_3 = 0
EP_Num_4 = 0

[PSTN Params]

[SS7 Params]

[Voice Engine Params]

ECNLPMode = 1
BrokenConnectionEventTimeout = 3
RFC2833PayloadType = 101
CallProgressTonesFilename = ‘usa_tones_12.dat’

[WEB Params]

LogoWidth = ‘339’

[SIP Params]

CODERNAME = g711Alaw64k,20,0,$$,0

These are the analog phone numbers – replace the x’s with your area code and number omitting the zero, eg 118 999, the ip address is the gateway

PREFIX = +441189992001,,*,0,255

PREFIX = +441189992002,,*,0,255

Below id the numbers in OCS – all my extension numbers start in 2, replace the x’s as before – the IP  address is the Mediation server

PREFIX = +441189992,,*,0,255
PREFIX = *,,*,0,255

The info below is how I manipulate the numbers – so if some dials 2xxx on the analog phone the gateway turns is into +44xxxxxx2xxx – where the x correspond to numbers so that the mediation server recognises them, likewise the reverse is true so if an OC client calls an analog phone we strip of the +44 and present a number that the phone understands

SOURCENUMBERMAPIP2TEL = +1,2,$$,$$,$$,$$, *,$$,*
SOURCENUMBERMAPTEL2IP = PSTN_Line,0,$$,$$,$$,$$,*,$$,*
SOURCENUMBERMAPTEL2IP = *,0,+44,$$,$$,$$,*,$$,*
NUMBERMAPIP2TEL = +441189992001,3,$$,$$,$$,$$,*,$$,*
NUMBERMAPIP2TEL = +441189992002,3,$$,$$,$$,$$,*,$$,*
NUMBERMAPIP2TEL = +442001,3,118999,$$,$$,$$,*,$$,*
NUMBERMAPIP2TEL = +442002,3,118999,$$,$$,$$,*,$$,*
NUMBERMAPIP2TEL = +1,9,$$,$$,$$,$$,*,$$,*
NUMBERMAPTEL2IP = 2003,0,+44118999,$$,$$,$$,*,$$, +1
NUMBERMAPTEL2IP = 2004,0,+44118999,$$,$$,$$,*,$$,*
NUMBERMAPTEL2IP = 2000,0,+44118999,$$,$$,$$,*,$$,*
NUMBERMAPTEL2IP = 2005,0,+44118999,$$,$$,$$,*,$$,*
NUMBERMAPTEL2IP = *,0,+1,$$,$$,$$,*,$$,*
PSTNPREFIX = 1189992001,0,*,*,0
PSTNPREFIX = 1189992002,0,*,*,0
PSTNPREFIX = *,2,*,*,0
TARGETOFCHANNEL2 = 1189992003,1
TARGETOFCHANNEL3 = 1189992004,1
TRUNKGROUP = 1-1,1189992001,0
TRUNKGROUP = 2-2,1189992002,0
TRUNKGROUP_2 = 3-3,PSTN_Line_1,0
TRUNKGROUP_2 = 4-4,PSTN_Line_2,0


So one last step

Configure the dialing an routing

As I have mentioned before OCS needs e164 formatted numbers, therefore you need to do some work to ensure that the numbers are presented in this way. You could always tell users that whenever they need to ring someone outside of the org they have to ring +44xxxxxxxxxx. Not sure it would go down to well – 4 digits work for me so I have configured my demo to use 4 digits and I have set up rules to normalise them to E164 format.

For example if I need to ring the phone ext 2001 I dial that but the number will be normalised to +441189992001

The first place to do this is in the Voice Properties – right click the forest to get to these.

You need to create a location profile – click add, give it a name (ensure this is the fqdn of your domain)and then create a normalisation rule

I want a 4 digit extn to be presented as an e164 number

All my extensions start with 2

In the Phone Pattern regular Expression type

^2(\d{3})$ this is looking for any number starting in 2 and then taking the next 3 digits

In the Translation pattern regular expression type


This in effect takes the 3 digits and appends them on the end of the full number.

You can test if your translation and normalisation are correct by testing it in the Test Translation box.

The only other tab I changed was the Routes tab 

This is quite explanatory – the target regular expression is .*



Last thing to do is go back to the props of the mediation server and add the location profile that you have just created.

So this should now all work – call routed in and out.

If you do have issues then there is a great utility in the reskit called Enterprise Voice route helper”  The reskit can be found here

Comments (2)

  1. Anonymous says:

    i’m sorry. i’m newbie.. i’m installin ocs 2007 in my enviromente for testing but i’cant read your part 1..

    can you help me?