Comments (5)
This issue is not relayted to the message content. The sipml5 does not accept
websocket.opcode == Text frame, but...
http://tools.ietf.org/html/draft-ibc-sipcore-sip-websocket-02#section-4.2
WebSocket messages are carried on top of WebSocket UTF-8 text frames
or binary frames. The SIP protocol [RFC3261] allows both text and
binary bodies in SIP messages. Therefore SIP WebSocket Clients and
SIP WebSocket Servers MUST accept both WebSocket text and binary
frames.
Original comment by [email protected]
on 16 May 2012 at 8:46
from sipml5.
Possible solution:
function __tsip_transport_ws_onmessage_for_buffer(data) {
var o_ragel_state = tsk_ragel_state_create();
tsk_ragel_state_init_ai(o_ragel_state, data);
var o_message = tsip_message.prototype.Parse(o_ragel_state, true);
if (o_message) {
//--console.debug("recv=%s", o_message.toString());
o_message.o_socket = this;
return this.o_transport.get_layer().handle_incoming_message(o_message);
}
else {
console.error("Failed to parse message: %s", data);
return -1;
}
}
function __tsip_transport_ws_onmessage(evt) {
console.debug("__tsip_transport_ws_onmessage");
if(typeof(evt.data) == 'string') {
var bb = new (window.MozBlobBuilder || window.WebKitBlobBuilder || window.BlobBuilder)();
bb.append(evt.data);
var f = new FileReader(bb.getBlob());
f.websocket = this;
f.onload = function(e) {
__tsip_transport_ws_onmessage_for_buffer.call(f.websocket, e.target.result);
}
f.readAsArrayBuffer(bb.getBlob());
}
else {
return __tsip_transport_ws_onmessage_for_buffer(evt.data);
}
}
Original comment by [email protected]
on 16 May 2012 at 10:12
from sipml5.
The problem with "DOMString" is that SIP message will not be able to contain
binary data while ArrayBuffer can contain both.
You don't need to write a new function. Try to change the ragel initializer
from:
tsk_ragel_state_init_ai(o_ragel_state, data);
to:
tsk_ragel_state_init_str(o_ragel_state, data);
Original comment by [email protected]
on 16 May 2012 at 11:09
- Changed state: Accepted
from sipml5.
>The problem with "DOMString" is that SIP message will not be able to contain
binary
But sipml5 sends text blob itself. :)
>Try to change the ragel initializer from
Yes, it works! Thank you. Will you add it to project?
if(typeof(evt.data) == 'string')
tsk_ragel_state_init_str(o_ragel_state, evt.data);
else
tsk_ragel_state_init_ai(o_ragel_state, evt.data);
Original comment by [email protected]
on 17 May 2012 at 8:24
from sipml5.
Fixed by r54
Original comment by [email protected]
on 17 May 2012 at 9:51
- Changed state: Fixed
from sipml5.
Related Issues (20)
- Called in wrong state: STATE_INPROGRESS HOT 10
- startBfcpShare not working
- Content length for SIP INFO packets is incorrect in latest release HOT 1
- Firefox ICE resolution to incorrect 0.0.0.0 address HOT 2
- Video stream doesnt add in SipML5
- Export to GitHub
- Available on main package managers
- sipml5 unable to play remote audio HOT 2
- No early audio in outgoing sipml call to an extension. HOT 2
- Parameters send to Event Listener Function HOT 2
- Outbound call hangs up after 1 minute with FreeSwitch Session-Expire
- Problem in BYE send from SIPML5 - Webrtc2sip (Version 2.6.0)
- Temporary failure in name resolution
- Call.info() result is logged to console instead of given to user HOT 1
- One way video, any browser, webrtc2sip and Asterisk to softphone HOT 2
- call disconnection in api version SIPML5 API version = 1.5.230
- Caller Hangup loud buzzing Chrome 43 and above
- Handle mediastream deprecations
- 'SIPml.Stack.newSession' or 'SIPml.Session.Configuration' does not appear to be documented correctly
- on the same computer demo works with FireFox and doesn't work with Chrome
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 sipml5.