Skip to content

Instantly share code, notes, and snippets.

View lminiero's full-sized avatar

Lorenzo Miniero lminiero

View GitHub Profile
const fs = require('fs');
const yaml = require('yaml');
// Read lifeograph diary
var lifeograph = fs.readFileSync('activities.diary.txt', 'utf8'), rednotebook = {};
var lines = lifeograph.split('\n');
// Iterate on lifeograph diary lines
var item = null, content = [], newDate = 0;
for(var i in lines) {
setRemoteDescription
--------------------
type: offer, sdp: v=0
o=- 1545062535851399 1 IN IP4 192.168.1.104
s=VideoRoom 1234
t=0 0
a=group:BUNDLE 0 1
a=ice-options:trickle
a=fingerprint:sha-256 D2:B9:31:8F:DF:24:D8:0E:ED:D2:EF:25:9E:AF:6F:B8:34:AE:53:9C:E6:F3:8F:F2:64:15:FA:E8:7F:53:2D:38
a=msid-semantic: WMS janus
diff --git a/html/janus.js b/html/janus.js
index e7bed83..ad8584a 100644
--- a/html/janus.js
+++ b/html/janus.js
@@ -393,6 +393,13 @@ function Janus(gatewayCallbacks) {
// Public methods
this.getServer = function() { return server; };
this.isConnected = function() { return connected; };
+ this.reconnect = function(callbacks) {
+ callbacks = callbacks || {};
@lminiero
lminiero / astricon.lua
Last active November 27, 2020 22:49
Janus Lua script for the Astricon 2017 Dangerous Demo
-- This is the Astricon Dangerous Demo application logic built in Lua,
-- and conceived to be used in conjunction with the janus_lua.c plugin.
-- It only uses data channels, and expects commands to control the ARI.
--
-- Note: this example depends on lua-json to do JSON processing
-- (http://luaforge.net/projects/luajson/) and on lua-http for HTTP
-- requests (https://daurnimator.github.io/lua-http/)
json = require('json')
-- Example details
Offer (Janus)
-------------
v=0
o=- 1498756533614220 1498756533614220 IN IP4 192.168.1.80
s=Mountpoint 1
t=0 0
a=group:BUNDLE audio video
a=msid-semantic: WMS janus
m=audio 9 RTP/SAVPF 111
c=IN IP4 192.168.1.80
Firefox 56 simulcasting: offer (browser)
----------------------------------------
v=0
o=mozilla...THIS_IS_SDPARTA-56.0a1 6240803254751085187 0 IN IP4 0.0.0.0
s=-
t=0 0
a=fingerprint:sha-256 E7:F5:25:C8:88:0D:4E:7D:B1:49:60:BF:AB:8D:84:5B:F6:D6:A9:74:FB:F1:2A:82:16:65:5B:AF:0F:23:02:BE
a=group:BUNDLE sdparta_0 sdparta_1 sdparta_2
a=ice-options:trickle
a=msid-semantic:WMS *
Firefox 54 simulcasting: offer (browser)
----------------------------------------
v=0
o=mozilla...THIS_IS_SDPARTA-54.0 8032511078174487015 0 IN IP4 0.0.0.0
s=-
t=0 0
a=fingerprint:sha-256 3C:22:03:71:82:EA:7B:46:DB:4E:A8:9E:FE:5F:0C:83:3E:65:CB:CF:A0:59:F7:A1:58:FB:DC:9E:6C:E0:8D:FA
a=group:BUNDLE sdparta_0 sdparta_1 sdparta_2
a=ice-options:trickle
a=msid-semantic:WMS *
Chrome simulcasting: offer (browser)
------------------------------------
v=0
o=- 4308117731863853442 2 IN IP4 127.0.0.1
s=-
t=0 0
a=group:BUNDLE audio video data
a=msid-semantic: WMS ZUJWk5rc0kNVekwY7gpiWsPbvAa6UbZWQI4A
m=audio 9 UDP/TLS/RTP/SAVPF 111 103 104 9 0 8 106 105 13 110 112 113 126
c=IN IP4 0.0.0.0
@lminiero
lminiero / broken-test-mhd-0.9.53.c
Created April 24, 2017 13:26
Example of a broken MHD daemon on 0.9.53 (fc25)
#include <stdio.h>
#include <stdlib.h>
#include <microhttpd.h>
/* Placeholders: these methods do nothing */
static int janus_http_client_connect(void *cls, const struct sockaddr *addr, socklen_t addrlen) {
return MHD_YES;
}
==8054== Thread 24 sipre handler:
==8054== Syscall param write(buf) points to uninitialised byte(s)
==8054== at 0x6E975DD: ??? (syscall-template.S:84)
==8054== by 0x1A311AF1: pipe_write (mqueue.h:21)
==8054== by 0x1A311D4B: mqueue_push (mqueue.c:152)
==8054== by 0x1A0A9220: janus_sipre_handler (janus_sipre.c:1484)
==8054== by 0x56DCB02: ??? (in /usr/lib64/libglib-2.0.so.0.5000.2)
==8054== by 0x6E8E6C9: start_thread (pthread_create.c:333)
==8054== by 0x71ACF7E: clone (clone.S:105)
==8054== Address 0x1b530d54 is on thread 24's stack