Tuesday, June 21, 2011

Using Asteriks with Lync 2010

Next week I am teaching how to install and configure Lync using the material provided in the course10533 from Microsoft. Although the course has some great stuff, it misses out on the really juicy bits. Setting up a PSTN connection for example.
I simply could not resist setting it up for myself. After some digging I found this GREAT! Post by Adam:
http://imaucblog.com/archive/2010/10/09/step-by-step-microsoft-lync-2010-asterisk-and-skype-installationintegration-guide/

But then I need to get my Virtual machines connected to the internet! Now ICS has proven to be rather icky. And Bridging really mucks things up. So in the end only a good ol Routing Service would do the trick.
John Paul has a nice article on how to configure Hyper-V to route traffic to your wireless adapter:
http://sqlblog.com/blogs/john_paul_cook/archive/2008/03/23/using-wireless-with-hyper-v.aspx

WARNING! Skip the first quarter of the screenshots where he shows bridging. don't wanna do that. jump down to where he starts talking about RRAS

Once I had routing set up and could connect to the net using the private ip-ranges I wanted, I was ready to install Asterisk using Adam's instructions.

Some tips for getting it all running:
No need to buy Skype Plugin if you wanna use sip. I used 2talk and am happy with the results. For the detailled config for 2talk try this page:
http://blog.2talk.co.nz/asterisk.html

IK found a mix between the settings from Adam and the ones from 2talk worked best.

WARNING! A typo or bad rule can send your Asterisk server into an endless crash loop. To fix that, copy the 2talk configurations back into the files and start over again.

Some helping commands I used along the way on the Linux box:
ifconfig (set a new IP address)
route (add a default route to connect to Gateway)
ping (test ip connectivity)
nslookup (test dns server connectivity)
ifconfig and route take effect immediately on the linux box. The changes made via the network setup program only come to life on the next reboot (which took about 5-10 minutes each time)
 
asterisk -r (connect to asterisk console)
  reload (reload all configs)
  diaplan reload (reload only the dialplan)
  sip show peers (see what routes are setup and working)

And as I hate using the command line editor, downlad a browser/editor for Windows ASAP, such as WinSCP: http://winscp.net/eng/download.php
You will need that editor to edit the /etc/asterisk/sip.conf and /etc/asterisk/extensions.conf files

Whenever you make a change to sip.conf or extensions.conf make sure to run the reload command in asterisk again.
Also, staying logged in to Asterisk will show what is going on and is useful when debugging conversation attempts.
Finally, try getting it working step by step.
1) connect X-Lite to SIP provider via Asterisk
2) connect X-Lite to Lync
3) connect Lync to X-Lite
4) connect Lync to SIP provider
Step 1 should be your priority. Once that works the rest falls into place.


Happy configuring. Having it all working is an exhilerating feeling. you'll know what I mean once you have made your first Lync phone call to a real land line.

No comments: