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)
- JsSIP Logger Override Functionality Not Working As Expected in v3.7.7 HOT 1
- UnMute Call HOT 2
- How not to get microphone permission HOT 1
- For SIP server Account Register Working? HOT 2
- Abnormal session cancellation method under race condition
- Type definition errors in 3.10.0 HOT 1
- Error when getting video track status on Firefox
- Play audio or tone to remote user. HOT 2
- The new JsSIP.UA(configuration).call method does not return the status after execution
- import JsSIP from "jssip"; 打印JsSIP undefined HOT 2
- Error 'setLocalDescription' on Chrome HOT 1
- BYE: Request-URI does not point to us HOT 34
- Incorrect SDP a=sendrecv in firefox HOT 7
- I want to send and Receive message using JSSIP
- Sending a silent stream on latest Chrome HOT 1
- Error when trying to change the microphone during a call HOT 1
- Add custom header JsSIP - Asterisk HOT 1
- JsSIP processing re-INVITE HOT 1
- SDP is cut off between recieving 200 OK and the sdp event being emitted HOT 2
- On iOS, navigator.mediaDevices is `undefined` unless page is served in a secure context, but Errors are swallowed
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.