Skip to content

Commit

Permalink
More JsSIP -> SIP.js changes
Browse files Browse the repository at this point in the history
  • Loading branch information
Will Mitchell committed Jan 8, 2014
1 parent a30a777 commit c65fbcc
Show file tree
Hide file tree
Showing 3 changed files with 31 additions and 24 deletions.
24 changes: 12 additions & 12 deletions BUILDING.md
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
## What you need to build JsSIP
## What you need to build SIP.js

You just need to have [Node.js](http://nodejs.org/) and [Git](http://git-scm.com/). Optionally you also need [PhantomJS](http://phantomjs.org/) if you want to run test units.

Expand All @@ -21,11 +21,11 @@ You just need to have [Node.js](http://nodejs.org/) and [Git](http://git-scm.com
* In modern Debian/Ubuntu systems PhantomJS can be installed via `apt-get install phantomjs`


## How to build JsSIP
## How to build SIP.js

Clone a copy of the main JsSIP git repository by running:
Clone a copy of the main SIP.js git repository by running:
```
$ git clone https://github.com/versatica/JsSIP.git
$ git clone https://github.com/onsip/SIP.js.git
```

Install grunt-cli globally:
Expand All @@ -35,30 +35,30 @@ $ npm install -g grunt-cli

Enter the directory and install the Node.js dependencies:
```
$ cd JsSIP && npm install
$ cd SIP.js && npm install
```

Make sure you have `grunt` installed by testing:
```
$ grunt -version
```

Finally, run `grunt` command with no arguments to get a complete version of JsSIP:
Finally, run `grunt` command with no arguments to get a complete version of SIP.js:
```
$ grunt
```

The built version of JsSIP will be available in the `dist/` subdirectory in both flavors: normal (uncompressed) and minified, both linted with [JSLint](http://jslint.com/). There will be also a file named `dist/jssip-devel.js` which is an exact copy of the uncompressed file.
The built version of SIP.js will be available in the `dist/` subdirectory in both flavors: normal (uncompressed) and minified, both linted with [JSLint](http://jslint.com/). There will be also a file named `dist/sip-devel.js` which is an exact copy of the uncompressed file.


## Development version

Run `grunt devel` for just generating the `dist/jssip-devel.js` file. An uncompressed JsSIP source file named `jssip-devel.js` will be created in `dist` directory.
Run `grunt devel` for just generating the `dist/sip-devel.js` file. An uncompressed SIP.js source file named `sip-devel.js` will be created in `dist` directory.


## Test units

JsSIP includes test units based on [QUnit](http://qunitjs.com/). Test units use the `dist/jssip-devel.js` file. Run the tests as follows:
SIP.js includes test units based on [Jasmine](http://pivotal.github.io/jasmine/). Test units use the `dist/sip-devel.js` file. Run the tests as follows:
```
$ grunt test
Expand All @@ -67,10 +67,10 @@ Testing testNoWebRTC.html.........OK
>> 250 assertions passed (177ms)
```

## Changes in JsSIP grammar
## Changes in SIP.js grammar

If you modify `src/Grammar/src/Grammar.pegjs` then you need to recompile JsSIP grammar files. For that run the following task:
If you modify `src/Grammar/src/Grammar.pegjs` then you need to recompile SIP.js grammar files. For that run the following task:
```
$ grunt grammar
```
And then build JsSIP again as explained above.
And then build SIP.js again as explained above.
16 changes: 11 additions & 5 deletions Gruntfile.js
Original file line number Diff line number Diff line change
Expand Up @@ -37,6 +37,12 @@ module.exports = function(grunt) {
banner: '\
/*\n\
* SIP version <%= pkg.version %>\n\
* Copyright (c) 2014-<%= grunt.template.today("yyyy") %> Junction Networks, Inc <http://www.onsip.com>\n\
* Homepage: http://sipjs.com\n\
* License: http://sipjs.com/license\n\
*\n\
*\n\
* Some portions of SIP.js adapted from JsSIP:\n\
* Copyright (c) 2012-<%= grunt.template.today("yyyy") %> José Luis Millán - Versatica <http://www.versatica.com>\n\
* Homepage: http://jssip.net\n\
* License: http://jssip.net/license\n\
Expand Down Expand Up @@ -151,15 +157,15 @@ module.exports = function(grunt) {
grunt.loadNpmTasks('grunt-contrib-jasmine');


// Task for building JsSIP Grammar.js and Grammar.min.js files.
// Task for building SIP.js Grammar.js and Grammar.min.js files.
grunt.registerTask('grammar', function(){
var done = this.async(); // This is an async task.
var sys = require('sys');
var exec = require('child_process').exec;
var child;

// First compile JsSIP grammar with PEGjs.
console.log('"grammar" task: compiling JsSIP PEGjs grammar into Grammar.js ...');
// First compile SIP.js grammar with PEGjs.
console.log('"grammar" task: compiling SIP.js PEGjs grammar into Grammar.js ...');
child = exec('if [ -x "./node_modules/pegjs/bin/pegjs" ] ; then PEGJS="./node_modules/pegjs/bin/pegjs"; else PEGJS="pegjs" ; fi && $PEGJS -e SIP.Grammar src/Grammar/src/Grammar.pegjs src/Grammar/dist/Grammar.js', function(error, stdout, stderr) {
if (error) {
sys.print('ERROR: ' + stderr);
Expand All @@ -179,7 +185,7 @@ module.exports = function(grunt) {
});
});

// Task for building JsSIP SDP.js and SDP.min.js files.
// Task for building SIP.js SDP.js and SDP.min.js files.
grunt.registerTask('sdp', function(){
var done = this.async(); // This is an async task.
var sys = require('sys');
Expand All @@ -198,7 +204,7 @@ module.exports = function(grunt) {
});
});

// Task for building jssip-devel.js (uncompressed), sip-X.Y.Z.js (uncompressed)
// Task for building sip-devel.js (uncompressed), sip-X.Y.Z.js (uncompressed)
// and sip-X.Y.Z.min.js (minified).
// Both sip-devel.js and sip-X.Y.Z.js are the same file with different name.
grunt.registerTask('build', ['concat:devel', 'includereplace:devel', 'jshint:devel', 'concat:post_devel', 'concat:dist', 'includereplace:dist', 'jshint:dist', 'concat:post_dist', 'uglify:dist']);
Expand Down
15 changes: 8 additions & 7 deletions package.json
Original file line number Diff line number Diff line change
@@ -1,24 +1,25 @@
{
"name": "sip",
"title": "JsSIP",
"title": "SIP.js",
"description": "the Javascript SIP library",
"version": "0.4.0-devel",
"homepage": "http://jssip.net",
"author": "José Luis Millán <[email protected]>",
"version": "0.5.0-devel",
"homepage": "http://sipjs.com",
"author": "Will Mitchell <[email protected]>",
"contributors": [
{
"url": "http://jssip.net/authors/"
"url": "http://sipjs.com/authors/"
}
],
"repository": {
"type": "git",
"url": "https://github.com/versatica/JsSIP.git"
"url": "https://github.com/onsip/SIP.js.git"
},
"keywords": [
"sip",
"websocket",
"webrtc",
"library"
"library",
"javascript"
],
"devDependencies": {
"grunt": "~0.4.0",
Expand Down

0 comments on commit c65fbcc

Please sign in to comment.