関連技術情報 Wiki

STUN サーバを Brekeke SIP Server と使用する方法

This document introduces an example of setting up a STUN server for using with the Brekeke SIP Server.

Installing a STUN server on a Linux Server

1. Visit http://sourceforge.net/projects/stun/

Download a Vovida Stun server (The package name is “stun”) for Linux server.

2. Extract “stund_0.XX_XXXXX.tgz” file on a Linux server.

(Version used in this tutorial is stund_0.96_Aug13)

3. Open the “stund” folder and send the following files to the directory on the Linux Server where you want to install the STUN server (Ex. /var/stund).

client.cxx 
Makefile
server.cxx
stun.cxx
stun.h
tlsServer.cxx
udp.cxx
udp.h

4. Go to the directory on the Linux Server (/var/stund) and issue the command

#make

After the compilation is finished, make sure that an executable file “server” is created.

5. Start a STUN server

a) If the machine has two public IP addresses (2 NICs), issue the command

#./server -h IP_address_1 -a IP_address_2 -b

b) If the machine has only one public IP address, issue the command

#./server -h IP_address -b

Note: It is better to have two IP addresses (2 NICs) on the server so that UAs can know the NAT type correctly that they use. But having only one IP address seems to be enough for the UAs to know its global IP address and port number that the NAT opens for them.

 

Installing a STUN server on a Windows PC

1. Visit http://sourceforge.net/projects/stun/

Download a Vovida Stun server server.exe (The package name is “stun-win32”) on a Windows PC and place it in some directory.

2. Open a command window and go to the directory where the server.exe resides

3. Execute a command as follows

a) If the machine has two public IP addresses (2 NICs), issue the command

>server -h IP_address_1 -a IP_address_2

b) If the machine has only one public IP address, issue the command

>server -h IP_address

Note: It is better to have two IP addresses (2 NICs) on the server so that UAs can know the NAT type correctly that they use. But having only one IP address seems to be enough for the UAs to know its global IP address and port number that the NAT opens for them.

 

Testing with a UA (X-Lite) and Brekeke SIP Server

1. We assume Brekeke SIP Server is located in a public domain, either on the same machine as the STUN server or on the different machine, and your X-Lite (http://www.counterpath.com) resides in a different LAN behind a NAT.

2. Open X-lite -> [SIP Account] -> [Topology]

Set [Use specified STUN server] = YOUR_STUN_SERVER_IP_ADDRESS

3. Open X-lite Menu -> [SIP Account] -> [Account]

[Username] any_user_name
[Domain]  Brekeke_SIP_Server_IP_address
[Register with domain and receive incoming calls] checked
Send outbound via: [Domain] selected

Set also [Authorization User] and [Password] if authorization is set to “on” at Brekeke SIP Server.

4. Register X-lite with Brekeke SIP Server.

5. From Brekeke SIP Server Admintool [Registered Clients] page, make sure if the UA’s Contact URI is registered with a public IP address. If so, STUN server is working fine with the UA.

6. You can also check if the STUN server is working by capturing STUN packets using Ethereal on the machine that the UA is installed on.

Yes No
Suggest Edit