-
Notifications
You must be signed in to change notification settings - Fork 735
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Content-Type check for incoming SIP MESSAGE #20
Comments
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):
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. |
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:
|
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). |
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. |
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? |
In fact it is not an issue but a design task. |
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. |
Issue defined in the initial note has been solved 4e70a25 |
Enhance the content type check for incoming SIP MESSAGES. Nowadays only an exact "text/plain" value is allowed, but not media type parameters.
Also, respond a (415 Unsupported Media Type) if received content is not "text/plain"
The text was updated successfully, but these errors were encountered: