Comparing version 0.9.0 to 0.9.1
{ | ||
"name": "sip.js", | ||
"version": "0.9.0", | ||
"version": "0.9.1", | ||
"authors": [ | ||
@@ -5,0 +5,0 @@ "James Criscuolo <james@onsip.com>", |
@@ -5,3 +5,3 @@ { | ||
"description": "A simple, intuitive, and powerful JavaScript signaling library", | ||
"version": "0.9.0", | ||
"version": "0.9.1", | ||
"main": "dist/sip.min.js", | ||
@@ -30,4 +30,6 @@ "browser": { | ||
"devDependencies": { | ||
"babel-core": "^6.26.0", | ||
"babel-loader": "^7.1.2", | ||
"babel-preset-env": "^1.6.1", | ||
"eslint": "^4.9.0", | ||
"eslint-loader": "^1.9.0", | ||
"jasmine-core": "^2.8.0", | ||
@@ -51,2 +53,3 @@ "karma": "^1.7.1", | ||
"scripts": { | ||
"prebuild": "eslint src/*.js src/**/*.js", | ||
"build": "webpack --progress && cp dist/sip.js dist/sip-$npm_package_version.js && cp dist/sip.min.js dist/sip-$npm_package_version.min.js", | ||
@@ -53,0 +56,0 @@ "browserTest": "sleep 2 && open http://0.0.0.0:9876/debug.html & karma start --reporters kjhtml --no-single-run", |
@@ -226,2 +226,11 @@ "use strict"; | ||
/** | ||
* Returns a promise which resolves once the UA is connected. | ||
*/ | ||
UA.prototype.waitForConnected = function() { | ||
return new SIP.Utils.Promise(function(resolve) { | ||
this.afterConnected(resolve); | ||
}.bind(this)); | ||
}; | ||
/** | ||
* Make an outgoing call. | ||
@@ -239,4 +248,9 @@ * | ||
this.afterConnected(context.invite.bind(context)); | ||
this.emit('inviteSent', context); | ||
// Delay sending actual invite until the next 'tick' if we are already | ||
// connected, so that API consumers can register to events fired by the | ||
// the session. | ||
this.waitForConnected().then(function() { | ||
context.invite(); | ||
this.emit('inviteSent', context); | ||
}.bind(this)); | ||
return context; | ||
@@ -243,0 +257,0 @@ }; |
@@ -245,3 +245,3 @@ "use strict"; | ||
// Merge passed constraints with saved constraints and save | ||
this.constraints = Object.assign(this.constraints, options.constraints); | ||
this.constraints = Object.assign({}, this.constraints, options.constraints); | ||
this.constraints = this.checkAndDefaultConstraints(this.constraints); | ||
@@ -317,2 +317,5 @@ | ||
var localDescription = self.peerConnection.localDescription; | ||
return SIP.Utils.reducePromises(modifiers, localDescription); | ||
}) | ||
.then(function(localDescription) { | ||
self.emit('getDescription', localDescription); | ||
@@ -359,3 +362,6 @@ return localDescription.sdp; | ||
this.logger.log('initPeerConnection'); | ||
if (this.peerConnection) { | ||
this.logger.log('Already have a peer connection for this session. Tearing down.'); | ||
this.resetIceGatheringComplete(); | ||
@@ -367,2 +373,3 @@ this.peerConnection.close(); | ||
this.logger.log('New peer connection created'); | ||
this.session.emit('peerConnection-created', this.peerConnection); | ||
@@ -369,0 +376,0 @@ |
@@ -56,5 +56,5 @@ var UglifyJSPlugin = require('uglifyjs-webpack-plugin'); | ||
exclude: /node_modules/, | ||
loader: "eslint-loader", | ||
loader: "babel-loader", | ||
options: { | ||
// eslint options (if necessary) | ||
presets: ['env'] | ||
} | ||
@@ -61,0 +61,0 @@ }, |
Sorry, the diff of this file is too big to display
Sorry, the diff of this file is too big to display
Sorry, the diff of this file is too big to display
1536028
16
29482