Skip to content

Commit

Permalink
Fix #111. Create confirmed dialog before setting remote description.
Browse files Browse the repository at this point in the history
Thanks to @wakamoleguy and @gavllew
  • Loading branch information
jmillan committed Jun 15, 2013
1 parent 15d83bb commit dad84a1
Show file tree
Hide file tree
Showing 2 changed files with 6 additions and 6 deletions.
2 changes: 1 addition & 1 deletion package.json
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@
"name": "jssip",
"title": "JsSIP",
"description": "the Javascript SIP library",
"version": "0.3.3-devel",
"version": "0.3.4-devel",
"homepage": "http://jssip.net",
"author": "José Luis Millán <jmillan@aliax.net>",
"contributors": [
Expand Down
10 changes: 5 additions & 5 deletions src/RTCSession.js
Original file line number Diff line number Diff line change
Expand Up @@ -840,6 +840,11 @@ RTCSession.prototype.receiveResponse = function(response) {
break;
}

// An error on dialog creation will fire 'failed' event
if (!this.createDialog(response, 'UAC')) {
break;
}

this.rtcMediaHandler.onMessage(
'answer',
response.body,
Expand All @@ -848,11 +853,6 @@ RTCSession.prototype.receiveResponse = function(response) {
* SDP Answer fits with Offer. Media will start
*/
function() {
// An error on dialog creation will fire 'failed' event
if (!session.createDialog(response, 'UAC')) {
return;
}

session.sendACK();
session.status = C.STATUS_CONFIRMED;
session.started('remote', response);
Expand Down

0 comments on commit dad84a1

Please sign in to comment.