Disabling SIP ALG -Netgear

Several of today’s commercial routers implement SIP ALG (Application-level gateway), and come’s with this feature enabled by default. While ALG could in many cases help in solving NAT related problems, but the fact is that many routers’ ALG implementations are wrong and often modifies SIP packets in unexpected ways, corrupting them and making them unreadable.

In general, you would want to disable SIP ALG and configure one to one port mapping on the router. We will show you how to disable SIP ALG on a Netgear router.

• Open the Netgear router’s configuration by browsing to its LAN Address (http://192.168.0.1 by default).
• Log on to the router’s configuration. The default username is ‘admin’ and the default password is ‘password’

Netgear-WAN-Setup

• In the main menu, select Advanced and then WAN Setup
• Enable the option Disable SIP ALG
• Click Apply to apply this setting

VoIP Bandwidth Utilization

When calculating VoIP bandwidth, one can’t assume that every channel is used all the time. Normal conversation includes a lot of silence, which often means no packets are sent at all. So even if one voice call sets up two 64 Kbit RTP streams over UDP over IP over Ethernet (which adds overhead), the full bandwidth is not used at all times.

A codec that sends a 64kb stream results in a much larger IP network stream. The main cause of the extra bandwidth usage is IP and UDP headers. VoIP sends small packets and so, many times, the headers are actually much larger than the data part of the packet.

FacetPhone has the table which shows how the codec’s theoretical bandwidth usage expands with UDP/IP headers:

Codec BR
G.711 64 Kbps 87.2 Kbps

BR = Bit rate
NEB = Nominal Ethernet Bandwidth (one direction)

Disabling SIP ALG – SonicWall

SonicWall has a feature called SIP Transformations that may cause issues with your VOIP end points.  Providers will often ask you to disable these setting if you are experiencing call control issues.

To disable SIP Transformations on the TZ170 or the TZ200.

1. Log into the web interface on the SonicWall.

2. On the left, find the VOIP tab. Depending on the version of SonicOS your screen may appear slightly different.

sonicwall_alg

3. Enable “Consistent NAT”

4. Make sure that ALL of the options are unchecked under SIP Transformation.

5. Than click-on “Apply”.

6. Reboot your VOIP / SIP endpoints.

Grandstream GXW-4104/8 FXO Gateway

Configuring FacetPhone to work with Grandstream Gateways:

Step 1: Log on to the FacetPhone User Interface and go to:

Admin => Change System Confirguration
Add => Add a Gateway

Configuring Gateway Fields:

Add Gateway ID:
Add Description:
Add LAN IPADDR:
Add Default Route:
Select Manufacturer: Grandstream GXW410x
Enter: Number FXO ports or T1 Channels in field
Select: Branch Location
Select: RFC2833 Digit Detection

Click: OK

gateway

Status Page:

Important: This device may be upgraded to the latest firmware version here: http://www.grandstream.com/support/firmware

Check Firmware Version:

Step 2: Checking Firmware Load in the management console of the gateway, open a browser and enter the device IP address which should be randomly assigned from your DHCP server.

The default password should be ‘admin’.

Click the ‘status’ tab and check the software version.

Be sure the software version is 1.3.4.13, if it is older you will need to upgrade to the supported FacetPhone version.

status_tab

Basic Configuration:

After login, the next configuration is the Basic Settings page.

Select Static IP mode:

Enter LAN IP address,
Subnet Mask,
Default Router IP address,

Daylight Savings Time: YES

Grandstream_basic_1_1

Advanced Settings:

Layer 3 QoS:  We tag voice-packets for Expedited Forwarding ToS with DSCP of 101110 (binary), 46 (decimal), 2E (hexadecimal). Enter 46.

Automatic Upgrade: No
Always Skip the Firmware Check

Syslog Server: <fp_server_ipaddr>
Syslog Level: DEBUG
NTP Server: <fp_server_ipaddr>

advanced_settings

FXO Lines: Page 1 of 2

FXO Termination:

Enable Current Disconnect: ch1-4:Y;
If enabled, use threshold: ch1-4:600;
Enable Tone Disconnect: ch1-4:N;
Enable Polarity Reversal: ch1-4:N;
Enable Call Answer Supervision: ch1-4:N;
Silence Timeout(X1s): ch1-4:65535;
Incoming Call Ring Timeout(X1s): ch1-4:6;
AC Termination Impedance: ch1-4:0

Channel Dialing to PSTN:

Wait for Dial-Tone: ch1-4:N;
Stage Method: ch1-4:1;
Min Delay Before Dialing Out: ch1-4:750;

Channel Dialing to VoIP:

Unconditional Call Forward:
User ID: ch1:1;ch2:2;ch3:3;ch4:4;
Sip Server: ch1-4:p1;
Sip Destination Port: ch1-4:5060;

grandstream_fxo_lines

FXO Lines: Page 2 of 2

PSTN to VOIP Caller ID Setting:

Number of Rings Before Pickup: ch1-4:10;
Caller ID Scheme: ch1-4:1;
Caller ID Transport Type: ch1-4:1;

T.38 Setting: ch1-4:mode=2,rate=9600,ecm=1;

grandstream_fxo_lines_page_1

Channel Configuration:

Channel Voice Setting:

Tx to PSTN Audio Gain(dB): ch1-4:1;
Rx from PSTN Audio Gain(dB): ch1-4:6;
Silence Suppression: ch1-4:N;
Echo Cancellation: ch1-4:Y;

Channel Specific Setting:

DTMF Methods: ch1-4:2;

Grandstream_channels

Dial Plan Settings:

Call Routing / Dial Plan:

PSTN Outgoing Call Dail Plan: {x+}
Use DTMF Parameter from RFC2833 or SIP Info: Yes

dialplan

Profile Settings:

SIP Server: <fp_server_ipaddr>

grandstream_profile

Mean Opinion Score

MOS Introduction

There is a numerical method of expressing voice quality. It is called Mean Opinion Score (MOS). MOS gives a numerical indication of the perceived quality of the voice received after being transmitted and eventually compressed using codecs.

MOS

A score of 4.0 or above indicates good voice quality.  A MOS between 3.5 and 4 indicates satisfactory quality, perhaps similar to many mobile phone calls.  Any scores below 3.5 indicate unacceptable voice quality.  A score of 1.0 most likely indicates that VoIP End Point is experiencing 100% packets loss.

Packet Loss
VoIP can function with packet loss as high as 3 to 5%.  Beyond that, the conversation is affected too greatly to be of used.  The author opinion, packet loss should always be 0%.  In other words, you shouldn’t expect any packet loss and even a small about of loss (i.e., 1%) will be noticeable in your calls.

Latency
Any latency measurement under 100ms is perfect.  Furthermore, you don’t need to panic if your latency is over 100ms.  Most people won’t notice even if the latency is up around 175ms, however you definitely want it to be under 200-250ms.  At that point, you will start to notice awkward pauses in your conversations and both sides may even start to talk over one another.

Mac OSX Mountain Lion Host

Just doing some catch-up with Mountain Lion to make sure I can get all our dev environments up and running and have just came along a little quirk.

This is how the default hosts file looks like in: OS X 10.8.2 (12C60)

##
# Host Database
#
# localhost is used to configure the loopback interface
# when the system is booting.  Do not change this entry.
##
127.0.0.1	localhost

255.255.255.255	broadcasthost
::1             localhost
fe80::1%lo0	localhost

Nothin unusual. However, if you are used to adding lines like:-

"127.0.0.1 local-facetphone-apps"

to the end of the file, then it might throw you off a little bit as it seems you now have to have them above the fe80::1%lo0 line.

SIP Tutorial

SIP: Session Initiation Protocol (RFC 3261) –  Application-layer control (signaling) protocol used to create, manage and terminate sessions in an IP based network. A session could be a simple two-way telephone call or it could be a collaborative conference session.

SIP PHYSICAL ATTRIBUTES [Characteristics]

SIP is a text-based protocol. Endpoints that communicate using SIP use the following three protocols:

  1. SIP itself, used to establish and terminate the session;
  2. Session Description Protocol (SDP), used to exchange information about audio channels.
  3. RTP, used to send the real-time streams of audio across the network.

Messages are sent between each endpoint while in a SIP transaction. A transaction consists of a request and a response between each endpoint. The messages that belong to the transaction share the same ID. This ID is called CSeq.

Each transaction id will have a unique CSeq number, with only a single exception: the ACK message uses the same CSeq number as the transaction which it applies to.

(ACK for “acknowledge”)

SIP Methods: SIP requests or messages. SIP originally only had 6 requests (also called methods). Lets describe the individual methods:

INVITE — This is a request to establish a call (a session).

CANCEL — This method is used to stop an INVITE that is in progress (that is, the call has not been established yet).

ACK — The ACK request is used to confirm that the endpoint has received a final response in a transaction. Typically, after the called party accepts a call, the caller confirms the receipt of the accepting response (200 OK) with the ACK method.

BYE — The BYE method is used to end an established call.

REGISTER — The REGISTER method is used to register the SIP endpoint at the registrar server.

OPTIONS — The OPTIONS method is used to ask the other party for the list of SIP methods it supports.

In addition to the six SIP methods listed, several other SIP methods have been added to SIP 2.0

INFO — The FacetPhone system uses the SIP INFO method to carry DTMF digits only. RFC2833

SUBSCRIBE / NOTIFY— If you send a SUBSCRIBE method you are asking the other party to send you notifications NOTIFY method about status changes, example: at desk, away from desk, DND, etc.). The status change notifications is then sent in the NOTIFY messages.

MESSAGE — The MESSAGE method is a single message transmission used in instant messaging.

SIP Response Codes: SIP Requests are answered with SIP responses, of which there are 6 classes: 1xx through 6xx.

SIP User Agent (UA): An endpoint device that can issue or respond to SIP protocol methods.

SIP User Agent Client (UAS): A SIP endpoint device issuing the request (eg: Phone, PC, Smartphone ie iPhone, Android)

SIP Gateway: A network element that can convert SIP methods and response codes to another protocol.

SIP Proxy Server: An intermediary entity that acts as both a server and a client for the purpose of making requests on behalf of other clients.

SDP: Session Description Protocol (RFC 2327): – Text-based protocol describing multi-media sessions.

Most of these response codes are briefly described in RFC 3261. These are some of the most common reasons and in many cases debug logs might be required to troubleshoot further and find the exact reason.

100 – Trying
180 – Ringing
181 – Call Being Forwarded
182 – Call Queued
183 – Session Progress
200 – OK
202 – Accepted
300 – Multiple Choices
301 – Moved Permanently
302 – Moved Temporarily
305 – Use Proxy
380 – Alternative Service
400 – Bad Request
401 – Unauthorized
402 – Payment Required
403 – Forbidden
404 – Not Found
405 – Method Not Allowed
406 – Not Acceptable
407 – Proxy Authentication Required
408 – Request Timeout
409 – Conflict
410 – Gone
411 – Length Required
413 – Request Entity Too Large
414 – Request URI Too Long
415 – Unsupported Media Type
416 – Unsupported URI Scheme
420 – Bad Extension
421 – Extension Required
423 – Interval Too Brief
480 – Temporarily Unavailable
481 – Call/Transaction Does Not Exist
482 – Loop Detected
483 – Too Many Hops
484 – Address Incomplete
485 – Ambiguous
486 – Busy Here
487 – Request Terminated
488 – Not Acceptable Here
491 – Request Pending
493 – Undecipherable
500 – Server Internal Error
501 – Not Implemented
502 – Bad Gateway
503 – Service Unavailable
504 – Server Time-Out
505 – Version Not Supported
513 – Message Too Large
600 – Busy Everywhere
603 – Declined
604 – Does Not Exist Anywhere
606 – Not Acceptable

Bandwidth SIP Trunks

This document is intended as an aid to setting up the FacetPhone VoIP interface to connect to the Bandwidth Business Grade SIP Trunking Service.  This document is specifically being written using server version 5.0 build 736 of the FacetPhone IP PBX system.

PROXY SERVERS

To connect to the bandwidth network, you will need to add their proxy address into the FacetPhone system. It was automatically sent to you when your account was setup. If you no longer have this information or would like bandwidth to issue a new proxy address, please contact them directly.

NOTE: Bandwidth must point numbers to a Public IP.

SPECIAL CHARACTERS

Please note that special characters should not be used anywhere in SIP configurations. These include, but are not limited to, @#$%&! and spaces.

CONFIGURING THE FACETPHONE IP PBX SYSTEM

Configuring the SIP Trunk is very simple. Before you start please ensure that you have access to the email sent to the registered user on the bandwidth account with the title ‘bandwidth Account Setup’. This email is sent after you register and contains the account information you need to complete the setup process.

DEFINING GATEWAYS AND LINES

On the user interface menu bar, choose the menu selection: Admin / Change System Configuration / Add Gateway and Line

gw_ln2

A sample screenshot from the FacetPhone Gateway is displayed below.

  1. Enter gateway id: <1>
  2. Enter gateway description: <GW1: Bandwidth>
  3. Enter gateway IPADDR: <Bandwidth IPADDR>
  4. Select Manufacturer: <SIP Trucking Service>
  5. Enter number of FXO lines / channels <1>
  6. Select Branch: <Branch Location>
  7. Check mark: <RFC2833 digit detection>

SIP trunking service settings

  1. URI Domain: <Bandwidth IPADDR>
  2. Registrar:
  3. Number: <+214xxxxxxx>
  4. ITSP Domain: <bandwidth.com>
  5. Username
  6. Password
  7. Expire: <3600>
  8. SIP Port: <SIP PORT>
  9. NAT Address: <Customer IPADDR>
  10. Use E164 phone number format <check-mark>

EXAMPLE GATEWAY CONFIGURATION

sip_gw

Welcome to IP PBX & Stuff

IP PBX & Stuff… How an IP PBX works and its Benefits. With the advancement of technology the old PBX systems is constantly being replaced by the new more efficient private branch exchanges known as IP PBX’s. As the name predicts the IP PBX works in combination with both VoIP and PBX together.