forked from onsip/SIP.js
-
Notifications
You must be signed in to change notification settings - Fork 1
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Inaugural Hacks.js - Replace Firefox turn candidates in Ack SDP
- Loading branch information
Will Mitchell
committed
Apr 8, 2014
1 parent
5ab81d2
commit dfbbe17
Showing
3 changed files
with
45 additions
and
13 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,35 @@ | ||
/** | ||
* @fileoverview Hacks - This file contains all of the things we | ||
* wish we didn't have to do, just for interop. It is similar to | ||
* Utils, which provides actually useful and relevant functions for | ||
* a SIP library. Methods in this file are grouped by vendor, so | ||
* as to most easily track when particular hacks may not be necessary anymore. | ||
*/ | ||
|
||
(function (SIP) { | ||
|
||
var Hacks; | ||
|
||
Hacks = { | ||
|
||
Firefox: { | ||
/* Condition to detect if hacks are applicable */ | ||
isFirefox: function () { | ||
return window.mozRTCPeerConnection !== undefined; | ||
}, | ||
cannotHandleRelayCandidates: function (message) { | ||
if (this.isFirefox() && message.body) { | ||
message.body = message.body.replace(/relay/g, 'host generation 0'); | ||
} | ||
}, | ||
cannotHandleExtraWhitespace: function (message) { | ||
if (this.isFirefox() && message.body) { | ||
message.body = message.body.replace(/ \r\n/g, "\r\n"); | ||
} | ||
} | ||
} | ||
}; | ||
|
||
|
||
SIP.Hacks = Hacks; | ||
}(SIP)); |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters