Monday, June 28, 2010
HTML 5 Web Sockets
The HTML 5 specification introduces the Web Socket interface, which defines a full-duplex communications channel that operates over a single socket and is exposed via a JavaScript interface in HTML 5 compliant browsers.
Unlike Comet and Ajax, Web Socket is native to the browser, and only requires a single connection to maintain both upstream and downstream data to and from the browser. Note, that to support streaming over HTTP, Comet requires a long-lived connection, which is often severed by proxies and firewalls. In addition, few Comet solutions support streaming over HTTP, employing a low performance technique called "long-polling" instead.
By moving to a single, streaming channel of communications, we can overcome the inadequacies of techniques such as long-polling and "forever frames," and as a result further reduce latency.
[Constructor(in DOMString url)]
interface WebSocket {
readonly attribute DOMString URL;
// ready state
const unsigned short CONNECTING = 0;
const unsigned short OPEN = 1;
const unsigned short CLOSED = 2;
readonly attribute int readyState;
// networking
attribute EventListener onopen;
attribute EventListener onmessage;
attribute EventListener onclosed;
void postMessage(in DOMString data);
void disconnect();
};
To connect to an end-point, just create a new Web Socket instance, providing the new object with a URL that represents the end-point to which you wish to connect (See listing 2). Note that a ws:// and wss:// prefix indicate a Web Socket and a secure Web Socket connection, respectively. A Web Socket connection is established by upgrading from the HTTP protocol to the Web Socket protocol during the initial handshake between the client and the server, over the same underlying TCP/IP connection. Once established, Web Socket data frames can be sent back and forth between the client and the server in full-duplex mode. The connection itself is exposed via the onMessage and postMessage methods defined by the Web Socket interface.
var myWebSocket = new WebSocket("ws://www.websocket.org");
Before connecting to an end-point and sending a message, you can associate a series of event listeners to handle each phase of the connection life-cycle.
myWebSocket.onopen = function(evt) { alert("Connection open ..."); };
myWebSocket.onmessage = function(evt) { alert( "Received Message: " + evt.data); };
myWebSocket.onclose = function(evt) { alert("Connection closed."); };
To send a message to the server, simply call postMessage and provide the content you wish to deliver. After sending the message, call disconnect to terminate the connection.
myWebSocket.postMessage("Hello Web Socket! Goodbye Comet!");
myWebSocket.disconnect();
Firewalls and Proxies? No Problem
One of the more unique features Web Socket provides is its ability to traverse firewalls and proxies, a problem area for many Comet-enabled applications. Comet-style applications typically employ long-polling as a rudimentary line of defense against firewalls and proxies. The technique is effective, but is not well suited for applications that have sub-500 millisecond latency or high throughput requirements. Plugin-based technologies such as Adobe Flash, also provide some level of socket support, but have long been burdened with the very proxy and firewall traversal problems that Web Sockets now resolve.
A Web Socket detects the presence of a proxy server and automatically sets up a tunnel to pass through the proxy. The tunnel is established by issuing an HTTP CONNECT statement to the proxy server, which requests for the proxy server to open a TCP/IP connection to a specific host and port. Once the tunnel is set up, communication can flow unimpeded through the proxy. Since HTTP/S works in a similar fashion, secure Web Sockets over SSL can leverage the same HTTP CONNECT technique.
Any RIA, Any Time
In addition, the Web Socket protocol can be used to support a diverse set of clients (e.g. JavaScript, Adobe Flex, JavaFX, Microsoft Silverlight, etc.). However, the HTML 5 specification only defines support for JavaScript, which is limited to text-based protocols. To serve other client-types and support binary protocols you will need to look to vendor offerings.
Tuesday, June 22, 2010
SIP DTMF Signalling - voip-info.org
DTMF delivery options in SIP
With in a VoIP conversation, DMTF tones are delivered either in-band (as a beep), or out-of-band via SIP or RTP signaling messages. 3CX Phone System supports both
In-band
Incoming stream delivers DTMF signals in-audio independently of codecs – in this case the 3CX Phone System Media Server listens to the audio stream, and will detect DTMF signals.
- Delivery to DR or VM: Efficiency of DTMF detection depends on audio quality. Dropped packets will also reduce audio quality.
- Delivery to some external party (typically via gateway or provider): DTMF strokes are recognized from the in-audio stream, and delivered to the external party in 2 forms – in-audio (leaving audio content unchanged) and additionally via RFC2833.
- Delivery to MS Exchange 2007 IVR: DTMF strokes are recognized from the in-audio stream, and delivered to the external party in 2 forms – in-audio (leaving audio content unchanged) and additionally via RFC2833. Please note that since MS Exchange 2007 IVR does not provide in-audio recognition, it will only use RFC2833 delivery mechanism.
Out-of-band
Incoming stream delivers DTMF signals out-of-audio using either SIP-INFO or RFC-2833 mechanism, independently of codecs – in this case the DTMF signals are sent separately from the actual audio stream.
- Delivery to DR or VM: These are passed through as received.
- Delivery to some external party (typically via gateway or provider): These are passed through as received. The external party must support the corresponding delivery mechanism if DTMF strokes are to be recognized. Effectively this means that if DTMF is received with SIP-INFO, it is forwarded also as SIP-INFO. If your VoIP Provider requires RFC2833 DTMF delivery, then it will be necessary to ensure all SIP Phones are configured to deliver DTMF using RFC2833.
- Delivery to MS Exchange 2007 IVR: These are passed through as received.
Note:
SIP-INFO is not recommended for DTMF delivery, since it cannot deliver strokes synchronously with the audio stream, introducing timing artifacts (mainly because it’s delivered using SIP, which is not a real-time mechanism for delivering media). It is very common for public services to NOT support SIP INFO, and it seems unlikely that such services will improve support for this delivery mechanism.
Cisco and RFC-2833
• 7905
• 7910
• 7912
• 7940
• 7960
All digits are sent out of band in either SCCP or SIP signaling packets depending on the phone firmware. These phones are referred to as Type A phones in the Cisco Unified Communications Manager 6.x SRND (Solution Reference Network Design) guide available at www.cisco.com/go/srnd.
• 7906
• 7911
• 7941
• 7942
• 7945
• 7961
• 7962
• 7965
• 7970
• 7971
• 7975
SIP trunks in Cisco Call Manager 5.0 supports RFC2833 DTMF-Relay. RFC2833 supports is very important for multi-vendor interoperability since this is the preferred way of exchanging DTMF digits between vendors.
Note that Cisco's JTAPI connections used for CTI ports in CUCM only support out of band DTMF messages.
Wednesday, June 16, 2010
Gzip and Tar
Gzip:
- Gzip is used to compress a file. To zip "thisfile", type gzip thisfile. You'll get a file named thisfile.gz.
- $gzip thisfile
- $thisfile.gz
- To unzip thisfile.gz, type gunzip thisfile.gz.
- $gunzip thisfile.gz
- Gzip supports 9 levels of compression; 1 being the fastest and least compressed; 9 being the slowest and most compressed; 6 being the default. To get the best compression, use the command: gzip -9 readme
Tar:
- Tar is used to pack the entire contents of a directory or directories into a single file called a tarball.
- Tar preserves the entire directory organization including file ownership, permissions, links, and the directory structure.
- The most commonly used tar functions are:
- c - create an archive
- x - extract files from an archive
- t - list the contents of an archive
- v - verbose
- f filename - use the specified file
- z - gzip/gunzip
Examples: Back |up the contents of the home directory for gemini (/home/gemini) in a tarball called a.tar on a floppy disk.
mount /floppy
cd /home
tar -cvf /floppy/a.tar gemini
Explanation:- Change to the parent of the /home/gemini directory.
- Create a backup of gemini in the file /floppy/a.tar.
- Now, check the contents of the tarball that you just created.
cd /floppy
tar -tvf a.tar
- Back |up the contents of the etc directory in an archive called etc.tar . Make sure that the archive is created in your own home directory.
cd /
tar -cvf ~/etc.tar etc
Explanation:- Change to the parent of the /etc directory.
- Create a backup of etc in the file ~/etc.tar
- Back |up and compress the contents of the home directory into the tarball home.tgz on a floppy disk.
mount /floppy
cd /
tar -cvzf /floppy/home.tgz home
Explanation:- change to the parent of the /home directory
- Create a compressed backup of home in the file /floppy/home.tgz.
- Now check the contents of the archive that you just created.
cd /floppy
tar -tvzf home.tgz
- Unpack the archive home.tgz on your floppy.
cd /floppy
tar -xvzf home.tgz
Explanation:- change to the /floppy directory
- unpack and unzip the tarball home.tgz
Thursday, June 10, 2010
The four principles
Basic principles of copyright law
Say, for example, you doodle a drawing of a fish on a piece of napkin. That drawing is copyrighted simultaneously with its creation and is your property. Your drawing cannot be copied, displayed, or exploited by any person other than you for the life of the copyright. In addition, no person other than you can create "derivative works" from the original drawing.
Saturday, June 5, 2010
The web and video
So you have HTML5, VP8 for codec, etc...
Personal Learning Environment and CloudCourse
Moodle is another Course Management System (CMS), also known as a Learning Management System (LMS) or a Virtual Learning Environment (VLE). It is a Free web application that educators can use to create effective online learning sites.
PLE is a new term that describes how we learn in the Web 2.0 context. What do mean by that? What does Web 2.0 have anything to do with PLE? Let's pause for a second to think about this.