Coder Social home page Coder Social logo

restcomm / webrtcomm Goto Github PK

View Code? Open in Web Editor NEW
18.0 26.0 21.0 2.79 MB

WebRTCComm is a simple high level JavaScript WebRTC framework for Web Developers to add Real Time Communications and IM Capabilities to any website.

Home Page: http://www.restcomm.com/

License: GNU General Public License v3.0

Batchfile 0.34% Shell 0.27% JavaScript 98.69% HTML 0.70%

webrtcomm's Introduction

Try Restcomm Cloud NOW for FREE! Zero download and install required.

All Restcomm docs and downloads are now available at Restcomm.com.

WebRTComm - Add WebRTC to any WebSite

WebRTCComm is a simple high level JavaScript WebRTC Framework for Web Developers to add Real Time Communications and IM Capabilities to any website.

WebRTCComm allows to create Real Time Video, Voice and Instant Messaging Web Applications that can connect together any WebRTC enabled Browser (Chrome, Firefox, ...), SIP enabled devices and legacy phones (Cell Phone, Desktop Phone)

It leverage under the covers the popular JAIN SIP JS (a full Javascript SIP Stack based on JAIN SIP) to interconnect with any SIP Over WebSockets Capable Server allowing to reach any SIP Endpoints or traditional Telecom infrastructure.

webrtcomm's People

Contributors

ammendonca avatar deruelle avatar ivelin avatar jaimecasero avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

webrtcomm's Issues

Introduce CI/CD in webrtcomm

Let's create separate issues for this after we investigate what is needed and see how we 'll split among releases.

One of the impacts is #28

IceServers parameter should use new "urls" format

According to new WebRTC spec (4.2.2 RTCIceServer Type), the name of th e JSON param to pass TURN/STUN server is now called "urls" instead of "url". Firefox is already giving a warning:
"RTCIceServer.url is deprecated! Use urls instead."

This should be fixed sooner or later before browsers remove backwards compatibility

Use version numbering in Webrtcomm library

Right now, a user only has the Olympus version as a lead in the SIP 'User-Agent' string:

User-Agent: TelScale RTM Olympus/1.0.0

We should automate the generation of an auto-increasing version number in CI/CD and make sure we can easily see it in the JS logs or SIP requests (ideally the User-Agent should show both Olympus + SDK version)

JainSip + WebRTComm to WEBRTC2SIP GW of Doubango : pb with Firefox

Hello,

I am working on a WebRTC project that uses Jain-sip and WebRTComm libraries to communicate with legacy network through a WebRTC2SIP Gateway from Doubango (open source).

All works well with Chrome but it doesn't work at all with Firefox (I made test with FF 24 or 33.0.2).
The SDP in the INVITE is quite strange on Firefox and the gateway rejects it (it doesn't transmit it on the SIP side).

Did you make similar tests of jain-sip/WebRTComm with Doubango WebRTC2Sip gateway or did you ever face such problems with Firefox ?

Attached : the INVITE with Chrome 38 and the one with FF 33.0.2

Thanks

Xavier

Implement on-demand getStats()

Right now getStats() are collected and returned at the end of the call, but some apps might be interested in retrieving stats during the call, and/or in intervals

In logs also print out an identifier to correlate logs

This is a big problem when investigating issues in load tests where the SIP traffic is too complex to follow.

I think we could use Call-Id that exists both in REGISTER and INVITE methods.

This is mainly for jain-sip-js, but maybe we could do that in webrtcomm connectors as well.

Add kbps metric for getStats for Chrome as well

Right now only Firefox provides one out of the box. We just need to divide the total number of bytes with the duration of the call in seconds. Actually we might have to do that for FF as well since it sometimes doesn't work well

Add new event type for issues that occur while on call

Right now we only have WebRTCommCallEventListenerInterface.prototype.onWebRTCommCallOpenErrorEvent which is about errors while we are connecting. We don't have a way to notify for error while connected. Let's introduce: WebRTCommCallEventListenerInterface.prototype.onWebRTCommCallErrorEvent for that

CANCELing a call leads to timeout error on callee side

on callee side of the call, after a call has been cancelled and the timeout period is over, an error can be seen on the JS console

PrivateJainSipClientConnector:processTimeout(): catched exception:TypeError: Cannot call method 'getDialog' of null WebRTComm.js:1904
PrivateJainSipClientConnector.processTimeout WebRTComm.js:1904
EventScanner.deliverEvent jain-sip.js:29791
SipProviderImpl.handleEvent jain-sip.js:31000
SipProviderImpl.transactionErrorEvent jain-sip.js:31543
SIPTransaction.raiseErrorEvent jain-sip.js:27725
SIPServerTransaction.fireTimeoutTimer jain-sip.js:29066
SIPTransaction.fireTimer jain-sip.js:27645
(anonymous function)

However, functionally everything keeps working all right

HTML5/WebRTComm.js==>MMS on WSS: SSLException: Received fatal alert: protocol_version

Hello all !!

Given the new requirement that browsers no longer support voice/video over insecure origine(which is taking us we the developers to redo/undo/goback since none of the test environment workarounds is practical in A distributed environment),I have tried to switch to https and wss and I have configured MMS connector with the following.I am running a converged app with two tomcat instances:
1-Apache Tomcat v8.0 at localhost for the app embeding WebRTComm framework( WebRTComm.js and jain-sip.js etc..).https is working perfect in browser and in code for the app.
2-Mobicent Apache Tomcat v7.0 at localhost for the sipservlet for signalling and other need pre-session requirements.WSS is causing trouble at the server with no return from handshake.
this is the connector in Mobicent Apache Tomcat v7.0.
<Connector SSLEnabled="true"
URIEncoding="UTF-8"
acceptCount="200"
clientAuth="false"
compressableMimeType="text/html,text/xml,text/plain"
compression="off"
compressionMinSize="2048"
connectionUploadTimeout="120000"
disableUploadTimeout="true"
enableLookups="false"
keystoreFile=":\Developement.....\ServerTrustStore\truststore.jks" // wonder why relative path(conf/ServerTrustStore\truststore.jks) is resolved but throw FileNoFoundExc in particular case.Any idea?
keystorePass="xxxxxx"
keyAlias="clientselfsigned"
maxKeepAliveRequests="200"
maxThreads="250"
maxSpareThreads="75"
minSpareThreads="25"
maxHttpHeaderSize="8192"
port="8443"
protocol="org.apache.coyote.http11.Http11NioProtocol"
scheme="https"
secure="true"
sslEnabledProtocols="TLSv1.2,TLSv1.1,TLSv1,SSLv3,SSLv2Hello"
sslProtocol="TLS"
truststorePass="xxxxxx"
truststoreType="jks"
truststorefile="D:\Developement.....\ServerTrustStore\truststore.jks" // wonder why relative path(conf/ServerTrustStore\truststore.jks) is resolved but throw FileNoFoundExc in particular case.Any idea?
/>
and this is the connector in Apache Tomcat v8.0 for the web app:

Both configured my sip-stack and eclipse lunch configuration(run/debug) with :
gov.nist.javax.sip.TLS_CLIENT_AUTH_TYPE=Disabled

javax.net.ssl.keyStore="D:\Developement\Projects\Sources\Pending\security\ServerKeyStore\rootingo.jks"

javax.net.ssl.trustStore="D:\Developement\Projects\Sources\Pending\security\ServerKeyStore\rootingo.jks"

javax.net.ssl.trustStorePassword=%sxp1#calculog#

javax.net.ssl.keyStorePassword=%sxp1#calculog#

javax.net.ssl.trustStoreType=JKS
gov.nist.javax.sip.TLS_CLIENT_PROTOCOLS=TLSv1.2,TLSv1.1,TLSv1,SSLv3,SSLv2Hello

gov.nist.javax.sip.MAX_MESSAGE_SIZE=1048576

javax.net.debug=ssl
.
I have also created the necessary keystore and clien truststore as can be seen above.
I have tried a variation of TLSv1.2,TLSv1.1,TLSv1 and see that the client(jain-sip.js) and MMS are both hapy with TLSv1.2. see ClientHello, TLSv1.2 and ServerHello, TLSv1.2 as below:
%% Initialized: [Session-13, SSL_NULL_WITH_NULL_NULL]
%% Negotiating: [Session-13, TLS_ECDHE_RSA_WITH_AES_256_CBC_SHA384]
*** ServerHello, TLSv1.2
and the TLS_ECDHE_RSA_WITH_AES_256_CBC_SHA384 was selected.
So when I click client.hml=>>TelScaleRTMController.js(onClickConnectButtonViewEventHandler)==>>this.webRTCommClient.open(this.webRTCommClientConfiguration);==>RegistrarSIPServlet.java,TLS handshakes succeeds as I can get to my RegistrarSIPServlet.doRegister():
It is here that things go bad:As soon as it executes SipServletResponse.send();,it says:
NioSelector-WSS-172.62.2.10/5082, RECV TLSv1.2 ALERT: fatal, protocol_version
NioSelector-WSS-172.62.2.10/5082, fatal: engine already closed. Rethrowing javax.net.ssl.SSLException: Received fatal alert: protocol_version
NioSelector-WSS-172.62.2.10/5082, fatal: engine already closed. Rethrowing javax.net.ssl.SSLException: Received fatal alert: protocol_version
javax.net.ssl.SSLException: Received fatal alert: protocol_version
.....

Caused by: java.lang.NullPointerException
at gov.nist.javax.sip.stack.SSLStateMachine.unwrap(SSLStateMachine.java:263)
at gov.nist.javax.sip.stack.SSLStateMachine.unwrap(SSLStateMachine.java:198)
at gov.nist.javax.sip.stack.NioTlsWebSocketMessageChannel.addBytes(NioTlsWebSocketMessageChannel.java:215)
at gov.nist.javax.sip.stack.NioTcpMessageChannel.readChannel(NioTcpMessageChannel.java:117)

.....
the sip msg generated and received by the registrar is:
SIP message sent: REGISTER sip:pbx.rootingo.com SIP/2.0
Call-ID: 1451477183409
CSeq: 1 REGISTER
From: sip:[email protected];tag=1451477183429
To: sip:[email protected]
Via: SIP/2.0/WSS XNCrSBbscUch.invalid;branch=z9hG4bK-333430-45dd017fdcbb8f884bf0a78789902ae7;rport
Max-Forwards: 70
User-Agent: RoooterUAv1.0[admin-MOHAMMAD-125-1]-0
Expires: 3600
Allow: INVITE,ACK,BYE,CANCEL,UPDATE,INFO,SUBSCRIBE,NOTIFY,REFER,MESSAGE,OPTIONS
Contact: sip:[email protected];transport=wss
Content-Length: 0

As you can see no SDP is generated as now and this is where we stop.
The client waits to timeout ....

One more,I have restriced to the same domain of my PBX, in my dar as:
INVITE=("project","DAR:From","ORIGINATING","","NO_ROUTE","0","REGEX=From:.sip:.@pbx.domain.com"),("project","DAR:From","TERMINATING","","NO_ROUTE","0","REGEX=From:.sip:.@pbx.domain.com")
MESSAGE=("project","DAR:From","ORIGINATING","","NO_ROUTE","0")
PUBLISH=("project","DAR:From","ORIGINATING","","NO_ROUTE","0")
NOTIFY=("project","DAR:From","ORIGINATING","","NO_ROUTE","0")
REGISTER=("project","DAR:From","ORIGINATING","","NO_ROUTE","0","REGEX=From:.sip:.@pbx.domain.com"),("project","DAR:From","TERMINATING","","NO_ROUTE","0","REGEX=From:.sip:.@pbx.domain.com")
REFER=("project","DAR:From","ORIGINATING","","NO_ROUTE","0")
SUBSCRIBE=("project","DAR:From","ORIGINATING","","NO_ROUTE","0")
OPTIONS=("project","DAR:From","ORIGINATING","","NO_ROUTE","0")

I will very much applreciate your ideas on understanding the problem and the solution.
Thank you !!

Support DTMF for Firefox

PeerConnection.createDTMFSender() doesn't exist for Firefox, so in order to support DTMF for IVR apps we need to use SIP INFO

Seems IceTransports constraint breaks Chrome Beta build

Seems iceTransports constraint is no longer valid.

WebRTCommCall:open():calleePhoneNumber=+1234
WebRTCommCall:open():configuration={"displayName":"Alice Alissys","localMediaStream":{},"audioMediaFlag":true,"videoMediaFlag":false,"messageMediaFlag":false,"audioCodecsFilter":"","videoCodecsFilter":""}
WebRTCommCall:checkConfiguration()
PrivateJainSipCallConnector:open()
PrivateJainSipCallConnector:checkConfiguration()
WebRTCommCall:createPeerConnection()
WebRTCommCall:createPeerConnection():rtcPeerConnectionConfiguration={"iceServers":[{"url":"stun:stun.l.google.com:19302"}]}
WebRTCommCall:createPeerConnection():peerConnectionConstraints=undefined
Unknown constraint named IceTransports rejected
WebRTCommCall:open(): catched exception:NotSupportedError: Failed to construct 'RTCPeerConnection': Unsatisfiable constraint IceTransports
WebRTCommCall:close(), with no media stats
WebRTCommCall:hangup()
PrivateJainSipCallConnector:close(): this.sipCallState=INVITING_INITIAL_STATE
PrivateJainSipCallConnector:resetSipContext()
PrivateJainSipClientConnector:removeSessionConnector(): sipSessionId=1460206588906
WebRTCommCall:onPrivateCallConnectorCallClosedEvent()
WebRTCommClient:call(): catched exception:NotSupportedError: Failed to construct 'RTCPeerConnection': Unsatisfiable constraint IceTransports
Error: Failed to construct 'RTCPeerConnection': Unsatisfiable constraint IceTransports
    at Error (native)
    at new window.RTCPeerConnection (https://tadhack.restcomm.com/olympus/resources/js/adapter/adapter.js:259:14)
    at WebRTCommCall.createRTCPeerConnection (https://tadhack.restcomm.com/olympus/resources/js/mobicents-libs/WebRTComm.js:2999:25)
    at WebRTCommCall.open (https://tadhack.restcomm.com/olympus/resources/js/mobicents-libs/WebRTComm.js:2070:12)
    at WebRTCommClient.call (https://tadhack.restcomm.com/olympus/resources/js/mobicents-libs/WebRTComm.js:4695:22)
    at Scope.$scope.makeCall (https://tadhack.restcomm.com/olympus/resources/js/controllers/room.js:272:41)
    at https://tadhack.restcomm.com/olympus/resources/js/controllers/room.js:258:46
    at Object.fn (https://tadhack.restcomm.com/olympus/resources/js/controllers/room.js:249:11)
    at Scope.$digest (https://tadhack.restcomm.com/olympus/lib/angular/angular.js:14230:29)
    at Scope.$apply (https://tadhack.restcomm.com/olympus/lib/angular/angular.js:14493:24)
TypeError: Cannot read property 'calleePhoneNumber' of undefined
    at room.js:402
    at Scope.$eval (angular.js:14388)
    at Scope.$apply (angular.js:14487)
    at room.js:400
    at Scope.$broadcast (angular.js:14707)
    at onWebRTCommCallOpenErrorEvent (services.js:46)
    at WebRTComm.js:2137

Add custom headers support for incoming calls

And expose them to the App via Device.incoming() callback at connection.parameters['Custom-Headers'] dictionary. Here's some sample content for this dictionary:

{
"X-RestComm-ApiVersion": "2012-04-24",
"X-RestComm-AccountSid": "ACae6e420f425248d6a26948c17a9e2acf",
"X-RestComm-CallSid": "CAe90d9084e282493799612f2e9a586c24"
}

Please note that any SIP header contained in the incoming INVITE that starts with 'X-' is provided in this dictionary.

Inconsistency between Chrome and Firefox in P2P call

Scenario:

  • Bob makes an audio/video call to Alice
  • Alice answers with audio only

In Chrome (49.0.2623.110):

  • Alice doesn't send video to Bob as she should but, she doesn't get video from Bob either, even though Bob initiated an audio/video call (in SDP answer Alice negates the m-video line by using port 0)

In Firefox (45.0.1):

  • Alice doesn't send video to Bob as she should and also get video from Bob (in SDP answer Alice just uses recv-only and doesn't negate the whole stream)

Firefox seems the right thing to do for P2P calls, so we should investigate Chrome

WebRTCom client ==>Asterisk==>WebRTCom client :ICE Iissue breaks call

As a new user of this framework,I have this problem:
I am using Asterisak 13.4.0 pbx,I have been working on a worst-so-far WEB RTC issue for too much longer than I'd actually expected; I am using WebRTComm for my sip client stack and chrome Version 44.0.2403.125 m on both of client boxes as userA and userB resp. I have deployed and set up asterisk for web RTC on a centos 7(x86_64) server runing at "192.168.1.2" with the following sip.conf,extensions.conf,http.conf,rtp.conf:

sip.conf :
[general]
context=guest
localnet=192.168.1.0/255.255.255.0
externrefresh=150
language=en
allowguest=yes
callcounter=yes
allowtransfer=yes
callevents=yes
udpbindaddr=0.0.0.0:5060
transport=udp,ws
limitonpeers=yes
realm=192.168.1.2
nat=force_rport,comedia ;eventhough I am runing everytyhing local.'no' had not effect change
rtcachefriends=yes
disallow=all
allow=alaw
allow=ulaw
allow=gsm
useragent=test-agent

[userA]
host=dynamic
secret=strong pass
context=IncomingRTCCxt
type=friend ;tried user and peer as well
insecure=invite ;helped me avoid 401 auth issue
avpf=yes
dtmf=auto
nat=no
qualify=yes
force_avp=yes
icesupport=yes
encryption=yes
transpport=ws,udp
directmedia=no
disallow=all
allow=alaw
allow=ulaw
allow=gsm
dtlsenable=yes
dtlsverify=no ;tried fingerprint as well
dtlscertfile=/etc/asterisk/keys/asterisk.pem
dtlscafile=/etc/asterisk/keys/ca.crt
dtlsprivatekey=/etc/asterisk/keys/asterisk.pem
dtlssetup=actpass
same for userB (though will be using template later) [userB] ... ;as above

extensions.conf:
exten => userA,1,Dial(SIP/userA,40)
exten => userB,1,Dial(SIP/userB,40)
NOTE: even with:answer(),Playback(hello-world),i get failed to set remote answer sdp...this time answer sdp.but with dial application,it is 'remote offer sdp...'

http.conf:
[general]
enable=yes
bindaddr=0.0.0.0
bindport=8088

rtp.conf:
[general]
rtpstart=10000
rtpend=65000 ;because I realised asterisk was using large ports in my sdp on REGISTER etc..
icesupport=yes ;tried 'true' as well
;stunaddr=stun.l.google.com:19302//disabled to avoid ice connectivity as I am on the internet.

when I call userB from userA, userB rings with the rtp debug: --Executing [userA@IncomingRTCCxt:1] Dial("SIP/userB 0000000","SIP/userA,40") in new stack ==Using SIP/RTP CoS mark 5 ==Called SIP/userB ==SIP/userB-00000001 is ringing

As soon as callee/userB picks up,some endless ICE messages trying to connect to an ice server which is dsiabled at the client (WebRTCom) as null/undefined and at the asterisk side. since I am running all three boxes on my local net I set srvlookup=no,nat=no.I even set localnet=192.168.1.0/255.255.255.0.My realm is 192.168.1.2 defined on both sides (I had also disable stunaddr in rtp.conf too ).this is the latest error:
==chan_sip.c:....ast_sockaddr_resolve:getaddrinfo("xABjhsnyHGS.invalid","null",...):Name or service not known.
==chan_sip.c __setaddress_fromk_contact : invalid host name in contact (can't resolve in dns)'.

The caller keeps ringing and as soon as I pick up,it goes through the ice connection and messages for a while and displays the above messages and the caller keeps calling/ringing and callee hungs up with:local media stream has been ended.both clients are the same WebRTCom instances deployed on the same local server.
Any ideas ?
thanks once again

Expose Twilio compatible 'Client' API

Not sure if this will be implemented as part of this repo or whether we'll introduce a new project that will encapsulate this. Opening this to keep track

Integrate webrtcomm with adapter.js

Primary reason for this is to aid in #32 since the APIs for getStats are still a moving target and different between Chrome and FF but apart from that it's going to help a lot to remove browser idiosyncrasies from webrtcomm code and leave them in adapter.js (https://github.com/webrtc/adapter) that is actively maintained

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.