FreeSWITCH 1.2
上QQ阅读APP看书,第一时间看更新

Configuring a SIP phone to work with FreeSWITCH

Most of the devices that we connect to FreeSWITCH will be SIP-based. SIP or Session Initiation Protocol is a very common signaling protocol for telephone calls. (SIP is not limited to voice; it can handle chat, video, and other session types.) SIP phones come in two varieties: hard phones and soft phones. A hard phone is a standalone device with a headset, keypad, and usually a digital display. A soft phone is a software application that runs on a computer and utilizes the computer's speaker and microphone or an external headset. We will examine the setup process for a free soft phone called X-Lite, as well as the basic SIP configuration options for hard phones from Aastra, Polycom, and Snom.

SIP settings

All SIP devices have a minimum set of configuration parameters that must be set. Like all complex protocols, SIP has its share of obscure and sometimes arcane configuration options. However, they are well beyond the scope of this book. We will be limiting our discussion to the basics that are necessary to make a SIP device connect to FreeSWITCH and perform standard PBX functions: make and receive calls, transfer calls, put calls on hold, and so on.

In our SIP configuration, we will have our SIP devices register with our FreeSWITCH server. When a SIP device is registered with an SIP registrar, then that registrar knows how to route calls to the SIP device. FreeSWITCH acts as a SIP registrar. SIP allows for digest authentication for SIP endpoints that wish to register. It is possible to allow unauthorized SIP endpoints to register, but it is not recommended. (A good analogy might be that of an open relay SMTP server. If you just let anyone into your system to send an e-mail or make phone calls, bad things are bound to happen. Please do not do it!)

SIP users bear other semblances to e-mail. A SIP URI contains user@domain just like an e-mail address. There is also a real name or display name in addition to the username, as well as a domain. There is also an authorization username and password. The authorization username does not need to be the same as the username but in many cases it is.

FreeSWITCH comes preconfigured with 20 SIP user accounts. (In Chapter 4, SIP and the User Directory, we will discuss these in more detail, including how to configure additional users.) The user names are 1000 through 1019. You can use any of these users for testing.

The following are the SIP settings for user 1000:

  • Username: 1000
  • Authorization Username: 1000
  • Password: 1234
  • Domain: [IP address of your FreeSWITCH server]

Keep these settings handy for setting up your SIP device. Let's look at the configuration process for several different SIP phones. Even if your device is not specifically mentioned here, you can still use the basic principles of configuring the SIP device and you should be able to get your phone connected without much hassle. In each of the following examples, we will connect a different telephone to a FreeSWITCH server running on a local LAN.

X-Lite soft phone

X-Lite (http://www.counterpath.com) is a free soft phone. (X-Lite is, however, not open source.) Download and install X-Lite on a computer that is on the same LAN as your FreeSWITCH server.

Note

While it is technically possible to run a soft phone on the same machine as your FreeSWITCH server, this is neither recommended nor supported.

Launch the X-Lite application. You will see a phone as shown in the following screenshot:

Click on Softphone, and then click on SIP Account Settings… to open the SIP account menu. X-Lite supports just a single SIP account. Click on Add to open up the SIP Account screen. Fill in the form fields.

Setting up extension 1005 would look like the following screenshot:

Click on OK to accept these settings. The phone will attempt to register with FreeSWITCH. A successful registration looks like the following screenshot:

This phone is now registered. If you receive a different message in the display, there was most likely a configuration error. Several common errors are 403, 404, and 408:

  • 403—Forbidden: This means that the authorization username or password is incorrect.
  • 404—Not Found: This means that the username specified was not found by the FreeSWITCH server.
  • 408—Timeout: Usually, this means that the domain is not correct or there is a network problem. Be sure to check firewall settings to make sure that port 5060 traffic is not being blocked.

Now that your phone is registered, you can begin making test calls. Skip to the Testing the example Dialplan section.

Hard phones

We will take a brief look at setting up a few different kinds of hard phones. After reviewing the sample setup for Aastra, Polycom, and Snom phones, you will know the basic principles and should be able to set up any SIP-compliant telephone.

Before you start, be sure that you have at least the following basic information for your phone:

  • IP address: You will need to know the IP address of the phone if you wish to use the web interface. Most phones also have a small menu system for configuring the phone itself.
  • Admin name: Most phones will have an admin user.
  • Admin password: Most phones also require an admin password.

If you are unsure of the telephone's default username and password, consult the manufacturer's website for more information.

Tip

Most hard phones are field upgradable, that is, the manufacturer supplies updated firmware that can be downloaded and installed on each phone. Visit the manufacturer's website to find out if there is an updated firmware available for your phone as well as what features it includes.

Aastra phones

Aastra phones have a standard web-based interface. Point a browser to the phone's IP address and then log in. Click on the Global SIP link on the navigation pane. The interface for the Aastra 9112i will look as shown in the following screenshot:

Fill in all the fields under Basic SIP Authentication Settings. Under Basic SIP Network Settings, fill in the Proxy Server, Proxy Port, Registrar Server, and Registrar Port fields. Scroll down and click on Save Settings, then restart the phone by clicking on the Reset link on the navigation pane. The phone will restart and connect to FreeSWITCH.

If the registration is successful then the display name (Aastra Test), and the phone number (1006) will show in the telephone display. Now that your phone is registered, you can begin making test calls. Skip to the Testing the example Dialplan section.

Polycom phones

Polycom phones have a web interface as well as a menu on the phone. You can use either; however, it is easier to use the web interface. Point a browser at the phone's IP address and log in. Click on the Lines link. Like many SIP phones, the SoundPoint IP 330 can register to more than one server. In this example, we'll use Line 1 to connect to FreeSWITCH. The web interface for a Polycom SoundPoint IP 330 looks like the following screenshot:

For Line 1, fill in the following fields: Display Name, Address, Auth User ID, Auth Password, and Label. Under Server 1, fill in the Address and Port fields. Scroll down and click on the Submit button. The phone will reboot and then connect to FreeSWITCH.

Now that your phone is registered, you can begin making test calls. Skip to the Testing the example Dialplan section.

Snom phones

Snom phones have a full-featured web interface for configuration. Point a browser at your phone's IP address to open up the web interface. Notice that Snom phones have the concept of identities, which allow you to connect to more than one server. Click on the Identity 1 link on the navigation pane and fill in the SIP configuration fields. The web interface for a Snom 300 looks like the following screenshot:

Configure Identity 1 by filling in the fields under Login Information: Displayname, Account, Password, Registrar, Outbound Proxy, Authentication Username, and Display test for idle screen. Click on Save then click on Re-Register. The phone will immediately connect to FreeSWITCH.

Now that your phone is registered, you can begin making test calls. Skip to the Testing the example Dialplan section.

Tip

FreeSWITCH supports the use of the local sound card or an external headset that is connected to the FreeSWITCH server. The optional PortAudio module (mod_portaudio) can be compiled and enabled in the same manner as the mod_flite example discussed in Chapter 2, Building and Installation. See http://wiki.freeswitch.org/wiki/Mod_portaudio for details on how to configure and use the PortAudio module with FreeSWITCH.