Logging cleanup: Trim ICE candidate output
Logging cleanup: Check for null before method call
Merge pull request #73 from seanbright/master

Logging cleanup: Trim ICE candidate output
Use Grammar to parse Content-Disposition type

This makes Content-Disposition-related behavior more correct.

fixes #6
Merge pull request #78 from joseph-onsip/parseDisposition

Use Grammar to parse Content-Disposition type
Grammar: use text() instead of input.substring(peg$currPos, offset())
SpecGrammar.js: add a couple UUID tests
Grammar: remove unused uuid_URI rule, clean up uuid rule
Grammar: fix quoted_string_clean rule

In theory, the rule returns what's between the quotes in the input.

In practice, it was slicing off the first and last characters of the input,
then returning the result. This only worked if there wasn't any SWS before
the quoted string.

Now, it actually returns what's between the quotes.
Grammar: userinfo rule uses text().slice instead of input.substring

Note that this rule is (still) broken, in that data.user gets set to a string
containing both the user and the password.
Grammar.pegjs: remove unused variable 'header' from SIP_URI rule

See 987c7e6f16f5922e635bb1f6bdd6c7c1359c012d
Allow REFER to non-SIP resources

Usage:

  Send:

    session.refer('http://www.ietf.org')

  Receive:

    session.on('refer', function handleRefer (request) {
      var uri = request.parseHeader('refer-to').uri;
      if (!uri.scheme.match("^sips?$")) {
        // handle non-SIP referral
      } else {
        // handle SIP referral
      }
    });

fixes #9
Merge pull request #80 from joseph-onsip/REFERnonSIP

Allow REFER to non-SIP resources
src/Session.js: non-SIP .refer() and .followRefer() don't .terminate()

This keeps sessions open after non-SIP referrals.

.followRefer():
  1. opens the URI using window.open if it's available
  2. doesn't call its callback argument, since there's no new session

One of REFER tests had to be changed to use an actual sip: URI and avoid
triggering the non-SIP behavior.

Usage:

  var referrerUri = 'FILL THIS IN';
  var refereeUri = 'FILL THIS IN TOO';

  var referrer = new SIP.UA({
      traceSip: true,
      uri: referrerUri,
  });

  var referee = new SIP.UA({
      traceSip: true,
      uri: refereeUri,
  });

  referee.on('invite', function (session) {
      session.accept().on('refer', session.followRefer(function wontGetCalled () {}));
  });

  referee.on('registered', function () {
      referrer.invite(refereeUri).on('accepted', function referToIETF() {
          this.refer('http://www.ietf.org');
      });
  });
src/EventEmitter.js: inherit from Node's EventEmitter
src/EventEmitter.js: implement event initialization/validation
src/SIP.js: require EventEmitter correctly
src/EventEmitter.js: don't init _validEvents in constructor

Since the constructor might not be called when EventEmitter is extended,
methods should work if _validEvents is undefined.
src/EventEmitter.js: implement checkListener

also rename filterMethod to filterFluentMethod
test/spec/SpecEventEmitter.js: try not to modify internals when testing