The JavaScript blog.


audio node modules voip npm telephony

Node Roundup: npm and Heartbleed, sipster

Posted on .

npm and Heartbleed

The npm blog has an article about npm and Heartbleed:

We started patching machines within 30 minutes of the revelation of the bug, and our last vulnerable machine was patched at 7.30am Pacific today.

There has been no evidence so far that our keys were compromised during this period, but nevertheless we are regenerating all our SSL keys anyway and will be rolling them out over the next couple of days (we are very cautious about testing and rolling out new certs since an earlier incident in which we broke a lot of older npm clients while doing so).


Brian White sent in sipster (GitHub: mscdex / sipster, License: MIT, npm: sipster), a pjsip binding for Node. This is the basis for the SIP driver used by Asterisk 12+. He hasn't yet been able to get a working build environment set up for Windows, but it should work for Unix systems.

Here's a list of what Brian says it can do so far:

  • Make and receive calls
  • Play either individual or a playlist of wav files (ulaw, alaw, or pcm)
  • Record audio to wav file (ulaw, alaw, or pcm)
  • Hook up audio streams from different calls (e.g. create your own conference or record a mix of streams to wav)
  • Adjust volume levels of audio streams
  • Detect/Send DTMF digits
  • Hold/un-hold
  • Call transfer

The API is event based -- for example: call.on('dtmf', cb), and I think the C++ binding is a cool example of a Node native module: src/binding.cc.


jquery plugins voip

jQuery Roundup

Posted on .

Welcome to the jQuery Roundup 28. You can send your plugins and articles
in for review through our contact form or

jQuery 1.4.3 Released

jQuery 1.4.3 is out and it now
passes Crockford's JSLint, which means Crockfordites can finally put
down their pitchforks. Something else interesting I noticed (given how I
harp on about this in the Let's Make a Framework posts) was that the
internal modules are less dependent on each other, which means chunks of
the framework can be used in isolation.

There are a lot of other changes too, especially in the CSS module. I
like the fact jQuery.fx.interval can be used to control
animation smoothness, at the expense of CPU cycles.

All this from a so-called minor release!

jQuery 1.4.3 is passing 3621 tests on all supported browsers. We're 100% passing on Firefox 4 and nearly passing in IE 9 (we discovered two bugs, filed them, and one of them has already been fixed).

The blog post
has full details, with benchmarks and graphs. And if you really like
reading about jQuery changes, it's worth following on


Phono is a jQuery plugin and SDK for working with phones and IM. The server-side components are Voxeo
and Tropo, but
the authors want to release a gateway to allow SIP VoIP communication
without Voxeo. The plugin is made by Voxeo, and is released under the
Apache2 license.

Events for ringing, answering, and hanging up are passed in using a
simple object:

$("#call").click(function() {
  $("#call").attr("disabled", true).val("Busy");
  phono.phone.dial("985-655-2500", {
    onRing: function() {
    onAnswer: function() {
    onHangup: function() {
      $("#call").attr("disabled", false).val("Call");

I think this is an interesting project with a friendly API for us
JavaScript developers. I've always wanted to make something with
Tropo but I haven't thought up a suitable project yet.

Sean Koole's jQuery Posts

Sean Koole sent me a link to his blog, where he writes about JavaScript
and jQuery. In On jQuery and

he writes about how to reduce the amount of jQuery objects that get
created when instantiating elements. He describes several solutions,
like chaining calls or assigning \$(this) to a variable.

Koole discusses the differences between \$.fn.each and
\$.fn.map in Fine dining, jQuery's map and

He also covers \$.fn.clone in What you should know about
cloning form
which is useful reading if you haven't yet had to deal with the weird
world of IE and cloning elements.

Digging into jQuery 1.4.3's data method
is a lengthier article all about the changes to the data
method. He actually explains the internal changes and how they relate to
native JavaScript behaviour.


The jQuery Closure plugin by
Paul Hinds (MIT and GPL) provides this:

jQuery.callback = function(object, method) {
    return function() {
       return method.apply(object, arguments);

So callbacks can be written using \$.callback():

$('selector').click($.callback(this, this.eventHandler));

This makes it a little bit easier to follow closure capturing. Arguments
can also be captured with \$.closeArgs():

var i = 0;
for(; i < 5; i++) {
      jQuery('#id' + i).click($.closeArgs(this, this.myEventHandler, i));

In combination these methods are similar to Prototype's bind.