<?xml version="1.0" encoding="UTF-8"?>
<rss version="2.0"
	xmlns:content="http://purl.org/rss/1.0/modules/content/"
	xmlns:wfw="http://wellformedweb.org/CommentAPI/"
	xmlns:dc="http://purl.org/dc/elements/1.1/"
	xmlns:atom="http://www.w3.org/2005/Atom"
	xmlns:sy="http://purl.org/rss/1.0/modules/syndication/"
	xmlns:slash="http://purl.org/rss/1.0/modules/slash/"
	>

<channel>
	<title>Unified Communications by Yann Espanet &#187; SIP trunk</title>
	<atom:link href="http://blog.unifiedcommunications.eu/category/ocs-2007/sip-trunk-ocs-2007/feed/" rel="self" type="application/rss+xml" />
	<link>http://blog.unifiedcommunications.eu</link>
	<description>MS Office Communications,Lync,Exchange,VoIP,telephony</description>
	<lastBuildDate>Tue, 18 Oct 2011 10:14:04 +0000</lastBuildDate>
	<language>en</language>
	<sy:updatePeriod>hourly</sy:updatePeriod>
	<sy:updateFrequency>1</sy:updateFrequency>
	<generator>http://wordpress.org/?v=3.1.1</generator>
		<item>
		<title>Remove Plus From Request URI OCS 2007 R2 : bypass RFC 3966 compliance for OCS R2</title>
		<link>http://blog.unifiedcommunications.eu/10/remove-plus-from-request-uri-ocs-2007-r2-bypass-rfc-3966-compliance-for-ocs-r2/</link>
		<comments>http://blog.unifiedcommunications.eu/10/remove-plus-from-request-uri-ocs-2007-r2-bypass-rfc-3966-compliance-for-ocs-r2/#comments</comments>
		<pubDate>Sun, 25 Oct 2009 21:41:42 +0000</pubDate>
		<dc:creator>Yann Espanet</dc:creator>
				<category><![CDATA[Interoperability]]></category>
		<category><![CDATA[Office Communication Server]]></category>
		<category><![CDATA[SIP trunk]]></category>

		<guid isPermaLink="false">http://blog.unifiedcommunications.eu/?p=924</guid>
		<description><![CDATA[How to make OCS 2007 R2 non-RFC 3966-compliant ? Office Communications Server 2007 Mediation Server uses a plus sign (+) to prefix E.164 numbers in the Request Uniform Resource Identifier (URI) for outgoing calls. Unfortunately, some IP-PBXs don&#8217;t comply with RFC 3966 and do not accept numbers that are prefixed with a plus sign (+). [...]]]></description>
			<content:encoded><![CDATA[<p>How to make OCS 2007 R2 non-RFC 3966-compliant ?<br />
Office Communications Server 2007 Mediation Server uses a plus sign (+) to prefix E.164 numbers in the Request Uniform Resource Identifier (URI) for outgoing calls. Unfortunately, some IP-PBXs don&#8217;t comply with RFC 3966 and do not accept numbers that are prefixed with a plus sign (+).</p>
<p>In OCS 2007 R2 use a new WMI setting, RemovePlusFromRequestURI, which is described in this TechNet article called Enterprise Voice Server-Side Components.<br />
According to the TechNet article, Office Communications Server 2007 R2 introduces two new Windows Management Instrumentation (WMI) settings for Mediation Server. The first new setting specifies how Mediation Server processes E.164 numbers in outbound calls. The second new setting enables Quality of Service (QoS) marking on Mediation Server.</p>
<p>Handling E.164 Numbers in Outbound Calls (OCS 2007 R2)<br />
By default, E.164 numbers in the Request Uniform Resource Identifier (URI) for outgoing calls are prefixed with a plus sign (+). Most Private Branch eXchanges (PBXs) process such numbers without problem. Certain PBXs, however, do not accept numbers that are prefixed with a plus sign.</p>
<p>To ensure interoperability with these PBXs, Mediation Server has a new WMI Boolean setting called RemovePlusFromRequestURI, which has two values: TRUE and FALSE. If your PBX does not accept numbers prefixed with a plus sign, the value for the WMI setting should be set to TRUE, which causes Mediation Server to strip the plus sign from a Request URI for outbound calls. The default is FALSE, which causes Mediation Server to pass the outgoing INVITE&#8217;s Request URI, To URI, and From URI unchanged.</p>
<p>The TechNet article also discusses compatibility with PBXs that do not support the plus (+) sign.</p>
<p>By default, E.164 numbers in the Request URI of outgoing calls from Office Communications Server 2007 R2 are prefixed with a plus sign. Most PBXs process such numbers without problem. Some PBXs, however, do not accept numbers that are prefixed with a plus sign and do not route those calls correctly.</p>
<p>Additionally, the From headers of inbound calls from some PBXs does not conform to RFC 3966 because they are not prefixed with a plus sign. Microsoft Office Communicator cannot resolve these numbers to the correct user.</p>
<p>To assure interoperability with these PBXs, Office Communications Server 2007 R2 has a new Mediation Server setting for WMI called RemovePlusFromRequestURI. This setting can be set to YES or NO. The default value is NO.</p>
<p>- If a PBX downstream from the Office Communications Server 2007 R2 Mediation server does not accept numbers prefixed with a plus sign, set the value of RemovePlusFromRequestURI to YES. This causes Mediation Server to remove the plus signs from the Request URIs of outgoing calls. It also causes the plus signs to be removed from the To and From URIs.<br />
- If the downstream PBX accepts numbers prefixed with plus signs, leave the value of RemovePlusFromRequestURI set to its default value of NO. This causes Office Communications Server 2007 Mediation Server to pass Request URIs, To URIs, and From URIs unchanged (that is, with plus signs).</p>
<p>Extract from : <a href="http://tmcnet.com/blog/tom-keating/">http://tmcnet.com</a></p>
]]></content:encoded>
			<wfw:commentRss>http://blog.unifiedcommunications.eu/10/remove-plus-from-request-uri-ocs-2007-r2-bypass-rfc-3966-compliance-for-ocs-r2/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Using Asterisk to pass and receive SIP calls from Microsoft OCS to a SIP Trunk in UDP</title>
		<link>http://blog.unifiedcommunications.eu/08/using-asterisk-to-pass-and-receive-sip-calls-from-microsoft-ocs-to-a-sip-trunk-in-udp/</link>
		<comments>http://blog.unifiedcommunications.eu/08/using-asterisk-to-pass-and-receive-sip-calls-from-microsoft-ocs-to-a-sip-trunk-in-udp/#comments</comments>
		<pubDate>Tue, 04 Aug 2009 18:16:38 +0000</pubDate>
		<dc:creator>Yann Espanet</dc:creator>
				<category><![CDATA[Hardware Device]]></category>
		<category><![CDATA[Interoperability]]></category>
		<category><![CDATA[SIP trunk]]></category>
		<category><![CDATA[Gateway]]></category>
		<category><![CDATA[ip phones]]></category>
		<category><![CDATA[OCS R2]]></category>
		<category><![CDATA[SIP]]></category>
		<category><![CDATA[trunk]]></category>
		<category><![CDATA[Windows 2008]]></category>

		<guid isPermaLink="false">http://blog.unifiedcommunications.eu/?p=906</guid>
		<description><![CDATA[Enabling Any SIP Phone &#38; Any SIP Trunking Service Provider with OCS 2007 R2 ! Goals of the demo : Use asterisk like a UPD/TCP translator between OCS and a SIP trunking services in UDP mode. make calls from Microsoft Office Communicator to the sip trunk dial froma external mobile or a PSTN phonetrough the [...]]]></description>
			<content:encoded><![CDATA[<h2>Enabling Any SIP Phone &amp; Any SIP Trunking Service Provider with OCS 2007 R2 !</h2>
<p><strong>Goals of the demo : </strong></p>
<p align="left"><strong></strong>Use asterisk like a UPD/TCP translator between OCS and a SIP trunking services in UDP mode.</p>
<ul>
<li>make calls from Microsoft Office Communicator to the sip trunk</li>
<li>dial froma external mobile or a PSTN phonetrough the sip trunk and answer the call on eithera hard or soft phone or Office Communicator.</li>
<li>control forwarding and simultaneous ringing options from the Communicator</li>
</ul>
<p>I use Asterisk 1.6 which support TCP and UDP installed on <span style="line-height: 115%; font-family: &quot;Courier New&quot;; font-size: 10pt;">CentOS 5 &#8211; Kernel 2.6.18</span></p>
<p align="left"><strong>Installation steps :</strong></p>
<ol>
<li>
<div>Add a mediation server to the OCS infrastructure</div>
</li>
<li>
<div>Add an asterisk server</div>
</li>
<li>
<div>Configure Mediation server to use the asterisk box</div>
</li>
<li>
<div>Resolve NAT problem (if needed)</div>
</li>
<li>
<div>Create two SIP trunks :</div>
<ol>
<li>Asterisk to OCS</li>
<li>Asterisk to SIP Trunk service</li>
</ol>
</li>
<li>
<div>Define the context used by this trunks</div>
</li>
<li>
<div>Configure follow me</div>
</li>
<li>
<div>Test the infrastructure</div>
</li>
</ol>
<p align="left"><strong></strong></p>
<h3><strong>Basic schema :<br />
</strong></h3>
<h3>
<p align="left">OCS R2 &#8212;- Mediation &#8212;- Asterisk &#8212;&#8212; Firewall &#8212; SIPTrunk<br />
<span style="color: #ff0000">MTLS &#8212;- TCP &#8212;- UDP &#8212;- NAT &#8212;&#8211; UDP</span>
</p>
<p align="left"><span style="color: #ff0000"><span style="color: #000000"></span></span></p>
<p align="left"><span style="color: #ff0000"><span style="color: #000000">I use Hyper-V for the two OCS servers and VMware for the Asterisk server.</span></span></p>
<p align="left"><span style="color: #ff0000"><span style="color: #000000"></span></span></p>
<h1>Step-by-steps</h1>
</h3>
<h3>Step 1 : Add a mediation server to your infrastructure</h3>
<ol>
<li>
<div>Install a mediation server</div>
</li>
<li>
<div>Configure certificate</div>
</li>
<li>
<div>Add the OCS reskit tools (useful for troubleshooting)</div>
</li>
<li>
<div>Create a dial plan</div>
</li>
<li>
<div>Create a location profile with two normalization rules.</div>
</li>
</ol>
<div>
<div id="_mcePaste" style="position: absolute; overflow-x: hidden; overflow-y: hidden; width: 1px; height: 1px; top: 300px; left: -10000px;">The first will be use for internal numbering and the second is a generic rule that redirect all call that do not correspond to a valid extension number in OCS to the default gateway.</div>
</div>
<div>
<div id="_mcePaste" style="position: absolute; overflow-x: hidden; overflow-y: hidden; width: 1px; height: 1px; top: 300px; left: -10000px;">Internal : OCS user have an three digit extension beginning by 2</div>
</div>
<div>
<div id="_mcePaste" style="position: absolute; overflow-x: hidden; overflow-y: hidden; width: 1px; height: 1px; top: 300px; left: -10000px;">Phone pattern : ^2(\d{2})$</div>
</div>
<div>
<div id="_mcePaste" style="position: absolute; overflow-x: hidden; overflow-y: hidden; width: 1px; height: 1px; top: 300px; left: -10000px;">Translation pattern : +2$1</div>
</div>
<div>
<div id="_mcePaste" style="position: absolute; overflow-x: hidden; overflow-y: hidden; width: 1px; height: 1px; top: 300px; left: -10000px;">Generic rule : All number are concerned (be careful to put this rule in second position in your location profile)</div>
</div>
<div>
<div id="_mcePaste" style="position: absolute; overflow-x: hidden; overflow-y: hidden; width: 1px; height: 1px; top: 300px; left: -10000px;">Phone pattern : ^(.*)$</div>
</div>
<div>
<div id="_mcePaste" style="position: absolute; overflow-x: hidden; overflow-y: hidden; width: 1px; height: 1px; top: 300px; left: -10000px;">Translation pattern : $1</div>
</div>
<div>
<div id="_mcePaste" style="position: absolute; overflow-x: hidden; overflow-y: hidden; width: 1px; height: 1px; top: 300px; left: -10000px;">Assign your location profile to front-end server (properties of the pool / properties of front-end / Voice Tab)</div>
</div>
<div>
<div id="_mcePaste" style="position: absolute; overflow-x: hidden; overflow-y: hidden; width: 1px; height: 1px; top: 300px; left: -10000px;">NB : Test your dial plan using the Enterprise Voice route helper</div>
</div>
<p align="left">The first will be use for internal numbering and the second is a generic rule that redirect all call that do not correspond to a valid extension number in OCS to the default gateway.</p>
<ul>
<li>
<div>Internal : OCS user have an three digit extension beginning by 2</div>
</li>
</ul>
<blockquote>
<p align="left"><em><strong>Phone pattern : ^2(\d{2})$ </strong></em></p>
<p align="left"><em><strong>Translation pattern : +2$1</strong></em><strong> </strong></p>
</blockquote>
<ul>
<li>
<div>Generic rule : All number are concerned (be careful to put this rule in second position in your location profile)</div>
</li>
</ul>
<blockquote>
<p align="left"><em><strong>Phone pattern : ^(.*)$ </strong></em></p>
<p align="left"><em><strong>Translation pattern : $1</strong> </em></p>
</blockquote>
<p align="left"><em><span style="font-style: normal">Assign the location profile to the front-end server (properties of the pool / properties of front-end / Voice Tab)<br />
</span></em>NB : Test your dial plan using the Enterprise Voice route helper</p>
<h3>Step 2 : Add an asterisk server</h3>
<ol>
<li>
<div>Download trixbox 2.2 Virtual Appliance from VMware website <a href="http://www.vmware.com/appliances/directory/939">http://www.vmware.com/appliances/directory/939</a></div>
</li>
<li>
<div>Configure basic settings (Ip address, ..)</div>
</li>
<li>
<div>Add this line in the begining of sip.conf</div>
</li>
</ol>
<blockquote><p>tcpenable = yes<br />
bindport = 5060</p></blockquote>
<ol>
<li>
<div>Access the web Trixbox interface (use Mozilla) In system menu / Network / Configure IP, Subnet, DNS and a valid hostname on internet : Ex : sip.mydomain.com</div>
</li>
</ol>
<p align="left">
<h3>Step 3 : Configure Mediation server to use the asterisk box</h3>
<ol>
<li>Open the properties of your mediation server verify that :</li>
<li>in General tab : the gateway listening port is 5060</li>
<li>In next hop connections tab : put the IP address of your asterisk server in PSTN gateway next hop with 5060 for the port number</li>
</ol>
<h3>Step 4 : Resolve NAT problems (if needed)</h3>
<ol>
<li>In Asterisk, Go to PBX / Config File Editor / and edit SIP_NAT.conf</li>
</ol>
<blockquote>
<p align="left"><em><strong>nat=yes </strong></em></p>
<p align="left"><em><strong>externip=<span style="color: #00ff00">Valid_FQDN </span></strong></em></p>
<p align="left"><em><strong>localnet=<span style="color: #00ff00;">Your_Localnet</span>/<span style="color: #00ff00;">Your_Subnet</span></strong></em></p>
</blockquote>
<ol>
<li>Open in your firewall port
<ul>
<li>5060 in UDP and TCP for SIP</li>
<li>RTP: 10000 to 20000 UDP</li>
</ul>
</li>
<li>Verify that you can see you valid public IP in the Trixbox system status</li>
</ol>
<p align="left">
<h3>Step 5 : Create two SIP trunk in Trixbox : asterisk to OCS and Asterisk to SIP Trunk service</h3>
<ul>
<li>Asterisk to OCS</li>
</ul>
<blockquote>
<p style="padding-left: 60px" align="left"><em><strong>Trunk Name : ocs </strong></em></p>
<p style="padding-left: 60px" align="left"><em><strong>PEER Details : </strong></em></p>
<p style="padding-left: 90px" align="left"><em><strong>host=<span style="color: #00ff00">ip-mediation-server</span></strong></em></p>
<p style="padding-left: 90px" align="left"><em><strong>type=peer </strong></em></p>
<p style="padding-left: 90px" align="left"><em><strong>qualify=yes </strong></em></p>
<p style="padding-left: 90px" align="left"><em><strong>transport=tcp </strong></em></p>
<p style="padding-left: 90px" align="left"><em><strong>insecure=very </strong></em></p>
<p style="padding-left: 90px" align="left"><em><strong>port=5060 </strong></em></p>
<p style="padding-left: 90px" align="left"><em><strong>canreinvite=yes </strong></em></p>
<p style="padding-left: 90px" align="left"><em><strong>fromdomain=<span style="color: #00ff00">yourdomain</span> </strong></em></p>
<p style="padding-left: 90px" align="left"><em><strong>context=from-ocs</strong></em></p>
<p style="padding-left: 60px" align="left">
<p style="padding-left: 60px" align="left"><em><strong>Incoming Settings :</strong></em></p>
<p style="padding-left: 60px" align="left"><em><strong>User context : <span style="color: #00ff00">(I put a OCS username here)</span></strong></em></p>
<p style="padding-left: 60px" align="left"><em><strong>User details :</strong></em></p>
<p style="padding-left: 90px" align="left"><em><strong>host=<span style="color: #00ff00">ip-mediation-server</span></strong></em></p>
<p style="padding-left: 90px" align="left"><em><strong>type=peer </strong></em></p>
<p style="padding-left: 90px" align="left"><em><strong>transport=tcp </strong></em></p>
<p style="padding-left: 90px" align="left"><em><strong>insecure=very </strong></em></p>
<p style="padding-left: 90px" align="left"><em><strong>port=5060 </strong></em></p>
<p style="padding-left: 90px" align="left"><em><strong>context=from-ocs</strong></em></p>
<p style="padding-left: 60px" align="left"><em><strong>register string : </strong></em></p>
<p style="padding-left: 90px" align="left"><em><strong>(leave blank)</strong></em></p>
<p style="padding-left: 90px" align="left"><strong><em></em></strong></p>
</blockquote>
<ul>
<li>
<div>Asterisk to SIP Trunk service</div>
</li>
</ul>
<blockquote>
<p style="padding-left: 60px" align="left"><em><strong>Trunk Name : siptrunk </strong></em></p>
<p style="padding-left: 60px" align="left"><em><strong>PEER Details :</strong></em></p>
<p style="padding-left: 90px" align="left"><em><strong>type=friend </strong></em></p>
<p style="padding-left: 90px" align="left"><em><strong>disallow=all </strong></em></p>
<p style="padding-left: 90px" align="left"><em><strong>allow=ilbc&amp;speex&amp;gsm&amp;alaw&amp;ulaw </strong></em></p>
<p style="padding-left: 90px" align="left"><em><strong>username=<span style="color: #00ff00">username</span> </strong></em></p>
<p style="padding-left: 90px" align="left"><em><strong>secret=<span style="color: #00ff00">password </span></strong></em></p>
<p style="padding-left: 90px" align="left"><em><strong>host=<span style="color: #00ff00">yoursipregistrar</span> </strong></em></p>
<p style="padding-left: 90px" align="left"><em><strong>canreinvite=no </strong></em></p>
<p style="padding-left: 90px" align="left"><em><strong>context=from-siptrunk</strong></em></p>
<p style="padding-left: 60px" align="left"><em><strong>Incoming Settings :</strong></em></p>
<p style="padding-left: 90px" align="left"><em><strong>Clear all</strong></em></p>
<p style="padding-left: 60px" align="left"><em><strong>register string : </strong></em></p>
<p style="padding-left: 90px" align="left"><em><strong><span style="color: #00ff00">username:password@yoursipregistrar (/yournumber if needded)</span></strong></em></p>
<p style="padding-left: 90px" align="left"><em><strong></strong></em><span style="font-size: 13px; font-weight: normal"></span></p>
</blockquote>
<h3>Step 6 : configure context</h3>
<p>Edit Extension_Custom.conf and add a the end of the file :</p>
<p style="padding-left: 30px" align="left"><span style="font-size: 13px; font-weight: normal">[from-ocs] </span></p>
<p style="padding-left: 30px" align="left"><span style="font-size: 13px; font-weight: normal">exten =&gt; _X.,1,Answer </span></p>
<p style="padding-left: 30px" align="left"><span style="font-size: 13px; font-weight: normal">exten =&gt; _X.,2,Dial(<a href="mailto:SIP/${EXTEN}@siptrunk,,tr">SIP/${EXTEN}@siptrunk,,tr</a>)</span></p>
<p style="padding-left: 30px" align="left"><span style="font-size: 13px; font-weight: normal">#include extensions-away-status.conf </span></p>
<p style="padding-left: 30px" align="left"><span style="font-size: 13px; font-weight: normal">[from-siptrunk] </span></p>
<p style="padding-left: 30px" align="left"><span style="font-size: 13px; font-weight: normal">exten =&gt; _X.,1,Set(numDialled=+${EXTEN:<span style="color: #00ff00;">Number_of_X_to_ignore</span>}) </span></p>
<p style="padding-left: 30px" align="left"><span style="font-size: 13px; font-weight: normal">exten =&gt; _X.,2,Set(__FROM_DID=${EXTEN}) </span></p>
<p style="padding-left: 30px" align="left"><span style="font-size: 13px; font-weight: normal">exten =&gt; _X.,3,Answer </span></p>
<p style="padding-left: 30px" align="left"><span style="font-size: 13px; font-weight: normal">exten =&gt; _X.,4,Dial(<a href="mailto:SIP/${numDialled}@ocs,,tr">SIP/${numDialled}@ocs,,tr</a>)</span></p>
<p style="padding-left: 30px" align="left"><span style="font-size: 13px; font-weight: normal"></span></p>
<p style="padding-left: 30px" align="left"><span style="font-size: 13px; font-weight: normal">exten =&gt; _X.,4,Dial(<a href="mailto:SIP/${numDialled}@ocs">SIP/${numDialled}@ocs</a>)</span></p>
<p style="padding-left: 30px" align="left"><span style="font-size: 13px; font-weight: normal"></span></p>
<h3>Step 7 : Configure follow-me in Asterisk</h3>
<p>Assign line number from your sip trunk to Asterisk extension and redirect to phone extension in OCS by using a # after the number.<br />
DID number from your SIP trunk provider &#8212;&gt; Extension in Asterisk &#8212;&gt; Follow-me to OCS extention (use # after the number to precise that itâ€™s external to asterisk)</p>
<h3>Step 8 : Test the infrastructure</h3>
<ol>
<li><strong>Troubleshooting tools that you can use in Asterisk :</strong>
<ol>
<li>Log as root with a terminal tools (putty) / Type asterisk â€“r / Type sip set debug on</li>
<li>Assign a line prefix to test the trunk from a softphone directly connected to Asterisk<br />
Ex : Create a outbound route with â€œ9|.â€ to test the trunk by dialing 9 before the number</li>
</ol>
</li>
<li><strong>Troubleshooting tools that you can use in OCS :</strong>
<ol>
<li>Eventviewer</li>
<li>Use the Debug tools (right click your mediation server)</li>
<li>MS Netmon</li>
<li>OCS Route helper to validate your dial plan.</li>
</ol>
</li>
</ol>
<p>Have fun with that and leave me a message if encounter some problems!</p>
<p>It&#8217;s probably possible to do the same withother IP/PBX like : Freeswitch, OpenSer, SipxECS, &#8230;</p>
<p>Date : 04/08:2009 &#8211; Author : Yann Espanet &#8211; mail : <a href="mailto:yann@unifiedcommunications.eu">yann@unifiedcommunications.eu</a></p>
]]></content:encoded>
			<wfw:commentRss>http://blog.unifiedcommunications.eu/08/using-asterisk-to-pass-and-receive-sip-calls-from-microsoft-ocs-to-a-sip-trunk-in-udp/feed/</wfw:commentRss>
		<slash:comments>2</slash:comments>
		</item>
	</channel>
</rss>

