tag:blogger.com,1999:blog-7869312647255592139.post8214983716596605852..comments2023-04-23T00:27:38.026-07:00Comments on Andrew's Tech Page: Microsoft Lync Server 2010 Integration with Digium AsteriskAndrew Parisiohttp://www.blogger.com/profile/13700424021784141757noreply@blogger.comBlogger24125tag:blogger.com,1999:blog-7869312647255592139.post-26581184235981961832012-08-19T05:35:19.543-07:002012-08-19T05:35:19.543-07:00Ok turned up debugging and trawling through logs.....Ok turned up debugging and trawling through logs...noticed the following SIP/2.0 407 Proxy Authentication Required. And [Aug 19 12:56:54] NOTICE[3172] chan_sip.c: Failed to authenticate on INVITE to '"Administrator" ;tag=as0bb97465'. Looks like Sipgate is rejecting the call as unauthenticated. But the trunk is up and i can make outbound calls from a registered phone on Asterisk. Just not from Lync...My conf looks like this:<br /><br /><br />type=friend<br />transport=tcp,udp<br />qualify=yes<br />port=5068<br />host=192.168.1.x<br />dtmfmode=rfc2833<br />disallow=all<br />context=from-internal<br />canreinvite=no<br />allow=ulaw<br /> <br />Any ideas?scurlaruntingshttps://www.blogger.com/profile/13983629861168930782noreply@blogger.comtag:blogger.com,1999:blog-7869312647255592139.post-74081619856242779812012-08-19T03:28:39.082-07:002012-08-19T03:28:39.082-07:00Tried that no dice.Iv tried soo many combinations ...Tried that no dice.Iv tried soo many combinations and the net result is always the same. The call just loops in the trunk infinitely and never breaks out to the PSTN. I give up. I think iv lost interest now in trying to get this to work. I just cannot understand why a vanilla set up like mine just won't play ball when i have inbound calls working very easily but Lync>TrixBox>Sipgate>PSTN is just a mess. And the worst part for me is i know positively this should work. scurlaruntingshttps://www.blogger.com/profile/13983629861168930782noreply@blogger.comtag:blogger.com,1999:blog-7869312647255592139.post-81902129354663435592012-07-31T11:07:10.525-07:002012-07-31T11:07:10.525-07:00In your from-ocs context you would include the ast...In your from-ocs context you would include the asterisk side extensions and the long distance extensions. <br /><br />In your normal internal context you would have logic for calls TO lync.<br /><br />[from-ocs]<br />exten => _+0XXXXXXXXXX,1,Dial(SIP/${EXTEN}@sipgate.co.uk,30)<br />exten => _+XXX,1,Goto(internal-context,${EXTEN:1},1)Andrew Parisiohttps://www.blogger.com/profile/13700424021784141757noreply@blogger.comtag:blogger.com,1999:blog-7869312647255592139.post-72188932285626217062012-07-28T01:21:53.035-07:002012-07-28T01:21:53.035-07:00Hi andrew iv just decided to revisit this but im s...Hi andrew iv just decided to revisit this but im still not understanding your explanation. <br />I don't use 9 for an outside line. Numbers are dialled 11 digits beginning with a 0. The extensions on the Lync side are 4 digits beginning with an 8 and on the Asterisk side 3 digits beginning with a 2. <br />Should i append to extensions.conf:<br /><br />[from-ocs]<br />exten => _+8XXX,1,Goto(internal-call,${EXTEN:1},1)<br />exten => _+0XXXXXXXXXX,1,Dial(SIP/${EXTEN}@sipgate.co.uk,30)scurlaruntingshttps://www.blogger.com/profile/13983629861168930782noreply@blogger.comtag:blogger.com,1999:blog-7869312647255592139.post-69638145621954800772012-05-17T10:36:31.796-07:002012-05-17T10:36:31.796-07:00The 30 means ring for 30 seconds before giving up ...The 30 means ring for 30 seconds before giving up and going to the next extension in the dialplan. You should use whatever is valid... If you have to dial a 9 for an outside line then it would be 9XXXXXXXX(Dial/${EXTEN:1})<br /><br />If every phone number starts with a 0, then you have your dialplan set up correctly.Andrew Parisiohttps://www.blogger.com/profile/13700424021784141757noreply@blogger.comtag:blogger.com,1999:blog-7869312647255592139.post-65191639247470184862012-05-17T10:06:42.257-07:002012-05-17T10:06:42.257-07:00[from-ocs]
exten => _+1XXX,1,Goto(internal-call...[from-ocs]<br />exten => _+1XXX,1,Goto(internal-call,${EXTEN:1},1)<br />exten => _+1XXXXXXXXXX,1,Dial(SIP/${EXTEN}@OUTBOUND_PROVIDER,30)<br /><br />I'm having real trouble following the above. I'm using Lync and my dial pattern is _+0XXXXXXXXXX. Should the correct syntax be "exten => _+1XXXXXXXXXX,1,Dial(SIP/${EXTEN}@sipgate.co.uk,30)" (Sipgate being my ITSP) ? Although i don't understand what the ,30 denotes in the string. Either way entering this doesn't allow calls froom Lync to go down the Sipgate Trunk despite the Trunk being configured and working properly to Sipgate.scurlaruntingshttps://www.blogger.com/profile/13983629861168930782noreply@blogger.comtag:blogger.com,1999:blog-7869312647255592139.post-91898170336095416052011-12-07T10:13:58.402-08:002011-12-07T10:13:58.402-08:00As far as I know for external IM connectivity and ...As far as I know for external IM connectivity and Federation you need an Edge server.Peterhttps://www.blogger.com/profile/00389807967042212992noreply@blogger.comtag:blogger.com,1999:blog-7869312647255592139.post-61675290770791794382011-12-04T17:40:53.089-08:002011-12-04T17:40:53.089-08:00Thanks for clarifying Andrew. Just one last quest...Thanks for clarifying Andrew. Just one last question. Does the Edge server still need to be setup in order to federate the external IM connection? I was hoping to only use 1 server total for Lync with external IM federation.Charliehttps://www.blogger.com/profile/13903719395475892721noreply@blogger.comtag:blogger.com,1999:blog-7869312647255592139.post-17715040876514266382011-12-04T15:54:07.075-08:002011-12-04T15:54:07.075-08:00Hi Charlie,
Your understanding is correct, all th...Hi Charlie,<br /><br />Your understanding is correct, all this does is connect Lync to Asterisk via SIP. Then you can use it to connect Lync to the PSTN or connect it to your Asterisk based PBX in your office to allow dialing desk phones from Lync. That's what we've done.Andrew Parisiohttps://www.blogger.com/profile/13700424021784141757noreply@blogger.comtag:blogger.com,1999:blog-7869312647255592139.post-55428580547232683502011-12-03T19:17:34.106-08:002011-12-03T19:17:34.106-08:00Hi Andrew,
With this setup, will all the Lync fe...Hi Andrew, <br /><br />With this setup, will all the Lync feature such as external IM, including IM with external hotmail, yahoo, etc users still work using the Lync client?<br /><br />From my understanding here, Asterisk only provides the SIP connection to any ITSP, and provides the SIP connections of phones that Lync do not provide support for. From there, Lync, does everything else, presence for internal and external users, federation with outside users such as hotmail.com, yahoo.com, gmail.com, integration with Outlook and other MS Servers such as SharePoint, etc. Would this be a correct understanding? Thank you.Charliehttps://www.blogger.com/profile/13903719395475892721noreply@blogger.comtag:blogger.com,1999:blog-7869312647255592139.post-87818429742588968312011-11-28T02:46:05.814-08:002011-11-28T02:46:05.814-08:00Hi Jif,
I am also getting same error "All Ga...Hi Jif,<br /><br />I am also getting same error "All Gateways are marked as Down or Unavailable." when I dial to Asterisk PBX from Lync. Can you help me with step by step process of setting up PSTN gateway and outbound routing plan since i am successfully able to make out a call from Asterisk to Lync user.collinhttps://www.blogger.com/profile/13751694501086348770noreply@blogger.comtag:blogger.com,1999:blog-7869312647255592139.post-9562639315206217522011-08-01T11:24:03.603-07:002011-08-01T11:24:03.603-07:00Thanks for the quick response. I spoke too soon. ...Thanks for the quick response. I spoke too soon. All is working. I may have missed a reload or just had to wait. Best I can tell is that Lync does not check if the gateway is up on every call. Maybe every few minutes?Unknownhttps://www.blogger.com/profile/01656343412252232190noreply@blogger.comtag:blogger.com,1999:blog-7869312647255592139.post-83578714921785197702011-08-01T11:12:26.504-07:002011-08-01T11:12:26.504-07:00Hi Jif,
What does Asterisk say in sip debug? &qu...Hi Jif,<br /><br />What does Asterisk say in sip debug? "sip set debug ip "<br /><br />If asterisk doesn't even see the call then you know it's a lync issue, if asterisk is rejecting the call look at the sip debug output and see what it says to get a starting point of where to look.Andrew Parisiohttps://www.blogger.com/profile/13700424021784141757noreply@blogger.comtag:blogger.com,1999:blog-7869312647255592139.post-77483143296642826332011-08-01T11:06:30.445-07:002011-08-01T11:06:30.445-07:00Great post! My Asterisk box can now dial in to my...Great post! My Asterisk box can now dial in to my Lync server but the opposite is not true. I cannot call from my Lync server to my Asterisk box. Based on the event log, i believe it to be because "All Gateways are marked as Down or Unavailable." Packet captures show traffic going to and from the Lync server and Asterisk box so I am not sure what the Lync server is looking for to consider the asterisk server "up". Any ideas?Unknownhttps://www.blogger.com/profile/01656343412252232190noreply@blogger.comtag:blogger.com,1999:blog-7869312647255592139.post-84659076282916498532011-07-27T14:43:18.099-07:002011-07-27T14:43:18.099-07:00Thanks for your response and this great post!Thanks for your response and this great post!Davehttps://www.blogger.com/profile/02078422425810340717noreply@blogger.comtag:blogger.com,1999:blog-7869312647255592139.post-57019664411488523662011-07-27T14:07:28.043-07:002011-07-27T14:07:28.043-07:00Hi Dave,
I did all of this with Lync Standard, al...Hi Dave,<br /><br />I did all of this with Lync Standard, although you should be able to do this with the enterprise version as well but the instructions will likely be a little bit different.Andrew Parisiohttps://www.blogger.com/profile/13700424021784141757noreply@blogger.comtag:blogger.com,1999:blog-7869312647255592139.post-53502930637634728732011-07-27T10:45:47.816-07:002011-07-27T10:45:47.816-07:00can you clarify what lync license is required for ...can you clarify what lync license is required for this setup?Davehttps://www.blogger.com/profile/02078422425810340717noreply@blogger.comtag:blogger.com,1999:blog-7869312647255592139.post-1244177689697115052011-04-14T11:13:38.086-07:002011-04-14T11:13:38.086-07:00I'm glad to hear that this helped!
Yes, allow...I'm glad to hear that this helped!<br /><br />Yes, allowguest=no is important. Additionally, using allow & deny entries to restrict SIP Peers by the IP's they are allowed to connect with helps prevent brute force scanners from getting in if you have 4 digit extensions and or relatively simple passwords.<br /><br />Finally, fail2ban can be very helpful to block brute force scans, I had one IP scan me for a week and racked up 50gb of bandwidth before I had my NOC drop the traffic at the head end. Maybe I should write a post on fail2ban...Andrew Parisiohttps://www.blogger.com/profile/13700424021784141757noreply@blogger.comtag:blogger.com,1999:blog-7869312647255592139.post-65160736525036567712011-04-14T09:58:20.505-07:002011-04-14T09:58:20.505-07:00Thanks for taking the time to post Andrew, I built...Thanks for taking the time to post Andrew, I built an Asterisk SBC this week in my lab and it works very well with Lync, including Access Edge users with my Flowroute trunk. <br /><br />All of my supplementary calling features work as well "out of the box", including PSTN ringback, music on hold, call transfer (with transfer complete notifications), call forward to Exchange UM and conference bridging. A lot less pain then I had expected! I didn't even finish a cup of coffee before I had it working.<br /><br />On another note I did set allowguest=no in my sip.conf for security - a lot of drive-by international SIP calls going on these days.<br /><br />Thanks again.<br /><br />PatUnknownhttps://www.blogger.com/profile/07789044057488115625noreply@blogger.comtag:blogger.com,1999:blog-7869312647255592139.post-49738326036877588862011-03-10T14:39:04.056-08:002011-03-10T14:39:04.056-08:00First, make sure you have set canreinvite=no. If ...First, make sure you have set canreinvite=no. If you have, then I'd recommend looking at the raw SIP traffic to see what is going on. My guess is you have a routing/nat issue and looking at the SIP debugs may help you identify that. You can look at the SIP traffic in asterisk using sip set debug on.<br /><br />To look at the SIP traffic in Lync you need to use the Lync Server Logging Tool. Between the two tools you should be able to narrow down where the problem is so you can resolve it.Andrew Parisiohttps://www.blogger.com/profile/13700424021784141757noreply@blogger.comtag:blogger.com,1999:blog-7869312647255592139.post-48450323628457914002011-03-09T00:08:51.567-08:002011-03-09T00:08:51.567-08:00Hi. I have such deployment, but i have problem wit...Hi. I have such deployment, but i have problem with external users. External Lync users (Edge server+TMG is used) cannot talk to asterisk users(internal or external). This is my deployment diagram.<br /><br />https://picasaweb.google.com/lh/photo/PMblyZnEinp1QfWy1ajjfg?feat=directlinkUnknownhttps://www.blogger.com/profile/09815351289135184416noreply@blogger.comtag:blogger.com,1999:blog-7869312647255592139.post-77854251255878318852011-03-09T00:06:35.506-08:002011-03-09T00:06:35.506-08:00This comment has been removed by the author.Unknownhttps://www.blogger.com/profile/09815351289135184416noreply@blogger.comtag:blogger.com,1999:blog-7869312647255592139.post-54633612322778460382011-03-04T15:15:25.037-08:002011-03-04T15:15:25.037-08:00You should replace it with the SIP peer for your o...You should replace it with the SIP peer for your outbound provider. For example mine is bandwidth-primary. I hope this helps!Andrew Parisiohttps://www.blogger.com/profile/13700424021784141757noreply@blogger.comtag:blogger.com,1999:blog-7869312647255592139.post-64536733865690849402011-02-25T22:21:43.905-08:002011-02-25T22:21:43.905-08:00Thanks for this Andrew, it's very helpful.
I ...Thanks for this Andrew, it's very helpful.<br /><br />I have a question on the Asterisk side-<br /><br />exten => _+1XXXXXXXXXX,1,Dial(SIP/${EXTEN}@OUTBOUND_PROVIDER,30)<br /><br />should OUTBOUND_PROVIDER be typed in literally, or should it be replaced with our outbound sip trunk?<br /><br />thanks!<br /><br />PaulAnonymoushttps://www.blogger.com/profile/15314637064711626223noreply@blogger.com