Versions Compared

Key

  • This line was added.
  • This line was removed.
  • Formatting was changed.
Comment: Migrated to Confluence 5.3

...

No Format
Media:
Communicator 2007 <-SRTP-> OCS <-SRTP-> OCS med serv <------------RTP----------> Asterisk <-> PSTN

This recipe needs one bug to be resolved concerning RTP flowing from Asterisk to the Mediation server. Solution coming soon.

Prerequisites

  • Linux machine with Asterisk, a number plan and PSTN connectivity
  • Linux machine with OpenSER 1.2.1 or higher http://www.openser.org/mos/view/Download/
  • Microsoft Office Communications Server 2007 core installation
  • Windows 2003 machine to install OCS Mediation Server 

...

The dialog opens in the 'Localization Profiles' tab.
Edit the default location profile or add a new one and edit the profile, so you can add a localization rule. !OCS Normalization rule!

Image Added

Add a normalization rule

Within the localization rule, add a normalization rule. The rule translates numbers dialed by users to a standard format. Here we always translate to E.164 format, namely

No Format
+<countrycode><area code><subscriber number>

...

Fortunately, the Microsoft Communicator translates numbers automatically to this format, leaving out the +, (), spaces and dashes, even when starting a call from Microsoft Outlook. However, we have to add at least one rule. The normalization rule is written in .net regular expression format. See http://www.regular-expressions.info/tutorial.html for more explanation of regular expressions. In our case, we translate any number starting with a zero to a Dutch number:

No Format
\^0(\d*)$       ->       \+31$1


It basically means that for any new translation (^) of a number that starts with a 0 and then containing any number of digits \d* it should take the part of the number between brackets () and use it as variable in the translation. The translation adds +31 to it.
THE '+' SIGN IS ABSOLUTELY CRUCIAL!!!!! Don't forget to put it there! Please double check whether it's in the config! Don't say we didn't warn!

Add phone usages and policies

When you're done with the 'Localization Profiles' tab you can add 'phone usages' in the 'voice properties' dialog, which are useful for assigning to users and logging these types of use. Be sure to also create at least one Policy in the Policy tab. A collection of phone usages form a 'policy', and a user will later on be assigned a policy. This way, you can discern which users are allowed what type of calls (for instance disallow service numbers).

Add a Route

Most important, however, is to Finally add a 'route' under the 'routes' tab.
Here is defined that for numbers matching a certain regular expression, the call should be routed to our mediation server. The regular expression states in this case that any number should be forwarded:

No Format
\^(\d*)$

Part of the route definition are the phone usages that are allowed for this route. A collection of phone usages form a 'policy', and a user will later on be assigned a policy. This way, you can discern which users are allowed what type of calls (for instance disallow service numbers).


See the Microsoft 'OCS_VoIp_Guide' document for further reference.

...

In the 'Communications Tab' choose 'additional options' -> Configure,
and in the new dialog select 'Enable Enterprise Voice'.: Image Added
Fill in the line URI. which can be of the form

...

Configure the Medation Server as follows:

  Image Added

Next Hop:
Gateway Listening IP address: the external IP address of the Mediation Server

...

Gateway IP addres:
<your OpenSER IP address>

Phone usages: 'PSTN out'Image Added

Configuration of OpenSER

Edit your openser.cfg as follows or download openser.cfg for your convenience:

Code Block
# lower debug level for debugging purposes: 
debug=5
log_stderror = no
fork=yes
children=4alias4
alias=<your OpenSER proxy FQDN>listenFQDN>
listen=udp:<your OpenSER proxy IP address>:5060
listen=tcp:<your OpenSER proxy IP address>:5060check5060
check_via=no
dns=no
rev_dns=nompath="/usr/local/lib/openser/modules/"
loadmodule "sl.so"
loadmodule "tm.so"
loadmodule "maxfwd.so"
loadmodule "uri.so"
loadmodule "uac.so"
modparam("uac","from_restore_mode","auto")
loadmodule "textops.so"
loadmodule "rr.so"
modparam("rr", "enable_full_lr", 1)
modparam("rr", "enable_double_rr",0)
loadmodule "mi_fifo.so"
modparam("mi_fifo", "fifo_name", "/tmp/openser_fifo")
loadmodule "xlog.so"
modparam("xlog", "buf_size", 4096)
modparam("xlog", "force_color", 1)

route {
if (mf_process_maxfwd_header("10")) {
	sl_send_reply("483","Too Many Hops");
	exit;
};
if (msg:len >= 2048 )  {
	sl_send_reply("513", "Message too big");
	exit;
};
 
if (loose_route()) {
	append_hf("P-hint: rr-enforced\r\n");
	route(1);
};
 
if (!uri==myself) {
	append_hf("P-hint: outbound\r\n");
	route(1);
};

route(1);
}
 
route[1] {
	# If coming from OCS
	if (src_ip==<your OCS Mediation Server IP address>)
		{ if (method=="INVITE|BYE") {
			xlog("L_INFO", "*** invite from OCS M=$rm RURI=$ru F=$fu T=$tu IP=$si ID=$ci\n");
		}
		t_relay("udp:<your Asterisk Server IP Address>:5060");
	}
	# else coming from Asterisk
	else {
		t_relay("tcp:<your Asterisk Server IP Address>:5060");
	};
	exit;
}

...