pax_global_header00006660000000000000000000000064122767052110014515gustar00rootroot0000000000000052 comment=05fd496ac325c3540a5a8809aa26ac42794ed1cd jssip/000077500000000000000000000000001227670521100122115ustar00rootroot00000000000000jssip/.gitignore000066400000000000000000000000241227670521100141750ustar00rootroot00000000000000dist/ node_modules/ jssip/.travis.yml000066400000000000000000000004271227670521100143250ustar00rootroot00000000000000# Doc: http://manuel.manuelles.nl/blog/2012/06/22/integrate-travis-ci-into-grunt/ language: node_js node_js: - 0.8 notifications: email: recipients: - jmillan@aliax.net - ibc@aliax.net - saghul@gmail.com on_success: change on_failure: always jssip/AUTHORS.md000066400000000000000000000005721227670521100136640ustar00rootroot00000000000000# AUTHORS ### José Luis Millán * Main author. Core Designer and Developer. * (Github [@jmillan](https://github.com/jmillan)) ### Iñaki Baz Castillo * Core Designer and Developer. * (Github [@ibc](https://github.com/ibc)) ### Saúl Ibarra Corretgé * Core Designer. * (Github [@saghul](https://github.com/saghul)) jssip/BUILDING.md000066400000000000000000000034601227670521100137330ustar00rootroot00000000000000## What you need to build JsSIP You just need to have [Node.js](http://nodejs.org/) and [Git](http://git-scm.com/). ### Node.js * [Install Node.js via package manager](https://github.com/joyent/node/wiki/Installing-Node.js-via-package-manager) * [Install Node.js from sources](http://nodejs.org) ### Git * [Install Git](http://git-scm.com/book/en/Getting-Started-Installing-Git) ## How to build JsSIP Clone a copy of the main JsSIP git repository by running: ``` $ git clone https://github.com/versatica/JsSIP.git ``` Install grunt-cli globally: ``` $ npm install -g grunt-cli ``` Enter the directory and install the Node.js dependencies: ``` $ cd JsSIP && 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: ``` $ 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. ## 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. ## 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: ``` $ grunt test Running "qunit:noWebRTC" (qunit) task Testing testNoWebRTC.html.........OK >> 250 assertions passed (177ms) ``` ## Changes in JsSIP grammar If you modify `src/Grammar/src/Grammar.pegjs` then you need to recompile JsSIP grammar files. For that run the following task: ``` $ grunt grammar ``` And then build JsSIP again as explained above. jssip/CHANGELOG.md000066400000000000000000000256511227670521100140330ustar00rootroot00000000000000CHANGELOG ========= Version 0.3.0 (released in 2013-03-18) ------------------------------- * [(fea1326)](https://github.com/versatica/JsSIP/commit/fea1326) Don't validate configuration.password against SIP URI password BNF grammar (fix #74). * [(3f84b30)](https://github.com/versatica/JsSIP/commit/3f84b30) Make RTCSession local_identity and remote_identity NameAddrHeader instances * [(622f46a)](https://github.com/versatica/JsSIP/commit/622f46a) remove 'views' argument from UA.call() * [(940fb34)](https://github.com/versatica/JsSIP/commit/940fb34) Refactored Session * [(71572f7)](https://github.com/versatica/JsSIP/commit/71572f7) Rename causes.IN_DIALOG_408_OR_481 to causes.DIALOG_ERROR and add causes.RTP_TIMEOUT. * [(c79037e)](https://github.com/versatica/JsSIP/commit/c79037e) Added 'registrar_server' UA configuration parameter. * [(2584140)](https://github.com/versatica/JsSIP/commit/2584140) Don't allow SIP URI without username in configuration.uri. * [(87357de)](https://github.com/versatica/JsSIP/commit/87357de) Digest authentication refactorized. * [(6867f51)](https://github.com/versatica/JsSIP/commit/6867f51) Add 'cseq' and 'call_id' attributes to OutgoingRequest. * [(cc97fee)](https://github.com/versatica/JsSIP/commit/cc97fee) Fix. Delete session from UA sessions collection when closing * [(947b3f5)](https://github.com/versatica/JsSIP/commit/947b3f5) Remove RTCPeerConnection.onopen event handler * [(6029e45)](https://github.com/versatica/JsSIP/commit/6029e45) Enclose every JsSIP component with an inmediate function * [(7f523cc)](https://github.com/versatica/JsSIP/commit/7f523cc) JsSIP.Utils.MD5() renamed to JsSIP.Utils.calculateMD5() (a more proper name for a function). * [(1b1ab73)](https://github.com/versatica/JsSIP/commit/1b1ab73) Fix. Reply '200' to a CANCEL 'before' replying 487 to the INVITE * [(88fa9b6)](https://github.com/versatica/JsSIP/commit/88fa9b6) New way to handle Streams * [(38d4312)](https://github.com/versatica/JsSIP/commit/38d4312) Add Travis CI support. * [(50d7bf1)](https://github.com/versatica/JsSIP/commit/50d7bf1) New `grunt grammar` task for automatically building customized Grammar.js and Grammar.min.js. * [(f19842b)](https://github.com/versatica/JsSIP/commit/f19842b) Fix #60, #61. Add optional parameters to ua.contact.toString(). Thanks @ibc * [(8f5acb1)](https://github.com/versatica/JsSIP/commit/8f5acb1) Enhance self contact handling * [(5e7d815)](https://github.com/versatica/JsSIP/commit/5e7d815) Fix. ACK was being replied when not pointing to us. Thanks @saghul * [(1ab6df3)](https://github.com/versatica/JsSIP/commit/1ab6df3) New method JsSIP.NameAddrHeader.parse() which returns a JsSIP.NameAddrHeader instance. * [(a7b69b8)](https://github.com/versatica/JsSIP/commit/a7b69b8) Use a random user in the UA's contact. * [(f67872b)](https://github.com/versatica/JsSIP/commit/f67872b) Extend the use of the 'options' argument * [(360c946)](https://github.com/versatica/JsSIP/commit/360c946) Test units for URI and NameAddrHeader classes. * [(826ce12)](https://github.com/versatica/JsSIP/commit/826ce12) Improvements and some bug fixes in URI and NameAddrHeader classes. * [(e385840)](https://github.com/versatica/JsSIP/commit/e385840) Make JsSIP.URI and JsSIP.NameAddrHeader more robust. * [(b0603e3)](https://github.com/versatica/JsSIP/commit/b0603e3) Separate qunitjs tests with and without WebRTC. Make "grunt test" to run "grunt testNoWebRTC". * [(659c331)](https://github.com/versatica/JsSIP/commit/659c331) New way to handle InvalidTargetErorr and WebRtcNotSupportedError * [(d3bc91a)](https://github.com/versatica/JsSIP/commit/d3bc91a) Don't run qunit task by default (instead require "grunt test"). * [(e593396)](https://github.com/versatica/JsSIP/commit/e593396) Added qunitjs based test unit (for now a parser test) and integrate it in grunt.js. * [(da58bff)](https://github.com/versatica/JsSIP/commit/da58bff) Enhance URI and NameAddrHeader * [(df6dd98)](https://github.com/versatica/JsSIP/commit/df6dd98) Automate qunit tests into grunt process * [(babc331)](https://github.com/versatica/JsSIP/commit/babc331) Fix. Accept multiple headers with same hader name in SIP URI. * [(716d164)](https://github.com/versatica/JsSIP/commit/716d164) Pass full multi-header header fields to the grammar * [(2e18a6b)](https://github.com/versatica/JsSIP/commit/2e18a6b) Fix contact match in 200 response to REGISTER * [(3f7b02f)](https://github.com/versatica/JsSIP/commit/3f7b02f) Fix stun_host grammar rule. * [(7867baf)](https://github.com/versatica/JsSIP/commit/7867baf) Allow using a JsSIP.URI instance everywhere specting a destination. * [(a370c78)](https://github.com/versatica/JsSIP/commit/a370c78) Fix 'maddr' and 'method' URI parameters handling * [(537d2f2)](https://github.com/versatica/JsSIP/commit/537d2f2) Give some love to "console.log|warn|info" messages missing the JsSIP class/module prefix. * [(8cb6963)](https://github.com/versatica/JsSIP/commit/8cb6963) In case null, emptry string, undefined or NaN is passed as parameter value then its default value is applied. Also print to console the processed value of all the parameters after validating them. * [(f306d3c)](https://github.com/versatica/JsSIP/commit/f306d3c) hack_ip_in_contact now generates a IP in the range of Test-Net as stated in RFC 5735 (192.0.2.0/24). * [(528d989)](https://github.com/versatica/JsSIP/commit/528d989) Add DTMF feature * [(777a48f)](https://github.com/versatica/JsSIP/commit/777a48f) Change API methods to make use of generic 'options' argument * [(3a6971d)](https://github.com/versatica/JsSIP/commit/3a6971d) Fix #26. Fire 'unregistered' event correctly. * [(5616837)](https://github.com/versatica/JsSIP/commit/5616837) Rename 'outbound_proxy_set' parameter by 'ws_servers' * [(37fe9f4)](https://github.com/versatica/JsSIP/commit/37fe9f4) Fix #54. Allow configuration.uri username start with 'sip' * [(a612987)](https://github.com/versatica/JsSIP/commit/a612987) Add 'stun_servers' and 'turn_servers' configuration parameters * [(9fad09b)](https://github.com/versatica/JsSIP/commit/9fad09b) Add JsSIP.URI and JsSIP.NameAddrHeader classes * [(f35376a)](https://github.com/versatica/JsSIP/commit/f35376a) Add 'Content-Length' header to every SIP response * [(3081a21)](https://github.com/versatica/JsSIP/commit/3081a21) Enhance 'generic_param' grammar rule * [(e589002)](https://github.com/versatica/JsSIP/commit/e589002) Fix. Allow case-insentivity in SIP grammar, when corresponds * [(aec55a2)](https://github.com/versatica/JsSIP/commit/aec55a2) Enhance transport error handling * [(d0dbde3)](https://github.com/versatica/JsSIP/commit/d0dbde3) New stun_servers and turn_servers parameters * [(47cdb66)](https://github.com/versatica/JsSIP/commit/47cdb66) Add 'extraHeaders' parameter to UA.register() and UA.unregister() methods * [(69fbdbd)](https://github.com/versatica/JsSIP/commit/69fbdbd) Enhance in-dialog request management * [(da23790)](https://github.com/versatica/JsSIP/commit/da23790) Fix 'UTF8-NONASCII' grammar rule * [(3f86b94)](https://github.com/versatica/JsSIP/commit/3f86b94) Require a single grunt task for packaging * [(81595be)](https://github.com/versatica/JsSIP/commit/81595be) Add some log lines into sanity check code for clarity * [(a8a7627)](https://github.com/versatica/JsSIP/commit/a8a7627) Enhance RTCPeerconnection SDP error handling. Thanks @ibc for reporting. * [(3acc474)](https://github.com/versatica/JsSIP/commit/3acc474) Add turn configuration parameters for RTCPeerConnection * [(9fccaf5)](https://github.com/versatica/JsSIP/commit/9fccaf5) Enhance 'boolean' comparison * [(24fcdbb)](https://github.com/versatica/JsSIP/commit/24fcdbb) Make preloaded Route header optional. * [(defeabe)](https://github.com/versatica/JsSIP/commit/defeabe) Automatic connection recovery. * [(a45293b)](https://github.com/versatica/JsSIP/commit/a45293b) Improve reply() method. * [(f05795b)](https://github.com/versatica/JsSIP/commit/f05795b) Fix. Prevent outgoing CANCEL messages from being authenticated * [(5ed6122)](https://github.com/versatica/JsSIP/commit/5ed6122) Update credentials with the new authorization upon 401/407 reception * [(2c9a310)](https://github.com/versatica/JsSIP/commit/2c9a310) Do not allow reject-ing a Message or Session with an incorrect status code * [(35e5874)](https://github.com/versatica/JsSIP/commit/35e5874) Make optional the reason phrase when reply-ing * [(85ca354)](https://github.com/versatica/JsSIP/commit/85ca354) Implement credential reuse * [(351ca06)](https://github.com/versatica/JsSIP/commit/351ca06) Fix Contact header aggregation for incoming messages * [(d6428e7)](https://github.com/versatica/JsSIP/commit/d6428e7) Fire UA 'newMessage' event for incoming MESSAGE requests regardless they are out of dialog or in-dialog. * [(1ab3423)](https://github.com/versatica/JsSIP/commit/1ab3423) Intelligent 'Allow' header field value. Do not set a method in the 'Allow' header field if its corresponding event is not defined or has zero listeners. * [(4e70a25)](https://github.com/versatica/JsSIP/commit/4e70a25) Allow 'text/plain' and 'text/html' content types for incoming SIP MESSAGE Fixed incoming SIP MESSAGE processing when the Content-Type header contains parameters * [(d5f3432)](https://github.com/versatica/JsSIP/commit/d5f3432) Fixed the message header split when a parsing error occurs. Parsing error log enhanced. Version 0.2.1 (released in 2012-11-15) ------------------------------- * [(24e32c0)](https://github.com/versatica/JsSIP/commit/24e32c0d16ff5fcefd2319fc445a59d6fc2bcb59) UA configuration `password` parameter is now optional. * [(ffe7af6)](https://github.com/versatica/JsSIP/commit/ffe7af6276915695af9fd00db281af51fec2714f) Bug fix: UA configuration `display_name` parameter. * [(aa51291)](https://github.com/versatica/JsSIP/commit/aa512913733a4f63af066b0a9e12a8e38f2a5acb) Bug fix: Allows multibyte symbols in UA configuration `display_name` parameter (and require not to write it between double quotes). * [(aa48201)](https://github.com/versatica/JsSIP/commit/aa48201) Bug fix: "cnonce" value value was not being quoted in Digest Authentication (reported by [vf1](https://github.com/vf1)). * [(1ecabf5)](https://github.com/versatica/JsSIP/commit/1ecabf5) Bug fix: Fixed authentication for in-dialog requests (reported by [vf1](https://github.com/vf1)). * [(11c6bb6)](https://github.com/versatica/JsSIP/commit/11c6bb6aeef9de3bf2a339263f620b1caf60d634) Allow receiving WebSocket binary messages (code provided by [vf1](https://github.com/vf1)). * [(0e8c5cf)](https://github.com/versatica/JsSIP/commit/0e8c5cf) Bug fix: Fixed Contact and Record-Route header split (reported by Davide Corda). * [(99243e4)](https://github.com/versatica/JsSIP/commit/99243e4) Fixed BYE and ACK error handling. * [(0c91285)](https://github.com/versatica/JsSIP/commit/0c91285) Fixed failure causes in 'registrationFailed' UA event. Version 0.2.0 (released in 2012-11-01) -------------------------------------- * First stable release with full website and documentation. * Refactored sessions, message and events API. Version 0.1.0 (released in 2012-09-27) -------------------------------------- * First release. No documentation. jssip/Gruntfile.js000066400000000000000000000130661227670521100145140ustar00rootroot00000000000000/*global module:false*/ module.exports = function(grunt) { var srcFiles = [ 'src/JsSIP.js', 'src/LoggerFactory.js', 'src/EventEmitter.js', 'src/Constants.js', 'src/Exceptions.js', 'src/Timers.js', 'src/Transport.js', 'src/Parser.js', 'src/SIPMessage.js', 'src/URI.js', 'src/NameAddrHeader.js', 'src/Transactions.js', 'src/Dialogs.js', 'src/RequestSender.js', 'src/Registrator.js', 'src/RTCSession.js', 'src/Message.js', 'src/UA.js', 'src/Utils.js', 'src/SanityCheck.js', 'src/DigestAuthentication.js', 'src/WebRTC.js', 'src/tail.js', ]; // Project configuration. grunt.initConfig({ pkg: grunt.file.readJSON('package.json'), meta: { banner: '\ /*\n\ * JsSIP version <%= pkg.version %>\n\ * Copyright (c) 2012-<%= grunt.template.today("yyyy") %> José Luis Millán - Versatica \n\ * Homepage: http://jssip.net\n\ * License: http://jssip.net/license\n\ */\n\n\n' }, concat: { dist: { src: srcFiles, dest: 'dist/<%= pkg.name %>-<%= pkg.version %>.js', options: { banner: '<%= meta.banner %>', separator: '\n\n', process: true }, nonull: true }, post_dist: { src: [ 'dist/<%= pkg.name %>-<%= pkg.version %>.js', 'src/Grammar/dist/Grammar.js' ], dest: 'dist/<%= pkg.name %>-<%= pkg.version %>.js', nonull: true }, devel: { src: srcFiles, dest: 'dist/<%= pkg.name %>-devel.js', options: { banner: '<%= meta.banner %>', separator: '\n\n', process: true }, nonull: true }, post_devel: { src: [ 'dist/<%= pkg.name %>-devel.js', 'src/Grammar/dist/Grammar.js' ], dest: 'dist/<%= pkg.name %>-devel.js', nonull: true } }, includereplace: { dist: { files: { 'dist': 'dist/<%= pkg.name %>-<%= pkg.version %>.js' } }, devel: { files: { 'dist': 'dist/<%= pkg.name %>-devel.js' } } }, jshint: { dist: 'dist/<%= pkg.name %>-<%= pkg.version %>.js', devel: 'dist/<%= pkg.name %>-devel.js', options: { browser: true, curly: true, eqeqeq: true, immed: true, latedef: true, newcap: false, noarg: true, sub: true, undef: true, boss: true, eqnull: true, onecase:true, unused: true, supernew: true, globals: { module: true, define: true } } }, uglify: { dist: { files: { 'dist/<%= pkg.name %>-<%= pkg.version %>.min.js': ['dist/<%= pkg.name %>-<%= pkg.version %>.js'] } }, options: { banner: '<%= meta.banner %>' } }, qunit: { noWebRTC: ['test/run-TestNoWebRTC.html'] } }); // Load Grunt plugins. grunt.loadNpmTasks('grunt-contrib-concat'); grunt.loadNpmTasks('grunt-include-replace'); grunt.loadNpmTasks('grunt-contrib-uglify'); grunt.loadNpmTasks('grunt-contrib-jshint'); grunt.loadNpmTasks('grunt-contrib-qunit'); // Task for building JsSIP 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 ...'); child = exec('if [ -x "./node_modules/pegjs/bin/pegjs" ] ; then PEGJS="./node_modules/pegjs/bin/pegjs"; else PEGJS="pegjs" ; fi && $PEGJS -e JsSIP.Grammar src/Grammar/src/Grammar.pegjs src/Grammar/dist/Grammar.js', function(error, stdout, stderr) { if (error) { sys.print('ERROR: ' + stderr); done(false); // Tell grunt that async task has failed. } console.log('OK'); // Then modify the generated Grammar.js file with custom changes. console.log('"grammar" task: applying custom changes to Grammar.js ...'); var fs = require('fs'); var grammar = fs.readFileSync('src/Grammar/dist/Grammar.js').toString(); var modified_grammar = grammar.replace(/throw new this\.SyntaxError\(([\s\S]*?)\);([\s\S]*?)}([\s\S]*?)return result;/, 'new this.SyntaxError($1);\n return -1;$2}$3return data;'); fs.writeFileSync('src/Grammar/dist/Grammar.js', modified_grammar); console.log('OK'); done(); // Tell grunt that async task has succeeded. }); }); // Task for building jssip-devel.js (uncompressed), jssip-X.Y.Z.js (uncompressed) // and jssip-X.Y.Z.min.js (minified). // Both jssip-devel.js and jssip-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']); // Task for building jssip-devel.js (uncompressed). grunt.registerTask('devel', ['concat:devel', 'includereplace:devel', 'jshint:devel', 'concat:post_devel']); // Test tasks. grunt.registerTask('testNoWebRTC', ['qunit:noWebRTC']); grunt.registerTask('test', ['testNoWebRTC']); // Travis CI task. // Doc: http://manuel.manuelles.nl/blog/2012/06/22/integrate-travis-ci-into-grunt/ grunt.registerTask('travis', ['grammar', 'devel', 'test']); // Default task is an alias for 'build'. grunt.registerTask('default', ['build']); }; jssip/LICENSE000066400000000000000000000022541227670521100132210ustar00rootroot00000000000000Name: JsSIP Maintainer: José Luis Millán Copyright (c) 2012-2013 José Luis Millán - Versatica License: The MIT License Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated documentation files (the "Software"), to deal in the Software without restriction, including without limitation the rights to use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of the Software, and to permit persons to whom the Software is furnished to do so, subject to the following conditions: The above copyright notice and this permission notice shall be included in all copies or substantial portions of the Software. THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. jssip/Makefile000066400000000000000000000053131227670521100136530ustar00rootroot00000000000000#!/usr/bin/make -f ##################### configurable stuff ################################### # # Tools we require # # UglifyJS UGLIFY ?= uglifyjs # # PEG.js PEGJS ?= pegjs # # Google Closure Compiler (minify) MINIFY_GCC ?= closure-compiler # hack for Debian bug 705565: #MINIFY_GCC ?= java -classpath /usr/share/java/closure-compiler.jar:/usr/share/java/args4j.jar:/usr/share/java/guava.jar:/usr/share/java/json.jar com.google.javascript.jscomp.CommandLineRunner ############################################################################# # # Version we are building VERSION = $(shell cat package.json | grep version.: | cut -f4 -d'"') # Sources SOURCES = $(shell cat Gruntfile.js | grep 'src/.*js' | grep -v Grammar | tr -d " ',") all: normal minified @echo JsSIP version = $(VERSION) normal: dist/JsSIP-$(VERSION).js minified: dist/JsSIP-$(VERSION).min.js # # Compile and minify the SIP grammar # src/Grammar/dist/Grammar.js: src/Grammar/src/Grammar.pegjs $(PEGJS) -e JsSIP.Grammar src/Grammar/src/Grammar.pegjs src/Grammar/dist/Grammar.js perl -0777 -pi -e 's/throw new this\.SyntaxError\(([\s\S]*?)\);([\s\S]*?)}([\s\S]*?)return result;/new this.SyntaxError(\1);\n return -1;\2}\3return data;/' src/Grammar/dist/Grammar.js src/Grammar/dist/Grammar.min.js: src/Grammar/dist/Grammar.js $(MINIFY_GCC) --js src/Grammar/dist/Grammar.js --js_output_file src/Grammar/dist/Grammar.min.js # # Do the concate and replacement stuff # tmp/JsSIP-$(VERSION).js.part: $(SOURCES) mkdir -p tmp cat $(SOURCES) \ | sed -e '/^var Request .*= /r src/RTCSession/Request.js' \ | sed -e '/^var RequestSender.*= /r src/Dialog/RequestSender.js' \ | sed -e '/^var RTCMediaHandler.*= /r src/RTCSession/RTCMediaHandler.js' \ | sed -e '/^var DTMF.*= /r src/RTCSession/DTMF.js' \ | sed -e '/^var Logger = /r src/Logger.js' \ | sed -e 's/@@include.*$$//' \ > tmp/JsSIP-$(VERSION).js.part # | sed -e '$$a\\window.JsSIP = JsSIP;\n}(window));' \ # > tmp/JsSIP-$(VERSION).js.part dist/JsSIP-$(VERSION).js: src/Grammar/dist/Grammar.js tmp/JsSIP-$(VERSION).js.part mkdir -p dist cat tmp/JsSIP-$(VERSION).js.part src/Grammar/dist/Grammar.js\ > dist/JsSIP-$(VERSION).js dist/JsSIP-$(VERSION).min.js: src/Grammar/dist/Grammar.min.js tmp/JsSIP-$(VERSION).js.part mkdir -p dist $(UGLIFY) tmp/JsSIP-$(VERSION).js.part > tmp/JsSIP-$(VERSION).min.js.part cat tmp/JsSIP-$(VERSION).min.js.part src/Grammar/dist/Grammar.min.js \ > dist/JsSIP-$(VERSION).min.js clean: -rm -rf tmp dist srcdist: -rm -rf jssip-$(VERSION) mkdir jssip-$(VERSION) cp -r AUTHORS.md BUILDING.md CHANGELOG.md Gruntfile.js LICENSE Makefile package.json README.md src test THANKS.md jssip-$(VERSION) tar czf jssip-$(VERSION).tar.gz jssip-$(VERSION) jssip/README.md000066400000000000000000000061211227670521100134700ustar00rootroot00000000000000 [![Build Status](https://travis-ci.org/versatica/JsSIP.png?branch=master)](https://travis-ci.org/versatica/JsSIP) ## Overview * SIP over [WebSocket](http://jssip.net/documentation/misc/sip_websocket/) (use real SIP in your web apps) * Audio/video calls ([WebRTC](http://jssip.net/documentation/misc/webrtc)), instant messaging and presence * Lightweight! (~140KB) * Easy to use and powerful user API * Works with OverSIP, Kamailio, Asterisk and repro (reSIProcate) servers ([more info](http://jssip.net/documentation/misc/interoperability)) * Written by the authors of [draft-ietf-sipcore-sip-websocket](http://tools.ietf.org/html/draft-ietf-sipcore-sip-websocket) and [OverSIP](http://www.oversip.net) ## Getting Started The following simple JavaScript code creates a JsSIP User Agent instance and makes a SIP call: ```javascript // Create our JsSIP instance and run it: var configuration = { 'ws_servers': 'ws://sip-ws.example.com', 'uri': 'sip:alice@example.com', 'password': 'superpassword' }; var coolPhone = new JsSIP.UA(configuration); coolPhone.start(); // Make an audio/video call: // HTML5