Skip to content

Integration of Lync Server 2010 Voice with Asterisk

March 20, 2012

In this article, I will be demonstrating integration of Lync Server 2010 with Asterisk open source voice over IP solution. Asterisk can serve as gateway for Lync server in test environment for validating voice connectivity and feature. 

Scenario:

Scenario

To help you setup direct SIP with Asterisk, step-by-step instructions for configuring Asterisk, Lync Server and the 3CX SIP client for Asterisk are discussed. Installation of Asterisk server is not discussed in this article. If you want to try the same you can start after the default installation and basic “setup” is completed.

A. Configure Asterisk environment

I am using Asterisk Graphical Interface to create a new Dial plan and two user extensions associated with this dial plan.

  1. Login to Asterisk Graphical Interface “http://<AsteriskServerIP:8088/static/config/index.html”

 

Login with “Admin” user. In the left hand side menu expand “Dial Plans” section and click on “New DialPlan” button.

 

In “Create new Dial Plan” à type the name of Dialplan in “DialPlan Name” à Click Save.

Create Dial Plan

  Now Expand Users and click on “Create New User” Button.

Create Users

  Now add the details for new user

User Details

 

I have added two extensions for testing

Users

 

You can install any SIP phone client on desktop or from Android Market on Android phone.  For this demonstration I have installed 3CXphone on my Android phone

3CXPhone

Create extension profile on SIPPhone, Click on Settings button

Profile Settings

 

Add details for the user we just created in Asterisk, to profile

Profile setting 1

Click on Save button to save the profile.

Profile Save

 

SIP Phone is now connected to the server you would be able to make calls to local Asterisk extensions

3CXPhone Connected

 Let’s make a call to another extension and track the call status.

Run command below to open asterisk command line on Asterisk server

Asterisk Commandline

After running command, you will see the asterisk command prompt

Commandline

To Show Current peer connections on Asterisk server

SIP Show Peer

Dial extension 6001, which is having voice mail enabled, extension is not online so call will be routed to voicemail. Enter the extension number in SIP phone and press 

Call connected

 Call status will be visible in Asterisk command prompt

Recording sound starts because extension is not online

Connected to voicemail

Configuring Asterisk for Lync integration

To configure Asterisk, you must edit a series of configuration files. The following files are in a text format and are normally found in the /etc/asterisk directory:

sip.conf

extensions.conf

 SIP.conf File

The sip.conf file defines all SIP configurations for Asterisk.

The first section in this text file is labeled [general]. In the [general] section, you define general SIP settings for the entire Asterisk server.

SIP.Conf

Next, we define a section in the sip.conf file to instruct Asterisk how to connect to the Lync Server 2010, Mediation Server.

SIP.conf

[Lynctrunk]   Tells Asterisk this is the start of a new section in the sip.conf file. Note the name is inside square brackets. You can name your SIP object anything you like.

type=friend   Set this option to friend. This tells Asterisk that this SIP object (that is, Mediation Server) is capable of sending and receiving calls.

If this field is set to peer. This indicates to Asterisk that this SIP object can receive calls.

qualify=yes   Instructs Asterisk to verify that this SIP object is reachable. Asterisk performs a check every 60 seconds. 

Extensions.conf File

This file defines the dial plan configuration in Asterisk. The dial plan dictates how calls flow in Asterisk. Every incoming call that Asterisk receives is processed depending on the instructions defined in the dial plan.

Contexts

Contexts are nothing more than a convenient container for grouping extensions.

Extensions.conf

After changing configuration reload Asterisk by using following command

Conf Reload

 

 B.      Configuring Lync Server

 Using Lync 2010, Topology Builder define PSTN gateway

Define PSTN Gateway

PSTN Gateway properties

PSTN Gateway Properties

 

Associate PSTN gateway to the Mediation pools and define listening ports:

Mediation Associate PSTN Gateway

 

Publish the topology changes,

Publish Topology

 

Configure Dial Plan, voice policy and route to define route for Asterisk Extensions

Lync DialPlan

 

Open Dial plan OCSUMDial.ng.com to Create a Normalization rule.

Click New in “Associated Normalization Rules”

New Normalization Rule

 Add details for new Normalization rule and click OK

New Normalization rule details

Click on OK,

Normalization Rule

 

Click on Voice Policy Tab and double click on default “Global” policy to open

Update Voice Policy

Update Voice Policy

 

Click On New on “Associated PSTN Usages”

Create PSTN Usage

 

Add “Name” of PSTN Usage record name and Click on New on Associated Routes

PSTN Usage Record Name and New Route

 

Add Route details and click OK

Route Details

 

Click OK twice and exit voice policy.

Voice Policy Update

 

Route and PSTN Usage tab will populate with configuration we just added.

PSTN Usage Record and Route Tab

 

Commit the changes to apply

Apply Changes

 

Click Commit

Commit Changes

 

 

C.      Testing Voice Integration

1.  Dial Asterisk Extension from Lync Client

Dial Extn 6000

 

Call will land to the Asterisk Extension

SIP Phone Ringing

When call is answered

Trunk Status

 

SIP Client Call Connected

 

2. Dial Lync Extension from Asterisk SIP Client

Calling to Lync client

Call is connected

 

Call Answered

 Word Document of this This Post “Asterisk Configuration

Advertisements

From → Uncategorized

Leave a Comment

Leave a Reply

Fill in your details below or click an icon to log in:

WordPress.com Logo

You are commenting using your WordPress.com account. Log Out / Change )

Twitter picture

You are commenting using your Twitter account. Log Out / Change )

Facebook photo

You are commenting using your Facebook account. Log Out / Change )

Google+ photo

You are commenting using your Google+ account. Log Out / Change )

Connecting to %s

%d bloggers like this: