Giter VIP home page Giter VIP logo

Comments (8)

saghul avatar saghul commented on June 26, 2024

We should deliver all messages to the app. Then the user decides. Now, as for replying 415, we have 2 choices (from the top of my head):

  • Don't reply in the library, let the user to it (accept() and reject(code) methods)
  • Have a way to configure which are the acceptable types in the UA

I like the first approach because it's more flexible and allows for extra checks like the wrapped content type in case CPIM is used.

from jssip.

ibc avatar ibc commented on June 26, 2024

It's like we receive an INVITE and "deliver it to the application on top of OverSIP", leaving the user to deal with WebRTC stuff, IMHO it makes no sense.

JsSIP is a SIP stack and thus must provide a usable API for common tasks as receiving a text message, without forcing the end user (web developer) to deal with Content-Type value.

BTW:

  • If the user defines a function (or functions) for event newMessage (in UA) then execute it and don't reply automatically 200.
  • If not, the JsSIP must reply "something" (maybe 404 since the user does not want to receive MESSAGE requests).

from jssip.

ibc avatar ibc commented on June 26, 2024

BTW this requires a new API for incomming MESSAGES. But a easy API which means don't pass (always) the full body to the high user (imagine passing the "iscomposing" XML body... no please). Anyhow let's discuss such a new API in a new issue (not for 0.2 branch).

from jssip.

saghul avatar saghul commented on June 26, 2024

Please define "text message". It could de anything. text/plain, text/html, text/base64 (not sure if it exists bu anyway). And the best one: message/cpim, which contains a wrapped content type.

JsSIP is a SIP stack, not an IM client.

Yes, we need to pass the iscomposing body to the user. BUT, we can build another API on top of this, which just deals with IM, so it's hidden and only available to those who really want to.

from jssip.

ibc avatar ibc commented on June 26, 2024

If defining what a "text message" is is so hard then we have chosen the wrong protocol ;)

Not 100% sure, but IMHO it would make sense some API that calls a function by passing the "body" of the message and some other parameter "type" which could be "text", "html" or "other".

In the case of "iscomposing" we need a separate callback (IMHO).

Is it ok to discuss this subject in a separate issue?

from jssip.

jmillan avatar jmillan commented on June 26, 2024

In fact it is not an issue but a design task.

from jssip.

saghul avatar saghul commented on June 26, 2024

Sure, let's discuss it as a design issue. Since it will probably require API changes, I'd go for applying the suggested fix on 0.2 branch and update the docs saying that only text/plain is supported right now.

from jssip.

jmillan avatar jmillan commented on June 26, 2024

Issue defined in the initial note has been solved 4e70a25

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.