Giter Site home page Giter Site logo

WebSocket w/ binary frame about jssip HOT 4 CLOSED

vf1 avatar vf1 commented on September 17, 2024
WebSocket w/ binary frame

from jssip.

Comments (4)

ibc avatar ibc commented on September 17, 2024

Right, for now JsSIP ignores WebSocket binary messages. Does your suggested code convert the received binary data into a real JS string that can be later parsed by JsSIP SIP parser?

BTW when JavaScript receives a WS "binary" message it calls onmessage(data), and such data is:

  • Blob (in case WebSocket binaryType attribute is set to "blob", which is the default value).
  • ArrayBuffer (in case WebSocket binaryType attribute is set to "arraybuffer").

It seems that using ArrayBuffer is more efficient in case the data will be managed in memory (rather than storing in disk).

Which mode should JsSIP use for binary data? which one will work with your suggested code?

Thanks a lot!

from jssip.

vf1 avatar vf1 commented on September 17, 2024

Yes, it is convert. But I did not test it w/ non-ascii symbols.

I did not change anything else. But connect function already has mode selection.

  /**
  * Connect socket.
  */
  connect: function() {
    var transport = this;

    ....

    this.ws.binaryType = 'arraybuffer';

PS. Actually, I am not js developer.

from jssip.

ibc avatar ibc commented on September 17, 2024

Ok, I will test it by sending a WebSocket binary message to JsSIP after implementing your code, let me sometime to do it. Thanks a lot.

from jssip.

ibc avatar ibc commented on September 17, 2024

It works, commited. Thanks a lot!

from jssip.

Related Issues (20)

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.