Sie sind auf Seite 1von 81

I'M A UC BLOG

m y thoughts and e x pe rie nce s in e nte rprise com m unications te chnology

Hom e

About

Type text to search here...

Step-by-step Microsoft Lync 2010, Asterisk and Skype installation/integration guide


O ctobe r 9th, 2010 | Tags: Aste risk , Lync 2010, Lync Se rve r 2010, Sk ype , Sk ype for Aste risk , Sk ype for SIP

Resources

Tw eet

> My PowerPoint Decks > Nortel Case Study > BlackBerry Case Study > Windows Official Mag Article > Next Hop Articles
Recent Posts

Once a year I give my blessing to the wife to go away on a long weekend with the girls and usually I try to call in a few child minding favours from my parents/in-laws and this weekend, thank goodness, is no exception to the rule! Last time I was given these days of peace I wrote a Trixbox/Exchange 2010 integration guide, the emphasis was on this becoming the first in a series of how-tos however this never really came to fruition, the reason? Asterisk + friendly UI = Bad bad badso from here on in I have chosen to move to AsteriskNOW. Trixbox is a great distribution of Asterisk, however it does break certain Asterisk standards and you cant beat a good ol command line yes in Asterisks case the command line is easier than a web interface. So why not plain old Asterisk? AsteriskNOW makes light work of the install and Im by no means a Linux guru! You can still opt for the FreePBX front end but we will choose to not go down this dark path trust me on this! So lets talk objectives 1. Setup AsteriskNOW, configuring a SIP extension and corresponding dial-plan 2. Install and configure Skype for Asterisk (SFA), ensuring the SIP extension above can route in/out (SkypeOut) 3. Take the Lync 2010 Server install performed here and integrate it with AsteriskNOW Make calls to and from the Asterisk SIP extension (Lync & SFA) Make calls to and from the Lync client (SIP & SFA) So here is an idea of how this will all piece together:

Lync In-Person Events in 2014 Lync Room System (LRS) account creation in 10 easy steps Deploying Polycom Boss/Admin (now a part of UCS 5.0 Firmware) CX7000 and Room Mailboxes within Office 365 Unable to enable Lync to Skype connectivity (PIC) once split-domain is provisioned within Lync Online
Upcoming MUCUGL Events

undefined 2011 S M T W T F S

open in browser PRO version

Are you a developer? Try out the HTML to PDF API

pdfcrowd.com

Sounds like a tall order right? Wrong. With AsteriskNOW and Lync Server 2010, it is reasonably straight forward and I will endeavour to document the end-to-end setup process. Before I begin let me talk about SFA Skype as you may or may not be aware offers two SME level VoIP integrations:1. Skype for SIP (now re-branded as Skype Connect) essentially a way of integrating Skypes cloud of PSTN in/out connectivity including the capability to call Skype users (22.5k online as I type) to an SIP enabled IP PBX for supported vendors see here. 2. Skype for Asterisk (SFA) an add-on Asterisk channel driver which allows for Skype-to-Skype calls and access to Skypes uber cheap calling rates via your Asterisk end-point. If you are already running an Asterisk based PBX you will probably want to know the difference. From a high level it comes down to the following:1. Cost Skype Connect is subscription-based, you pay $6.95 per channel plus calling costs not cheap for those who want to use this for a lab sized implementation. 2. Functionality SFA is not channel-based, it is user-based, for a one off charge of $66 you get a single user license sounds a bit more digestible, right? A single license would give you one channel. In this guide we will enable a single license be configured to route out from either SIP or Lync end points. From an inbound perspective you could create a Lync response group or Asterisk call group to broadcast inbound calls to multiple users. One (or should i say three?) last caveat before we get on with the good stuff:1. Lync is currently in release candidate, it is unlikely to change on a grand scale, but be aware it is not supported by Microsoft 2. Lync (or OCS) + Asterisk integrations are not supported by Microsoft 3. This is a just for fun guide or lab setup only Okay, with that over with lets look at requirements

Archives

January 2014 (2) September 2013 (1) August 2013 (2) July 2013 (1) May 2013 (1) March 2013 (1) February 2013 (1)

open in browser PRO version

Are you a developer? Try out the HTML to PDF API

pdfcrowd.com

Okay, with that over with lets look at requirements 1. Ill be using Windows Server 2008 R2 with Hyper-V to run Lync Server 2010 RC & AsteriskNOW 2. I have assigned 2gb of memory to Lync Server 2010 RC and 512mb to AsteriskNOW (I know this seems minimal but it is enough for this small test setup) 3. Youll need to setup a Skype business account as SFA will not work with regular consumer accounts (you can route Skype-to-Skype calls between business and consumer accounts) 4. Once you have setup a free Skype business account youll need credit as without credit it wont route out to PSTN. I suggest you test the account by adding it to a Skype software client first (if you hit any roadblocks further down the line youll be pleased to have ruled this potential issue out) 5. Buy an SFA single channel license which can be purchased directly from Digium, the makers of Asterisk, via their online store (currently at $66) youll get a licence key that we will activate later Lets begin Download a copy of AsteriskNOW, I have opted for the 64-bit version here, whilst this is downloading (it is approximately 600mb), lets setup our VM. Create a name:

December 2012 (1) November 2012 (1) October 2012 (1) September 2012 (2) August 2012 (2) July 2012 (1) June 2012 (2) May 2012 (2) April 2012 (1) March 2012 (1) February 2012 (2) January 2012 (2) December 2011 (2) November 2011 (2) October 2011 (1) September 2011 (2) August 2011 (2) July 2011 (1) June 2011 (5) May 2011 (7) April 2011 (4) March 2011 (9) February 2011 (5) January 2011 (8) December 2010 (4) November 2010 (4) October 2010 (3)

open in browser PRO version

Are you a developer? Try out the HTML to PDF API

pdfcrowd.com

October 2010 (3) Set memory: September 2010 (6) August 2010 (5) July 2010 (2) June 2010 (7) May 2010 (6) April 2010 (15) March 2010 (9) February 2010 (5) January 2010 (9) December 2009 (7) November 2009 (14) October 2009 (13) September 2009 (14) August 2009 (54) July 2009 (75) Dont connect it to your virtual network, well need to create a legacy network adaptor as we are using Linux June 2009 (42) May 2009 (50)

open in browser PRO version

Are you a developer? Try out the HTML to PDF API

pdfcrowd.com

April 2009 (15)

Im going to accept the default options when configuring my virtual disk (this isnt usually recommended for performance, but for AsteriskNOW itll be sufficient)

Lync Software Updates Center

Updates for Lync Server 2013: January

open in browser PRO version

Are you a developer? Try out the HTML to PDF API

pdfcrowd.com

Updates for Lync Server 2013: January 2014 Cumulative updates for Lync Server 2010: January 2014 Cumulative update for Lync 2010: January 2014 Cumulative updates for Lync Phone Edition (for Aastra 6721ip and Aastra 6725ip): January 2014 Cumulative updates for Lync Phone Edition (for HP 4110 and HP 4120): January 2014 Cumulative updates for Lync Phone Edition (for Polycom CX500, Polycom CX600, and Polycom CX3000): January 2014 Cumulative updates for Lync Phone Edition (for Polycom CX700 and LGOnce your bootable AsteriskNOW ISO is downloaded, select this as the operating system to boot from within Hyper-V Manager Nortel IP Phone 8540): January 2014 Security Update for Lync 2013: December 2013

open in browser PRO version

Are you a developer? Try out the HTML to PDF API

pdfcrowd.com

December 2013 Cumulative updates for Lync for Mac 2011: December 2013 Security update for Lync 2010 Attendee (Administrator level installation): December 2013
Tags

Apple Asterisk Avaya


Bing BlackBerry

/ Nortel

blogging

Communicator Data
Classifications

Exchange

2007 Exchange

2010 Google Hyper-V


iPhone iPod Laptop Hunters
Our summary, click Finish

Lync 2010 Lync

open in browser PRO version

Are you a developer? Try out the HTML to PDF API

pdfcrowd.com

Lync 2010 Lync

Server 2010
Microsoft
Microsoft Retail

Microhoo!

MUCUGL

OCS 2007 OCS

2007 R2 Office 365 Office


2007 Office 2010 Outlook 2007
Outlook 2010 PlayStation3

Polycom

Security Skype Skype for Asterisk

Unified Communications
Speaker TechEd UC Expo

User Group Virtualisation VoIP

Windows 7 Windows
Server Windows Server 2008 Before we kick off the install, youll need to go to your settings and add one hardware component, the legacy network adaptor mentioned earlier and make sure this is connected to your virtual network

Windows Server 2008 R2


Windows Vista

open in browser PRO version

Are you a developer? Try out the HTML to PDF API

pdfcrowd.com

Lets start our VM! Fingers-crossed the AsteriskNOW ISO will boot and the install commences, select option 5 Asterisk 1.6 only (we need Asterisk 1.6 for TCP support, a SIP trunk requirement for OCS and Lync)

open in browser PRO version

Are you a developer? Try out the HTML to PDF API

pdfcrowd.com

Select yes, to accept the creation of partitions and wiping of data

open in browser PRO version

Are you a developer? Try out the HTML to PDF API

pdfcrowd.com

The default partition scheme is fine, select next. Set your region, select next and create a root (or Administrator) password then click next.

open in browser PRO version

Are you a developer? Try out the HTML to PDF API

pdfcrowd.com

The install will now commence, in my case Im going to grab some breakfast!

open in browser PRO version

Are you a developer? Try out the HTML to PDF API

pdfcrowd.com

Im back and the install is complete, eject your ISO via the Hyper-V toolbar, Select Media -> DVD Drive -> Eject. Then click reboot

open in browser PRO version

Are you a developer? Try out the HTML to PDF API

pdfcrowd.com

During the boot sequence youll see a ton of text, which will all (hopefully) end with [ OK ]. Upon completion you will see a Setup Agent, quit this and you will be presented with the screen below.

open in browser PRO version

Are you a developer? Try out the HTML to PDF API

pdfcrowd.com

Login with your root account and start the network configuration utility, type system-confignetwork. You will then be presented with the screen below

open in browser PRO version

Are you a developer? Try out the HTML to PDF API

pdfcrowd.com

Edit your network device eth0 Digital Equipment Corporation DECchip 21140 [FasterNet], remove the DHCP option and set a static address, in my case 192.168.10.30

open in browser PRO version

Are you a developer? Try out the HTML to PDF API

pdfcrowd.com

Save and now edit your DNS configuration. In my case I have a local DNS server (192.168.10.253) but set this to suit your needs. I have also set my host name as ast.jacobs.local (jacobs.local is my local domain name) and set the search to my local domain. Then Save & Quit.

open in browser PRO version

Are you a developer? Try out the HTML to PDF API

pdfcrowd.com

Once you are back to the command line type: shutdown r now this will result in a reboot of the system. Once the system has completed a restart, login again as root. You should now be able to ping from this system to another address on your local network including the Internet (to check this, ping www.bing.com to ensure internet connectivity is working) if you cant then something has gone wrong! In some cases I have found that you need to head back into the network settings and re-input the DNS, this issue shouldnt re-occur. Now you are back to your Asterisk command line, type yum install register, youll be prompted to download the package, accept this by inputting Y and hitting enter. YUM is an abbreviated word for Yellow dog Updater Modified, it is a command line package management tool. The Register package is used to activate your SFA license.

open in browser PRO version

Are you a developer? Try out the HTML to PDF API

pdfcrowd.com

Next well update our version of AsteriskNOW, type yum update asterisk16, accept the upgraded packages (as detailed within our previous step)

open in browser PRO version

Are you a developer? Try out the HTML to PDF API

pdfcrowd.com

Once completed, well install SFA, type yum install asterisk16-skypeforasterisk, accept the package download. Once installed reboot, type shutdown r now.

open in browser PRO version

Are you a developer? Try out the HTML to PDF API

pdfcrowd.com

Once the reboot has completed login and well register the SFA module (using the license key received from Digium). Login as root and type, register. Select option 1 (Digium Products), then option 7 Skype for Asterisk. Next you will be prompted to enter you SFA key, enter the key and register now. Click the space bar to run through the license agreement (does anyone read these?) and accept the agreement. Complete your personal details and your license should be written to /var/lib/asterisk/licenses/ (you should back this up Ill explain this next). But one last reboot first, type shutdown r now, our Asterisk install is now complete, next well need to configure it!

open in browser PRO version

Are you a developer? Try out the HTML to PDF API

pdfcrowd.com

To configure our Asterisk PBX we need to edit a number of text files, there are Linux-based editors, but in my experience they are not that user friendly and I like to perform this remotely using my friendly Windows PC, to do this you need an SSH client I use WinSCP. Download a free copy via their website here. Once installed add a new site (see below)

open in browser PRO version

Are you a developer? Try out the HTML to PDF API

pdfcrowd.com

Then change the default remote directory (as per the illustration below) and save the site.

open in browser PRO version

Are you a developer? Try out the HTML to PDF API

pdfcrowd.com

Once saved click login. The first time you connect you will be prompted to save your Asterisk server key, click yes to add the host key to your cache. Finally enter your password, once connected an explorer type view of your Asterisks file system will be displayed I have changed to a detailed view (choose view -> details)

open in browser PRO version

Are you a developer? Try out the HTML to PDF API

pdfcrowd.com

Back-up your SFA license by copying the file from /var/lib/asterisk/licenses there should only be one .lic file in there, just right click and copy to your desktop to save locally. Now head back to the folder /etc/asterisk this is where our Asterisk config files are located. We will be editing three files: (right click and edit within WinSCP) 1. Sip.conf for main Asterisk settings (trunks/extensions) 2. Extensions.conf for dial plans 3. Chan_skype.conf SFA settings First sip.conf, replace the content of your file with the following settings (you should probably backup your original conf files before) [general] context=default allowoverlap=no udpbindaddr=0.0.0.0 bindport=5060

; Default context for incoming calls ; Disable overlap dialing support. (Default is yes) ; IP address to bind UDP listen socket to (0.0.0.0 binds to all)
Are you a developer? Try out the HTML to PDF API

open in browser PRO version

pdfcrowd.com

bindaddr=0.0.0.0 tcpenable=yes tcpbindaddr=0.0.0.0 srvlookup=yes notifyhold = yes [1001] type=friend callerid=1001 canreinvite=no dtmfmode=rfc2833 mailbox=1001 disallow=all allow=ulaw transport=udp secret=password host=dynamic context=default [Lync_Trunk] type=friend port=5068 host=192.168.10.29 dtmfmode=rfc2833 context=from-lync qualify=yes transport=tcp,udp

; ; ; ;

Enable server for incoming TCP connections (default is no) IP address for TCP server to bind to (0.0.0.0 binds to all interfaces) Enable DNS SRV lookups on outbound calls Notify subscriptions on HOLD state (default: no)

; A locally attached SIP extension

; Our Lync trunk ; This is the default Lync Server TCP listening port ; This should be the IP address of your Lync Server

Next extensions.conf, replace the content of your file with the following settings [general] static=yes writeprotect=no [globals] [default] ;dialling other extensions starting with 1 followed by three digits exten=>_1XXX,1,Dial(SIP/${EXTEN},20)

open in browser PRO version

Are you a developer? Try out the HTML to PDF API

pdfcrowd.com

exten=>_1XXX,n,hangup() ;send every digit after 9 to Skype for Asterisk exten=>_9.,1,Dial(Skype/${EXTEN:1},20) exten=>_9.,n,hangup() ;dialling other extensions starting with 2 followed by three digits exten=>_2XXX,1,Dial(SIP/Lync_Trunk/${EXTEN},20) exten=>_2XXX,n,hangup() [from-lync] ;dialling other extensions starting with 1 followed by three digits exten=>_1XXX,1,Dial(SIP/${EXTEN},20) exten=>_1XXX,n,hangup() ;send other calls to Skype for Asterisk exten=>_.,1,Dial(Skype/${EXTEN},20) exten=>_.,n,hangup() This dial plan will enable call routing between Lync , Asterisk & SFA. Finally configure your chan_skype.conf You will need to change the default_user to represent your Skype ID, in my case: ;default_user=james_bond changed to (general section) default_user=imapcblog update the password ;secret=goldeneye changed to (user section) secret=myskypepassword change the default context to match your dial plan ;context=demo changed to (user section) context=default route the inbound calls to your Lync extension, in my case 2001

open in browser PRO version

Are you a developer? Try out the HTML to PDF API

pdfcrowd.com

;exten=s changed to (user section) exten=2001 Once you have configured all three config files reboot Asterisk, type shutdown r now. Congratulation, your Asterisk configuration is complete! Next we need to configure Lync and pre-supposing you followed my previous Lync install guide here, you will need to head back into the Lync Topology Builder we didnt add a PSTN gateway previously. Download your Topology from the existing deployment and save the file locally, then add a PSTN gateway (see both steps below)

open in browser PRO version

Are you a developer? Try out the HTML to PDF API

pdfcrowd.com

Once you have added the PSTN gateway you will have to re-publish the Topology, this will update the existing Topology with the new configuration settings, click finish

open in browser PRO version

Are you a developer? Try out the HTML to PDF API

pdfcrowd.com

To permit call flow between both Lync and Asterisk worlds we need to define our Voice Routing within Lync Server 2010. Open the Lync Server Control Panel and access the Voice Routing options, well need to configure our Dial Plan, Voice Policy, Route and PSTN Usage. I wont walk you through this configuration (some is based upon location preferences, in my case UK), but I will show you the resulting configuration within the Lync Control Panel. First the dial plan summary (pay close attention to my normalisation rules) this will route 1xxx to Asterisk, +44xxxxxxxxx to Asterisk and 2xxx internally (treated as local extension)

open in browser PRO version

Are you a developer? Try out the HTML to PDF API

pdfcrowd.com

Next the Voice Policy, the default Global Policy should have the following PSTN usage records (these rules will handle our calls destined for Asterisk)

open in browser PRO version

Are you a developer? Try out the HTML to PDF API

pdfcrowd.com

and the routes, as follows

Finally the PSTN usage, as follows

open in browser PRO version

Are you a developer? Try out the HTML to PDF API

pdfcrowd.com

In my previous guide we created a test user, that user should now have his or her telephone details set, in our scenario tel:2001 (this is not best practice in a production deployment of Lync/OCS, but as a lab setup with a single PSTN number we should be given a free pass!) typically in production we would assign individual PSTN number and normalise to an internal DDI range i.e. +44208 555 2001 would normalise to 2001 when dialled.

With these settings committed successfully your setup should be complete, calls can now be made between both Asterisk and Lync, to setup a SIP based client I recommend X-Lite (for download and setup instruction follow my previous guide here) Here we can see X-Lite to Lync

open in browser PRO version

Are you a developer? Try out the HTML to PDF API

pdfcrowd.com

And the reverse Lync to X-Lite

open in browser PRO version

Are you a developer? Try out the HTML to PDF API

pdfcrowd.com

Finally, lets SkypeOut, first from Lync! (this illustration wont mean a lot, but you will have to trust me it works!)

open in browser PRO version

Are you a developer? Try out the HTML to PDF API

pdfcrowd.com

Thats it, whilst Im sure there are better ways of achieving PSTN breakout from OCS or Lync (with hardware/gateways), there is a certain amount of self-gratification from 100% software based VoIP. Im sure my configuration could have been applied in a number of different ways and youll probably notice that whilst X-Lite will permit Asterisk-to-Skype calls (dial 9 + Skype name), at this time Lync will not only numbers can be passed (Im happy to take suggestions on this). Otherwise let me know if you have spotted any errors or need guidance on issues (Ill be moderating the comments below) and above all good luck and have some fun!
Le ave a com m e nt | Track back

Profile

or

open in browser PRO version

Are you a developer? Try out the HTML to PDF API

pdfcrowd.com

Name Email Website Comment


Not pub lished

Post It
Notify me of followup comments via e-mail. You can also subscribe without commenting.

136 Replies

127 Comments

0 Tweets

0 Facebook

8 Pingbacks
last reply was october 27, 2012

Tweets that mention Step-by-step Microsoft Lync 2010, Asterisk and Skype installation/integration guide | I'm a UC Blog -- Topsy.com

October 9, 2010

[...] This post was mentioned on Twitter by Tom Arbuthnot, Jan S. Andreassen and Mike Pfeiffer, Adam Jacobs. Adam Jacobs said: I'm a UC Blog: Step-by-step Microsoft Lync 2010, Asterisk and Skype installation/integration guide http://retwt.me/1P8gQ #lync #asterisk [...]

Andrey Veselov

October 9, 2010

Great and inspiring article. Just at this week I have talk with client. He wanted to integrate Skype with OCS (Lync). Now I can see the way to do it.

Arman Obosyan
open in browser PRO version
Are you a developer? Try out the HTML to PDF API

October 10, 2010

pdfcrowd.com

Thank you, great article!

Step-by-step Microsoft Lync 2010, Asterisk and Skype installation/integration guide | Im a UC Blog JCs Blog-O-Gibberish

October 11, 2010

[...] Step-by-step Microsoft Lync 2010, Asterisk and Skype installation/integration guide | Im a UC Blog Posted on October 11, 2010 by johnacook http://imaucblog.com/archive/2010/10/09/step-by-step-microsoft-lync-2010aste… [...]

Doug

October 11, 2010

Nice article. Im currently looking for any Remote Call Control help on Lync.

Adam [I'm a UC Blog]


@Doug Hi Doug, are you referring to RCC functionality within Asterisk?

October 11, 2010

Deane
Thanks for this much appreciated!

October 12, 2010

Khani
Nice job

October 12, 2010

Diego
Awesome Doug, let me try it and wait for my comments..

October 14, 2010

Asterisk 1.8.0 is released to web | I'm a UC Blog


[...] [...]

October 23, 2010

Fredrik

October 28, 2010

Im having some trouble routing calls even between Lync and Asterisk. How do I

open in browser PRO version

Are you a developer? Try out the HTML to PDF API

pdfcrowd.com

configure the mediation server? I cant route from the Asterix out to skype either it seems, but first things first, the internal route. Thank you for your great blog posts BTW!!

Adam [I'm a UC Blog]

October 28, 2010

@Fredrik Can you make calls Asterisk ext to ext? Which version of Asterisk are you using?

Calum MacRawe

November 23, 2010

Hey there, I am having trouble with the dial in. It answers fine, put in the conf id, thats fine. When it try to join the confernce, it says i cant connect to the confernce. In the event viewer, all I get is: User failed to join the conference. Microsoft.Rtc.Collaboration.ConferenceFailureException:The operation failed due to a response from the server. For more information, examine the properties on the exception and inner exception. at Microsoft.Rtc.Signaling.SipAsyncResult`1.ThrowIfFailed() at Microsoft.Rtc.Signaling.Helper.EndAsyncOperation[T](Object owner, IAsyncResult result) at Microsoft.Rtc.Collaboration.McuSession.EndSendCommandInternal(IAsyncResult result) at Microsoft.Rtc.Collaboration.AudioVideo.AudioVideoMcuSession.EndTransfer(IAsyncResult result) at Microsoft.LiveServer.Caa.CaaCall.EndTransfer(IAsyncResult asyncResult, Boolean& retry, Exception& caught) Detected at System.Environment.get_StackTrace() at Microsoft.Rtc.Collaboration.ConferenceFailureException..ctor(String message, Exception innerException) at Microsoft.Rtc.Collaboration.Conferencing.SendCommandAsyncResult.ProcessCccpResponse(SipMessageData messageData, responsetype response, Boolean& isPendingResponse) at Microsoft.Rtc.Collaboration.Conferencing.SendCommandAsyncResult.ProcessStatusMessage(SipMessageData statusMessageData, responsetype response) open in browser PRO version Are you a developer? Try out the HTML to PDF API

pdfcrowd.com

at Microsoft.Rtc.Collaboration.Conferencing.StatusMessageReceivedWorkItem.Process() at Microsoft.Rtc.Signaling.AsyncWorkitemQueue.ProcessItems() at Microsoft.Rtc.Signaling.SerializationQueue`1.ResumeProcessing() at Microsoft.Rtc.Signaling.SerializationQueue`1.ResumeProcessingCallback(Object state) at Microsoft.Rtc.Signaling.QueueWorkItemState.ExecuteWrappedMethod(WaitCallback method, Object state) at System.Threading.ExecutionContext.Run(ExecutionContext executionContext, ContextCallback callback, Object state) at System.Threading._ThreadPoolWaitCallback.PerformWaitCallbackInternal(_ThreadPoolWaitCallback tpWaitCallBack) at System.Threading._ThreadPoolWaitCallback.PerformWaitCallback(Object state) Cause: Administration issues. Resolution: Verify that Conferencing Attendant is installed in a supported topology and the dependant Front End servers are functioning correctly. Help please!!!

TreeFox

November 23, 2010

Im wondering if I need to include Mediation server into this scenario or just PSTN Gateway Please, let me know

Adam [I'm a UC Blog]

November 24, 2010

@TreeFox The mediation service is deployed during the install, for PSTN termination a gateway or SIP trunking is required.

BlaNon

November 30, 2010

Call forwarding and simul ring to PSTN/Asterisk number does not work with this setup.

open in browser PRO version

Are you a developer? Try out the HTML to PDF API

pdfcrowd.com

BlaNon

December 1, 2010

@BlaNon Actually, just the Asterisk extension. Try forwarding your OCS extension to PSTN or Asterisk extension. If you dial from the phone connected to Asterisk to the OCS extension, the call will not be forwarded. OCS sends the INVITE with from=@lyncserver, and Asterisk will not authorize it, except if you set insecure=invite on the Asterisk extension. There must be a better way tho.

Johnny
For me trunk between Asterisk & Lync is not showing UP

December 1, 2010

asterisk*CLI> sip show peers Name/username Host Dyn Nat ACL Port Status 1001/1001 192.168.100.100 D 29082 Unmonitored Lync_Trunk 192.168.100.101 5060 UNREACHABLE 2 sip peers [Monitored: 0 online, 1 offline Unmonitored: 1 online, 0 offline] I am getting below error for my Lync 2010 RTM trunk. I have configured PSTN gateway with TCP 5060 port without any issues.. I am able to make calls between asterisk extensions & as well as in between Lync extension is I am missing anything????? [Dec 1 11:11:36] ERROR[3294]: tcptls.c:350 ast_tcptls_client_start: Unable to connect SIP socket to 192.168.100.101:5060: Connection refused

Johnny
Now I am able to get my trunk UP, But not able to make calls in between Asterisk & Lync vice versa asterisk*CLI> sip show peers Name/username Host Dyn Nat ACL Port Status 1001/1001 192.168.100.100 D 51890 Unmonitored 1002/1002 192.168.100.102 D 5060 Unmonitored Lync_Trunk 192.168.100.101 5060 OK (2 ms)

December 1, 2010

3 sip peers [Monitored: 1 online, 0 offline Unmonitored: 2 online, 0 offline] == Using SIP RTP CoS mark 5 Executing [2001@default:1] Dial(SIP/1001-0000000a, open in browser PRO version Are you a developer? Try out the HTML to PDF API

pdfcrowd.com

SIP/Lync_Trunk/2001,20) in new stack == Using SIP RTP CoS mark 5 Called Lync_Trunk/2001 SIP/Lync_Trunk-0000000b is circuit-busy == Everyone is busy/congested at this time (1:0/1/0) Executing [2001@default:2] Hangup(SIP/1001-0000000a, ) in new stack == Spawn extension (default, 2001, 2) exited non-zero on SIP/1001-0000000a Getting SIP/Lync_Trunk-0000000b is circuit-busy error

Adam [I'm a UC Blog]

December 1, 2010

Can you call out from Lync or Asterisk? Which scenarios work for you?

Adam [I'm a UC Blog]

December 1, 2010

@Johnny I noticed an error in my Asterisk SIP.CONF, the default Lync Server TCP listening port is 5068. Change your port and you should be all good (fingers crossed!)

Johnny

December 2, 2010

Thanks Adam for this Awesome post. Now I am able to make calls from Asterisk to Lync extension without any issues. Problem was with my Lync extension telephone number previously I used default format (i.e. tel:+2001) that was causing the problem.. I have changed extension to tel:2001 & it works Still I have one issue, I am not able to make calls from Lync extension to Asterisk extension, I am working on it I would like if you post more on Lync Dial Plan.. This will help newbies like me Cheerssss!!!!!!!!!!!!

Adam [I'm a UC Blog]


Hi Johnny,

December 3, 2010

This is more than likely a dial-plan issue (as correctly identified) did you permit calls to route to 2xxx extentions via your Lync trunk configuration? - Adam

open in browser PRO version

Are you a developer? Try out the HTML to PDF API

pdfcrowd.com

Johnny
Thanks Adam, It works by adding PSTN gateway route for Asterisk extensions. Cheerss!!!!!!!

December 8, 2010

Adam
Adam,

December 12, 2010

Much thanks. You got me rolling on Lync. Now to play and really dig in. Going to do a little more on your Asterisk integration. Im pretty familiar with Asterisk and FreePBX (trixbox, AsteriskNow, even my own UI). Perhaps we can add a little more on that config. to a real world scenario for those using FreePBX. Should be able to get some alone time in a week or so.

Adam [I'm a UC Blog]

December 12, 2010

Hi Adam, Im glad you have picked up Lync! If you have anything youd like to contibute please let me know happy to run a special guest article All the best, another Adam

Jim
@Adam Adam,

December 13, 2010

This is almost exactly what im looking to do and as a proff of concept was able to get things working with this. However we currently have a decent sized asterisk implementaion that hooks to the pstn. I want to hook things in to make my migration seemless but all the articles ive seen say rip out all that is in the cfg files right now. Do you or anyone else have some guidance on how to integrate lync into an existing asterisk deployment?

Adam [I'm a UC Blog]


Hi Jim,

December 13, 2010

open in browser PRO version

Are you a developer? Try out the HTML to PDF API

pdfcrowd.com

You may be able to take elements of my code and merge with your existing config (taking into account changes to suit your environment). Is there a specific areas where you are struggling? - Adam

Goofy
Hello,

December 16, 2010

i geht the same error ERROR[31807]: tcptls.c:367 ast_tcptls_client_start: Unable to connect SIP socket to 172.16.1.155:5068: Connection refused but if i make telnet 172.16.1.155 5068 (to my Lync Server) i get the following message Trying 172.16.1.155 telnet: Unable to connect to remote host: Connection refused can anybody help me ?

Bryan Hunt
Adam,

December 16, 2010

Im setting up Lync in our test environment. I dont have my SIP trunk yet, but do have enterprise voice enabled. I have X-Lite 4 downloaded but cannot get it to connect to the Lync server. A sniffer shows X-Lite trying to connect to port 5060 as expected, but when I go to my Lync server, Netstat shows that it is not listening on port 5060? Did I miss a step in installation/setup? I have no devices defined in the Clients tab. Also could you share a screenshot of your X-Lite account setup page so that I can check my syntax? Thanks for your help and for a great article. Bryan Hunt

Adam [I'm a UC Blog]

December 16, 2010

Hi Bryan, you cant connect the x-lite client to Lync (only the Lync client can be used here) configure it to point to the Asterisk server.

open in browser PRO version

Are you a developer? Try out the HTML to PDF API

pdfcrowd.com

- Adam

Adam [I'm a UC Blog]


- Adam

December 16, 2010

Hi Goofy, is the firewall running on the server? Are all the Lync services running?

Bryan Hunt

December 17, 2010

Thanks for the response Adam. The Lync client is working perfectly. Does this imply that MS plans for Lync to be a somewhat closed platform as far as SIP devices go? In other words, only phones and soft clients with firmware designed specifically for Lync will be able to connect to it? Not all devices that speak SIP? Thanks. Bryan Hunt

Adam [I'm a UC Blog]


@Bryan Hunt Glad to hear it is working Bryan!

December 17, 2010

Now onto your excellent question, OCS/Lync does utilise SIP, but as with most major telephony vendors it has been enhanced to include product specific functionality as such device firmware needs to support the OCS or Lync SIP specification. Typically these devices will only work with these Microsoft products, however there are signs of change one example are Snoms IP Phones, these have dual firmware support. See here for more information. I hope this helps? - Adam

Ralf

December 19, 2010

Hi Adam, have you perhaps experiences that PSTN Media Gateways for Home Office and are available and working with Lync? Audiocodes and Ferrari SBAs are out of the question. These are too expensive for me just for testing @ home. Also a matching card from Divacom (for example Diva BRI-2 PCI v2, Diva V-BRI-2 PCI

open in browser PRO version

Are you a developer? Try out the HTML to PDF API

pdfcrowd.com

v2) eliminated for cost reasons. Thanks for suggestions, Ralf

Adam [I'm a UC Blog]


Hi Ralf,

December 19, 2010

I am playing around with an AudioCodes MediaPack 114 gateway (chances are I will probably upload config guides in due course) this device isnt what I would call expensive approximately 250? - Adam

Ralf

December 20, 2010

Thank you Adam for the tip with the small audio codes device and of course a big compliment for your How-Tos on this Site. Thanks especially for the Lync Asterisk Howto. Ralf

Chris
@Johnny Hi Adam!

December 22, 2010

Where do I add the PSTN gateway route for Asterisk extensions? Thanks Chris

Chris

December 22, 2010

Chris :@Johnny Hi Adam! Where do I add the PSTN gateway route for Asterisk extensions? ThanksChris Solved On Lync Server under Voice Routing -> Route -> Add Associated gateways

open in browser PRO version

Are you a developer? Try out the HTML to PDF API

pdfcrowd.com

Michael

December 22, 2010

I just implemented this for OCS 2007r2, and, after a few modifications, it works like a charm!

Wayne

December 24, 2010

When I bring up the Lync Control Panel, under Topology, what should my Asterisk PBX status be listed as? Right now I am able to communicate internally between Lync Clients and Tanguay desk phones, but I seem to be having some troubles integrating Asterisk. I currently use PBX-In-A-Flash for my Asterisk needs. It is Asterisk v1.8 with FreePBX v2.8. I changed the dial plan to the following (since I live in North America, and my Asterisk extensions are in the 7xx range): http://img24.imageshack.us/img24/500/18534005.jpg Right now when I try to call externally through my Tanguay phone I get a Call unsuccessful. Cannot complete the call due to restrictions on your account error. And when I try to call through the Lync Client I get this: http://img443.imageshack.us/img443/540/captureodf.jpg Not sure where to start in troubleshooting this problem. Any help would be appreciated. Thanks.

Adam [I'm a UC Blog]


Hi Wayne,

December 24, 2010

First things first is there a SIP trunk successfully established between Lync/Asterisk? In Asterisk you can check this via the CLI on Lync the server event log will report trunk related errors. Also ensure your PBXIAF is set to allow TCP this is not enabled by default. Let me know how you get on. - Adam

JOhnny
open in browser PRO version
Are you a developer? Try out the HTML to PDF API

December 29, 2010

pdfcrowd.com

Hi Adam, I am using Linksys 3102 as my asterisk gateway to make outgoing calls to external world.. I am able to make calls in between asterisk & Lync extension vice versa without any issue. Also I am able dial outside numbers i.e. local mobile number from my asterisk extension by dialing 8 then local mobile number & phones .. But i am not able to dial 8 + local mobile number/phone number via Lync clientI have addedd required route on lync control panel..is I am missing anything? thanks in advance.. Cheers!!!!

Adam [I'm a UC Blog]


Hi Johnny,

December 31, 2010

There a number of ways this can be achieved, my lab setup was configured to automatically prefix Lync PSTN routes with 9 as per my config this will route via SFA. I hope this helps? - Adam

Jeremy

January 3, 2011

@Calum MacRawe did you ever get this figured outIm having the exact same issue on the final release of Lync. Calum MacRawe :Hey there, I am having trouble with the dial in. It answers fine, put in the conf id, thats fine. When it try to join the confernce, it says i cant connect to the confernce. In the event viewer, all I get is: User failed to join the conference. Microsoft.Rtc.Collaboration.ConferenceFailureException:The operation failed due to a response from the server. For more information, examine the properties on the exception and inner exception. at Microsoft.Rtc.Signaling.SipAsyncResult`1.ThrowIfFailed() at Microsoft.Rtc.Signaling.Helper.EndAsyncOperation[T](Object owner, IAsyncResult result) at Microsoft.Rtc.Collaboration.McuSession.EndSendCommandInternal(IAsyncResult result) at open in browser PRO version Are you a developer? Try out the HTML to PDF API

pdfcrowd.com

Microsoft.Rtc.Collaboration.AudioVideo.AudioVideoMcuSession.EndTransfer(IAsyncResult result) at Microsoft.LiveServer.Caa.CaaCall.EndTransfer(IAsyncResult asyncResult, Boolean& retry, Exception& caught) Detected at System.Environment.get_StackTrace() at Microsoft.Rtc.Collaboration.ConferenceFailureException..ctor(String message, Exception innerException) at Microsoft.Rtc.Collaboration.Conferencing.SendCommandAsyncResult.ProcessCccpResponse(SipMessageData messageData, responsetype response, Boolean& isPendingResponse) at Microsoft.Rtc.Collaboration.Conferencing.SendCommandAsyncResult.ProcessStatusMessage(SipMessageData statusMessageData, responsetype response) at Microsoft.Rtc.Collaboration.Conferencing.StatusMessageReceivedWorkItem.Process() at Microsoft.Rtc.Signaling.AsyncWorkitemQueue.ProcessItems() at Microsoft.Rtc.Signaling.SerializationQueue`1.ResumeProcessing() at Microsoft.Rtc.Signaling.SerializationQueue`1.ResumeProcessingCallback(Object state) at Microsoft.Rtc.Signaling.QueueWorkItemState.ExecuteWrappedMethod(WaitCallback method, Object state) at System.Threading.ExecutionContext.Run(ExecutionContext executionContext, ContextCallback callback, Object state) at System.Threading._ThreadPoolWaitCallback.PerformWaitCallbackInternal(_ThreadPoolWaitCallback tpWaitCallBack) at System.Threading._ThreadPoolWaitCallback.PerformWaitCallback(Object state) Cause: Administration issues. Resolution: Verify that Conferencing Attendant is installed in a supported topology and the dependant Front End servers are functioning correctly. Help please!!!

otanger
@Goofy

January 4, 2011

open in browser PRO version

Are you a developer? Try out the HTML to PDF API

pdfcrowd.com

- firewall is down - Restart Lync Server Mediation service or all Lync service after publishing the topology - you could be able to telnet your lync server on 5068

Rosewood

January 18, 2011

This guide is absolutely awesome. I used your Lync step-by-step guide to get a basic Lync server up and running and Ill probably use this to get some awesome integration going.

Adam [I'm a UC Blog]


Thanks for your feedback!

January 18, 2011

Turbomcp

February 2, 2011

Hi adam first i want to say this and the previous guide for exchange um are amazing:) the coolest thing i ever saw:) BUT in this guide i just wanted to test lync and asterisk going(no skype) so i did exactly what you said(besides registering skype part) and i just cant get this thing to work:( i cannot dial not from the asterisk and not from lync i get network busy and busy dial tone. do you have any idea what i am missing here:)? (can provide access to my lab if u have time:)) Thanks

Turbomcp

February 2, 2011

Turbomcp :Hi adamfirst i want to say this and the previous guide for exchange um are amazing:)the coolest thing i ever saw:)BUT in this guide i just wanted to test lync and asterisk going(no skype)so i did exactly what you said(besides registering skype part)and i just cant get this thing to work:(i cannot dial not from the asterisk and not from lynci get network busy and busy dial tone.do you have any idea what i am missing here:)?(can provide access to my lab if u have time:))Thanks

open in browser PRO version

Are you a developer? Try out the HTML to PDF API

pdfcrowd.com

small update, i rebooted the lync server and now i can call from lync to asterisk using 1001 but i still cannot dial from asterisk and x-lite to lync, i get busy signal like before

Adam [I'm a UC Blog]


Hi there, firstly thanks for the feedback!

February 2, 2011

Chances are you have issues with your call routing, specifically within Lync. Does your Lync enabled user have an extension assigned? When calling what is the error reported within the Asterisk CLI type asterisk -r on your Asterisk command line. Let me know how you get on. - Adam

Turbomcp

February 2, 2011

mm, my user name is test and his line uri is tel:2001 on the asterisk i dont see any specific error(i think) besides: unable to connect sip socket to 192.168.10.4:5068: network is unreachable. so i checked my lync server(forgot i had to reinstall my asterisk) my subnet is 192.168.25.0 255.255.255.0 i changed the lync server entry ofcourse to point to my lync server which is 192.168.25.4 and set all other options and rebooted and still busy signal from x-lite 2001 to lync. is there something else i need to do like register the 2001 number at asterisks(this is a brand new lab so not the one used for exchange um)

Turbomcp

February 2, 2011

Turbomcp :mm,my user name is testand his line uri is tel:2001on the asterisk i dont see any specific error(i think) besides:unable to connect sip socket to 192.168.10.4:5068: network is unreachable.so i checked my lync server(forgot i had to reinstall my asterisk)my subnet is 192.168.25.0255.255.255.0i changed the lync server entry ofcourse to point to my lync server which is 192.168.25.4and

open in browser PRO version

Are you a developer? Try out the HTML to PDF API

pdfcrowd.com

set all other options and rebooted and still busy signal from x-lite 2001 to lync.is there something else i need to do like register the 2001 number at asterisks(this is a brand new lab so not the one used for exchange um) quick question(i know its stupid but still) when im configuring the x-lite phone i configure it to register/login to the asterisk as 1001 right? so when i dial 2001 how does it know to forward that to lync because of the trunk and rule we confiured? another thing: on my lab i only have 2 things under pstn usage and not 4 like your printscreen shows i have local route and local extensions(both as global)

Turbomcp

February 2, 2011

now for the weirdest thing:) i added another xp machine with test2 user. duplicated the 1001 to be 1002(so i have 2 locally attachwed extensions) i configured it and logged on and bam that one works perfect:) how weird is that:) i dial 1001 from lync get to x-lite dial 2002 from x-lite get to 1002:) at this point im clueless as to what the heck is going on with the first user:)

Turbomcp
found it:) i configured user one(test) with topologhy tab stupid i know anyway when is set this thing to none all is good. Thanks again your hard work is highly appreciated daily watcher of this web site:)

February 2, 2011

Craig Gauntlett

February 21, 2011

Used this article (which is brilliant by the way) and have got skypeout working fine, however I have got an online number setup on the skype account but having some open in browser PRO version Are you a developer? Try out the HTML to PDF API

pdfcrowd.com

issues routing the inbound to the lync client. Here is what I see in the debug [Feb 21 20:13:49] NOTICE[3362]: core.cpp:2146 sfa_call_hangup: ending call Executing [2001@default:1] Dial(Skype/{skype-signin-name}-1f762d98, SIP/Lync_Trunk/2001,20) in new stack == Using SIP RTP CoS mark 5 Called Lync_Trunk/2001 SIP/Lync_Trunk-00000006 is circuit-busy == Everyone is busy/congested at this time (1:0/1/0) Executing [2001@default:2] Hangup(Skype/{skype-signin-name}-1f762d98, ) in new stack == Spawn extension (default, 2001, 2) exited non-zero on Skype/{skype-signinname}-1f762d98 Any help would be much appreciated!

Adam [I'm a UC Blog]


@Craig Gauntlett

February 21, 2011

Hi Craig, now if you are trying to get assistance on account of your flattery then you are going the right way about it! First off have you given the extension number 2001 to your Lync client? Next how have you triggered your trunk, the busy tone usually indicates a trunk/routing issue. - Adam

Igor
Dear Adam, I have interesting issue.

March 16, 2011

My Setup: Asterisk Lync AudiocodesMP No direct routes between Asterisk and AudiocodesMP, both configured as voice gate in Lync. From Lync I can call extensions on both Asterisk and AudiocodesMP. From AudiocodesMP I was not able to call any extensions on Asterisk until ive configured New-CSAnalogDevice account in Lync for AudiocodesMP (TEL:+900).

open in browser PRO version

Are you a developer? Try out the HTML to PDF API

pdfcrowd.com

Now using +900 as CallerID I can call any number from AudiocodesMP. When calling +900 from Lync I can reach AudiocodesMP. But when I call +900 from Asterisk, always get SIP 404 Not Found error. While monitoring Asterisk SIP log, ive noticed what when I call +900 from Asterisk, Lync is trying to call +900 extension on Asterisk instead of AudiocodesMP. Ive tried to create CSAnalogDevice account for Asterisk, when use its TEL:+950 us CallerID when I call from Asterisk to TEL:901 (which is routed to AudiocodesMP, but this number is not assigned to any Lync account). This Call is routed. But in this case im loosing my original Asterisk CallerID and this is not acceptable. Also, call to +900 still fails. How can I solve my problems: enable calls from Asterisk to AudiocodesMP thru Lync and keep original CallerID?

Adam [I'm a UC Blog]

March 20, 2011

Wow Igor, this one threw me a little (lets put it this way I had to get Visio out!) Q. For you, why are you not using the AudioCodes as a gateway for Lync and Asterisk? If you took this approach you could establish cross extension capability via a Lync to Asterisk trunk. - Adam

Billy Bob

March 22, 2011

Im currently testing, but is there any way for Asterisk and Lync to share the same extension? What Id like to accomplish is to ring our existing Asterisk IP desk phone and ring/show the incoming call on the users Lync client, basically a simultaneous ring using the same extension. Cant figure out how to do it or if its even possible. Thanks!

Adam [I'm a UC Blog]

March 22, 2011

Would a simultaneous ring to yor Lync extension not achieve this? I dont have the code to hand, let me know if I am missing something on this?

Alex
open in browser PRO version
Are you a developer? Try out the HTML to PDF API

March 24, 2011

pdfcrowd.com

Does Skype Connect or SFA (described in article) allow two-way audio communication between cloud of Lync users and cloud of Skype users? What about the same question about messages exchange between that clouds?

Adam [I'm a UC Blog]


Hi Alex,

March 24, 2011

Unfortunately Skype does not allocate cloud-based DIDs, therefore Lync is unable to normalise the calls for Lync-2-Skype purposes (Asterisk can handle names so this is not an issue here). Potentially you might be able to setup a speedial within Asterisk and assign a number that could be reached via Lync but this starts to get complex. The biggest win is being able to utilse Skypes PSTN for outbound and for inbound you can use Skype-in or your Skype ID for other Skype based clients. I hope this helps? - Adam

Alex
Thanks, Adam,

March 25, 2011

Surely, we got an comfortable long distance prices from our provider, so cost optimisation via Skype is not an issue. Problem is that users are requiring Skype to talk, chat and use videoconference with contragents and to minimise long-distance expenses, but this requires Skype client installation and interfere with security policies. Lync 2010 instead, fits the corporate security, meets all the internal corporate needs, but were stuck with Skype interoperability. Potentially, there are number of solutions to integrate Skype and Lync, for example Skystone and Skystone Video. Will evaluate it.

Adam [I'm a UC Blog]


Let me know how you get on Alex. - Adam

March 25, 2011

open in browser PRO version

Are you a developer? Try out the HTML to PDF API

pdfcrowd.com

Max
Hi,

April 5, 2011

I am trying to set up a test environment (XLite>Asterisk>MS Lync Server 2010 >Lync Client) similar to that in this excellent guide, but Im having trouble calling from XLite to the Lync client. 1. According to wireshark on MS Lync Server, the header checksum of the Internet Protocol in each SIP packet sent by MS Lync Server is 00000. 2. Im also getting the following error according to Lync Server Logging Tool,: TL_WARN(TF_COMPONENT) [2]143C.133C::04/04/2011-22:45:37.959.00000746 (SIPStack,CSIPRequest::RouteRequestUriOnNonEdgeProxy:SIPRequest.cpp(3441))( 0000000006370440 ) User [2001@appserver.com] is not in enterprise or we do not serve this domain using 404 TL_WARN(TF_DIAG) [2]143C.133C::04/04/2011-22:45:37.977.00000747 (SIPStack,SIPAdminLog::TraceDiagRecord:SIPAdminLog.cpp(145))$$begin_record LogType: diagnostic Severity: warning Text: Non-trusted source sent an FQDN/IP that doesnt match a routing table rule Result-Code: 0xc3e93c5e SIPPROXY_E_ROUTING SIP-Start-Line: INVITE sip:2001@appserver.com;user=phone SIP/2.0 SIP-Call-ID: 5f803ac8-ece1-47f8-9ac4-0981e5b3b617 SIP-CSeq: 57 INVITE Data: user=2001@appserver.com $$end_record Any idea what might be causing these problems? Thanks.

Adam [I'm a UC Blog]


Hi Max,

April 6, 2011

Stating the obvious first, have you properly assigned the extension no? Next have you looked at the Asterisk logging? Type asterisk -r via the command prompt. Is the trunk up? (again you can check this via the asterisk command prompt sip show peers) Let me know how you get on? - Adam

open in browser PRO version

Are you a developer? Try out the HTML to PDF API

pdfcrowd.com

Stephen

April 23, 2011

Hi, thanks for a great guide, just walked through this and got it all working, Thanks! The only problem I ran into was that I got no audio from the Skype client to Lync, X-lite -> Lync and mobile (via SkypeIn) -> Lync where fine. The fix I found was to add the following to to chan_skype.conf in the user section allow=ulaw,alaw -Stephen.

Syed Gulzar Hussain


I have disabled the firewall on Lync Server now the error is

April 29, 2011

Unable to connect SIP socket to 192.168.22.243:5068: Connection refused

Adam [I'm a UC Blog]


- Adam

April 29, 2011

Thanks for posting your workaround Stephen was this not enabled by default?

Adam [I'm a UC Blog]


Hi Syed,

May 3, 2011

Apologies for not getting back to you sooner (I was on vacation) and thanks for your previous message, given that Windows Firewall is disabled you may want to check the ports sometimes there can be some confusion on incoming/listening ports. Ild suggest you follow defaults and refer to this TechNet documentation for default port definitions. - Adam

Microsoft buys Skype, what could this mean for Lync? | I'm a UC Blog

May 10, 2011

[...] for Skype (R.I.P. my Skype-to-Lync integration blog post) okay so it was a workaround and PIC would be far [...]

open in browser PRO version

Are you a developer? Try out the HTML to PDF API

pdfcrowd.com

David

May 11, 2011

I dont have a Chan_skype.conf file in the asterisk directory. Is this something I should create manually?

Adam [I'm a UC Blog]


Hi David, This is usually created when you add SFA is this installed correctly? - Adam

May 11, 2011

David

May 11, 2011

Far as I can tell. I added the License Key for the SFA and that didnt give me any errors and it created the License File.

Adam [I'm a UC Blog]

May 11, 2011

Id strongly suggest re-installing something has gone wrong. This should definately be created as a part of the install. - Adam

Step-by-step Microsoft Lync 2010, Asterisk and Skype installation/integration guide : Lync Guru

May 30, 2011

[...] http://imaucblog.com/archive/2010/10/09/step-by-step-microsoft-lync-2010asterisk-and-skype-installa [...]

Alex Dean

June 21, 2011

GREAT POST!!!!!! Thanks to your hard work I got my environment up and running. Lync users can call X-Lite. X-Lite users can call Lync. X-Lite users can connect out via SIP. Lync users can connect out via SIP. All working like a charm. Not that it happened easily. Some changes were required. As Im using another SIP provider and not Skype my dial plan looks like this: [general] static=yes writeprotect=no open in browser PRO version Are you a developer? Try out the HTML to PDF API

pdfcrowd.com

[globals] [default] ;receive incoming calls to a connected phone exten => s,1,Dial(SIP/1001) ; outbound calls (outside of your own PBX) exten => _1XXX,1,Dial(SIP/${EXTEN},20) exten => _1XXX,2,hangup() exten => _0.,1,Dial(SIP/${EXTEN:1}@2talk) exten => _0.,2,hangup() exten => _2XXX,1,Dial(SIP/Lync_Trunk/${EXTEN},20) exten => _2XXX,2,hangup() [from-lync] ;dialling other extensions starting with 1 followed by three digits exten=>_1XXX,1,Dial(SIP/${EXTEN},20) exten=>_1XXX,n,hangup() ;send other calls to 2talk for Asterisk exten => _.,1,Dial(SIP/${EXTEN}@2talk) exten => _.,2,hangup() This way all calls get routed nicely. I found following commands very useful: enter Asterisk: asterisk -r Reload all config files: reload Reload only the dial plan: dialplan reload rebooting my asterisk server takes AGES. So reloading the configs is much much faster. Especially when testing different dial plans.

Adam [I'm a UC Blog]

July 18, 2011

Thanks Alex (sorry for not getting back to you sooner), really appreciate you sharing this info for other readers. - Adam

Andres
open in browser PRO version
Are you a developer? Try out the HTML to PDF API

July 22, 2011

pdfcrowd.com

Hi Adam Nortel CS1000M / Great post, I will try this on a topology Elastix Cisco \ Nortel BCM50 I guess it will be enough setting up the Lync-Asterisk part, I only have my doubts in the following: 1. Is it possible to have trouble using Asterisk 1.8? 2. Is there any codec support issue with Lync, like using codec g.729? 3. Will this have the same behavior when calling to an Asterisk Queue? because Im using Elastix call center module and it works based on queues. 4. Is there a how-to for connecting Lync Server with Microsoft Dynamics CRM and Outlook? If someone has any suggestion on this to be of consideration I will be great full if you share before I start deploying. I shall share the results and hopefully good answers to all this. Thanks again for the great post.

Andres
Andres :Hi Adam Nortel CS1000M / Great post, I will try this on a topology Elastix Cisco \ Nortel BCM50

July 22, 2011

hehe I guess it didnt show up as I meant. I will try this in a topology with Elastix working with Cisco, Nortel CS1000M and Nortel BCM50. Wish me luck xD

Adam [I'm a UC Blog]


Hi Andres, A1. Asterisk 1.8 is absolutely possible for Lync Integration A2. Lync supports g.711 ulaw/alaw (supported by Asterisk too) A3. I have not used Elastix, but I dont see why not? open in browser PRO version Are you a developer? Try out the HTML to PDF API

July 22, 2011

pdfcrowd.com

A4. So far as I am aware only an OCS -> CRM 4 out of the box integration is available at this time, see here - Adam

Bob K

August 10, 2011

I am really trying to work through this in my lab. I am running 2008 R2 SP1 Hyperv server. The Linux Integration Tools do not install at all! I can install Centos 5.2 fine but when I get to the integration tools I cannot access the command line nor install the tools. Any ideas?

Adam [I'm a UC Blog]


Hi Bob, I didnt need to install the Linux integration tools, sorry. - Adam

August 10, 2011

ojay

August 15, 2011

Hello Adam pls i will like if u can suggest to me a solution to this i got this from eventvwr The Mediation Server service has received a call that does not support comfort noise. This event is throttled after 5 calls from a single Gateway peer. The Mediation Server service has received a call that does not support comfort noise from the Gateway peer, 192.168.10.105 Cause: The Gateway peer does not support comfort noise. Resolution: Please ensure the comfort noise option on the Gateway has been enabled. I cant call from my xlite to lync but i can call from lync to xlite

Adam [I'm a UC Blog]


Hi Olay,

August 15, 2011

The comfort noise issue is unlikely to be the root cause, suggest as a first port of call you look into the Asterisk routing error. Access the Asterisk command line and examine the logging generated wen you try to initiate a call failure. The command

open in browser PRO version

Are you a developer? Try out the HTML to PDF API

pdfcrowd.com

line can be accessed by typing asterisk -r via the terminal. - Adam

ojay

August 16, 2011

hi Adams Thanks a lot i av gptten the error but what am i to do the error is tcptls.c 350 ast_tcptls_client_start unable to connect sip socket to 192.168.10.20:5060 : no route to host

Adam [I'm a UC Blog]


- Adam

August 16, 2011

Within the Asterisk CLI type sip show peers is your Lync trunk up?

ojay

August 17, 2011

Adam I type the command but it returns an error (-bash: sip : command not found)

Adam [I'm a UC Blog]


Hi Ojay,

August 17, 2011

Try the Asterisk CLI, this is enabled by typing asterisk -r from your Linux terminal. - Adam

ojay

August 18, 2011

HI Adam i am so sorry for disturbing you. i can get the sip peers now the trunk is unreachable. pls go through my configuration [general] context=default ; Default context for incoming calls allowoverlap=no ; Disable overlap dialing support. (Default is yes) udpbindaddr=0.0.0.0 ; IP address to bind UDP listen socket to (0.0.0.0 binds to all) bindport=5060

open in browser PRO version

Are you a developer? Try out the HTML to PDF API

pdfcrowd.com

bindaddr=0.0.0.0 tcpenable=yes ; Enable server for incoming TCP connections (default is no) tcpbindaddr=0.0.0.0 ; IP address for TCP server to bind to (0.0.0.0 binds to all interfaces) srvlookup=yes ; Enable DNS SRV lookups on outbound calls notifyhold = yes ; Notify subscriptions on HOLD state (default: no) [1001] ; A locally attached SIP extension type=friend callerid=1001 canreinvite=no dtmfmode=rfc2833 mailbox=1001 disallow=all allow=ulaw transport=udp secret=password host=dynamic context=default [Lync_Trunk] ; Our Lync trunk type=friend port=5068 ; This is the default Lync Server TCP listening port host=192.168.10.20 ; This should be the IP address of your Lync Server dtmfmode=rfc2833 context=from-lync qualify=yes transport=tcp,udp Name Host Port Status Lync_trunk 192.168.10.20 5068 unreacheable My PSTN GATE is using port 5060 My Mediation Tls listening port:5067 My Mediation TCP listeneing port:5068 i even try to change the PSTN gateway port to 5068 all to no avail all i can get is a call from lync to xlite and not the other way round

Adam [I'm a UC Blog]


open in browser PRO version
Are you a developer? Try out the HTML to PDF API

August 22, 2011

pdfcrowd.com

Ojay, You config looks good, something is stopping your Lync trunk from being established (from the Asterisk to Lync) this is the root cause. Not sure if I have asked, do you have Windows Firewall enabled, could this be blocking the port? Also is 192.168.10.20 the IP address of your Lync server? - Adam

bacmallard

August 31, 2011

Here is my issue I have freepbx and OCS 2007r2 I just upgraded to Lync in parralel note my connect-with-OCS trunk works fine my connect-with-Lync trunk for some reason does not I did reset the TCP listener from 5068 to 5060 on Lync and published it and verified it yet when I route from-internal to Connect-with-Lync context I get no love No firewalls are on and there on the same subnet. If i revert to the working Connect-with-OCS trunk here is what works and what doesnt and is my real issue. from PBX sip client (PSC) to Lync user (LU) ext to ext work fine from LU to PSC client ext to ext work fine from LU to dial out PBX to my mobile phone works fine BLOCKER on the LU i set call forwarding OCS to LU call forwarding works to mobile fine LU to LU call forwarding works to mobile fine PSC client then calls LU ext with call forwarding enabled and it rings tries to route and fails. So first issue is How do I get Lync to accept traffic from freepbx when it has the same settings of my OCS trunks and configs and my context from internal is pointed to the right trunk? How do I get Lync to forward calls from a PSC client out to the public mobile number. Should I just revert and try to use port 5068 and see what happens? open in browser PRO version Are you a developer? Try out the HTML to PDF API

pdfcrowd.com

SIP trace on Lync shows the forward traffic happening but my guess is The routing rules did not result in a final response for PSTN caller and non-UM enabled callee;source=site1pool.foo.local;Callee=jdaugherty@foo.com;appName=InboundRouting Im just thinking since lync anc ocs calls forward correctly that somehow I have to tell Lync or OCS to look at the PCS client number and that its ok to forward it off.

Adam [I'm a UC Blog]


Hi Bacmallard,

August 31, 2011

Ill be honest you have lost me a little! Nevertheless I would definately suggest you revert to 5068, I have this configuration setup and working with the default port configuration. - Adam

TiamaT
@Bob K

September 9, 2011

How I got Hyper-V Integration Tools to work with AsteriskNOW (Hyper-V R2 SP1 Host) Download http://www.microsoft.com/download/en/details.aspx?id=24247 and extract .exe Mount extraced .iso file in Hyper-V *Login as root* yum -y groupinstall Development Tools yum -y update yum -y install kernel-devel *Reboot* *Login as root* mkdir -p /mnt/cdrom mount /dev/cdrom /mnt/cdrom cp -rp /mnt/cdrom /opt/linux_ic unmount /mnt/cdrom cd /opt/linux_ic/ make

open in browser PRO version

Are you a developer? Try out the HTML to PDF API

pdfcrowd.com

make install *Reboot* *Done* Btw: Fantastic article. Now I can finally get some real hands-on experience with Enterprise Voice.

Ben

September 15, 2011

Adam, just attempted to purchase license for AsteriskNOW and it seems that it is no longer available? Am I missing something on there website?

Ben
BOO!

September 15, 2011

Why is Skype for Asterisk no longer available? Skype for Asterisk was developed as a result of an agreement between Digium and Skype to allow distribution of Skype proprietary software. This software enabled Asterisk to make use of proprietary Skype protocols and participate as a native client on the Skype network. Skype decided not to renew this agreement in 2011, so Digium had to cease sales of the product. Skype for Asterisk will be supported until July 26, 2013. http://www.digium.com/en/docs/SFA/sfa_faq.php Dang it!!!!

Adam [I'm a UC Blog]


Hi Ben, AsteriskNOW is free, download links here - Adam

September 15, 2011

Bikash
Reloading SIP Unregistered SIP 1001 Registered SIP 1001 at 192.168.1.47 port 23436

September 17, 2011

Error : SIP/Lync_Trunk-00000004 is circuit-busy Please help me.

open in browser PRO version

Are you a developer? Try out the HTML to PDF API

pdfcrowd.com

[Sep 17 17:41:37] NOTICE[3195]: chan_sip.c:23658 sip_poke_noanswer: Peer Lync_Trunk is now UNREACHABLE! Last qualify: 1 [Sep 17 17:41:47] NOTICE[4035]: chan_sip.c:18912 handle_response_peerpoke: Peer Lync_Trunk is now Reachable. (3ms / 2000ms) == Using SIP RTP CoS mark 5 Executing [2861@default:1] Dial(SIP/1001-00000003, SIP/Lync_Trunk/2861,20) in new stack == Using SIP RTP CoS mark 5 Called Lync_Trunk/2861 [Sep 17 17:41:48] WARNING[4035]: chan_sip.c:17726 reply_digest: missing Digest. [Sep 17 17:41:48] NOTICE[4035]: chan_sip.c:18451 handle_response_invite: Failed to authenticate on INVITE to 1001 ;tag=as790ee8f5 SIP/Lync_Trunk-00000004 is circuit-busy == Everyone is busy/congested at this time (1:0/1/0) Executing [2861@default:2] Hangup(SIP/1001-00000003, ) in new stack == Spawn extension (default, 2861, 2) exited non-zero on SIP/1001-00000003 localhost*CLI> [Sep 17 17:42:51] NOTICE[3195]: chan_sip.c:23658 sip_poke_noanswer: Peer Lync_Trunk is now UNREACHABLE! Last qualify: 3 [Sep 17 17:43:01] NOTICE[4039]: chan_sip.c:18912 handle_response_peerpoke: Peer Lync_Trunk is now Reachable. (3ms / 2000ms) [Sep 17 17:44:05] NOTICE[3195]: chan_sip.c:23658 sip_poke_noanswer: Peer Lync_Trunk is now UNREACHABLE! Last qualify: 3 [Sep 17 17:44:15] NOTICE[4042]: chan_sip.c:18912 handle_response_peerpoke: Peer Lync_Trunk is now Reachable. (3ms / 2000ms) [Sep 17 17:45:19] NOTICE[3195]: chan_sip.c:23658 sip_poke_noanswer: Peer Lync_Trunk is now UNREACHABLE! Last qualify: 3 [Sep 17 17:45:29] NOTICE[4045]: chan_sip.c:18912 handle_response_peerpoke: Peer Lync_Trunk is now Reachable. (3ms / 2000ms) [Sep 17 17:46:33] NOTICE[3195]: chan_sip.c:23658 sip_poke_noanswer: Peer Lync_Trunk is now UNREACHABLE! Last qualify: 3 localhost*CLI> Thanks Bikash

open in browser PRO version

Are you a developer? Try out the HTML to PDF API

pdfcrowd.com

Tarun
@ojay I have same problem trunk is unreachable Please help me

September 17, 2011

HI Adam i am so sorry for disturbing you. i can get the sip peers now the trunk is unreachable. pls go through my configuration [general] context=default ; Default context for incoming calls allowoverlap=no ; Disable overlap dialing support. (Default is yes) udpbindaddr=0.0.0.0 ; IP address to bind UDP listen socket to (0.0.0.0 binds to all) bindport=5060 bindaddr=0.0.0.0 tcpenable=yes ; Enable server for incoming TCP connections (default is no) tcpbindaddr=0.0.0.0 ; IP address for TCP server to bind to (0.0.0.0 binds to all interfaces) srvlookup=yes ; Enable DNS SRV lookups on outbound calls notifyhold = yes ; Notify subscriptions on HOLD state (default: no) [1001] ; A locally attached SIP extension type=friend callerid=1001 canreinvite=no dtmfmode=rfc2833 mailbox=1001 disallow=all allow=ulaw transport=udp secret=password host=dynamic context=default [Lync_Trunk] ; Our Lync trunk type=friend port=5068 ; This is the default Lync Server TCP listening port host=192.168.10.20 ; This should be the IP address of your Lync Server dtmfmode=rfc2833 context=from-lync

open in browser PRO version

Are you a developer? Try out the HTML to PDF API

pdfcrowd.com

qualify=yes transport=tcp,udp Name Host Port Status Lync_trunk 192.168.10.20 5068 unreacheable My PSTN GATE is using port 5060 My Mediation Tls listening port:5067 My Mediation TCP listeneing port:5068 i even try to change the PSTN gateway port to 5068 all to no avail all i can get is a call from lync to xlite and not the other way round

Adam [I'm a UC Blog]


Hi Bikash,

September 19, 2011

At a guess you have some sort of connectivity/performance related issue impacting the Asterisk -> Lync trunk. - Adam

Mike
Hi Adam, Great site. Have you ever tried this with Sipxecs?

September 21, 2011

I setup a gateway to my sipxecs server and a dial plan that routes the calls (with a 46 prefix) but I cant connect to the server. The client gets a fast busy. One of the errors I see in event viewer on the server is There was no response from a gateway to an OPTIONS request sent by the Mediataion Server. Any suggestions?

Adam [I'm a UC Blog]

September 23, 2011

Thanks for the feedback Mike. I have not played with sipXecs but I know it is popular, without looking into it is your trunk UP? - Adam

Bikash

September 23, 2011

Thanks for reply Now Asteris is Workinf Fine and Also I have configure Elastix GUI for LYNC.

open in browser PRO version

Are you a developer? Try out the HTML to PDF API

pdfcrowd.com

Thanks Bikash

Adam [I'm a UC Blog]


Glad to hear it Bikash! - Adam

September 24, 2011

Nils

October 18, 2011

Hi! Thanks for this great guide. Im totally new to Lync and SIP telephony in general and have just installed Lync and Asterisk for the first time. I followed your tutorial though using another SIP provider and was able to make calls to PSTN from X-lite client as well as from Lync clients for a while. Then this morning I was not able to enter numbers longer than 7 digits excluding the national prefix (in my case +46). When entering a number in the Lync client it starts searching the address book directly and I am able to press the call button as long as I enter less than 8 digits. But when I enter the 9th digit nothing happens when I press the call button. Im not sure but it seems like this happend after I entered my phone numbers in the Lync client configuration. I removed them but the problem persists. Does anybody have a clue where to start troubleshooting this? Cause Im clueless. The only thing that differs from your Lync conf is the regexp for national calls which is ^(\+46\d{7}\d+)$ instead. A typical Swedish mobile phone number is +46734123456. Any help would be greatly appreciated.

Nils

October 18, 2011

Seems like I solved it. Deleted the GalContacts.db and GalContacts.db.idx files and ran reg add HKLM\Software\Policies\Microsoft\Communicator /v GalDownloadInitialDelay /t REG_DWORD /d 0 /f to force a new address book sync. Also ran the UpdateCsAddressBook cmd on the Lync server before starting the client again. And now it seems like I can make >8 digits calls again. Have not been able to try it

open in browser PRO version

Are you a developer? Try out the HTML to PDF API

pdfcrowd.com

since Im on remote with my lab environment.

Adam [I'm a UC Blog]


Thanks for sharing Nils.

October 18, 2011

Incidentally youre doing pretty good considering youre new to both Lync and Asterisk (my guides are obviously working out too!) - Adam

Askwizard
Hello Adam and Nils,

October 28, 2011

Can you please let me know the other SIP vendors which I can use to call PSTN. Also please let me know the configuration.

pawp

November 4, 2011

I am trying to integrate Microsoft Lync 2010 with Trixbox. I have public line purchased from VoiP operator. I followed guide from this url to configure Trixbox: http://blogs.breezetraining.com.au/mickb/2009/07/31/FinallyConnectedOCS2007R2ToTrixboxAsteriskToAPSTNPBX.aspx I am able to receive call from public network to my Lync client. However I am unable to call from Lync to anybody in outside world. I examined the logs on Lync side. There is and error: Start-Line: SIP/2.0 504 Cannot connect to gateway. Socket error: ConnectionRefused I also examined logs on Trixbox side with doing: asterisk -r; sip set debug on. When i was placing a call there was no SIP traffic captured on Trixbox server. I did network trace. I noticed that Trixbox is dropping connection from Lync. Lync sends SYN packet to port 5060 and Trixbox is replying with RST,ACK packet. Here is trunk configuration from Trixbox to Lync and vice-versa: [Connect-with-Lync] disallow=all host=10.48.22.182 ; Lync server IP type=friend port=5068 ; Lync listening port insecure=port,invite dtmfmode=rfc2833

open in browser PRO version

Are you a developer? Try out the HTML to PDF API

pdfcrowd.com

qualify=yes transport=tcp,udp canreinvite=yes allow=ulaw context=from-lync [from-Lync] host=10.48.22.182 ;Lync IP transport=tcp port=5060 ;Trixbox port insecure=port,invite type=friend context=from-Lync Could you please help?

Adam [I'm a UC Blog]

November 5, 2011

If I understand this configuration correctly you have two Trixbox trunks defined (each for calls in/out) this is not neccessary and will confuse things. Id suggest you create one and configure Lync accordingly. - Adam

skype
skype

November 10, 2011

[...]Step-by-step Microsoft Lync 2010, Asterisk and Skype installation/integration guide | I'm a UC Blog[...]

Collin
@JOhnny hi, My Lync is still showing unreachable on 5060. can help me

November 26, 2011

Jeff

November 27, 2011

I apologize for perhaps a dumb question here. I am aware that Asterisk based solution is about telephony; SIP/IAX/PSTN, etc. Now, Lync, is pure presence/IM platform. What benefit exactly do I get with integrating the two? If the answer is

open in browser PRO version

Are you a developer? Try out the HTML to PDF API

pdfcrowd.com

presence of the phone and IMs then I still do not understand, because I can have OpenFire server on my Asterisk box providing IM/presence for those same extension via AsteriskIM plugin. Again, please correct me if I am wrong or missing something. IF there is a feature I can further enhance my solution, I am open to additional information. thank you.

Jordan Turner

November 28, 2011

I am using Bria which has integration with Asterisk, Outlook, and contains presence, click to dial, IM features, etc. Whats the purpose of having a huge product like Lync integrated with Asterisk? From ease of deployment, licensing cost, complexity of management, it seems to be an overkill.

Adam [I'm a UC Blog]


Hi Jeff,

November 29, 2011

Lync is whole lot more than just presence and IM, since Office Communications Server 2007 the platform has very much incorporated voice, a/v conferencing and collaboration. OCS/Lync integration with Asterisk can deliver a number of benefits, such as the leverage of existing Asterisk PSTN break-out. I can also tell you (based upon traffic statistics that there is a very keen interest around 150 vistors daily! - Adam

Adam [I'm a UC Blog]


Hi Jordon,

November 29, 2011

Asterisk is a great solution and it certainly offers a lot of capability found within OCS or Lync, Id also hasten to add that it would never be my recommendation to deploy, support and maintain both products within a production environment. It may however be of value if you are looking to migrate to Lync or leverage existing services already available within your existing Asterisk deployment i.e. PSTN breakout. Being familiar with both products I will say that you get what you pay for with Asterisk and Lync is now a mature enterprise-ready product with deep integration with the Microsoft stack. Of course if you are a start-up business or Contact Centre running Open Source technology, Asterisk will fit right in.

open in browser PRO version

Are you a developer? Try out the HTML to PDF API

pdfcrowd.com

I hope this helps? - Adam

IT Business Reviews Archive Microsoft Lync 2010, Asterisk & Skype Integration Tutorial

December 28, 2011

[...] VoIP & Gadgets Blog, VoIP & Gadgets Blog. I came across an excellent tutorial on installing and integrating Microsoft Lync 2010, Asterisk and Skype. The tutorial covers [...]
December 28, 2011 Microsoft Lync 2010, Asterisk & Skype Integration Tutorial | All Things VoIP - VoIP Phones, VoIP Products, VoIP Services, etc...

[...] Integration Tutorial Posted on December 28, 2011 by VoIP & Gadgets Blog I came across an excellent tutorial on installing and integrating Microsoft Lync 2010, Asterisk and Skype. The tutorial covers [...]

Paul

January 28, 2012

Adam, a short question I am trying to integrate 2 x Asterisk as gateways assosiated with a Mediation Pool consisting of the 3 FEs (collocated Mediation Servers) for some failover/redundancy testing. Do you have an idea how to configure the peer part of the sip.conf to let Asterisk communicate to all 3 DNS load balanced FEs or is this configuration not achievable at all. Thanks

Adam [I'm a UC Blog]


Hi Paul,

January 28, 2012

Interesting scenario. Id probably try using the DNS name as a host (pointed at the pool name) not sure how Asterisk will handle this though i.e. will it utilise round-robin or just fail Let me know how you get on? - Adam

Favad
open in browser PRO version
Are you a developer? Try out the HTML to PDF API

March 5, 2012

pdfcrowd.com

Hi Paul, Probably one of the best Lync Asterisk integration guides out there. Im working dedicatedly on Lync since past couple of years, but totally new to Asterisk. Im trying to do what Alex did in Post #73 below i.e set this up with a Asterisk Sip Trunk Provider which unfortunately doesnt work with Lync directly. Im using a Public IP on Asterisk and Lync Mediation and using TCP 5060 for communication between Lync and Asterisk. Im unable to dial from X-lite or Lync and get an error Unable to create channel of type SIP (cause 20 Unknown) Also sip show peers command shows Lync using 5060 correctly but also shows 1001 client also using 5060 and unmonitored, which should be some random port in my opinion. Alex Dean :GREAT POST!!!!!! Thanks to your hard work I got my environment up and running. Lync users can call X-Lite. X-Lite users can call Lync. X-Lite users can connect out via SIP. Lync users can connect out via SIP. All working like a charm. Not that it happened easily. Some changes were required. As Im using another SIP provider and not Skype my dial plan looks like this:[general]static=yeswriteprotect=no [globals] [default] ;receive incoming calls to a connected phone exten => s,1,Dial(SIP/1001) ; outbound calls (outside of your own PBX) exten => _1XXX,1,Dial(SIP/${EXTEN},20)exten => _1XXX,2,hangup() exten => _0.,1,Dial(SIP/${EXTEN:1}@2talk)exten => _0.,2,hangup() exten => _2XXX,1,Dial(SIP/Lync_Trunk/${EXTEN},20)exten => _2XXX,2,hangup() [from-lync] ;dialling other extensions starting with 1 followed by three digitsexten=>_1XXX,1,Dial(SIP/${EXTEN},20)exten=>_1XXX,n,hangup() ;send other calls to 2talk for Asteriskexten => _.,1,Dial(SIP/${EXTEN}@2talk)exten => _.,2,hangup() This way all calls get routed nicely. I found following commands very useful:enter Asterisk: asterisk -rReload all config files: reloadReload only the dial plan: dialplan reload rebooting my asterisk server takes AGES. So reloading the configs is much much faster. Especially when testing different dial plans.

open in browser PRO version

Are you a developer? Try out the HTML to PDF API

pdfcrowd.com

Adam [I'm a UC Blog]


Hi Favad,

March 5, 2012

Is the trunk up between your Asterisk server and Lync? As you previously stated, sip show peers will confirm. - Adam

Favad
Hi Adam,

March 6, 2012

Thank You for your reply. Yes it is up according to the sip show peers command on TCP 5060. Also when dialing from Lync to X-Lite I get 480 temporarily unavailable on Lync Mediation and Sip 404 Not found when I call from X-Lite to Lync Thank You

Adam [I'm a UC Blog]

March 7, 2012

Try asterisk -r at the command line and replicate a call to see what is going on it may be a route issue? - Adam

Rune Strand
Thanks for comprehensive and funny howto. Great work!

April 3, 2012

bacmallard

May 9, 2012

arrrgghh okay so I have installed PIAF purple and trying to move off my old pbx that I had working with Lync just fine. Where im at Lync snooper logs simply state when placing a call to PIAF Start-Line: SIP/2.0 503 Service Unavailable CSeq: 1 INVITE Call-ID: 37181e8685284502afb58faa5b279eb4 VIA: SIP/2.0/TLS 10.15.2.39:57786;branch=z9hG4bK62FB59E9.62B9C8E23E28080F;branched=FALSE,SIP/2.0/TLS

open in browser PRO version

Are you a developer? Try out the HTML to PDF API

pdfcrowd.com

10.15.16.52:50364;ms-received-port=50364;ms-received-cid=3A49500 CONTENT-LENGTH: 0 SERVER: RTCC/4.0.0.0 MediationServer ms-endpoint-location-data: NetworkScope;ms-media-location-type=intranet ms-trunking-peer-state: down ms-trunking-peer: 10.15.3.2 ms-enable-dns-failover: yes ms-diagnostics: 10001;source=site1pool;reason=Gateway did not respond in a timely manner (timeout);component=MediationServer ms-diagnostics-public: 10001;reason=Gateway did not respond in a timely manner (timeout);component=MediationServer Message-Body: $$end_record I have successful results in my sip peers that show OK in my Lync Trunk My objective as it was before was to have all calls from lync route to either outside if a public number dialed and be able to call PBX extensions as well. Im not worried about anything right now but having the Lync be able to connect I did switch my old ports from 5060 to 5068 triple checked Lync ports and config patched and restarted Mediation services As long as I can see traffic I can get through the rest. But for the life of me right now I cant dechiper why Lync is stating the its trunking peer state is down. Also in PIAF purple sip.conf is explicity stated not to edit it and to add your configs to sip_general_custom.conf instead mine looks like this tcpenable=yes tcpbindaddr=0.0.0.0 alwaysauthreject=no [Connect-with-Lync] type=peer host=10.15.2.39 qualify=yes transport=tcp,udp canreinvite=yes allowexternalinvites=yes open in browser PRO version Are you a developer? Try out the HTML to PDF API

pdfcrowd.com

port=5068 dtmfmode=rfc2833 disallow=all allow=ulaw context=from-lync My Lync trunk has two entries as it did on my old pbx that was working just fine except for the port change from 5060 to updated 5068 Connect-with-Lync Outgoing settings type=peer host=10.15.2.39 qualify=yes transport=tcp,udp canreinvite=yes allowexternalinvites=yes port=5068 dtmfmode=rfc2833 disallow=all allow=ulaw context=from-lync INCOMING Settings: User context from-lync type=peer host=10.15.2.39 qualify=yes transport=tcp,udp canreinvite=yes allowexternalinvites=yes port=5068 disallow=all allow=ulaw context=from-lync

Adam [I'm a UC Blog]


open in browser PRO version
Are you a developer? Try out the HTML to PDF API

May 10, 2012

From this it looks at though your Asterisk server is talking to Lync, but Lync is not

pdfcrowd.com

talking to Asterisk. Check your Lync SIP trunk out within topology builder is it set to 5060? - Adam

bacmallard

May 10, 2012

ok switched it to 5060 that seems to have done the trick Thanks ADAM I got traffic now just on to call routing from here so ill see how PIAF purple places contexts. Ill add my update here as well. Question: Subject SIP Trunks: My current sip trunk has only one DID is it possible for a SIP provider to have mulitple DIDs supported on a single sip trunk? If so whats the average capacity per sip trunk to support multiple call volume. I know its based off of internet bandwidth but that aside whats the ball park capacity?

bacmallard

May 10, 2012

Call forwarding from Asterisk to Lync then forwarding calls from Lync back out Asterisk PBX So say I want Lync users to utilize there client as there soft phone. That user wants to forward calls from Lync to their cell phone. That call will route out my Asterisk box. I discovered that if you set a password on your Asterisk extension and have Lync set to Forward the call. It translates the call back to Asterisk as a known extension from an outside source (Lync) in this case that is attempting to say hey Im one of your extensions please forward this call. The only work around I found wich is not ideal but does work is if you do not set a password on the extension. This way Asterisk does not try to validate a known extension from outside and allow it to pass the traffic. Anyone try this or have a different way of engineering it to work with the Asterisk extension and having success forwarding Lync calls out?

Adam [I'm a UC Blog]


open in browser PRO version
Are you a developer? Try out the HTML to PDF API

May 10, 2012

pdfcrowd.com

Absolutely, you can have a range of DDIs assigned to a trunk. Capacity is based upon network capability and any associated service provider restrictions. - Adam

bacmallard

May 10, 2012

Last at last, Okay so I have everything back on 5060 and now all seems to be happy again. My last nudge here is. I want to set the follow me settings on the PBX to the Lync Extension. I can dial the Lync number from PBX just fine but when I set the follow me settings to 5516 (lync extension) or 5516# it fails to forward over. Any ideas on how to get the follow me to ring to the Lync extension?

bacmallard
@bacmallard Okay so couldnt find any hacks for the follow me to work i set my Lync ext and my mobile in the PBX follow me list and ringall It would go to Lync but then roll over to the cell bit of duct tape here

May 15, 2012

What I did was create to local extensions 5516 and changed the context SIP to dial my lync extension over the trunk I then set up extension 4416 and changed the context SIP to dial my cell phone number over the ExternalProvider trunk set confirm calls and now everything works just fine with ringall forward me my office sounds like a ring tone party

How to Integrate Microsoft Lync 2010, Asterisk, and a sip trunk. | Sip Stories

June 25, 2012

[...] would like to give a big thanks to Adam Jacobs who wrote How to integrate Lync 2010, Asterisk and Skype as inspiration for this post. This entry was posted

open in browser PRO version

Are you a developer? Try out the HTML to PDF API

pdfcrowd.com

in How To, Lync by Jaredg. Bookmark the [...]

Javier
@bacmallard

October 25, 2012

Im trying something similar with PIAF. I have a working PBX with a Google trunk.. works really well. Now Im trying to get the SIP trunk between Lync and the PBX up but just having a horrible time!. when you said you switched everything to 5060 do you mean even the config on Lync? did you switch 5068 to 5060? Cause for the life of me I cant get the trunk to come up.

Adam [I'm a UC Blog]


Have you enabled SIP over TCP on PIAF? A

October 27, 2012

Analogue te le phony is bad m m m k ay?

Aste risk 1.8.0 is re le ase d to we b

TO P

C opyright 2009-2014 I'm a UC Blog | Powe re d by W ordPre ss | The m e by Ne oEase

Log in

open in browser PRO version

Are you a developer? Try out the HTML to PDF API

pdfcrowd.com

Das könnte Ihnen auch gefallen