Microsoft Skype for Business (Lync) with Asterisk as Mediation Server

Asterisk is open source telephony platform. It can be use as fully functional private branch exchange (PBX).

In addition Asterisk can be used as Voicemail Server, Session Border Controller (SBC), Audio Conference Bridge, IVR.

In other words Asterisk can be Integrated via SIP Trunk.

PREREQUISITES

In the first place Enterprise Voice needs configured be deployed on Skype for Business . Click here configure Enterprise Voice.

Second Asterisk needs to be up and running. Click here to know how to install asterisk on Ubuntu.

For this example we are using switch2voip configuration as internet outbound trunk.

Trunk for Skype for Business on Asterisk

Open sip.conf with your favorite editor in Linux I am using VI editor

Enter following configuration at the bottom of the file.

[SfB]
host=192.168.1.1 (skype for business front end server IP address)
transport=tcp
port=5060
insecure=very
type=friend
context=from-internal
promiscredir=yes
qualify=yes
canreinvite=yes

[switch2voip]
disallow=all
type=friend
username=username
secret=password
host=151.106.9.186
dtmfmode=rfc2833
context=trunkinbound
qualify=yes
nat=yes
insecure=port,invite
allow=ulaw
allow=alaw

OUTBOUND DIAL PLAN

Edit extensions.conf file and add following configuration

[from-internal]
exten => _X.,1,Dial(SIP/${EXTEN}@switch2voip,60,rTo)
exten => _X.,n,Hangup()

INBOUND DIAL PLAN

Next step is to create Inbound dial plan. Yon need to create dial plan as per your extensions or DID number. Hence we are taking 2xxx for this example. There are multiple way to handle inbound calls.

Following are the 2 way to handle the same

[trunkinbound]

exten => 2XXX,1,Dial(SIP/${EXTEN}@SfB,60,rTo)
exten => 2XXX,n,Hangup()

As a result of above dial plan, all calls come for 2xxx extension series will be sent to Skype for Business Server.

[trunkinbound]

exten => 2000,1,Dial(SIP/${EXTEN}@SfB,60,rTo)
exten => 2000,n,Hangup()

[trunkinbound]

exten => 2001,1,Dial(SIP/${EXTEN}@SfB,60,rTo)
exten => 2001,n,Hangup()

Calls come for extension 2000 and 2001 will be sent SfB  server. Therefore you can create multiple dial plan.

ENABLE SIP OVER TCP ON ASTERISK

Asterisk work on SIP over UDP by default, SfB need TCP to connect via SBC, to enable TCP on asterisk edit sip.conf and allow tcp.

tcpenable = yes

Then restart the Asterisk Server.

asterisk -rx”core restart now”

 

VERIFY ASTERISK TCP CONNECTION

Run netstat command from Linux shell asterisk should also listening on TCP.

netstat -anp | grep asterisk

Following output should be presented where port 5060 is listening on TCP and UDP both.

Netstat

Conclusion

Now you will be able to connect asterisk with Skype for Business. 

We are providing design, implementation and integration service many technologies. Contact us for more information. 

If you face any issue or have feedback, leave a comment below. We will be happy to help you.

Leave a Reply

Close Menu