VoIP using SIP

To read

http://freshmeat.net/articles/view/2079/

33-NAT-Traversal.pdf

Asterisk - The Future of Telephony.pdf

NATtraversal-BestPractices.pdf

Introduction

SIP is fast becoming the standard for Voice over IP (VoIP.) Design started at the end of the 90's, and relies on the RTP protocol to handle transmission and reception of voice data packets. Unfortunately, authors assumed that, by the time SIP would be finished, we would all have moved to IPV6, so, unlike Asterisk's IAX protocol, didn't take NAT and firewall issues into consideration. As a result, SIP and NAT/firewalls can be a pain to set up.

The big picture

(summarize here)

The little picture

Registering

Proxy

DNS SRV

http://www.voip-info.org/wiki-DNS+SRV

http://mit.edu/sip/sip.edu/dns.shtml

http://sipx-wiki.calivia.com/index.php/DNS_and_how_it_affects_SIP_URI_Addressing

SIP

"SIP clients traditionally use TCP and UDP port 5060 to connect to SIP servers and other SIP endpoints. SIP is primarily used in setting up and tearing down voice or video calls. All voice/video communications are done over separate transport protocols, typically RTP. SIP acts as a carrier for the Session Description Protocol (SDP), which describes the media content of the session, e.g. what IP ports to use, the codec being used etc. In typical use, SIP "sessions" are simply packet streams of the Real-time Transport Protocol (RTP). RTP is the carrier for the actual voice or video content itself." http://en.wikipedia.org/wiki/Session_Initiation_Protocol

In a SIP call there are several SIP transactions

SDP

"RTP Protocol is used to transport voice data in real time (the same as H.323 protocol), whereas SDP protocol is used to negotiate the participants capabilities, codification type, etc.)" http://www.en.voipforo.com/SIP/SIP_architecture.php

RTP

"RTP does not have a standard TCP or UDP port that it communicates on. The only standard that it obeys is that UDP communications are done via an even port and the next higher odd port is used for RTP Control Protocol (RTCP) communications. Although there are no standards assigned, RTP is generally configured to use ports 16384-32767." http://en.wikipedia.org/wiki/Real-time_Transport_Protocol

RTCP

"The primary function of RTCP is to provide feedback on the quality of service being provided by RTP." http://en.wikipedia.org/wiki/Real_time_control_protocol

NAT, STUN, TURN, NAT traversal, ICE, X-tunnels

"STUN (Simple Traversal of User Datagram Protocol (UDP) Through Network Address Translators (NATs)) is a network protocol allowing clients behind NAT (or multiple NATs) to find out its public address, the type of NAT it is behind and the internet side port associated by the NAT with a particular local port. This information is used to set up UDP communication between two hosts that are both behind NAT routers.

Once the clients have the Internet side UDP ports, communication can begin. If the NATs are full cone then either side can initiate communication. If they are restricted cone or restricted port cone both sides must start transmitting together.

STUN is a client-server protocol. A VoIP phone or software package may include a STUN client, which will send a request to a STUN server. The server then reports back to the STUN client what the public IP address of the NAT router is, and what port was opened by the NAT to allow incoming traffic back in to the network.

The STUN server is contacted on UDP port 3478, however the server will hint clients to perform tests on alternate IP and port number too (STUN servers have two IP addresses)." http://en.wikipedia.org/wiki/STUN

"NATs can also cause problems where IPsec encryption is applied and in cases where multiple devices such as SIP phones are located behind a NAT." http://en.wikipedia.org/wiki/Full_cone_NAT

"ICE is a mechanism for establishing the best connection between two endpoints based on the current network configuration and conditions. Requires the peer to also support ICE"

"Xtunnels allows TCP-tunneling protocol for signaling and media for certain NAT/firewall configurations"

UPnP

http://en.wikipedia.org/wiki/Universal_Plug_and_Play

DUNDI

http://en.wikipedia.org/wiki/DUNDi

Enum

Telephone Electronic Number Mapping. This is a free database where you enter your PSTN number and your SIP number: If your correspond uses an SIP phone that first checks with ENUM before calling you through your PSTN number, it will see that you can also be reached directly through the Net, and will call you in VoIP, saving one PSTN call. Information about ENUM is available on this site on the www.e164.org page.

http://en.wikipedia.org/wiki/Electronic_Numbering

Symetric RTP

Not available on all SIP devices. Instead of allocating 2 one-way audio channels, the SPA will communicate with the remote end using the same channel it is using for receiving audio.

Outbound Proxy

"An Outbound proxy is mostly used in presence of a firewall/NAT to handle the signaling and media traffic across the firewall. Generally, if you have an outbound proxy and you are not using STUN or other firewall/NAT traversal mechanisms, you can use it. However, if you are using STUN or other firewall/NAT traversal tools, do not use an outbound proxy at the same time."

"Usually symmetric NAT issue can not be resolved using STUN detection mechanism which is supported by Grandstream products; it can be solved on the media proxy server maintained by VoIP service provider. Please check with Voip service provider to obtain this information, and fill in “outbound proxy” setting on the configuration of Grandstream products accordingly. We recommend that “NAT traversal” is always set to yes. "

"User ID" vs. "Authentication ID"

"User ID is the user part of the SIP address of the phone and this is usually the information displayed as Caller ID on the LCD. e.g., typically it is a phone number or extension number or a user's name. Authentication ID is an ID used strictly for authentication purpose when the phone attempts to contact the SIP server. This may or may not be the same as User ID. "

NPT Servers

Software (Server)

OS-independent SIP PBX software

Brekeke

  • Closed-source
  • Java-based
  • Windows

    Axon

    Free PBX. Add-on's like music on hold or answering machine commercial. More information here.

    3CX Phone System

    MiniSIPServer

    SIPSP-PBX

    Linux

    Asterisk

    sipXPBX

    Yate

    Freeswitch

    OpenPBX CallWeaver

    SER

    OpenSER

    Software (clients)

    AGEPhone

    Avaya SIP Softphone

    Damaka

    Sippax Softphone Dialer

    Ekiga

    ExpressTalk

    From the company that makes the Axon PBX server. Free and (commercial; supports transferts) Business versions.

    MiniSIP

    Snom 360 Softphone

    http://www.snom.com/snom360softphone.html

    Nero Sipps

    Cubix

    Gizmo Project

    SJ Labs SJPhone

    PortSIP softphone

    sipXezPhone

    "While sipXphone is a fully featured implementation of a SIP softphone that is derived from the original Pingtel xpressa JAVA softphone, sipXezPhone is much leaner."

    sipXphone

    X-ten's X-Lite

    Version 2

    Version3

    (version 3 seems unstable; version 2 can still be found such as here)

    When making a call from X-Lite to the PSTN, if the remote party cannot hear the sound coming from your microphone, make sure you set a STUN server in the Topology tab of the SIP account, eg. stun.xten.com.

     "The display name is the string that will be used for Caller ID. The username and authorization user are used for authentication,along with the password. The domain/realm should be the IP address or FQDN of your Asterisk server. The SIP proxy is the same as the one entered for the domain/realm,but with :5060 appended (this specifies the port number to use for SIP signaling—be sure it matches the port you have configured in sip.conf).

    After entering all this information,verify that Enabled is set to Yes,and then close the configuration menu. X-Lite will then register to Asterisk. If X-Lite doesn"t appear to register,simply restart the client. Because X-Lite is minimized to the task tray when you close the application with the X button,you will need to exit the program by right-clicking on the icon in the tray and then clicking "Exit" in the pop-up menu before restarting."

    X-Lite can also be used to make direct IP calls without using an SIP proxy to register. To do this, here's how to register the local host in the SIP Account Settings dialog:

    Account tab: Display name = Whatever you want, User name = whatever you want, Password = none, Authorization user name = none, Domain = local IP of this computer, Domain Proxy : Uncheck "Register with domain" and select target domain

    Topology : Port used on local computer = 5060-5061. Make sure no other application is listening on those ports, as X-Lite won't say anything if it cannot bind to the ports.

    Next, open the Contacts Drawer (little arrow on the right-side of the main window), and add an account in the Contacts section of Type = Softphone and Address = remotename@remoteIP, eg. john@192.168.0.1 if the remote X-Lite user registered as john and is running the app on host 192.168.0.1. Double-click on this account to make a call.

    If you get a "488 Not Acceptable Here", make sure X-Lite/EyeBeam has at one codec in common with the remote party (eg. if the PBX uses G711 uLaw and X-Lite only uses G711aLaw, it will fail working. More information in EyeBeam Troubleshooting Guide.

    To transfer a call ("Attended Call Transfer")
    1. Select an available line. The original call will automatically be put on hold.
    2. Call the third party.
    3. After the third party answers, and when you are ready to make the transfer, click XFER. The line of the original call is now red, while the line of the third party is blue.
    4. Select the original line (the line that is red). The transfer is made and the lines on your softphone are now free (black).

    Hardware

    Sangoma A200

    Higher-quality alternative to Digium's FXO card.

    GrandStream HT-488

    Like the Linksys/Sipura 3000/3102, this is an entry level SIP gateway that also offers an FXS port so you can hook up an analog device and can act as a router if you don't have any on your LAN.

    Important: I saw weird things while trying to configure this device using Opera (9.02) and Privoxy. Use FireFox instead.

    BASIC SETTINGS >

    Questions:

    1. Doesn't detect that remote end hung up: What to use for regional settings in FXO Port?

      PSTN AC Termination: 320 Ohm + (1050 Ohm || 230 nF))
      PSTN Disconnect Tone: Frequency: f1 480 f2 620
      PSTN Disconnect Tone Cadence: All 0's
      PSTN Silence Timeout : 60 
    2. No CID (connect to Alice VoIP), although detected OK by analog modem. HT488 doesn't handle CID?
    3. How to secure access to PSTN line?

    GrandStream BudgeTone 101 IP phone

    BudgeTone 100 (Grandstream hardphone)

    The difference between the BT 101 and 102, is that the latter has two Ethernet plugs.

    How to set a static IP

    Menu, down arrow to menu 2, Menu to display current IP address, type new IP address eg. 192168000001 (192.168.0.1), Menu to save, Menu to scroll down to Reset followed by Menu to reboot the unit.

    GrandStream GXP2000

    Cons: Online PDF and firmware version not up to date with phone (phone ships with Software Version 1.1.3.1, but latest firmware on site is 1.1.1.14); Downloading XML-formatted phonebook doesn't work; Phonebook only holds 100 entries

    Daylight Savings Time: 4,1,7,2,0;10,-1,7,2,0;60 : Check for France (start=3/31/7/2;10/31/7/3;save=1)

    Firmware Server Path: fm.grandstream.com/gs -> 404

    Phonebook XML Download: Enable Phonebook XML Download:    No     YES, HTTP     YES, TFTP

    Phonebook XML Server Path : "When the device boot up and completed the provisioning routine, it will attempt to download the gs_phonebook.xml file specified in “Phonebook XML Path”"

    NTP Server: US

    Display Language: English only?

    Configuration tools (.Net required): http://www.grandstream.com/configurationtool.html

    Example Phonebook File

    <?xml version="1.0"?>
    <AddressBook>
            <Contact>
                    <LastName>Doe</LastName>
                    <FirstName>John</FirstName>
                    <Phone>
                            <phonenumber>8000</phonenumber>
                            <accountindex>0</accountindex>
                    </Phone>
            </Contact>
    </AddressBook>

    Note: Since the GXP2000 supports up to four VoIP accounts, <accountindex> is used to tell it which account to use to dial out.

    Set Yes-HTTP, created gs_phonebook.xml in http://192.168.0.1/gs, left 0 as default download interval, rebooted: Nothing happens. Documentation says "At any time, you can trigger an immediate download from by choosing the “Download Phonebook” in the GUI Phone Book Menu (you can use the down arrow key when the phone is on-hook).", but nothing happens either.

    Tried Automatic upgrade to Yes: No change

    Linksys SPA-921

    Cons: Unlike SPA9x2 phones, interface only available in English; LCD screen cannot be raised, so must use provided desk stand for easier reading; Phonebook cannot be filed by downloading file over the network, so must macro recorder to fill phonebook through web interface; Phonebook only holds 100 entries

    Sipura 3000

    Older brother of the Linksys 3102. Sipura is now part of Linksys, which is itself part of Cisco. Overall, the 3000 is a good product, but is known for having a so-so echo canceller. If it's an issue, shell out the dough, and get a Sangoma A200.

    "One of the biggest differences is the spa3k is rather limited in terms of echo cancellation. If your pstn line is outside the limits of the spa3k's echo canceller, you'll have less then acceptable audio quality. Unfortunately, there isn't any nice way to identify your pstn line characters (etc) without trying it. Also, a few users complain about voice interpreted as dtmf signaling under some circumstances."

    Making sense of the Sipura 3000 and Linksys 3102: Jump to chapter 4 of Sipura's SPA User Guide.

    Linksys 3102

    See this.

    Resources

    Tools

    Sites