Skype and Google Talk integration with Lync
At Tee Systems, we always strive to simplify communications. Especially for you, we have prepared an article in which we will tell you how to combine Skype and GTalk with Lync, for the convenience of your communication.
This article will help you install Asterisk, configure collaboration between Asterisk-Skype, Asterisk-GTalk, and integrate Asterisk into your existing Lync architecture.
First we need CentOS 6.2. We 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:
For stable operation of ip-pbx Asterisk and Lync 2010, we need to do the following:
1. In Topology Builder Lync 2010 add to our Asterisk PSTN gateways, specify the TCP port 5060
2. After that add routing calls from Lync Asterisk internal numbers:
(In In this case, all calls to Lync extension numbers [2,3] xxx from Lync will be transferred to Asterisk. In the examples below we will use numbers 2001, 2002).
3. Add sip.conf to the Asterisk configuration file :
[Lync_Trunk] Link name for Link
type = friend
port = 5068 (This port uses a Lync server)
host = xxxx.xxx.xxxx.xxx IP address of our Lync server
dtmfmode = rfc2833
context = from-lync
qualify = yes
transport = tcp
4. In the extensions.conf configuration file,add the from-lync context 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 calling an Asterisk 2002 extension from Lync, the call will transfer to Asterisk to the internal number.
In addition, to make calls from Asterisk extensions toLync extensions, we need toadd routing rules to theAsterisk extensions.conf configuration file. For example, in the default contextadd:
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 can make calls from Asterisk numbers 2xxx and 3xxx to the internal numbers of Lync subscribers (in our example 2xx and 3xx).
This integration will allow you to receive calls from Gtalk to Asterisk to an extension number, to Asterisk IVR or to IVR Lync (in our example, we will show how to make an incoming call from GTalk transfer to a Lync call group):
1. To register Asterisk to GTalk we will need a google account. We create it. After that we add the following to the gtalk.conf configuration file :
[general]
context = from-gtalk Incoming call receiving context
bindaddr = local_ip Asterisk server internal address
externip = external_ip Asterisk external address is white
allowguest = yes Ability to receive calls from people outside GTalk list
[guest]Special guest account settings
disallow = all
Disable all codecs allow = ulaw Allow only ulaw
context = from-gtalk Specify the call processing context
[account] In this section, specify the login from your Google account
username=YOUR_ACCOUNT@gmail.com
disallow = all
allow = ulaw
context = from-gtalk
connection = gtalk_account The connection from the jabber.conf
2 configuration file is indicated . After that, we change the jabber.conf configuration file Asterisk: [gtalk_account] GTalk account settings section type = client Connection type serverhost = talk.google.com
Registration server
username=YOUR_ACCOUNT@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
useasl = yes Use sasl or not
status = available Presence status
statusmessage = “Only Voice” Status message
3. Now configure call routing from GTalk to Lync. To do this, add the route to the configuration file extensions.conf Asterisk:
[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,write the followingin extensions.conf Asterisk:
exten => 3333.1, Dial (gtalk/gtalk_account/ called_user_name@gmail.com)
At the moment, Asterisk integration with Skype is paid. For integration, we need to buy Skype Connect and an online Skype number.
1. Register in 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 may look like this (+ 4420xxxxxxxx).
We add this data to the sip.conf Asterisk configuration file in the [general] section :
register => 990xxxxx: 9Jxxx@sip.skype.com/990xxxxxx
Add 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 = invite
After that we configure rules for processing incoming calls from Skype and outgoing calls to international numbers via Skype. To do this, add thefollowing to the extensions.conf Asteriskconfiguration 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 receive a call from Skype and transfer it to the 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 telephone 2001 through Asterisk-> Skype worldwide. To do this, configure the rule for processing outgoing calls in Skype in the same extensions.conf configuration file (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, Hangup
• Chapter 11: Interoperability with Asterisk and Skype (available here www.microsoft.com/download/en/details.aspx?displaylang=en&id=22644 )
• Asterisk protection or several ways to protect yourself from password guessing for your SIP account (http: / /subnets.ru/blog/?p=1552)
• Protection of asterisk from hacking (http://www.mahno.su/freebsd/asterisk-freebsd/zashhita-asterisk-ot-vzloma)
This article will help you install Asterisk, configure collaboration between Asterisk-Skype, Asterisk-GTalk, and integrate Asterisk into your existing Lync architecture.
Part one. Install Asterisk on CentOS 6.2
First we need CentOS 6.2. We 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 on 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 distributions iksemel, Asterisk and DAHDI:
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, start the DAHDI service and configure its autorun:
chkconfig dahdi on
service dahdi start - Now we can proceed to installing 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 the " Channel Drivers " and add support for [*] chan_jingle , and also connect [*] res_jabber in " Resource Modules ".
d) Save the settings and exit the configuration mode with the " x " key
e) Finish the installation:
make
make install
make samples samples
make config - It remains to configure Asterisk itself
a) Launch the asterisk console:
asterisk –vvvvc
b) To configure Asterisk autostart, run the following commands:
cp contrib / init.d / rc.redhat.asterisk /etc/rc.d/init.d/asterisk
chkconfig - add asterisk
c) After installation, it is necessary to modify the sip.conf configuration file to strengthen Asterisk security and stable operation of Asterisk with Lync:
[general]
context = default Used context for processing incoming calls
allowoverlap = no Dialing is disabled in the blend mode
udpbindaddr = 0.0.0.0 Specify that we bind a UDP listener to all IP addresses
bindport = 5080 Use port 5080
bindaddr = 0.0.0.0 Specify that we bind to all IP addresses
tcpenable = yes Turn on TCP support (for Lync support)
tcpbindaddr = 0.0.0.0 Specify that we bind a TCP listener to all IP addresses
srvlookup = yes Turn on DNS lookup support SRV
notifyhold = yes We
include subscriber information about the call put on hold alwaysauthreject = yes Asterisk will not report details on authorization errors
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. Asterisk and Lync 2010 integration
For stable operation of ip-pbx Asterisk and Lync 2010, we need to do the following:
1. In Topology Builder Lync 2010 add to our Asterisk PSTN gateways, specify the TCP port 5060
2. After that add routing calls from Lync Asterisk internal numbers:
(In In this case, all calls to Lync extension numbers [2,3] xxx from Lync will be transferred to Asterisk. In the examples below we will use numbers 2001, 2002).
3. Add sip.conf to the Asterisk configuration file :
[Lync_Trunk] Link name for Link
type = friend
port = 5068 (This port uses a Lync server)
host = xxxx.xxx.xxxx.xxx IP address of our Lync server
dtmfmode = rfc2833
context = from-lync
qualify = yes
transport = tcp
4. In the extensions.conf configuration file,add the from-lync context 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 calling an Asterisk 2002 extension from Lync, the call will transfer to Asterisk to the internal number.
In addition, to make calls from Asterisk extensions toLync extensions, we need toadd routing rules to theAsterisk extensions.conf configuration file. For example, in the default contextadd:
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 can make calls from Asterisk numbers 2xxx and 3xxx to the internal numbers of Lync subscribers (in our example 2xx and 3xx).
Part three. Configure Asterisk-GTalk Integration
This integration will allow you to receive calls from Gtalk to Asterisk to an extension number, to Asterisk IVR or to IVR Lync (in our example, we will show how to make an incoming call from GTalk transfer to a Lync call group):
1. To register Asterisk to GTalk we will need a google account. We create it. After that we add the following to the gtalk.conf configuration file :
[general]
context = from-gtalk Incoming call receiving context
bindaddr = local_ip Asterisk server internal address
externip = external_ip Asterisk external address is white
allowguest = yes Ability to receive calls from people outside GTalk list
[guest]Special guest account settings
disallow = all
Disable all codecs allow = ulaw Allow only ulaw
context = from-gtalk Specify the call processing context
[account] In this section, specify the login from your Google account
username=YOUR_ACCOUNT@gmail.com
disallow = all
allow = ulaw
context = from-gtalk
connection = gtalk_account The connection from the jabber.conf
2 configuration file is indicated . After that, we change the jabber.conf configuration file Asterisk: [gtalk_account] GTalk account settings section type = client Connection type serverhost = talk.google.com
Registration server
username=YOUR_ACCOUNT@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
useasl = yes Use sasl or not
status = available Presence status
statusmessage = “Only Voice” Status message
3. Now configure call routing from GTalk to Lync. To do this, add the route to the configuration file extensions.conf Asterisk:
[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,write the followingin extensions.conf Asterisk:
exten => 3333.1, Dial (gtalk/gtalk_account/ called_user_name@gmail.com)
Part Four Configure Asterisk-Skype integration
At the moment, Asterisk integration with Skype is paid. For integration, we need to buy Skype Connect and an online Skype number.
1. Register in 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 may look like this (+ 4420xxxxxxxx).
We add this data to the sip.conf Asterisk configuration file in the [general] section :
register => 990xxxxx: 9Jxxx@sip.skype.com/990xxxxxx
Add 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 = invite
After that we configure rules for processing incoming calls from Skype and outgoing calls to international numbers via Skype. To do this, add thefollowing to the extensions.conf Asteriskconfiguration 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 receive a call from Skype and transfer it to the 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 telephone 2001 through Asterisk-> Skype worldwide. To do this, configure the rule for processing outgoing calls in Skype in the same extensions.conf configuration file (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, Hangup
We hope that our article was able to 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 )
• Asterisk protection or several ways to protect yourself from password guessing for your SIP account (http: / /subnets.ru/blog/?p=1552)
• Protection of asterisk from hacking (http://www.mahno.su/freebsd/asterisk-freebsd/zashhita-asterisk-ot-vzloma)