Configuring Asterisk with Lync (Office365)

Hello all,

I was trying to find out if somebody can help me out to set up Asterisk with Unified Messaging in Office 365 (not Lync Server).

I have an Asterisk installation running properly and a Office 365 E3 account running normally.

I know how to do it on the Microsoft side, but on the Asterisk side I am lost. The most of the manuals follow procedures that only can be followed on a non-cloud Lync (Lync servers installed locally). :smiley:

Thanks in advance.

Pablo Barrios

What did you try and where exactly are you stuck?

Basic Asterisk configurations are well described on the internet. If you don’t want to search to find the answer, hire a professional consultant that might help you. The forum members can only help you when you get stuck. The “basic” stuff is already explain many many times.

Hi, well… I tried to create a trunk to make a receive calls from Lync, in the SIP.conf file and I pointed the host to, however it is saying that this address is not a valid host.

So I cannot have the lync trunks to be registered into my asterisk so this is the part in which i am stuck.

type = friend
port = 5068
host =
dtmfmode = rfc2833
qualify = yes
transport = tcp,udp
context = from-lync

When I list using sip show peers, this is the output:

Name/username Host Dyn Forcerport ACL Port Status Realtime Lync_Trunk (Unspecified) N 0 UNKNOWN

However nothing happens… It just remains there.

However, I posted just to know if somebody had a manual for doing this :smiley: … but it seems it is not :S


Pablo Barrios

This is a support question, so is on the wrong forum.

What DNS information exists for

Hi David,

I do really sorry to post it the wrong forum.

I am not sure since Microsoft does not post this type of information. Look at the attached image. This is where we are supposed to take the address we need to use in our PBX to forward the calls to Lync. And also here we set the address (Public IP address) of our Asterisk.



Pablo B.

I’m afraid my Spanish isn’t good enough.

Your show peers is behaving as though Asterisk failed to do a DNS search on the name you specified. If you don’t know what should be in the DNS for it, you are probably not going to get much further.

Hi David,

I am sorry about the spanish thing, I did not realize about it.

Yes, I will need to dig in better to find a best way to do this. In this post of Office 365, they make a brief explanation on how to do it on the Office 365 side… And in here: the explain how to rout calls from my IPPBX to UM:

[quote]How do I forward calls from a telephone system to UM?
Select Manage My Organization > Phone & Voice > UM IP Gateways.
Select the gateway you want to connect to, and then select Details.
From the Forwarding address box, copy the address of the UM IP gateway.
Using the instructions for your physical telephone device, configure it to forward calls to UM.
If you are using a PBX, configure it to talk to a physical IP gateway, and then configure the IP gateway to forward calls to the forwarding address you copied from UM. [/quote]
This is the explanation of the window I attached in my last post. I am doing what they are saying here, to take the address from the “forwarding address box” ( and configuring it as a trunk in asterisk however this is the part in which I am stucked.

However I will keep researching more until I get. Hopefully, I would post the Step-by-Step manual on how to do it :smiley:


Pablo B.

Hi nnaxer,

Sorry for being late to post…
I was doing a search with the same question and i become pretty mad about the kind of answer you received from david55. Then, I open an account to share with you what I found. Honestly, If someone answer like this to me, I will start searching for a competitor software.

On this forum:

2 users found a fix using the SRTP with the TLS encryption on your Asterisk PBX.

I hope the information will be useful for you.


What you are complaining about is not the answer I gave but that no one gave you a more useful answer.

With peer supported open source software, the areas of expertise of other users of the software does need to be taken into account and if you can find some software where there are people willing and able to provide better support for your usage, you are welcome to use it.

This is not commercial software with a paid support organisation. Of course, if you go to such an organisation, they will be working off a script, and it will take you some effort to get them off the script.

I’m perfectly at liberty not to reply, and often do when I don’t think there is anything that I can safely contribute. In that case, it is quite possible that your answer would have been the first one on this thread.

If you think you can provide better support, stay subscribed and answer the questions yourself. That’s how people become responders on forums like this.

Hi Pablo,

Is not easy to integrate Asterisk with Lync Online Services. When Lync is on-premise (on house), you can do some advanced configuration and architecture implementation to get those enviroment connected, but is not easy, and you also have to pay for Enterprise Voice Licenses …

Things got worse if you use Office365 Online Services (Lync Online). There is no way to have and hybrid enviroment, using cloud services and your own PBX… (since on cloud, you have no access to a mediation server).

I always suggest to go away of complications, and use Lync as a normal softphone, that can also register directly to Asterisk. This can be done if you install a plugin on Lync, that adds that funtionality… I will suggest to take a look of , on that web you can see also some examples of configuration, see some videos, and get a fast and easy integration of Lync with Asterisk in a couple of minutes…

This solutions works well for both, on cloud, and on-premise services, and it has a lot of flexivity. You should test it :wink: