At TI Systems, we always strive to simplify communications. Especially for you, we have prepared an article in which we will describe how to combine Skype and GTalk with Lync, for the convenience of your communication.
This article will help you install Asterisk, set up Asterisk-Skype, Asterisk-GTalk collaboration, and also integrate Asterisk into your existing Lync architecture.
Part one. Installing Asterisk on CentOS 6.2
First we need CentOS 6.2. We will assume that you have already installed CentOS 6.2 and made the initial setup of the system, so let's proceed directly to installing Asterisk:
')
- a) The first step is to install additional components in CentOS:
yum install wget kernel-devel gcc make gcc-c ++ libxml2-devel perl ncurses-devel gnutls-devel curl-devel net-snmp-devel neon-devel
b) After that, download the iksemel, Asterisk and DAHDI distributions:
wget downloads.asterisk.org/pub/telephony/asterisk/releases/asterisk-1.8.7.2.tar.gz
wget downloads.asterisk.org/pub/telephony/dahdi-linux-complete/releases/dahdi-linux-complete-2.5.0.2+2.5.0.2.tar.gz
wget iksemel.googlecode.com/files/iksemel-1.4.tar.gz
c) Unpack the archives in the current directory:
tar -xvzf asterisk-1.8 * && tar -xvzf dahdi-linux-complete- * && tar -xvzf iksemel- *
d) Install iksemel first:
cd iksemel- *
./configure --prefix = / usr --with-libgnutls-prefix = / usr --with-gnutls
make
make install
cd ..
e) Then install DAHDI:
cd dahdi-linux-complete *
make all
make install
make config
cd ..
e) After installing DAHDI, we start the DAHDI service and configure its autostart:
chkconfig dahdi on
service dahdi start - Now we can proceed to the installation of Asterisk itself.
cd asterisk- *
make clean
./configure
a) Set the terminal resolution to at least 80 x 27
b) Run the configuration mode:
make menuselect
c) Go to " Channel Drivers " and add support for [*] chan_jingle , and also connect [*] res_jabber to " Resource Modules ".
d) Save the settings and exit the configuration mode by pressing the " x " key
e) Finish the installation:
make
make install
make samples
make config - It remains to configure itself Asterisk
a) Start the asterisk console:
asterisk –vvvvc
b) To set up Asterisk autorun, execute the following commands:
cp contrib / init.d / rc.redhat.asterk /etc/rc.d/init.d/asterisk
chkconfig --add asterisk
c) After installation, you need to change the sip.conf configuration file to enhance Asterisk security and Asterisk stable operation with Lync:
[general]
context = default Used context for handling incoming calls
allowoverlap = no Set overlay inactivated
udpbindaddr = 0.0.0.0 Specify that we bind the UDP listener to all IP addresses
bindport = 5080 Using port 5080
bindaddr = 0.0.0.0 Specify that we bind to all IP addresses
tcpenable = yes Enable TCP support (for Lync support)
tcpbindaddr = 0.0.0.0 Specify that we bind the TCP listener to all IP addresses
srvlookup = yes Enable DNS SRV search support
notifyhold = yes Enable subscriber call information on hold
alwaysauthreject = yes Asterisk will not give details when authorization errors occur.
localnet = 192.xxx.xxx.xxx/255.255.255.0 Specify the local subnet
externip = 8.8.8.8 Specify the external IP address that we will use for Asterisk
Part two. Integration of asterisk and Lync 2010
For stable operation of ip-pbx Asterisk and Lync 2010, we need to perform the following steps:
1. In Lync 2010 Topology Builder, add our Asterisk to PSTN gateways, specifying TCP port 5060
2. After that add routing of calls from Lync to Asterisk internal numbers:

(In this case, all calls to internal numbers [2,3] xxx from Lync will be transferred to Asterisk. In the examples below we will use numbers 2001, 2002).
3. Add to the Asterisk configuration file
sip.conf :
[Lync_Trunk] Trunk Name for Link
type = friend
port = 5068 (This port uses the Lync server)
host = xxxx.xxx.xxx.xxx IP address of our Lync server
dtmfmode = rfc2833
context = from-lync
qualify = yes
transport = tcp4. Add the
from-lync context to the
extensions.conf configuration file to service calls from Lync to Asterisk:
[from-lync]
exten => _ 2XXX, 1, Dial (SIP / $ {EXTEN})
exten => _ 2XXX, 2, playback (vm-nobodyavail)
exten => _ 2XXX, 3, playback (vm-goodbye)
exten => _ 2XXX, n, hangup ()Now, when you call an Asterisk 2002 extension from Lync, the call will be transferred to Asterisk to the extension.
In addition, to make calls from internal Asterisk numbers to internal Lync numbers, we need to add routing rules to the Asterisk
extensions.conf configuration file. For example, in the context of the
default add:
exten => _ 2XX, 1, Dial (SIP / Lync_Trunk / $ {EXTEN})
exten => _ 2XX, n, hangup ()
exten => _ 3XX, 1, Dial (SIP / Lync_Trunk / $ {EXTEN})
exten => _ 3XX, n, hangup ()Now we will be able to make calls from Asterisk 2xxx and 3xxx numbers to Lync extension numbers (in our example 2 and 3).
Part Three Configuring Asterisk-GTalk Integration
This integration will allow you to receive calls from Gtalk to Asterisk to an extension number, to Asterisk IVR or to Lync IVR (in our example, we will show how to make an incoming call from GTalk to the Lync call group):
1. To register Asterisk with GTalk, we will need an account with google. Create it. After that we add the following to the
gtalk.conf configuration file:
[general]
context = from-gtalk Incoming call context
bindaddr = local_ip Internal address of the Asterisk server
externip = external_ip The external white address of Asterisk
allowguest = yes Ability to receive calls from people outside the GTalk list
[guest] Parameters of a special guest account
disallow = all Disable all codecs
allow = ulaw Only
allow ulaw
context = from-gtalk Specify the call handling context
[account] In this section, we specify the login from Google account
username= YOUR_ACCAUNT@gmail.comdisallow = all
allow = ulaw
context = from-gtalk
connection = gtalk_account Connection is specified from the jabber.conf configuration file
2. After that, we change the Asterisk
jabber.conf configuration file:
[gtalk_account] GTalk Account Setup Section
type = client Connection type
serverhost = talk.google.com Registration Server
username=YOUR_ACCAUNT@gmail.com/Talk Account.
secret = YOUR_PASSWORD Password
priority = 1 Resource Priority Level
port = 5222 Server port, default 5222
usetls = yes Use tls or not
usesasl = yes Use sasl or not
status = available Presence status
statusmessage = “Only Voice” Status Message
3. Now we set up call routing from GTalk to Lync. To do this, add the route to the Asterisk
extensions.conf configuration file:
[from-gtalk]
exten => s, 1, NoOP (Call from Gtalk)
exten => s, n, Set (CALLERID (name) = Google Talk)
exten => s, n, Dial (SIP / Lync_Trunk / 3xx) 3xx - number for the Lync call group.
4. To make outgoing calls to certain accounts in GTalk, we can create a “virtual” number in Asterisk. To do this, in the Asterisk
extensions.conf file, write the following:
exten => 3333,1, Dial (gtalk/gtalk_account/call_name_user@gmail.com)Part Four Setting up Asterisk-Skype integration
At the moment, the integration of Asterisk with Skype is paid. To integrate, we need to buy Skype Connect and Skype online number.
1. Register with Skype Manager and then create a Skype Connect profile (https://manager.skype.com/features/sip). In the authorization settings you will see your SIP User and Password, as well as the connection address (sip.skype.com) and the connection port (UDP 5060).

Now you need to buy an online Skype number. It can look like this (+ 4420xxxxxxxx).
We add this data to the
[general] section of the
sip.conf Asterisk configuration file:
register => 990xxxxx: 9Jxxx@sip.skype.com/990xxxxxxAdd a new section called SIP User:
[990xxxxx]
type = friend
dtmfmode = rfc2833
context = default
host = sip.skype.com
username = 990xxxxx
secret = 9Jxxx
disallow = all
allow = ulaw
allow = alaw
allow = g729
nat = yes
canreinvite = no
fromdomain = sip.skype.com
insecure = inviteAfter that, we configure the rules for processing incoming calls from Skype and outgoing calls to international numbers via Skype. To do this, add the following to the Asterisk
extensions.conf configuration file:
exten => 4420xxxxxxxx, 1, Answer
exten => 4420xxxxxxxx, n, Dial (SIP / Lync_Trunk / 3xx) 3xx - number for the Lync call group
This will allow you to take a call from Skype and transfer it to a Lync call group.
You can also assign an international number to a virtual number in Asterisk (for example, 2001). This will allow us to make calls from Lync by calling 2001 via Asterisk-> Skype worldwide. To do this, configure the rule for processing outgoing calls in Skype in the same configuration file
extensions.conf (for testing, you can use the free Skype number + 17606604590)
exten => 1001,1, Answer
exten => 1001, n, Set (CALLERID (num) = 990xxxxx)
exten => 1001, n, Dial (SIP / + 17606604590 @ 9990xxxxx)
exten => 1001, n, HangupWe hope that our article could help you!
In the article we used the following materials:
• Chapter 11: Interoperability with Asterisk and Skype (available here
www.microsoft.com/download/en/details.aspx?displaylang=en&id=22644 )
• Protection of Asterisk or several ways how to protect against selecting a password for a SIP account (http://subnets.ru/blog/?p=1552)
• Protection of asterisk from hacking (http://www.mahno.su/freebsd/asterisk-freebsd/zashhita-asterisk-ot-vzloma)