Comments (8)
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.
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.
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.
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.
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.
In fact it is not an issue but a design task.
from jssip.
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.
Issue defined in the initial note has been solved 4e70a25
from jssip.
Related Issues (20)
- _createLocalDescription answer/connect delay greater than 10 seconds HOT 2
- Unable to unhold call in version 3.9.1 HOT 2
- RTCSession.isReadyToReOffer method is undefined HOT 2
- I have no problem when I call, but I report an error when I answer a call. The following is the picture HOT 3
- Ask you questions
- Trying to use jssip on react-native 0.70.7 HOT 2
- No INVITE sent if mediaConstraints: { audio: false, video: false } HOT 1
- JsSIP (Failed / Ended) Event not fired when call ended by remote party without receive HOT 3
- [TypeError: null is not an object (evaluating 'constraints.optional')] when call sipUa.call HOT 1
- how use https://tryit.jssip.net/ this not work
- socket: WebSocketInterface, error: true, code: 1006, reason: ''当频繁刷新去连接信令服务时,收到一个新的来电,去接听这个通话,而此时信令服务正好断开,导致无法正常接听,如何规避这个问题呢? HOT 2
- refer of 2 incoming call failed
- Before answering a phone call, the connection may occasionally be disconnected, making it impossible to answer
- Subscribe sending time 0 on re-subsribtion
- Demo Down? HOT 1
- Change type of request in OutgoingRTCSessionEvent to OutgoingRequest HOT 2
- 'hold' and 'unhold' event listener are not triggered for the remotes hold/unhold events HOT 1
- UA.call or any other method not working as expected with VueJS HOT 1
- Allow set JSSIP.UA extra_headers in runtime HOT 2
- resetLocalMedia is declared but not implemented HOT 1
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
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.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from jssip.