Project Manager: Susan S. Bradley Content Architect


Asterisk Integration with Lync Server 2010



Yüklə 207,34 Kb.
səhifə2/5
tarix14.10.2017
ölçüsü207,34 Kb.
#5063
1   2   3   4   5

Asterisk Integration with Lync Server 2010


To interoperate Lync Server with Contoso’s existing telephony system, which doesn’t support Direct SIP with Lync Server, Bob decides to use Asterisk as a gateway between the telephony system and Lync Server 2010, Mediation Server for the following reasons:

  • Asterisk supports a large set of protocols.

  • Asterisk is free.

  • Asterisk supports the Integrated Services Digital Network (ISDN) interface.

He decides to deploy Asterisk on a CentOS virtual machine. To test interoperability with Lync Server, Bob installs a SIP client (that is, X-Lite) to connect to Asterisk.

This topology is illustrated in Figure 1. This topology is illustrated in Figure 1. In this figure, the normalization rule was created to allow a PBX phone to dial five digits and reach the Lync user. If the X-Lite user dials 50150, the normalization rule for the trunk normalizes 50150 to +14255550150.





Figure 1. Integration topology with desk phones, X-Lite, Asterisk server, and Lync Server 2010 Standard Edition collocated with a Mediation Server

Basic Call Flow


Bob dials the phone number "1000" from his Lync client, as shown in Figure 2.



Figure 2. Lync 2010 client dials Asterisk extension number 1000

The call is routed based on matched voice route and PSTN usage that is configured in Lync Server 2010 to the Mediation Server.

The Mediation Server and Asterisk server are configured for direct SIP so that calls can be routed between the two VoIP systems.

Then, Asterisk routes the incoming call from the Mediation Server to the X-Lite client according to the Asterisk dial plan.

In this scenario, Luka is using the X-Lite client. Luka sees an alert message pop-up on the X-Lite client, which notifies him of an incoming call, as shown in Figure 3.



Figure 3. Incoming call alert message on the X-Lite client

Luka answers the call on the X-Lite client, as shown in Figure 4.





Figure 4. X-Lite client in an established call with Bob’s Lync 2010 client

Using the X-Lite client, Luka dials the E.164 phone number 1-425-555-0150, which is assigned to Bob. The call is routed to Asterisk. The Asterisk dial plan then routes the call outbound to the Mediation Server over the SIP trunk (that is, direct SIP). This can be confusing. When the call is routed from the Mediation Server to the gateway (that is, Asterisk), this connectivity is referred to as a direct SIP connection. When third-party gateways route calls to Lync Server 2010, Mediation Server, this connectivity is referred to as a SIP trunk. Microsoft reserves the term, SIP trunk, to refer specifically to connectivity to Internet telephony service providers (ITSP).

Because the Mediation Server is configured to accept calls from the Asterisk server, the incoming call is forwarded to the Lync Server 2010 Front End pool where the recipient (that is, Bob who is assigned the phone number, 1-425-555-0150) is homed. In turn, the Front End pool forwards the call to Bob’s Lync 2010 client.

Bob sees an alert message pop-up on the Lync client, which notifies him of the incoming call, as shown in Figure 5.





Figure 5. Bob’s Lync 2010 client receiving an incoming call from the Luka on the X-Lite client number 1000

Asterisk with Skype


Skype is a peer-to-peer communications network that uses a proprietary voice codec. It has become very popular with consumers and a growing number of businesses. Bob wants to integrate Lync Server to the Skype network. Because Asterisk can interoperate with Skype, it can serve as the gateway interconnecting Lync Server to Skype. You can use the following configuration options to connect Asterisk to Skype:

  • Skype for SIP   This solution is provided by Skype and enables SIP clients to directly register to a SIP server on the Skype network.

  • Skype for Asterisk   This solution is provided by Digium, the company that created Asterisk, and enables the Asterisk server to connect directly to the Skype network.

By using these services, your Asterisk server (that is, as the SIP server) can receive incoming calls from any Skype user. Skype users can call your company by using one or more of your Skype business account’s names. You can also receive calls from any public switched telephone network (PSTN) user if you have purchased a Skype “online number” from Skype Manager. The ability to accept PSTN calls through Skype is included in your monthly “online number” charge.

Both solutions require Skype business accounts (that is, the Skype Business Version, not regular Skype accounts). You create business accounts by using Skype Manager at https://manager.skype.com. The Skype business account represents your company’s presence on the Skype network. So, we recommend that you use your company name to name this account. When you create a business account, a user name and password are created by the Skype Manager.



Note. Skype recommends that you create a regular Skype user to setup and control your Skype business accounts. The name of this regular Skype account is not that important. For example, you can use something like “yourcompany.admin” for this account name.

When you create a Skype business account, it is allocated a lengthy series of numbers (for example, 1234567890). Incoming calls from this Skype business account to your PBX will come in on this extension 1234567890. This can be difficult to deal with and confusing. To make things easier, there is an option to allocate an extension number to the Skype business account.

For example, if all incoming calls for your company should go to extension “1000”, assign “1000” as the extension number for the Skype business account. All calls now reaching your PBX from the Skype business account will go to extension “1000”.

Deciding which option to select can be challenging. Table 1 highlights the differences between these two options to assist you in your decision process.



Table 1. Skype SIP Solutions Comparison Table




Skype for SIP

Skype for Asterisk

Must use Skype business accounts?

Yes

Yes

Can receive incoming calls from the Skype community?

Yes

Yes

Can receive incoming calls from PSTN?

Yes (with a Skype online number)

Yes (with a Skype online number)

Can place outgoing calls to Skype user names (for example, bob_skype)?

No

Yes

Can place outgoing calls to Skype online numbers?

Yes

Yes

Can get or set information for incoming or outgoing Skype calls in the Asterisk dial plan?

No

Yes1

Can get or set information for your Skype business account in the Asterisk dial plan?

No

Yes2

1 Options available are topic, token, forward_by, target_identity, fullname, country, province, city, phone_home, phone_office, phone_mobile, email, homepage, about, birthday, and gender. These are available for incoming calls only if they have been set by the caller.

2 For your Skype business account, you can read skypeout_currency and skypeout_balance. You can get and set fullname, country, province, city, phone_home, phone_office, phone_mobile, email, homepage, about, birthday, gender, status, mood_text, and availability.

Skype for SIP


Skype for SIP is a service from Skype. This service allows any SIP server that supports G.729 (annex A and B) or G.711 (µ-law or A-law algorithms) codecs to connect to Skype’s SIP server.

The number of concurrent calls a SIP server can receive from Skype is based on the number of active Skype for SIP channels. For example, to have four concurrent incoming calls from Skype requires setting up four Skype for SIP channels. You need to perform some capacity planning to gauge the call load to and from your company.

Outgoing calls to the PSTN can be placed via the Skype network. You can also call Skype users IF they have a Skype online number. All outgoing calls using this service incur an extra charge.

Note. Skype for SIP cannot place an outgoing call to a Skype user using their regular Skype user name (for example, bob_skype).

You can choose to register your SIP account with Skype by IP address or by using a user name and password. If your SIP server is directly connected to the Internet, consider using the IP address option. However, placing your Asterisk server directly on the Internet will make it more susceptible to attacks. If your SIP server is behind a firewall, the user name and password registration is a better option.


Skype for Asterisk


Skype for Asterisk is a software component that is installed on the Asterisk server. This component allows your Asterisk server to interact with the Skype network directly, not via separate SIP service like the Skype for SIP solution.

Each incoming call from Skype users to your Skype business accounts uses one channel to deliver that call via the Skype for Asterisk solution to your Asterisk server. Skype for Asterisk requires one license per channel. To place concurrent calls, multiple Skype for Asterisk licenses are required.

For example, if your company has one Skype address and four licenses, you can have up to four concurrent calls, inbound or outbound, connected to the Skype network.

If you require PSTN calls to reach your Skype business accounts, you can purchase a Skype online number from Skype Manager at https://manager.skype.com. An online number allows calls directly from the PSTN to be routed to your Skype business accounts. This feature incurs an extra charge.

When you configure Skype for Asterisk on your Asterisk server, you define the details of the Skype business accounts you want to use. You can define as many Skype business accounts as you need. The number of concurrent calls allowed to the Skype network is only limited by the number of Skype for Asterisk licenses that you have.

As part of this configuration, you can specify which extension number the incoming Skype calls are directed to. This makes correctly routing calls much easier than dealing with Skype business account names. For example, let's say Bob has a phone number 1-425-555-0150 in Lync Server. He could configure his Skype business account in Skype for Asterisk to call extension 1-425-555-0150. This would route all incoming Skype calls directly to Bob, (that is, as long as Bob’s Asterisk dial plan is configured to correctly route 1-425-555-0150 calls to Lync Server).

Unlike the Skype for SIP solution, Skype for Asterisk can place outgoing calls to any Skype user by using their Skype user name, (for example, bob_skype). This does NOT incur any additional charges.

Note. Lync Server uses an E.164 numbering format, not the full range of text required for Skype user names. One solution would be an Asterisk dial plan that translates certain numbers into Skype user names. We shall demonstrate how to do this in the Internals section of this chapter.

You can place calls to PSTN via the Skype network, or you can call other Skype users by using their Skype online number (that is, if they have one), but these calls will incur an extra charge.

Each license of Skype for Asterisk includes a Digium license for the G.729 codec. The Skype for Asterisk software supports the G.729 and G.711 codecs. If required, Asterisk servers can place trunk calls to each other across the Skype network.

Note. The license for Skype for Asterisk contains the Media Access Control (MAC) address of your Ethernet equipment. If this equipment fails or you need to reinstall Skype for Asterisk on another server, you need to coordinate with Digium to generate a new license key. For details, see http://downloads.digium.com/pub/telephony/skypeforasterisk/README.

Asterisk with Google Talk


Google Talk is based on XMPP, formerly known as Jabber. It was developed by the Jabber open-source community as an open standard in 1999. Built to be extensible, the protocol has been extended to support VoIP and file transfer signaling.

Note. For details, see XMPP RFC 3920 - http://www.ietf.org/rfc/rfc3920.txt.

Asterisk has written a Jabber channel driver that is able to communicate directly with the Google Talk network.

Although it’s already possible to interoperate Google with Lync Server by using the XMPP gateway, this integration only allows Lync users and Google users to see each other’s presence and send instant messages to each other. To be able to call Google Talk users from Lync Server, you need to integrate by using Asterisk as a gateway. Because Lync Server can interoperate with Asterisk over a direct SIP connection, when you integrate Google Talk with Asterisk Lync users can communicate by voice with users on the Google network. Google Talk users can call into Lync Server conferences and reach Exchange Unified Messaging (UM) Auto Attendant or subscriber access.

The Google Talk client does not offer typical features such as a dual-tone multi-frequency (DTMF) keypad. To work around this problem, a menu can be shown to Google Talk users, as shown in Figure 6. For details about how to offer an interactive menu for Google Talk users calling Lync users, see the configuration section.





Figure 6. Google Talk client connected to an interactive menu hosted on Asterisk server

Asterisk Direct SIP Internals


In the scenarios section we discussed integration with Asterisk as an IP-PBX that provides PSTN connectivity. Bob and Alice are able to make and receive calls through the Asterisk PBX using their Lync clients. Asterisk can also be integrated with Skype and Google Talk. This integrate allows Lync users to call and receives calls from Google and Skype users who otherwise would have to pay toll charges to talk to Lync users and join conferences.

In this section the goal is to dig into the technical details of what it takes to integrate Skype and Google Talk with Asterisk and how to integrate Asterisk with Lync Server. We also look closely at how these calls flows all work together from the call setup on the XMPP network to delivering the invite to the Lync 2010 client.


Detailed Call Flow


Office Communications Server 2007 R2 introduced support for interconnecting IP-PBXs over Transmission Control Protocol (TCP).

The Mediation Server uses SIP (that is, RFC 3261) to signal and set up calls with IP-PBXs. The audio stream is carried over SRTP (that is, RFC 3550). The signaling for establishing the audio stream (that is, ports, protocols, or codecs) is established by using Session Description Protocol (that is, SDP, RFC 4566). This SDP information is transported within the SIP traffic.

Asterisk version 1.6 or more recent versions can use both TCP and User Datagram Protocol (UDP). The X-Lite for Windows® connects and registers to Asterisk over UDP.

For direct SIP, Asterisk must be configured to connect over TCP to the Lync Server 2010 Mediation Server. The dial plan within Asterisk is configured to route calls for certain numbers to the Mediation Server.

Let’s examine this call flow in detail. A call is placed from the X-Lite client to the number, +14255550150, which is assigned to a Lync user. The call is routed over the Direct SIP connection between the Asterisk server and Lync Server 2010, Mediation Server. Figure 7 is illustrates this call flow.



Figure 7. Incoming call flow overview

Let’s examine in more detail each step in the call flow process, as shown in Figure 7.

For example, in Contoso’s environment, the Asterisk server is configured with IP address 192.168.100.10 and the collocated Mediation Server is configured with IP address 192.168.100.20.


  1. A call is placed using the X-Lite client to the number +14255550150. The X-Lite client sends a SIP Invite message to the Asterisk server trying to connect to the number +14255550150. The SIP "Invite" message is shown.

== Using SIP RTP CoS mark 5

Audio is at 192.168.100.10 port 11954

Adding codec 0x4 (ulaw) to SDP

Adding non-codec 0x1 (telephone-event) to SDP

Reliably Transmitting (no NAT) to 192.168.100.20:5060:

INVITE sip:+14255550150@192.168.100.20 SIP/2.0

Via: SIP/2.0/TCP 192.168.100.10:5060;branch=z9hG4bK0bb3ed94;rport

Max-Forwards: 70

From: "Test User" ;tag=as6f893afb

To:

Contact:

Call-ID: 6db8ad1516f9e56d7fe51bfe6a668659@192.168.100.10

CSeq: 102 INVITE

User-Agent: Asterisk PBX 1.6.2.7

Date: Sun, 13 Jun 2010 22:22:42 GMT

Allow: INVITE, ACK, CANCEL, OPTIONS, BYE, REFER, SUBSCRIBE, NOTIFY, INFO

Supported: replaces, timer

Content-Type: application/sdp

Content-Length: 312

v=0


o=root 304001039 304001039 IN IP4 192.168.100.10

s=Asterisk PBX 1.6.2.7

c=IN IP4 192.168.100.10

t=0 0


m=audio 11954 RTP/AVP 0 3 8 101

a=rtpmap:0 PCMU/8000

a=rtpmap:101 telephone-event/8000

a=fmtp:101 0-16

a=silenceSupp:off - - - -

a=ptime:20

a=sendrecv


  1. The Asterisk server replies to this invite with a "SIP 100 Trying" message.

SIP/2.0 100 Trying

FROM: "Test User";tag=as6f893afb

TO:

CSEQ: 102 INVITE

CALL-ID: 6db8ad1516f9e56d7fe51bfe6a668659@192.168.100.10

VIA: SIP/2.0/TCP 192.168.100.10:5060;branch=z9hG4bK0bb3ed94;rport

CONTENT-LENGTH: 0

As shown in Figure 7, this sequence of SIP “Invite” and SIP “100 – Trying” messages continues across all the servers involved in the call flow.



  1. After progress is made, a SIP “183 – Session Progress” message is sent from the Lync Server.

SIP/2.0 183 Session Progress

FROM: "Test User";tag=as6f893afb

TO: ;tag=d6cf4571f;epid=075854646D

CSEQ: 102 INVITE

CALL-ID: 6db8ad1516f9e56d7fe51bfe6a668659@192.168.100.10

VIA: SIP/2.0/TCP 192.168.100.10:5060;branch=z9hG4bK0bb3ed94;rport

CONTACT: sip:mediationsrv.contoso.com:5060;transport=Tcp;maddr=192.168.100.20

CONTENT-LENGTH: 0

ALLOW: UPDATE

ALLOW: PRACK

SERVER: RTCC/3.5.0.0 MediationServerFROM: "Test User";tag=as6f893afb

TO: sip:+14255550150@192.168.100.20

CSEQ: 102 INVITE

CALL-ID: 6db8ad1516f9e56d7fe51bfe6a668659

As shown in the diagram, the SIP “183 – Session Progress” message to the Asterisk server can cause a SIP “180 – Ringing” message to the X-Lite client.


  1. A SIP “180 – Ringing” message indicates that a local alert (that is, ringing) should be activated (that is, if it’s not already activated).

SIP/2.0 180 Ringing

FROM: "Test User";tag=as6f893afb

TO: ;tag=d6cf4571f;epid=075854646D

CSEQ: 102 INVITE

CALL-ID: 6db8ad1516f9e56d7fe51bfe6a668659@192.168.100.10

VIA: SIP/2.0/TCP 192.168.100.10:5060;branch=z9hG4bK0bb3ed94;rport

CONTACT:

CONTENT-LENGTH: 0

ALLOW: UPDATE

ALLOW: PRACK

SERVER: RTCC/3.5.0.0 MediationServer


  1. A SIP “200 – OK” message is sent to indicate that the call has been answered by the Lync client.

SIP/2.0 200 OK

FROM: "Test User";tag=as6f893afb

TO: ;tag=d6cf4571f;epid=075854646D

CSEQ: 102 INVITE

CALL-ID: 6db8ad1516f9e56d7fe51bfe6a668659@192.168.100.10

VIA: SIP/2.0/TCP 192.168.100.10:5060;branch=z9hG4bK0bb3ed94;rport

CONTACT:

CONTENT-LENGTH: 259

SUPPORTED: 100rel

CONTENT-TYPE: application/sdp; charset=utf-8

ALLOW: ACK

SERVER: RTCC/3.5.0.0 MediationServer

Allow: CANCEL,BYE,INVITE,PRACK,UPDATE

v=0


o=- 8 1 IN IP4 192.168.100.21

s=session

c=IN IP4 192.168.100.21

b=CT:1000

t=0 0

m=audio 62602 RTP/AVP 0 101



c=IN IP4 192.168.100.21

a=rtcp:62603

a=label:Audio

a=rtpmap:0 PCMU/8000

a=rtpmap:101 telephone-event/8000

a=fmtp:101 0-16

a=ptime:20


  1. To acknowledge that the SIP “200 – OK” message has been received, a SIP “ACK” message is sent by all parties involved in the call flow (that is, servers and clients).

ACK sip:mediationsrv.contoso.com:5060;transport=Tcp;maddr=192.168.100.20 SIP/2.0

Via: SIP/2.0/TCP 192.168.100.10:5060;branch=z9hG4bK422adfe8;rport

Max-Forwards: 70

From: "Test User" ;tag=as6f893afb

To: ;tag=d6cf4571f

Contact:

Call-ID: 6db8ad1516f9e56d7fe51bfe6a668659@192.168.100.10

CSeq: 102 ACK

User-Agent: Asterisk PBX 1.6.2.7

Content-Length: 0





  1. At this point, a bidirectional media stream is established and the two endpoints are in a call. Some sections of the media stream are using real-time transport protocol (RTP) (that is, between Asterisk and Mediation Server), and some sections are using SRTP (that is, Mediation Server and Lync clients).

  2. At any time during the conversation, an additional SIP “Invite” message can be sent from either party, containing the a=inactive SDP command. This will place the call on hold.

INVITE sip:1000@192.168.100.10;transport=TCP SIP/2.0

FROM: ;epid=075854646D;tag=d6cf4571f

TO: ;tag=as6f893afb

CSEQ: 1 INVITE

CALL-ID: 6db8ad1516f9e56d7fe51bfe6a668659@192.168.100.10

MAX-FORWARDS: 70

VIA: SIP/2.0/TCP 192.168.100.20:5060;branch=z9hG4bK3f7ee1dc

CONTACT:

CONTENT-LENGTH: 271

SUPPORTED: 100rel

USER-AGENT: RTCC/3.5.0.0 MediationServer

CONTENT-TYPE: application/sdp; charset=utf-8

v=0

o=- 8 3 IN IP4 192.168.100.21



s=session

c=IN IP4 192.168.100.21

b=CT:1000

t=0 0


m=audio 62602 RTP/AVP 0 101

c=IN IP4 192.168.100.21

a=rtcp:62603

a=inactive

a=label:Audio

a=rtpmap:0 PCMU/8000

a=rtpmap:101 telephone-event/8000

a=fmtp:101 0-16

a=ptime:20


  1. Sending a SIP “200 – OK” message containing the a=sendrecv SDP command takes the call off hold.

SIP/2.0 200 OK

Via: SIP/2.0/TCP 192.168.100.20:5060;branch=z9hG4bKcdb285d;received=192.168.100.20

From: ;epid=075854646D;tag=d6cf4571f

To: ;tag=as6f893afb

Call-ID: 6db8ad1516f9e56d7fe51bfe6a668659@192.168.100.10

CSeq: 2 INVITE

Server: Asterisk PBX 1.6.2.7

Allow: INVITE, ACK, CANCEL, OPTIONS, BYE, REFER, SUBSCRIBE, NOTIFY, INFO

Supported: replaces, timer

Contact:

Content-Type: application/sdp

Content-Length: 267

v=0

o=root 304001039 304001043 IN IP4 192.168.100.113



s=Asterisk PBX 1.6.2.7

c=IN IP4 192.168.100.113

t=0 0

m=audio 43828 RTP/AVP 0 101



a=rtpmap:0 PCMU/8000

a=rtpmap:101 telephone-event/8000

a=fmtp:101 0-16

a=silenceSupp:off - - - -

a=ptime:20

a=sendrecv



  1. The bidirectional RTP media stream continues until one party ends the call. At that point, a SIP “BYE” message is sent.

BYE sip:1000@192.168.100.10;transport=TCP SIP/2.0

FROM: ;epid=075854646D;tag=d6cf4571f

TO: ;tag=as6f893afb

CSEQ: 3 BYE

CALL-ID: 6db8ad1516f9e56d7fe51bfe6a668659@192.168.100.10

MAX-FORWARDS: 70

VIA: SIP/2.0/TCP 192.168.100.20:5060;branch=z9hG4bK52b8b1d7

CONTENT-LENGTH: 0

USER-AGENT: RTCC/3.5.0.0 MediationServer


  1. To acknowledge the SIP “BYE” message, a SIP “200 – OK” message is sent in response.

  2. The RTP stream is discontinued and the ports in use are released. The call is terminated.


Yüklə 207,34 Kb.

Dostları ilə paylaş:
1   2   3   4   5




Verilənlər bazası müəlliflik hüququ ilə müdafiə olunur ©genderi.org 2024
rəhbərliyinə müraciət

    Ana səhifə