添加链接
link管理
链接快照平台
  • 输入网页链接,自动生成快照
  • 标签化管理网页链接
相关文章推荐
追风的小笼包  ·  Running Your Own ...·  21 小时前    · 
不爱学习的野马  ·  Best thing about ...·  昨天    · 
伤情的消防车  ·  Win11 Dev Build ...·  昨天    · 
俊秀的鼠标垫  ·  dev-cpp/gtkmm – ...·  3 天前    · 
爱笑的汉堡包  ·  Android蓝牙——HID开发·  3 天前    · 
有腹肌的小熊猫  ·  土屋 政雄 (Masao ...·  2 周前    · 
傻傻的凳子  ·  步非烟扶她amsr / dtshot.com·  2 月前    · 
咆哮的木瓜  ·  inno setup ...·  11 月前    · 
Post by Vipul Rastogi
Anybody tried asterisk connecting to Socket.io server as websocket client
? I am not getting websocket established.
See below error, after successful 101 Switching Protocols
res_http_websocket.c:576 __ast_websocket_read: WebSocket unknown opcode 5
--
_____________________________________________________________________
-- Bandwidth and Colocation Provided by http://www.api-digital.com --
asterisk-dev mailing list
http://lists.digium.com/mailman/listinfo/asterisk-dev
Hi Vipul,

Socket.io won't work with the websocket module in Asterisk as Socket.io is
a layer on top of websockets/xhr polling/flash sockets.

Socket.io actually makes HTTP requests to the host you're trying to connect
to and the host needs to understand the "socket.io protocol" as such, this
sets up a socket.io session, gives back a list of available transports etc,
then with that response, the client sends a websocket request (or whatever
transport you select) with the socket.io sessionId etc.

So you can see why the normal websocket module in Asterisk can't deal with
this. You would need a socket.io module in Asterisk, which does exist, the
Respoke team use socket.io and so our Respoke channel driver uses the
socket.io transport -
https://github.com/respoke/chan_respoke/blob/master/include/asterisk/res_socket_io.h,
this module is released under GPLv2 Licensing.

Hope this helps you

Dan
Thanks Dan. Do you have any example file to suggest how to use it. I am
looking for code lines which I can use in our app to connect, send and
receive from Nodejs applications.

thanks in advance !
On Wed, Jan 21, 2015 at 2:36 AM, Vipul Rastogi <
Post by Vipul Rastogi
Anybody tried asterisk connecting to Socket.io server as websocket client
? I am not getting websocket established.
See below error, after successful 101 Switching Protocols
res_http_websocket.c:576 __ast_websocket_read: WebSocket unknown opcode 5
--
_____________________________________________________________________
-- Bandwidth and Colocation Provided by http://www.api-digital.com --
asterisk-dev mailing list
http://lists.digium.com/mailman/listinfo/asterisk-dev
Hi Vipul,
Socket.io won't work with the websocket module in Asterisk as Socket.io is
a layer on top of websockets/xhr polling/flash sockets.
Socket.io actually makes HTTP requests to the host you're trying to
connect to and the host needs to understand the "socket.io protocol" as
such, this sets up a socket.io session, gives back a list of available
transports etc, then with that response, the client sends a websocket
request (or whatever transport you select) with the socket.io sessionId
etc.
So you can see why the normal websocket module in Asterisk can't deal with
this. You would need a socket.io module in Asterisk, which does exist,
the Respoke team use socket.io and so our Respoke channel driver uses the
socket.io transport -
https://github.com/respoke/chan_respoke/blob/master/include/asterisk/res_socket_io.h,
this module is released under GPLv2 Licensing.
Hope this helps you
Dan
--
_____________________________________________________________________
-- Bandwidth and Colocation Provided by http://www.api-digital.com --
asterisk-dev mailing list
http://lists.digium.com/mailman/listinfo/asterisk-dev
On Thu, Jan 29, 2015 at 8:17 PM, Vipul Rastogi
Post by Vipul Rastogi
Thanks Dan. Do you have any example file to suggest how to use it. I am
looking for code lines which I can use in our app to connect, send and
receive from Nodejs applications.
As Dan already pointed out, it is a module in an external repo, and is
not currently part of Asterisk. If you wanted to integrate a socket.io
transport with some API - say, for example, ARI - you'd have to do
that work yourself.

As it is, ARI does use WebSockets, and can be integrated quite well
with node.js already. If you're interested, a client library exists
for that purpose:

https://github.com/asterisk/node-ari-client
--
Matthew Jordan
Digium, Inc. | Engineering Manager
445 Jan Davis Drive NW - Huntsville, AL 35806 - USA
Check us out at: http://digium.com & http://asterisk.org
--
_____________________________________________________________________
-- Bandwidth and Colocation Provided by http://www.api-digital.com --

asterisk-dev mailing list
To UNSUBSCRIBE or update options visit:
http://lists.digium.com/mailman/listinfo/asterisk-dev
Today, I got Asterisk working with respoke channel code as well but on
startup Asterisk connects (register=yes) with node.js server with HTTP GET
which does not have following headers...
Connection: Upgrade
Upgrade: websocket

hence http connection is not upgraded. Please suggest what to do. Attaching
my respoke.conf file.
Post by Matthew Jordan
On Thu, Jan 29, 2015 at 8:17 PM, Vipul Rastogi
Post by Vipul Rastogi
Thanks Dan. Do you have any example file to suggest how to use it. I am
looking for code lines which I can use in our app to connect, send and
receive from Nodejs applications.
As Dan already pointed out, it is a module in an external repo, and is
not currently part of Asterisk. If you wanted to integrate a socket.io
transport with some API - say, for example, ARI - you'd have to do
that work yourself.
As it is, ARI does use WebSockets, and can be integrated quite well
with node.js already. If you're interested, a client library exists
https://github.com/asterisk/node-ari-client
--
Matthew Jordan
Digium, Inc. | Engineering Manager
445 Jan Davis Drive NW - Huntsville, AL 35806 - USA
Check us out at: http://digium.com & http://asterisk.org
--
_____________________________________________________________________
-- Bandwidth and Colocation Provided by http://www.api-digital.com --
asterisk-dev mailing list
http://lists.digium.com/mailman/listinfo/asterisk-dev
Vipul,

I found the exact same thing. Was unable to make it work so I use WS (
https://github.com/einaros/ws) for communicating with Asterisk. Works like
a champ.

I assume you're using node.js. If so, it can be installed with npm. And,
it doesn't interfere with socket.io which I use for communicating with the
client. Why? Because I had already started down that road and didn't want
to change. I use rooms in socket.io.

Phil Mickelson
Post by Vipul Rastogi
Anybody tried asterisk connecting to Socket.io server as websocket client
? I am not getting websocket established.
See below error, after successful 101 Switching Protocols
res_http_websocket.c:576 __ast_websocket_read: WebSocket unknown opcode 5
--
_____________________________________________________________________
-- Bandwidth and Colocation Provided by http://www.api-digital.com --
asterisk-dev mailing list
http://lists.digium.com/mailman/listinfo/asterisk-dev