<!-- WP QUADS Content Ad Plugin v. 2.0.92 -->
<div class="quads-location quads-ad2524 " id="quads-ad2524" style="float:none;margin:0px 3px 3px 3px;padding:0px 0px 0px 0px;" data-lazydelay="0">

</div>

<p>Installing AsteriskNow (FreePBX 6.12.65) and integration with Lync 2013</p>
<!-- WP QUADS Content Ad Plugin v. 2.0.92 -->
<div class="quads-location quads-ad2522 " id="quads-ad2522" style="float:none;margin:0px 3px 3px 3px;padding:0px 0px 0px 0px;" data-lazydelay="0">

</div>

<!-- WP QUADS Content Ad Plugin v. 2.0.92 -->
<div class="quads-location quads-ad2527 " id="quads-ad2527" style="float:none;margin:0px 3px 3px 3px;padding:0px 0px 0px 0px;" data-lazydelay="0">

</div>

<!-- WP QUADS Content Ad Plugin v. 2.0.92 -->
<div class="quads-location quads-ad2530 " id="quads-ad2530" style="float:none;margin:0px 3px 3px 3px;padding:0px 0px 0px 0px;" data-lazydelay="0">

</div>




<p>Download AsteriskNow from the following Link</p>



<p><a href="http://www.asterisk.org/downloads/asterisknow">http://www.asterisk.org/downloads/asterisknow</a></p>



<p>First the setup window will come: there I will choose No RAID on Asterisk 13 since this is a virtual machine.</p>



<figure class="wp-block-image"><a href="http://lh4.ggpht.com/-H2Q-FMN-ACI/VOJw_O1hiNI/AAAAAAAANB0/jzqfHYTgpfk/s1600-h/clip_image001%25255B4%25255D.png"><img src="http://lh6.ggpht.com/-eWTz-iQzDy0/VOJxAPL3d6I/AAAAAAAANB8/Vkw9cOW2nIA/clip_image001_thumb%25255B1%25255D.png?imgmax=800" alt="clip_image001"/></a> 

<!-- WP QUADS Content Ad Plugin v. 2.0.92 -->
<div class="quads-location quads-ad2528 " id="quads-ad2528" style="float:none;margin:0px 3px 3px 3px;padding:0px 0px 0px 0px;" data-lazydelay="0">

</div>
 
</figure>



<p>Here I will choose IPv4 static IP (Manual configuration) and click OK</p>



<figure class="wp-block-image"><a href="http://lh6.ggpht.com/-_qW5tvaic_Y/VOJxAyQQJzI/AAAAAAAANCE/K5zNg37OYa0/s1600-h/clip_image002%25255B4%25255D.png"><img src="http://lh5.ggpht.com/-TtPkLIIvt1I/VOJxBi_k5II/AAAAAAAANCM/eQ6lxoJDphk/clip_image002_thumb%25255B1%25255D.png?imgmax=800" alt="clip_image002"/></a></figure>



<figure class="wp-block-image"><a href="http://lh5.ggpht.com/-a05H0Nvgec8/VOJxCPgiTSI/AAAAAAAANCU/MNEE7vzHnoA/s1600-h/clip_image003%25255B4%25255D.png"><img src="http://lh5.ggpht.com/-VSHA2zlMz6g/VOJxDOTSMPI/AAAAAAAANCc/njiZ2Q9ChSo/clip_image003_thumb%25255B1%25255D.png?imgmax=800" alt="clip_image003"/></a></figure>



<figure class="wp-block-image"><a href="http://lh4.ggpht.com/-Zghq9CTWuco/VOJxDkVvnCI/AAAAAAAANCk/hGvdnW4JX_0/s1600-h/clip_image004%25255B4%25255D.png"><img src="http://lh6.ggpht.com/-11D8ehpUwJ4/VOJxEedGmrI/AAAAAAAANCs/BWfYAdG7vmE/clip_image004_thumb%25255B1%25255D.png?imgmax=800" alt="clip_image004"/></a></figure>



<p>Choose the time zone according to the nearest location to you</p>



<figure class="wp-block-image"><a href="http://lh4.ggpht.com/-BNKLhs9G5Bg/VOJxEw7qN_I/AAAAAAAANC0/LsHNW-UoCjY/s1600-h/clip_image005%25255B4%25255D.png"><img src="http://lh3.ggpht.com/-7LdOYcAzr5I/VOJxFvciz0I/AAAAAAAANC8/K50zepQuJKE/clip_image005_thumb%25255B1%25255D.png?imgmax=800" alt="clip_image005"/></a></figure>



<p>Next, we&#8217;ll configure the root password</p>



<figure class="wp-block-image"><a href="http://lh6.ggpht.com/-a9YwOuVzDDQ/VOJxGXo-avI/AAAAAAAANDE/xrXaBE6KX6E/s1600-h/clip_image006%25255B4%25255D.png"><img src="http://lh4.ggpht.com/-Z1LRbn1DeGE/VOJxG6OCRpI/AAAAAAAANDM/0ePjWknIw4U/clip_image006_thumb%25255B1%25255D.png?imgmax=800" alt="clip_image006"/></a></figure>



<p>Here it&#8217;s formatting the Disk that I have assigned to the VM.</p>



<figure class="wp-block-image"><a href="http://lh4.ggpht.com/-AL_Fkcs7Ges/VOJxHt-7lyI/AAAAAAAANDU/7HI3Asc-SKo/s1600-h/clip_image007%25255B4%25255D.png"><img src="http://lh3.ggpht.com/--2w_z_xOqeY/VOJxIEEY4NI/AAAAAAAANDc/7pY5qUtjx0A/clip_image007_thumb%25255B1%25255D.png?imgmax=800" alt="clip_image007"/></a></figure>



<p>It should start the installation now and should download all the required packages from the internet incase they were not found on the ISO which I&#8217;ve loaded.</p>



<figure class="wp-block-image"><a href="http://lh5.ggpht.com/-f2po-f6bIb4/VOJxI1af6aI/AAAAAAAANDk/MNo_wQ7iqgU/s1600-h/clip_image008%25255B4%25255D.png"><img src="http://lh6.ggpht.com/-7aDUFUFFdIw/VOJxJVciVdI/AAAAAAAANDs/L0g09fxMS3w/clip_image008_thumb%25255B1%25255D.png?imgmax=800" alt="clip_image008"/></a></figure>



<p>Now the installation is about to finish and once it does, the machine is supposed to restart on its own allowing you to go to the Web UI.</p>



<figure class="wp-block-image"><a href="http://lh6.ggpht.com/-URrS9DPHwfc/VOJxKPoDIPI/AAAAAAAAND0/_O6nSVhUr24/s1600-h/clip_image009%25255B4%25255D.png"><img src="http://lh5.ggpht.com/-isHDeFH511c/VOJxK627o0I/AAAAAAAAND8/Mb6EGjzuN3Q/clip_image009_thumb%25255B1%25255D.png?imgmax=800" alt="clip_image009"/></a></figure>



<p>Upon setup and restart, you might get the following error! The error states that your PBX can&#8217;t access the internet so you might wanna double check your NIC configuration and that you&#8217;re able to reach to it. ;</p>



<p>This is usually related to the DNS setup on the Centos machine where &#8220;AsteriskNow&#8221; is setup.</p>



<figure class="wp-block-image"><img src="http://lh5.ggpht.com/-v9PU8MnCk9k/VOJxMHZK6vI/AAAAAAAANEM/zKvc1u4isZc/clip_image010_thumb%25255B1%25255D.png?imgmax=800" alt="clip_image010"/></figure>



<p>If you do a test and try to update your system from the CLI window you might get this error which is related to the DNS.</p>



<figure class="wp-block-image"><a href="http://old.moh10ly.com/blog/VoIP/freepbx-6-12-65-integration-with-lync-2013/voip_asterisk1.png?attredirects=0"><img src="http://old.moh10ly.com/_/rsrc/1431547306052/blog/VoIP/freepbx-6-12-65-integration-with-lync-2013/voip_asterisk1.png" alt=""/></a></figure>



<p>To resolve it, you&#8217;ll have to replace the localhost with any public DNS e.g. (google or comodo DNS) or any internal DNS that&#8217;s capable of reaching out to the internet to resolve this problem.</p>



<p>To edit the DNS you will have to type in the command ; &#8220;nano /etc/resolv.conf&#8221;</p>



<figure class="wp-block-image"><a href="http://old.moh10ly.com/blog/VoIP/freepbx-6-12-65-integration-with-lync-2013/voip_asterisk2.png?attredirects=0"><img src="http://old.moh10ly.com/_/rsrc/1431547306052/blog/VoIP/freepbx-6-12-65-integration-with-lync-2013/voip_asterisk2.png" alt=""/></a></figure>



<p>The default DNS is the localhost</p>



<figure class="wp-block-image"><a href="http://old.moh10ly.com/blog/VoIP/freepbx-6-12-65-integration-with-lync-2013/voip_asterisk3.png?attredirects=0"><img src="http://old.moh10ly.com/_/rsrc/1431547306052/blog/VoIP/freepbx-6-12-65-integration-with-lync-2013/voip_asterisk3.png" alt=""/></a></figure>



<p>and you&#8217;ll have to manually change it and save the ; settings</p>



<figure class="wp-block-image"><a href="http://old.moh10ly.com/blog/VoIP/freepbx-6-12-65-integration-with-lync-2013/voip_asterisk4.png?attredirects=0"><img src="http://old.moh10ly.com/_/rsrc/1431547306052/blog/VoIP/freepbx-6-12-65-integration-with-lync-2013/voip_asterisk4.png" alt=""/></a></figure>



<p>Press Ctrl + X and then Press Y to save and hit Enter</p>



<figure class="wp-block-image"><a href="http://old.moh10ly.com/blog/VoIP/freepbx-6-12-65-integration-with-lync-2013/voip_asterisk5.png?attredirects=0"><img src="http://old.moh10ly.com/_/rsrc/1431547306053/blog/VoIP/freepbx-6-12-65-integration-with-lync-2013/voip_asterisk5.png" alt=""/></a></figure>



<p>To test that we can access the internet you can nslookup google.com for instance and see if it works</p>



<figure class="wp-block-image"><a href="http://old.moh10ly.com/blog/VoIP/freepbx-6-12-65-integration-with-lync-2013/voip_asterisk6.png?attredirects=0"><img src="http://old.moh10ly.com/_/rsrc/1431547306053/blog/VoIP/freepbx-6-12-65-integration-with-lync-2013/voip_asterisk6.png" alt=""/></a></figure>



<p>Once you are able to resolve the google.com, that error will go.</p>



<p>Now to continue, let&#8217;s setup a FreePBX Admin (Make sure you remember both username and password) ;</p>



<figure class="wp-block-image"><img src="http://lh5.ggpht.com/-SRNNIluzOh8/VOJxNcc9apI/AAAAAAAANEc/uGnlA7Y9ex0/image_thumb%25255B1%25255D.png?imgmax=800" alt="image"/></figure>



<figure class="wp-block-image"><a href="http://lh5.ggpht.com/-I84p_79DRmA/VOJxOFcGipI/AAAAAAAANEk/oHLLDRCE6M0/s1600-h/clip_image012%25255B4%25255D.png"><img src="http://lh5.ggpht.com/-r4VNlSqr47A/VOJxPD8WGmI/AAAAAAAANEs/n9wVLHEItIw/clip_image012_thumb%25255B1%25255D.png?imgmax=800" alt="clip_image012"/></a></figure>



<p>Click on the (FreePBX Administration) and enter the username and password you have just created in the previous step.</p>



<p>This will allow you to the configuration portal</p>



<figure class="wp-block-image"><a href="http://lh6.ggpht.com/-m8E30fF_hC8/VOJxPzqQnEI/AAAAAAAANE0/5HI6zg71o_o/s1600-h/clip_image013%25255B4%25255D.png"><img src="http://lh6.ggpht.com/-mjRV6iKziPA/VOJxRPjXUmI/AAAAAAAANE8/yOjvzv0bCys/clip_image013_thumb%25255B1%25255D.png?imgmax=800" alt="clip_image013"/></a></figure>



<p>Extensions configuration:</p>



<p>To start, let&#8217;s configure an extension (Since I don&#8217;t have an IP phone now) so I will use a SIP application for my test (Zoiper or Xlite would do fine)</p>



<figure class="wp-block-image"><a href="http://lh5.ggpht.com/-vf9NZCJoHcM/VOJxR69_C9I/AAAAAAAANFE/YHqQLYuzOxE/s1600-h/clip_image014%25255B4%25255D.png"><img src="http://lh6.ggpht.com/-T3OMycu2Hcs/VOJxTDxPCOI/AAAAAAAANFM/X75WA4oARQc/clip_image014_thumb%25255B1%25255D.png?imgmax=800" alt="clip_image014"/></a></figure>



<p>Select Chan SIP device as this talks directly with Lync Trunk then Click Submit once you choose the device .</p>



<figure class="wp-block-image"><a href="http://lh4.ggpht.com/-FOkb4tpmldQ/VOJxTrkT7wI/AAAAAAAANFU/wwt6OMtKwVo/s1600-h/clip_image015%25255B4%25255D.png"><img src="http://lh6.ggpht.com/-ZTENgXmFaZ0/VOJxUXhqoNI/AAAAAAAANFc/6IWjak0s46Q/clip_image015_thumb%25255B1%25255D.png?imgmax=800" alt="clip_image015"/></a></figure>



<p>Now I will configure the new extension&#8217;s number, name and secret and port too.</p>



<figure class="wp-block-image"><a href="http://lh5.ggpht.com/-mvBafzddSW4/VOJxVGcq1AI/AAAAAAAANFk/0sOLD2USDDs/s1600-h/clip_image016%25255B4%25255D.png"><img src="http://lh5.ggpht.com/-iiDNF3zOOr0/VOJxV9FfAwI/AAAAAAAANFs/pz6xWE-ncVk/clip_image016_thumb%25255B1%25255D.png?imgmax=800" alt="clip_image016"/></a></figure>



<p>Under device options, you have to set the secret (Password) which you’ll use to login to your sip phone or sip softphone..</p>



<p><strong>Note:</strong></p>



<p>You need to also make sure that the port configured under the device is what will be used for the device to login with this sip extension</p>



<p>so basically the sip port in this case is 5060 which is the default one unless you’re already using a different port then you’ll have to reconfigure it here.</p>



<figure class="wp-block-image"><a href="http://lh4.ggpht.com/-OVZZlthV7WY/VOJxWj5LFYI/AAAAAAAANF0/A9Y8arZesxs/s1600-h/image%25255B7%25255D.png"><img src="http://lh5.ggpht.com/-XPLSaNKWJck/VOJxXdv5yQI/AAAAAAAANF8/jhGA1ZLYujM/image_thumb%25255B3%25255D.png?imgmax=800" alt="image"/></a></figure>



<p>I&#8217;ll leave the rest of the options on default value and click submit. Then apply Config</p>



<p>Applying Configuration</p>



<figure class="wp-block-image"><a href="http://lh6.ggpht.com/-g83oDaeUxVg/VOJxYOnXLYI/AAAAAAAANGE/aWiQgfGmstU/s1600-h/clip_image018%25255B4%25255D.png"><img src="http://lh3.ggpht.com/-iF920Kmh6Ts/VOJxYwKJ5uI/AAAAAAAANGM/6KmSoswiZ9A/clip_image018_thumb%25255B1%25255D.png?imgmax=800" alt="clip_image018"/></a></figure>



<p>Now I will use a soft phone (SIP Application) on my PC to check out if calls are working properly. And for the second extension a second computer with the same software or even A software like Zoiper or Xlite can be utilized on iPhone or Android for the same purpose.</p>



<figure class="wp-block-image"><a href="http://lh6.ggpht.com/-mMdXwvLdd80/VOJxZrNh3zI/AAAAAAAANGU/V4MaRWqhSiM/s1600-h/clip_image019%25255B4%25255D.png"><img src="http://lh4.ggpht.com/-N55bDNQFfZQ/VOJxatqDsVI/AAAAAAAANGc/Yw3K87wVOO0/clip_image019_thumb%25255B1%25255D.png?imgmax=800" alt="clip_image019"/></a></figure>



<p>No other settings are required on the SIP phone after that it should register without an issue. And you&#8217;ll be able to make calls between SIP phones</p>



<figure class="wp-block-image"><a href="http://lh3.ggpht.com/-al6QaZdhVW8/VOJxbbXrqKI/AAAAAAAANGk/36ieb9IC8fo/s1600-h/clip_image020%25255B4%25255D.png"><img src="http://lh4.ggpht.com/-MYGXizgjfC4/VOJxcE09LMI/AAAAAAAANGs/8RKVIQ5gmjs/clip_image020_thumb%25255B1%25255D.png?imgmax=800" alt="clip_image020"/></a></figure>



<p>I am going to call my computer (3700) sip phone (Xlite) from my iPhone (Zoiper) soft phone (3800)</p>



<figure class="wp-block-image"><a href="http://lh3.ggpht.com/-mZiux9eLm5E/VOJxcx2RmbI/AAAAAAAANG0/AnRzOZcE3Fg/s1600-h/clip_image021%25255B4%25255D.png"><img src="http://lh6.ggpht.com/-o9xFcvbgX-0/VOJxd5a04AI/AAAAAAAANG8/sjkH13zpwQY/clip_image021_thumb%25255B1%25255D.png?imgmax=800" alt="clip_image021"/></a></figure>



<p>So calls are working properly between SIP extensions, now we&#8217;ll have to go configure Lync and Asterisk Configuration.</p>



<p>Before starting, we&#8217;ll have to enable the TCP protocol on Asterisk for Lync to send calls to Asterisk since Lync talks only TCP.</p>



<p>Enabling Asterisk to listen on TCP</p>



<p>Enable TCP for Lync and SIP Phones for Asterisk</p>



<figure class="wp-block-image"><a href="http://lh6.ggpht.com/-BgVfegR3mT4/VOJxegNtD7I/AAAAAAAANHE/YnY3uIIUTbk/s1600-h/clip_image022%25255B4%25255D.png"><img src="http://lh5.ggpht.com/-4vumuWM33iA/VOJxftngFEI/AAAAAAAANHM/Iq9bDiLMdWc/clip_image022_thumb%25255B1%25255D.png?imgmax=800" alt="clip_image022"/></a></figure>



<p>I&#8217;ll have to configure the local networks and the RTP port range as well.</p>



<figure class="wp-block-image"><a href="http://lh5.ggpht.com/-DhHOYHAoeRo/VOJxgXW1LjI/AAAAAAAANHU/sVBOq0E-o_Q/s1600-h/clip_image023%25255B4%25255D.png"><img src="http://lh6.ggpht.com/-lZbxi4SttqE/VOJxha1iNhI/AAAAAAAANHc/T6efgb1oQMc/clip_image023_thumb%25255B1%25255D.png?imgmax=800" alt="clip_image023"/></a></figure>



<p>Next I&#8217;ll click on Submit, and apply configuration then on top right I&#8217;ll click on Chan SIP to configure the ports and the right protocol</p>



<figure class="wp-block-image"><a href="http://lh4.ggpht.com/-iIR3NhypmtM/VOJxh88mNbI/AAAAAAAANHk/P9KkzS0TF2o/s1600-h/clip_image024%25255B5%25255D.png"><img src="http://lh3.ggpht.com/-GPpxhRvNPrk/VOJxirQeFjI/AAAAAAAANHs/8wEi3Pw-fhY/clip_image024_thumb%25255B2%25255D.png?imgmax=800" alt="clip_image024"/></a></figure>



<p>Under SIP Settings, make sure your settings matches the snapshot below, then navigate to advanced settings</p>



<figure class="wp-block-image"><a href="http://lh5.ggpht.com/-5_JE3hIbb4Q/VOJxjUc9YiI/AAAAAAAANH0/rLz1Ufnh0do/s1600-h/clip_image025%25255B4%25255D.png"><img src="http://lh5.ggpht.com/-Tf8_fD1Rnuc/VOJxkQ71-AI/AAAAAAAANH8/yLDzP-bavEY/clip_image025_thumb%25255B1%25255D.png?imgmax=800" alt="clip_image025"/></a></figure>



<p>Under Advanced General settings make sure that CHAN_SIP is bind to port 5061 or else calls from Lync will fail with &#8220;Unauthorized&#8221; error code.</p>



<figure class="wp-block-image"><a href="http://lh3.ggpht.com/-GRnPwS2p530/VOJxk-p5M5I/AAAAAAAANIE/uXy5OBEvzK4/s1600-h/clip_image026%25255B4%25255D.png"><img src="http://lh6.ggpht.com/-Zwkt3wqN_g0/VOJxl7S4lLI/AAAAAAAANIM/gnbKNT0ICsg/clip_image026_thumb%25255B1%25255D.png?imgmax=800" alt="clip_image026"/></a></figure>



<p>Once you change the port scroll further down to Other SIP settings and add the following variables</p>



<p>Tcpenable = Yes</p>



<p>Transport = tcp</p>



<figure class="wp-block-image"><a href="http://lh6.ggpht.com/-P4DGKWcS0wI/VOJxmcdSqRI/AAAAAAAANIU/1tJqklYzJoQ/s1600-h/clip_image027%25255B4%25255D.png"><img src="http://lh4.ggpht.com/-QqcVvOz2gGA/VOJxnE-lLOI/AAAAAAAANIc/btczmxHWKPI/clip_image027_thumb%25255B1%25255D.png?imgmax=800" alt="clip_image027"/></a></figure>



<p>Submit the changes and apply the configuration.</p>



<p>Lync Configuration</p>



<p>Now I will go on Lync server now (Standard edition) and enable the TCP port for the mediation server (Collocated mediation service)</p>



<p>To do so</p>



<p>Right click on your Mediation server and edit properties and Enable TCP port and change it from 5068 to 5060.</p>



<figure class="wp-block-image"><a href="http://lh4.ggpht.com/-g7L9R2kC4W4/VOJxn7CeYEI/AAAAAAAANIk/XyWHsK1RLM4/s1600-h/clip_image028%25255B4%25255D.png"><img src="http://lh3.ggpht.com/--6gdnBrZ5u4/VOJxot3yAVI/AAAAAAAANIs/2kHavHoZXQg/clip_image028_thumb%25255B1%25255D.png?imgmax=800" alt="clip_image028"/></a></figure>



<p>I will publish the topology</p>



<figure class="wp-block-image"><a href="http://lh5.ggpht.com/-wu-aXKn--QQ/VOJxpT9lOwI/AAAAAAAANI0/l1YN2ymeHDg/s1600-h/clip_image029%25255B4%25255D.png"><img src="http://lh5.ggpht.com/-z8vKl8fjMxo/VOJxqd2p-JI/AAAAAAAANI8/egXPLQvbrpk/clip_image029_thumb%25255B1%25255D.png?imgmax=800" alt="clip_image029"/></a></figure>



<p>Published the topology and now it&#8217;s time to run the setup as it will install the mediation server role on Front end.</p>



<figure class="wp-block-image"><a href="http://lh5.ggpht.com/-kO7F2u577Ck/VOJxrJJiFWI/AAAAAAAANJE/4gIqlH8FxE0/s1600-h/clip_image030%25255B4%25255D.png"><img src="http://lh3.ggpht.com/-uU5ngfvPGyk/VOJxsKhwa_I/AAAAAAAANJM/2PT03lw0LbY/clip_image030_thumb%25255B1%25255D.png?imgmax=800" alt="clip_image030"/></a></figure>



<p>Next I will run the second step (Setup or remove Lync Server Components):</p>



<figure class="wp-block-image"><a href="http://lh6.ggpht.com/-LTTVgBl9nFc/VOJxskQpXbI/AAAAAAAANJU/0eLkUxDQpDo/s1600-h/clip_image031%25255B4%25255D.png"><img src="http://lh6.ggpht.com/-pfLcvXEiP2A/VOJxuOlzJYI/AAAAAAAANJc/tVsLAG-38mE/clip_image031_thumb%25255B1%25255D.png?imgmax=800" alt="clip_image031"/></a></figure>



<p>I will go check if the mediation service is enabled now</p>



<figure class="wp-block-image"><a href="http://lh5.ggpht.com/-H_fnG1MJVAo/VOJxujI8_rI/AAAAAAAANJk/3HEAVlZsCj8/s1600-h/clip_image032%25255B4%25255D.png"><img src="http://lh6.ggpht.com/-zNm5WHsbmmo/VOJxvlYJQAI/AAAAAAAANJs/TTS2QlogIyE/clip_image032_thumb%25255B1%25255D.png?imgmax=800" alt="clip_image032"/></a></figure>



<p>I will run the command netstat -anb >;1.txt</p>



<p>The command will export all the ports status on the server including each of the Lync services.</p>



<figure class="wp-block-image"><a href="http://lh5.ggpht.com/-IiAWFGJN-4k/VOJxwLEa86I/AAAAAAAANJ0/KiTV6Y1__Qs/s1600-h/clip_image033%25255B4%25255D.png"><img src="http://lh6.ggpht.com/-AmRF4f0BOSY/VOJxw41oKEI/AAAAAAAANJ8/QIWI9i1QwSU/clip_image033_thumb%25255B1%25255D.png?imgmax=800" alt="clip_image033"/></a></figure>



<p>So Lync mediation service is listening on the default sip port 5060.</p>



<p>Now I will go back to the topology and add the PSTN Gateway (AsteriskNow)</p>



<p>Right click on PSTN Gateways &#8211;>; Click add PSTN gateways</p>
<!-- WP QUADS Content Ad Plugin v. 2.0.92 -->
<div class="quads-location quads-ad2529 " id="quads-ad2529" style="float:none;margin:0px 3px 3px 3px;padding:0px 0px 0px 0px;" data-lazydelay="0">

</div>




<figure class="wp-block-image"><a href="http://lh6.ggpht.com/-uEcjnS9mKBY/VOJxxar2FII/AAAAAAAANKE/M6loQBATIaE/s1600-h/clip_image034%25255B4%25255D.png"><img src="http://lh3.ggpht.com/-fleEa-mpxac/VOJxyXCbhII/AAAAAAAANKM/sk_yo01kYjQ/clip_image034_thumb%25255B1%25255D.png?imgmax=800" alt="clip_image034"/></a></figure>



<p>Next</p>



<figure class="wp-block-image"><a href="http://lh3.ggpht.com/-eUlKdAvMtqY/VOJxyyJ1Z2I/AAAAAAAANKU/-jCGr_aTt4o/s1600-h/clip_image035%25255B4%25255D.png"><img src="http://lh4.ggpht.com/-nsy-Bb3T0S0/VOJxz_JaWQI/AAAAAAAANKc/UW9DcXN5-ns/clip_image035_thumb%25255B1%25255D.png?imgmax=800" alt="clip_image035"/></a></figure>



<p>Next, I will type in the AsteriskNow PBX IP address and the port that &#8220;Chan_SIP&#8221; driver is listening on since all calls are going to be routed to it.</p>



<p>And will select my mediation server and the Mediation server&#8217;s configured port on Lync.</p>



<figure class="wp-block-image"><a href="http://lh5.ggpht.com/-_tACwxrBqrI/VOJx0UfdOLI/AAAAAAAANKk/AmfFZ_TDN6E/s1600-h/clip_image036%25255B4%25255D.png"><img src="http://lh4.ggpht.com/-ojm-V3vObws/VOJx1fTomyI/AAAAAAAANKs/x7CbWMxzV7o/clip_image036_thumb%25255B1%25255D.png?imgmax=800" alt="clip_image036"/></a></figure>



<p>Click Finish and Right click on your front end server and click properties</p>



<p>Make sure you</p>



<figure class="wp-block-image"><a href="http://lh6.ggpht.com/-1C8et118B9Q/VOJx2AZHgzI/AAAAAAAANK0/zasSlIwokOo/s1600-h/clip_image037%25255B4%25255D.png"><img src="http://lh6.ggpht.com/-NdY8zlKZxYA/VOJx3CF3QjI/AAAAAAAANK8/UDbE1f9RxPI/clip_image037_thumb%25255B1%25255D.png?imgmax=800" alt="clip_image037"/></a></figure>



<p>Click on Make default and then OK then publish the topology</p>



<p>Asterisk Configuration</p>



<p>Asterisk side of the Integration</p>



<p>In order for the configuration to work, we&#8217;ll have to configure a new trunk of the Asterisk IP PBX to identify where is the Lync server ..etc</p>



<p>Let&#8217;s go to our Asterisk portal, configure new trunk by going to Connectivity ->; Trunks then choose &#8220;Add SIP(chan_sip) Trunk&#8221;</p>



<figure class="wp-block-image"><a href="http://lh4.ggpht.com/-Sv3bhBceNZk/VOJx3zi-NwI/AAAAAAAANLE/T6uKVUoTpSk/s1600-h/clip_image038%25255B4%25255D.png"><img src="http://lh5.ggpht.com/-HzODlNCLklw/VOJx47lH5DI/AAAAAAAANLM/L6SbTCkLPWU/clip_image038_thumb%25255B1%25255D.png?imgmax=800" alt="clip_image038"/></a></figure>



<p>You will need to fulfill the boxes in red below each with what pertain to it.</p>



<figure class="wp-block-image"><a href="http://lh3.ggpht.com/-Wv3RCggZ6z0/VOJx5o26gsI/AAAAAAAANLU/UBfNnNUsdWY/s1600-h/clip_image039%25255B4%25255D.png"><img src="http://lh4.ggpht.com/-qV84-tSysdg/VOJx6n2HkXI/AAAAAAAANLc/NpZKLqR6UJo/clip_image039_thumb%25255B1%25255D.png?imgmax=800" alt="clip_image039"/></a></figure>



<p>The IP 172.16.24.195 is my Mediation server (Front end since Mediation server is collocated)</p>



<p>TCP is the protocol that Lync uses</p>



<p>5060 is the port which Lync listens on</p>



<p>I will clear all the settings below &#8220;User Details&#8221; and save this trunk</p>



<figure class="wp-block-image"><a href="http://lh5.ggpht.com/-6dzn5MNpZSk/VOJx7dnZGDI/AAAAAAAANLk/ZTPnbJSVwWM/s1600-h/clip_image040%25255B4%25255D.png"><img src="http://lh5.ggpht.com/-y7Egn42j6oc/VOJx8LRaWEI/AAAAAAAANLs/mh6TYjdP1L8/clip_image040_thumb%25255B1%25255D.png?imgmax=800" alt="clip_image040"/></a></figure>



<p>Now field cleared and next will click on Submit Changes.</p>



<figure class="wp-block-image"><a href="http://lh5.ggpht.com/-fQntthOwkgY/VOJx87Pf7yI/AAAAAAAANL0/-jDnb4D6T80/s1600-h/clip_image041%25255B4%25255D.png"><img src="http://lh5.ggpht.com/-fxsSUErjVPI/VOJx9qewyXI/AAAAAAAANL8/GNYg4n2x878/clip_image041_thumb%25255B1%25255D.png?imgmax=800" alt="clip_image041"/></a></figure>



<p>Inbound Routes</p>



<p>I have applied the configuration and now it&#8217;s time to create routes on Asterisk to route calls to Lync.</p>



<p>To configure routes, click on Connectivity and then Inbound routes</p>



<figure class="wp-block-image"><a href="http://lh4.ggpht.com/-es7hHBpIvLo/VOJx-bhkFTI/AAAAAAAANME/V75BW2axoAI/s1600-h/clip_image042%25255B4%25255D.png"><img src="http://lh3.ggpht.com/-h6nOpExzQkk/VOJx_dH7-GI/AAAAAAAANMM/tfA8xF04xEE/clip_image042_thumb%25255B1%25255D.png?imgmax=800" alt="clip_image042"/></a></figure>



<figure class="wp-block-image"><a href="http://lh4.ggpht.com/-Nu_HvEV07XM/VOJyAAhVs5I/AAAAAAAANMU/iTK0GQ5SrUc/s1600-h/clip_image043%25255B4%25255D.png"><img src="http://lh6.ggpht.com/-nL4-2hmEGcM/VOJyA-WUZJI/AAAAAAAANMc/C5GCfM7ujmk/clip_image043_thumb%25255B1%25255D.png?imgmax=800" alt="clip_image043"/></a></figure>



<figure class="wp-block-image"><a href="http://lh3.ggpht.com/-ri12FrO9K3A/VOJyBkbGrJI/AAAAAAAANMk/wJ4OcUFr8J8/s1600-h/clip_image044%25255B4%25255D.png"><img src="http://lh6.ggpht.com/-e3eBjuI3M4Y/VOJyCQaGTvI/AAAAAAAANMs/7As4Mi8XhDU/clip_image044_thumb%25255B1%25255D.png?imgmax=800" alt="clip_image044"/></a></figure>



<p>Click Submit now and Apply Config for changes to take effect</p>



<figure class="wp-block-image"><a href="http://lh6.ggpht.com/-2fnLq3r4UPI/VOJyC21gdOI/AAAAAAAANM0/kbAEgfK8YGc/s1600-h/clip_image045%25255B3%25255D.png"><img src="http://lh3.ggpht.com/-IOJfUII25Eo/VOJyDtY6qBI/AAAAAAAANM8/qWejcHB5eKA/clip_image045_thumb.png?imgmax=800" alt="clip_image045"/></a></figure>



<p>Outbound Routes</p>



<p>It&#8217;s time to configure the outbound routes, Depending on your Lync users URI or telephone number and extension number you will have to configure</p>



<p>Your outbound routes according so it will be able to route it properly to Lync users.</p>



<p>I&#8217;m going to show my user&#8217;s uri and extension on Lync server and what does it look like now</p>



<figure class="wp-block-image"><a href="http://lh4.ggpht.com/-kDg-0onVsnI/VOJyESuos1I/AAAAAAAANNE/mFlkJRrXi7w/s1600-h/clip_image046%25255B4%25255D.png"><img src="http://lh3.ggpht.com/-FACjmV34yH4/VOJyFRDzpyI/AAAAAAAANNM/RxRME--cpp8/clip_image046_thumb%25255B1%25255D.png?imgmax=800" alt="clip_image046"/></a></figure>



<p>So the entire number is +2163314210 but my extension is basically 4210</p>



<p>Now again click on Connectivity >; Outbound routes and add new &#8220;Dial Pattern&#8221; as following</p>



<p>The +216331 will be automatically entered by AsteriskNow once you dial the number defined in the &#8220;Match Pattern&#8221; field</p>



<figure class="wp-block-image"><a href="http://lh5.ggpht.com/-Y-HlOcrqST0/VOJyF2pfvLI/AAAAAAAANNU/cQOvlXNWEIw/s1600-h/clip_image047%25255B4%25255D.png"><img src="http://lh5.ggpht.com/-7NoQnlplUc8/VOJyGmXIlgI/AAAAAAAANNc/Z5DPuIXeamg/clip_image047_thumb%25255B1%25255D.png?imgmax=800" alt="clip_image047"/></a></figure>



<p>Once finished configuring the required dial patterns you can submit and apply …</p>



<figure class="wp-block-image"><a href="http://lh4.ggpht.com/-q-pYUd4gRlY/VOJyHQY4QDI/AAAAAAAANNk/navicJflEYA/s1600-h/clip_image048%25255B4%25255D.png"><img src="http://lh5.ggpht.com/-B9UU_zwu1bk/VOJyIAI6loI/AAAAAAAANNs/z80rixTArRw/clip_image048_thumb%25255B1%25255D.png?imgmax=800" alt="clip_image048"/></a></figure>



<p>Lync Voice Route Configuration</p>



<p>Now it&#8217;s time to go configure Lync Routes, Go to Lync Server and open the Control panel, Go to Voice routing there we will go under the dial plan</p>



<p>tab and choose New \ User Dial Plan.</p>



<p>If you don&#8217;t want to mess up your Global dial plan or let every new user be able to use this dial plan ,you will have to configure a user dial plan.</p>



<figure class="wp-block-image"><a href="http://lh4.ggpht.com/-5PKZJDZNr5A/VOJyI0YywGI/AAAAAAAANN0/DyPCl7ffvJw/s1600-h/clip_image049%25255B4%25255D.png"><img src="http://lh4.ggpht.com/-VqqiKv7jfos/VOJyJ0zCCzI/AAAAAAAANN8/3TsJ0E7nbrQ/clip_image049_thumb%25255B1%25255D.png?imgmax=800" alt="clip_image049"/></a></figure>



<p>I will have to create 2 normalization rules at least in the new dial plan. The first one is going to normalize the inbound numbers</p>



<p>And the second one is going to normalize the outbound.</p>



<figure class="wp-block-image"><a href="http://lh3.ggpht.com/-W78jeymHK0I/VOJyKbD_KZI/AAAAAAAANOE/iClNZEP6ozg/s1600-h/clip_image050%25255B4%25255D.png"><img src="http://lh4.ggpht.com/-Bg_RdiUJA6Q/VOJyLZ9ATtI/AAAAAAAANOM/gaOVe6wG6gE/clip_image050_thumb%25255B1%25255D.png?imgmax=800" alt="clip_image050"/></a></figure>



<p>Since on PBX I choose to create extensions that begins with 3 and are 4 digits long, I will create a normalization rule that&#8217;s exactly 4 digits</p>



<p>And it starts with 3. depending on your PBX configuration for the extension and inbound routes Lync needs to either have or not have the + in the dial plan</p>



<figure class="wp-block-image"><a href="http://lh5.ggpht.com/-A2WOPj5WrxE/VOJyL7-nsxI/AAAAAAAANOU/6iu6E5gGHzo/s1600-h/clip_image051%25255B4%25255D.png"><img src="http://lh3.ggpht.com/-_bGgc_j3dFA/VOJyMxtRtzI/AAAAAAAANOc/wzEg2WOCRr4/clip_image051_thumb%25255B1%25255D.png?imgmax=800" alt="clip_image051"/></a></figure>



<p>Now I will create the second dial plan which is from Asterisk to Lync &#8220;To match the full URI&#8221;</p>



<p>The normalization rule that I am creating here is 10 digits long and it starts with 21633 and it has + digits to add</p>



<figure class="wp-block-image"><a href="http://lh4.ggpht.com/-caCWqTjrpxQ/VOJyNcI46tI/AAAAAAAANOk/YeuulXzupP8/s1600-h/clip_image052%25255B4%25255D.png"><img src="http://lh6.ggpht.com/-gGIX-ku7AwY/VOJyOcZiqNI/AAAAAAAANOs/0OM51175GOI/clip_image052_thumb%25255B1%25255D.png?imgmax=800" alt="clip_image052"/></a></figure>



<figure class="wp-block-image"><a href="http://lh3.ggpht.com/-L8tQXEJG8IY/VOJyPO1QO6I/AAAAAAAANO0/vD3YxnlLAvg/s1600-h/clip_image053%25255B4%25255D.png"><img src="http://lh3.ggpht.com/-N2U1RJEocjI/VOJyQL8k7uI/AAAAAAAANO8/hA7APFQDDzQ/clip_image053_thumb%25255B1%25255D.png?imgmax=800" alt="clip_image053"/></a></figure>



<p>After creating the Dial plans, it&#8217;s time to test them now! I will go to the Test Voice Routing Tab and create a test</p>



<p>So the test for Asterisk Extensions goes well</p>



<figure class="wp-block-image"><a href="http://lh5.ggpht.com/-PZ_8uBNWPSY/VOJyQsG03YI/AAAAAAAANPE/-wkFlYUGIXw/s1600-h/clip_image054%25255B4%25255D.png"><img src="http://lh5.ggpht.com/-DpuIm7gcNk8/VOJyRmNYcwI/AAAAAAAANPM/eoPQM4eIOWo/clip_image054_thumb%25255B1%25255D.png?imgmax=800" alt="clip_image054"/></a></figure>



<p>Now I will test the Lync dial plan</p>



<figure class="wp-block-image"><a href="http://lh4.ggpht.com/-ah5Cgt5NE1w/VOJySbtYFmI/AAAAAAAANPU/JMyNpGkbnrY/s1600-h/clip_image055%25255B4%25255D.png"><img src="http://lh4.ggpht.com/-zxb8vp_TXLA/VOJyTRdoI9I/AAAAAAAANPc/-hoUHUT0uDk/clip_image055_thumb%25255B1%25255D.png?imgmax=800" alt="clip_image055"/></a></figure>



<p>Since Asterisk is going to send the full URI as it will auto complete it even if the user enters the extension only (4210) then our rule is configured properly</p>



<p>Now after configuring rules and testing them it&#8217;s time to go to Voice Policy tab and create a new voice policy for Asterisk</p>



<figure class="wp-block-image"><a href="http://lh4.ggpht.com/-c91bag4dkrM/VOJyT7V-c3I/AAAAAAAANPk/X2dbqyA2qms/s1600-h/clip_image056%25255B4%25255D.png"><img src="http://lh5.ggpht.com/--F_oT-ZF7IU/VOJyU79jf1I/AAAAAAAANPs/a8QxGygJDhk/clip_image056_thumb%25255B1%25255D.png?imgmax=800" alt="clip_image056"/></a></figure>



<p>Click on New under &#8220;Associated PSTN Usages&#8221;</p>



<figure class="wp-block-image"><a href="http://lh4.ggpht.com/-bPOnXTt5NAM/VOJyVsijqTI/AAAAAAAANP0/1emy7MQr_Z4/s1600-h/clip_image057%25255B4%25255D.png"><img src="http://lh3.ggpht.com/-CdxFEMwf4ac/VOJyWQObqYI/AAAAAAAANP8/11ADFU7Yw34/clip_image057_thumb%25255B1%25255D.png?imgmax=800" alt="clip_image057"/></a></figure>



<p>Click on New under Associated Routes</p>



<figure class="wp-block-image"><a href="http://lh4.ggpht.com/-qI591Tzg1kc/VOJyXEN5OmI/AAAAAAAANQE/1Obat4Z4CGM/s1600-h/clip_image058%25255B4%25255D.png"><img src="http://lh5.ggpht.com/-GnvDrbTydSA/VOJyXzkPCxI/AAAAAAAANQM/3mP1tJpCWWA/clip_image058_thumb%25255B1%25255D.png?imgmax=800" alt="clip_image058"/></a></figure>



<p>You can leave the pattern .* (Which will allow all calls) for the time being until we test everything between both systems.</p>



<p>Scroll down and click on Add next to &#8220;Associated Trunks&#8221;</p>



<figure class="wp-block-image"><a href="http://lh3.ggpht.com/-SQDbqPy7SSM/VOJyYqU65xI/AAAAAAAANQU/CaVy0rNalvc/s1600-h/clip_image059%25255B6%25255D.png"><img src="http://lh5.ggpht.com/-SJJFu4TNKfs/VOJyZV4Vz6I/AAAAAAAANQc/UKpSYNKNlyI/clip_image059_thumb%25255B3%25255D.png?imgmax=800" alt="clip_image059"/></a></figure>



<figure class="wp-block-image"><a href="http://lh3.ggpht.com/-WosU44kNwrY/VOJyaK2MsbI/AAAAAAAANQk/UGsKJlbIOmA/s1600-h/clip_image060%25255B4%25255D.png"><img src="http://lh4.ggpht.com/-AXH-qfV3pI4/VOJyawDKMlI/AAAAAAAANQs/oql7owPkcpQ/clip_image060_thumb%25255B1%25255D.png?imgmax=800" alt="clip_image060"/></a></figure>



<p>Select the available trunk and add it then Click OK 3 times and commit all changes</p>



<figure class="wp-block-image"><a href="http://lh3.ggpht.com/-MNi93eO_CLw/VOJybZuTKMI/AAAAAAAANQ0/alSG3SnVNLU/s1600-h/clip_image061%25255B4%25255D.png"><img src="http://lh3.ggpht.com/-j8NG7OwVtX4/VOJycUz_IwI/AAAAAAAANQ8/08KvTk3NEO8/clip_image061_thumb%25255B1%25255D.png?imgmax=800" alt="clip_image061"/></a></figure>



<p>Now after applying all the configuration, It&#8217;s time to apply some tests.</p>



<p>From Asterisk to Lync</p>



<p>Below when I initiated the call I managed to see the SIP invite coming from the IP &#8220;172.16.24.195&#8221; which is my AsteriskNOW PBX IP going to Lync and then the phone starts ringing.</p>



<p>When I have answered the call the RTP starts flowing.</p>



<figure class="wp-block-image"><a href="http://lh6.ggpht.com/-mSUa1DPoMeE/VOJydoph75I/AAAAAAAANRE/ILw5wsWj_LQ/s1600-h/clip_image062%25255B4%25255D.png"><img src="http://lh4.ggpht.com/-Owff1QcMERg/VOJyevFzDGI/AAAAAAAANRM/6VUsFftBcK8/clip_image062_thumb%25255B1%25255D.png?imgmax=800" alt="clip_image062"/></a></figure>



<p>Here I typed RTP in the Wireshark filter and could see the RTP media flowing between Asterisk and Lync Mediation server on the G.711 codec.</p>



<figure class="wp-block-image"><a href="http://lh3.ggpht.com/-kE00cusPocU/VOJygMfMXLI/AAAAAAAANRU/Cv5ka3-F-78/s1600-h/clip_image063%25255B4%25255D.png"><img src="http://lh5.ggpht.com/-xRASdqMEV2M/VOJyhSYFLeI/AAAAAAAANRc/lpoyvOMiXc0/clip_image063_thumb%25255B1%25255D.png?imgmax=800" alt="clip_image063"/></a></figure>



<p>Note:</p>



<p>What I like about Asterisk is that it sends all users information along with the call and doesn&#8217;t strip them out, in extension information I have typed the extension name as &#8220;NEWPHONE&#8221; and put it all in capitals.</p>



<figure class="wp-block-image"><a href="http://lh4.ggpht.com/-PYunD4NMOqw/VOJyiP4JVgI/AAAAAAAANRk/pjzAyZzy_JY/s1600-h/clip_image064%25255B4%25255D.png"><img src="http://lh4.ggpht.com/-yPBWKMe5K0g/VOJyi5lyEpI/AAAAAAAANRs/1RrvExMkXW4/clip_image064_thumb%25255B1%25255D.png?imgmax=800" alt="clip_image064"/></a></figure>



<p>From Lync to Asterisk</p>



<p>Since the call is from Lync to Asterisk, then I will have to run wireshark or trace on Asterisk to see the Invite.</p>



<figure class="wp-block-image"><a href="http://lh3.ggpht.com/-qQz70WslR0c/VOJyjgX2UuI/AAAAAAAANR0/GtFkhF4GgPk/s1600-h/clip_image065%25255B4%25255D.png"><img src="http://lh4.ggpht.com/-LwuxE3cpeTo/VOJykmxb9UI/AAAAAAAANR8/mwMjV3puRxw/clip_image065_thumb%25255B1%25255D.png?imgmax=800" alt="clip_image065"/></a></figure>



<p>You can see Asterisk logs if you click on &#8220;Reports>; Asterisk LogFiles&#8221;</p>



<figure class="wp-block-image"><a href="http://lh3.ggpht.com/-vfAePnZ8XO0/VOJymkziUII/AAAAAAAANSE/zPLwri_hIXY/s1600-h/clip_image066%25255B4%25255D.png"><img src="http://lh6.ggpht.com/-BzLLELWe-cs/VOJyoE8bjFI/AAAAAAAANSI/2u9re2BWJrM/clip_image066_thumb%25255B1%25255D.png?imgmax=800" alt="clip_image066"/></a></figure>



<p>Once the call has ended I was able to see that in detail as well in the logs.</p>



<p>All the media was</p>
<!-- WP QUADS Content Ad Plugin v. 2.0.92 -->
<div class="quads-location quads-ad2526 " id="quads-ad2526" style="float:none;margin:0px 3px 3px 3px;padding:0px 0px 0px 0px;" data-lazydelay="0">

</div>




<figure class="wp-block-image"><a href="http://lh3.ggpht.com/-HR_oVSb6icg/VOJypLaIK3I/AAAAAAAANSU/6p_sYcqjfWg/s1600-h/clip_image067%25255B4%25255D.png"><img src="http://lh3.ggpht.com/-fn3TtBTj3Vo/VOJyp12tNzI/AAAAAAAANSc/FO2exmkByn0/clip_image067_thumb%25255B1%25255D.png?imgmax=800" alt="clip_image067"/></a></figure>



<p>Next few days I will install and configure Brekeke to work with both (Asterisk and Lync) in the same environment… and share my deployment update with you all.</p>

<!-- WP QUADS Content Ad Plugin v. 2.0.92 -->
<div class="quads-location quads-ad2531 " id="quads-ad2531" style="float:none;margin:0px 3px 3px 3px;padding:0px 0px 0px 0px;" data-lazydelay="0">

</div>


Reset and manage your Active Directory users' Passwords Active Directory is one of the most…
Finding Exchange Database hidden mailboxes. Story:Maybe you have been in this situation before, trying to…
If you're using a Proxy server in your firewall or in your network and have…
Story:I got some clients that have reported some of their users being locked out and…
Delegate Permissions This is a code that I have wrote recently to check if an…
Story: I got a request from a client who constantly gets CVs and have to…