-
Integrating Asterisk FreePBX with Lync Server 2010
Integrating Asterisk FreePBX with Lync Server 2010
....................................................................................
1
AsteriskNow package Source
................................................................................................................
2
Installing AsteriskNow
...........................................................................................................................
2
Configure AsteriskNow
.........................................................................................................................
2
Add Extensions
..................................................................................................................................
2
Lync Stress Tool Incoming call Extension
..........................................................................................
3
Add SIP Trunk
....................................................................................................................................
4
Add Inbound Routes
.........................................................................................................................
6
Add Outbound Route
........................................................................................................................
7
Configure PSTN Gateway in Lync Server 2010
......................................................................................
7
Create Dial Plan, Voice Policy and Trunk Configuration
...................................................................
8
Testing / Troubleshooting the Configuration
.....................................................................................
12
AsteriskNow Configuration
.............................................................................................................
12
-
AsteriskNow package Source
Download the latest AsteriskNow 2.0.2 Here
Installing AsteriskNow
Boot the VM with AsteriskNOW-2.0.2-x86_64-DVD.iso image
In the Setup options, type 1 and press Enter (By Default, the
installation would continue with
Option 1. Option 1 installs AsteriskNow with FreePBX GUI)
Follow the install wizard, installation wiill complete without
the any interruption
Login to the server as root and password provided during the
installation
Configure AsteriskNow
Type Setup to configure Network configuration
Make sure you provide proper gateway and DNS server IP
addresses
Reboot the server using command shutdown –r now
Now, Login to AsteriskNow web GUI using http://X.X.X.X ( IP
address of AsteriskNow server)
Default user name and password for Web GUI is admin
Add Extensions
Click Extension and select Generic SIP Device and Click
Submit
Type the User Extension and Display Name as shown below. I have
extensions starting with 2
and XXX digits, example 2000.
Under Device Options, enter the secret (password for the user
extension)
http://www.asterisk.org/downloads/asterisknowhttp://x.x.x.x/
-
Click Submit
Note: I am not configuring Voice mail or DID number for now so
have not configured remaining sections
in the Extension tab.
Lync Stress Tool Incoming call Extension
Need to create extension “0000” with different target routing to
handle all the Incoming calls genrated
from Lync stress tool and via Mediation server to PBX system.
Follow the steps below:
Under FreePBX main Console, Click Applications -> Select
Generic SIP Device -> Click Submit
Add following information as in the below screenshot:
-
Add Extension as 0000 and Secret – as0000
Under Optional Destionations -> No Answer, select Feature
Code Admin and Directory#
Type “1” in the CID Prefix; As shown below:
Leave remaining options to Default.
Add SIP Trunk
Click Connectivity and Select Trunks
In the Right side of the window, click Add Trunk - > SIP
Trunk
In General Settings, under Trunk Name, provide name for your SIP
Trunk
-
Under Outgoing Settings,type values as in screenshot below:
Click Submit Changes.
-
Brief description of Outgoing Settings (Peer details):
host=10.10.1.16 ; IP address of the Lync Mediation Server or
Front-End
Server if Mediation server is collated.
transport=tcp,udp ; Trasmission protocol add both TCP and
UDP
port=5068 ; Listening port of Mediation Server or Collated
Front-End
Server
type=friend ; Friend variable indicates Host allows both
incoming &
outgoing calls and messages
context=from-internal ; Default context generated by FreePBX
GUI
qualify=yes ; Yes allows Asterisk server to check if Peer (Lync
Server) is
still Online
insecure=invite ; Do not require authentication of incoming
INVITEs
Add Inbound Routes
Click Connectivity -> Inbound Route
In Description Field: Provide name for the incoming Route
In Set Destination, select Trunks and then select SIP Trunk
created earlier.
-
Click Submit
Add Outbound Route
In Route name, Enter a name
In Set Patterns that will use this Route, enter 7XXX (I planned
to assign 7XXX series for Lync
extensions hence, this pattern will allow all the extensions
dailed with starting 7 and followed by
3 digits will get routed to SIP Trunk)
In Trunk Sequence for Matches Routes. Select SIP Trunk created
earlier
Click Submit Changes
This ends the configuration of AsteriskNow.
Configure PSTN Gateway in Lync Server 2010
Open the Lync Topology Builder and download the deployed
topology
In the section PSTN Gateway, right click New PSTN Gateway
Enter AsteriskNow IP address
Type Listening Port as 5060
-
Under SIP Transport Protocol, select TCP and click OK
Right Click PSTN Gateway newly added in the Topology, publish
the topology.
Create Dial Plan, Voice Policy and Trunk Configuration
First, lets create dial plan and assign the PSTN Gateway , voice
policy to dial plan.
Open the Lync Control Panel, click on Voice Routing
Under Dial Plan, double click, Global
Now under Normalization Rules, click New and enter values
similar to below screenshot:
-
I have imcoming calls from Asterisk PBX to Lync with 7XXX
extensions, creating normalization rules to
check starting digit as 7 and add “+” infront of 7XXX extension
to make the dialed number as e.164
format.
Click Ok twice. In the main Dial Plan main window, select Global
and click Commit and select
Commit All
Now Click on Voice Policy
Click on Voice Policy and downlob click Global
In Associated PSTN Usages, click New
Enter the name for Voice Policy
In Assoicated Routes, click New
Under Name section, Enter Name
Click Add and enter 7 (my Lync extentions starts with 7)
Under Associated gateways, click Add and select PSTN listed
CLick Ok 3 times to come back to main window
Select GLobal and select Commit - > Commit All
Click on Trunk Configuration
Double click Global
Under Assoicated Transliation Rules, Click new
Under Name field, Enter Name
Add remaining as per screenshot.
This rule is created for allowing outgoing call from Lync,
Normalization is required for outgoing calls. For
examples, Lync client will dial out 3000 as +3000. Normalizatin
rule is created to remove "+" and send
3000 to PBX system
CLick OK twice
Select Global and Commit All.
-
Configuration of Lync Policies to handle Lync Stress Tool
Outgoing Calls
Note: You need to remove the above rule “Call from Lync to PSTN”
and add below rule to make Lync
Server work for Stress tool. To check the End to End
Connectivity, don’t create the rule below yet.
To handle the outgoing call (Number +14250000000) from Lync
Stress tool and route it to PBX system,
create addition Rule in the Trunk Configuration as below:
-
This ends the Lync configuration.
Configure 3CX Softphone & add Extension
Download and install 3CX latest version from Here
Open the 3CX soft phone and Right on the Display Screen
Select Accounts and Click New
Add the information as shown in the screenshot below:
Note: You need to create Extension 0000 in the Asterisk PBX
system before configuring 3CX softphone.
http://www.3cx.com/VOIP/voip-phone.html
-
Testing / Troubleshooting the Configuration
AsteriskNow Configuration
1. To test the connectivity between AsteriskNow and Lync
Mediation Server
[root@pbx ~]# telnet 5068
If result shows “Not Connected” then Lync Mediation Server is
not listening on port 5068.
Check your Lync topology on what port is configured for Lync
Mediation Listening Port
(Don’t get confused with PSTN Gateway listening Port)
Go to Lync mediation server and open Command Prompt, type
Netstat –a This gives all
listening ports and respective IP address of Mediation
Server.
2. Check AsteriskNow service running
[root@pbx ~]# service asterisk status
asterisk (pid 4652) is running...
OR
[root@pbx ~]# /etc/init.d/asterisk status asterisk (pid 4652) is
running...
3. How to enable debugging in AsteriskNow
[root@pbx ~]# asterisk –r
[root@pbx ~]# sip set debug on
If you want to enable debug on specific peer then follow below
command:
[root@pbx ~]# sip set debug peer
To List Peer names added in your PBX:
[root@pbx ~]# sip show peers
4. Check SIP peers and SIP Trunk status and registration in
AsteriskNow
[root@pbx ~]# sip show peers
[root@pbx ~]# sip show registry