Skip to content
GitLab
Explore
Sign in
Primary navigation
Search or go to…
Project
Matrix
Manage
Activity
Members
Labels
Plan
Issues
Issue boards
Milestones
Code
Repository
Branches
Commits
Tags
Repository graph
Compare revisions
Build
Pipelines
Jobs
Pipeline schedules
Artifacts
Deploy
Container Registry
Model registry
Operate
Environments
Help
Help
Support
GitLab documentation
Compare GitLab plans
Community forum
Contribute to GitLab
Provide feedback
Terms and privacy
Keyboard shortcuts
?
Snippets
Groups
Projects
Show more breadcrumbs
TeDomum
Matrix
Commits
ecc59ae6
Commit
ecc59ae6
authored
9 years ago
by
Daniel Wagner-Hall
Browse files
Options
Downloads
Plain Diff
Merge branch 'master' into auth
parents
70e265e6
0ac61b1c
No related branches found
Branches containing commit
No related tags found
Tags containing commit
No related merge requests found
Changes
2
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
contrib/vertobot/bot.pl
+25
-15
25 additions, 15 deletions
contrib/vertobot/bot.pl
contrib/vertobot/cpanfile
+0
-3
0 additions, 3 deletions
contrib/vertobot/cpanfile
with
25 additions
and
18 deletions
contrib/vertobot/bot.pl
+
25
−
15
View file @
ecc59ae6
...
...
@@ -126,12 +126,26 @@ sub on_unknown_event
if
(
!
$bridgestate
->
{
$room_id
}
->
{
gathered_candidates
})
{
$bridgestate
->
{
$room_id
}
->
{
gathered_candidates
}
=
1
;
my
$offer
=
$bridgestate
->
{
$room_id
}
->
{
offer
};
my
$candidate_block
=
"";
my
$candidate_block
=
{
audio
=>
'',
video
=>
'',
};
foreach
(
@
{
$event
->
{
content
}
->
{
candidates
}})
{
$candidate_block
.=
"
a=
"
.
$_
->
{
candidate
}
.
"
\r\n
";
if
(
$_
->
{
sdpMid
})
{
$candidate_block
->
{
$_
->
{
sdpMid
}}
.=
"
a=
"
.
$_
->
{
candidate
}
.
"
\r\n
";
}
else
{
$candidate_block
->
{
audio
}
.=
"
a=
"
.
$_
->
{
candidate
}
.
"
\r\n
";
$candidate_block
->
{
video
}
.=
"
a=
"
.
$_
->
{
candidate
}
.
"
\r\n
";
}
}
# XXX: collate using the right m= line - for now assume audio call
$offer
=~
s/(a=rtcp.*[\r\n]+)/$1$candidate_block/
;
# XXX: assumes audio comes first
#$offer =~ s/(a=rtcp-mux[\r\n]+)/$1$candidate_block->{audio}/;
#$offer =~ s/(a=rtcp-mux[\r\n]+)/$1$candidate_block->{video}/;
$offer
=~
s/(m=video)/$candidate_block->{audio}$1/
;
$offer
=~
s/(.$)/$1\n$candidate_block->{video}$1/
;
my
$f
=
send_verto_json_request
("
verto.invite
",
{
"
sdp
"
=>
$offer
,
...
...
@@ -172,22 +186,18 @@ sub on_room_message
warn
"
[Matrix] in
$room_id
:
$from
:
"
.
$content
->
{
body
}
.
"
\n
";
}
my
$verto_connecting
=
$loop
->
new_future
;
$bot_verto
->
connect
(
%
{
$CONFIG
{"
verto-bot
"}
},
on_connect_error
=>
sub
{
die
"
Cannot connect to verto -
$_
[-1]
"
},
on_resolve_error
=>
sub
{
die
"
Cannot resolve to verto -
$_
[-1]
"
},
)
->
then
(
sub
{
warn
("
[Verto] connected to websocket
");
$verto_connecting
->
done
(
$bot_verto
)
if
not
$verto_connecting
->
is_done
;
});
Future
->
needs_all
(
$bot_matrix
->
login
(
%
{
$CONFIG
{"
matrix-bot
"}
}
)
->
then
(
sub
{
$bot_matrix
->
start
;
}),
$verto_connecting
,
$bot_verto
->
connect
(
%
{
$CONFIG
{"
verto-bot
"}
},
on_connect_error
=>
sub
{
die
"
Cannot connect to verto -
$_
[-1]
"
},
on_resolve_error
=>
sub
{
die
"
Cannot resolve to verto -
$_
[-1]
"
},
)
->
on_done
(
sub
{
warn
("
[Verto] connected to websocket
");
}),
)
->
get
;
$loop
->
attach_signal
(
...
...
This diff is collapsed.
Click to expand it.
contrib/vertobot/cpanfile
+
0
−
3
View file @
ecc59ae6
...
...
@@ -11,7 +11,4 @@ requires 'YAML', 0;
requires 'JSON', 0;
requires 'Getopt::Long', 0;
on 'test' => sub {
requires 'Test::More', '>= 0.98';
};
This diff is collapsed.
Click to expand it.
Preview
0%
Loading
Try again
or
attach a new file
.
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Save comment
Cancel
Please
register
or
sign in
to comment