Project Manager: Susan S. Bradley Content Architect


Configure Asterisk for Skype



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

Configure Asterisk for Skype


As introduced in the Scenarios section earlier in this chapter, there are methods for integrating Asterisk with Skype. Both of these methods allow Lync users to communicate with users on the Skype network using Asterisk as a gateway. Step-by-step configuration details for both methods are explained in this section.

Skype for SIP


Skype for SIP allows a SIP PBX such as Asterisk to authenticate to Skype directly. To configure Skype for SIP with Asterisk, first create a Skype SIP Profile, which can be done within Skype Manager at https://manager.skype.com. Skype for SIP requires authentication. This authentication can be performed one of the following ways: registration authentication (that is, by using a user name and password) or IP-based authentication.

If your Asterisk server is behind a firewall, which is recommended in the case of our example company Contoso, select registration authentication as shown in Figure 9, because the Asterisk server’s IP address will not be exposed directly to the Internet.





Figure 9. Creating a SIP profile using Skype Manager

In addition to specifying the SIP user name and password, specify the Skype for SIP address field as sip.skype.com and set the UDP port field to 5060.

Next, access your Asterisk server and edit the sip.conf file. Instruct Asterisk to register to the Skype SIP server using the details of the Skype SIP profile just created.

You do this by adding the following line to the [general] section of the sip.conf file. The newly inserted line should have the following format:

register => :@sip.skype.com/

Using the Contoso example from Figure 9, the line would appear as:

register => 99051000107808:zqPdq8Udueq2be@sip.skype.com/99051000107808

Note. The long user name given to this SIP profile (that is, 99051000107808), can make a dial plan difficult. We shall examine how to deal with this later.

In the section where we configured a sip.conf file in Asterisk, we defined SIP objects (that is, client or server) in sip.conf. Asterisk needs these definitions in the sip.conf file before it can use these SIP objects in the Asterisk dial plan (that is, extensions.conf).

Next, define a new user in the sip.conf file using the Skype SIP profile details. The definition for our Contoso example Skype SIP profile looks like the following.

[Skype SIP


]

type = friend

dtmfmode = rfc2833

context = default

host = sip.skype.com

username =

secret =

disallow = all

allow = ulaw

allow = alaw

allow = g729

nat = yes

canreinvite = no

fromdomain = sip.skype.com

insecure = invite

In your configuration file, replace


in [Skype SIP
] with your Skype SIP profile name. Also, insert the correct values for the fields, username and secret.

All the other fields shown in the previous example can be copied into your new Skype SIP object as they are. They do not require any changes or customization.

Save the changes and close the editor. Return to the Asterisk console. Reload the SIP settings using the following command:

asterisk*CLI> sip reload

To check the configured SIP peers in Asterisk, run the following command:



asterisk*CLI> sip show peers

This command displays the configured SIP peers in Asterisk. For our Skype for SIP example, it looks like the following:

99051000107808/9905100010 204.9.161.164 N 5060 Unmonitored

After the user is set up in Asterisk, return to the Skype Manager at https://manager.skype.com. Edit the Skype SIP profile that you created. You should see your Asterisk server registered. At this point, you know Asterisk is communicating correctly with Skype for SIP.

To activate the service, purchase a SIP channel subscription using the Skype Manager. You may need to add some credit to your Skype Manager to do this.

Using the Skype Manager, you can now associate Skype business accounts to the Skype SIP profile, more than one if necessary, and define an extension number for incoming Skype calls using this channel. The extension number assigned to the Skype SIP profile (as shown in Figure 10) is used as the destination number when incoming Skype calls reach your Asterisk server.





Figure 10. Skype for SIP channel extension number

If you decide not to set an extension number, incoming calls use the Skype for SIP profile number and you need to edit your Asterisk dial plan (that is, extensions.conf) to accommodate this, like the following for Contoso:

exten => 99051000107808,1,Dial(SIP/to_ocs/+14255550150)

exten => 99051000107808,n,Hangup


Testing Calls from Lync Server to Skype for SIP


At the time of writing, the Skype for SIP solution does not support calls directly to regular Skype user names. This solution does support calls out to the PSTN network and calls to other Skype users who have a Skype online number. These calls incur an extra charge.

Skype provides the following free number that anyone can call for testing: +17606604690.

In Bob's case, he already has a normalization rule to send all numbers starting with 1 and more than two digits to the Asterisk server. Bob modified his Asterisk dial plan (that is, in the extensions.conf file) to send the number 1001 to the Skype test number using the Skype for SIP service. Bob already has a section in his extensions.conf that removes the + from incoming calls from the Mediation Server.

Following is the code Bob added to his extensions.conf file.

exten => 1001,1,Answer

exten => 1001,n,Set(CALLERID(num)= 99051000107808)

exten => 1001,n,Dial(SIP/+17606604590@99051000107808)

exten => 1001,n,Hangup



Note. You must set the caller ID to your Skype for SIP number to ensure that Skype does not reject the call. The number you are calling must be in the E164 format.

Bob can now call the free testing number from his Lync client by dialing 1001.


Testing Calls from Skype for SIP to Lync Server


After you have downloaded and installed the Skype desktop client, log on using the regular Skype account that you used to create the Skype business accounts. Then, search for your business accounts and add them to your contacts.



Figure 11. Searching for your Skype business accounts

You can now place a call to your Skype business accounts in the same way as calling any other Skype user, as shown in Figure 12.





Figure 12. Place a call to another Skype user

On the Lync client, an incoming alert message appears. The caller ID from the incoming call from the Skype for SIP service appears as “Anonymous Caller” on the Lync client, as shown in Figure 13. On Office Communicator, the caller ID appears as “Unidentified Caller.”





Figure 13. Incoming Skype for SIP calls shown as "Anonymous Caller"

In Figure 14, we can see that after the call is answered, the incoming caller is simply displayed as “Anonymous Caller”. There are no further details provided.





Figure 14. Established call with the Skype for SIP service shows no call details

The Skype for Windows client provides a dial pad feature so that people who call into your Lync Server can use interactive menus with Response Group IVRs.





Figure 15. Skype client dial pad

Skype for Asterisk


Skype for Asterisk is an Asterisk channel driver, which is installed directly on an Asterisk server, which enables the Asterisk server to connect directly with the Skype network.

Note. It is important that you verify whether Skype for Asterisk will work with your Asterisk server because only specific versions are supported. For details, see http://downloads.digium.com/pub/telephony/skypeforasterisk/README.

First, you need to purchase the software. Visit http://www.digium.com and create a user account on the Digium website. Using this account, purchase a license for Asterisk for Skype.

Each license allows one concurrent call to or from Skype and each license that you purchase has its own license key. The license key will be sent to you in email shortly after purchasing.

The following example uses an Asterisk 1.6 server installed on CentOS. Download the registration tool and the Skype for Asterisk software using yum as follows:



yum install asterisk16-skypeforasterisk

Run the registration tool as follows:



register

You will be prompted for your name and address details, in addition to the license key that was sent to you in email. This information, along with the MAC address of your Asterisk server, are used to automatically generate a Skype for Asterisk license file. This automatically created license is in the directory /var/lib/asterisk/licenses on your Asterisk server. We recommend that you make a backup of this license file from the directory /var/lib/asterisk/licenses and then restart the Asterisk server.

To restart Asterisk, type the following command at a Linux command prompt:

asterisk –rx “restart now”

Skype for Asterisk is a new Asterisk channel driver. It uses its own configuration file, chan_skype.conf.

Replace all of the contents of the chan_skype.conf file with the information from the Skype business account created as shown.

[general]

default_user =

[]

secret =

context = default

exten = 14255550150

disallow = all

allow = ulaw

Save the chan_skype.conf file and access the Asterisk console (that is, by running asterisk –vvvvr) to reload the Skype channel module so that it picks up the new changes without needing to restart Asterisk as follows:



asterisk*CLI> module reload chan_skype

You can verify the number of Skype for Asterisk licenses installed by using the following command:



asterisk*CLI> skype show licenses

This command shows an output similar to the following:

Skype For Asterisk Licensing Information

========================================

Total licensed channels: 1

You can also check the status of the accounts you have defined for use with Skype for Asterisk with the following command:



asterisk*CLI> skype show users

This command shows an output similar to the following:

Skype UsersI>

contoso: Logged In

To log on and log off of your Skype Business Account(s) (that is, as defined in the chan_skype.conf file), use the following commands:

asterisk*CLI> skype login user

asterisk*CLI> skype logout user

In Bob’s dial plan example (that is, in the extensions.conf file), it was already configured to route calls for 14255550150 to his Lync Server. Therefore, his extensions.conf file did not require editing to deal with incoming calls for this number from the Skype for Asterisk service. You may need to edit your extensions.conf file to correctly route extension numbers from Asterisk for Skype to your Lync Server.


Testing Calls from Skype for Asterisk to Lync Server


To test calls into your Lync Server with this solution, search for and add your Skype business accounts to your Skype desktop client. You can refer to the Skype for SIP testing section if you need a guide on how to do this.

The Skype for Asterisk solution, like the Skype for SIP solution, allows you to receive calls from Skype users. Unlike the Skype for SIP solution, the Skype for Asterisk solution connects your Asterisk server directly to the Skype network, like the Skype desktop client. This also allows your Asterisk server to access more information about the Skype user calling in to your Asterisk server, including full name, country/region, date of birth, webpage, email, phone home, and phone work . Note that the availability of this information depends on whether the Skype user has populated these fields.

You can retrieve this information by using the ${SKYPE_CALL_PROPERTY()} command in the Asterisk dial plan (that is, in the extensions.conf file). For example, to get the topic of the call, you can use the following command:

exten => xxx,1,NoOp(${SKYPE_CALL_PROPERTY(topic)})

Note. For a full list of the extra information available, see https://www.digium.com/en/supportcenter/documentation/viewdocs/SFA.

Lync Server cannot display the Skype user name as caller ID. When the call is answered, the caller information is the same as the Skype for SIP solution and it appears as “Anonymous Caller” in Lync or “Unidentified Caller” in Office Communicator.


Testing calls from Lync Server to Skype for Asterisk


Like the Skype for SIP solution, the Skype for Asterisk solution can also dial PSTN numbers and Skype online numbers. These calls will incur an extra charge.

In addition, Skype for Asterisk can place outgoing calls to regular Skype user names (for example, bob_skype). This type of call do not incur an extra charge.

Lync Server uses the E+164 numbering format. Therefore, you cannot dial Skype user names. One solution, if there are people you regularly communicate with using Skype, is to create a customized Asterisk dial plan that translates the extension numbers to place calls out to those users.

In our example, Bob added to his dial plan in Asterisk. He set the extension 1002 to dial the echo123 user on the Skype network using the following commands:



exten => 1002,1,Dial(Skype/echo123)

exten => 1002,n,Hangup

Note. In Bob’s chan_skype.conf file, he already defined a default Skype user. The details of this default user are used for all outgoing Skype for Asterisk calls. If this default user was not defined or you want to use a different user for certain calls, the format in the Asterisk dial plan is “Dial(Skype/@

In the same way that Asterisk can read Skype information from an incoming Skype call using Asterisk for Skype, you can also specify information to be sent out with your outgoing Skype calls, including email address, phone office, phone home, website, mood, status, or availability. For a full list of the Skype Account details you can specify, see https://www.digium.com/en/supportcenter/documentation/viewdocs/SFA.



Bob amended his Asterisk dial plan to set the fullname property of the “Contoso” user using the following commands:

exten => xxx,1,Set(SKYPE_ACCOUNT_PROPERTY(fullname)=”Contoso”)

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 ©www.genderi.org 2024
rəhbərliyinə müraciət

    Ana səhifə