Skip to content
GitLab
Explore
Sign in
Primary navigation
Search or go to…
Project
synapse
Manage
Activity
Members
Labels
Plan
Issues
Issue boards
Milestones
Code
Merge requests
Repository
Branches
Commits
Tags
Repository graph
Compare revisions
Build
Pipelines
Jobs
Pipeline schedules
Artifacts
Deploy
Releases
Container Registry
Model registry
Monitor
Service Desk
Analyze
Value stream analytics
Contributor analytics
CI/CD analytics
Repository analytics
Model experiments
Help
Help
Support
GitLab documentation
Compare GitLab plans
Community forum
Contribute to GitLab
Provide feedback
Keyboard shortcuts
?
Snippets
Groups
Projects
Show more breadcrumbs
Maunium
synapse
Commits
08bf2aaa
Commit
08bf2aaa
authored
10 years ago
by
Matthew Hodgson
Browse files
Options
Downloads
Patches
Plain Diff
ignore rogue matrix call events; support verto.media RPC as a horrible hack; fix NA::Matrix dep
parent
f7fb4675
No related branches found
Branches containing commit
No related tags found
Tags containing commit
No related merge requests found
Changes
3
Hide whitespace changes
Inline
Side-by-side
Showing
3 changed files
contrib/vertobot/.gitignore
+2
-1
2 additions, 1 deletion
contrib/vertobot/.gitignore
contrib/vertobot/bot.pl
+30
-19
30 additions, 19 deletions
contrib/vertobot/bot.pl
contrib/vertobot/cpanfile
+1
-1
1 addition, 1 deletion
contrib/vertobot/cpanfile
with
33 additions
and
21 deletions
contrib/vertobot/.gitignore
+
2
−
1
View file @
08bf2aaa
vuc.yaml
vucbot.yaml
vertobot.yaml
This diff is collapsed.
Click to expand it.
contrib/vertobot/bot.pl
100644 → 100755
+
30
−
19
View file @
08bf2aaa
...
@@ -6,7 +6,7 @@ use 5.010; # //
...
@@ -6,7 +6,7 @@ use 5.010; # //
use
IO::Socket::
SSL
qw(SSL_VERIFY_NONE)
;
use
IO::Socket::
SSL
qw(SSL_VERIFY_NONE)
;
use
IO::Async::
Loop
;
use
IO::Async::
Loop
;
use
Net::Async::WebSocket::
Client
;
use
Net::Async::WebSocket::
Client
;
use
Net::Async::
Matrix
0.11
;
use
Net::Async::
Matrix
0.11
_002
;
use
JSON
;
use
JSON
;
use
YAML
;
use
YAML
;
use
Data::
UUID
;
use
Data::
UUID
;
...
@@ -148,10 +148,15 @@ sub on_unknown_event
...
@@ -148,10 +148,15 @@ sub on_unknown_event
}
}
}
}
elsif
(
$event
->
{
type
}
eq
'
m.call.hangup
')
{
elsif
(
$event
->
{
type
}
eq
'
m.call.hangup
')
{
send_verto_json_request
("
verto.bye
",
{
if
(
$bridgestate
->
{
$room_id
}
->
{
matrix_callid
}
eq
$event
->
{
content
}
->
{
call_id
})
{
"
dialogParams
"
=>
\
%dp
,
send_verto_json_request
("
verto.bye
",
{
"
sessid
"
=>
$bridgestate
->
{
$room_id
}
->
{
sessid
},
"
dialogParams
"
=>
\
%dp
,
})
->
get
;
"
sessid
"
=>
$bridgestate
->
{
$room_id
}
->
{
sessid
},
})
->
get
;
}
else
{
warn
"
Ignoring unrecognised callid:
"
.
$event
->
{
content
}
->
{
call_id
};
}
}
}
else
{
else
{
warn
"
Unhandled event:
$event
->{type}
";
warn
"
Unhandled event:
$event
->{type}
";
...
@@ -253,27 +258,33 @@ exit 0;
...
@@ -253,27 +258,33 @@ exit 0;
{
{
my
$json
=
JSON
->
new
->
decode
(
$_
[
0
]
);
my
$json
=
JSON
->
new
->
decode
(
$_
[
0
]
);
if
(
$json
->
{
method
})
{
if
(
$json
->
{
method
})
{
if
(
$json
->
{
method
}
eq
'
verto.answer
')
{
if
((
$json
->
{
method
}
eq
'
verto.answer
'
&&
$json
->
{
params
}
->
{
sdp
})
||
$json
->
{
method
}
eq
'
verto.media
')
{
my
$room_id
=
$roomid_by_callid
->
{
$json
->
{
params
}
->
{
callID
}};
my
$room_id
=
$roomid_by_callid
->
{
$json
->
{
params
}
->
{
callID
}};
my
$room
=
$bot_matrix_rooms
{
$room_id
};
my
$room
=
$bot_matrix_rooms
{
$room_id
};
# HACK HACK HACK HACK
if
(
$json
->
{
params
}
->
{
sdp
})
{
$room
->
_do_POST_json
(
"
/send/m.call.answer
",
{
# HACK HACK HACK HACK
call_id
=>
$bridgestate
->
{
$room_id
}
->
{
matrix_callid
},
$room
->
_do_POST_json
(
"
/send/m.call.answer
",
{
version
=>
0
,
call_id
=>
$bridgestate
->
{
$room_id
}
->
{
matrix_callid
},
answer
=>
{
version
=>
0
,
sdp
=>
$json
->
{
params
}
->
{
sdp
},
answer
=>
{
type
=>
"
answer
",
sdp
=>
$json
->
{
params
}
->
{
sdp
},
},
type
=>
"
answer
",
})
->
then
(
sub
{
},
send_verto_json_response
(
{
})
->
then
(
sub
{
method
=>
"
verto.answer
",
send_verto_json_response
(
{
},
$json
->
{
id
});
method
=>
$json
->
{
method
},
})
->
get
;
},
$json
->
{
id
});
})
->
get
;
}
}
}
else
{
else
{
warn
("
[Verto] unhandled method:
"
.
$json
->
{
method
});
warn
("
[Verto] unhandled method:
"
.
$json
->
{
method
});
send_verto_json_response
(
{
method
=>
$json
->
{
method
},
},
$json
->
{
id
});
}
}
}
}
elsif
(
$json
->
{
result
})
{
elsif
(
$json
->
{
result
})
{
...
...
This diff is collapsed.
Click to expand it.
contrib/vertobot/cpanfile
+
1
−
1
View file @
08bf2aaa
requires 'parent', 0;
requires 'parent', 0;
requires 'Future', '>= 0.29';
requires 'Future', '>= 0.29';
requires 'Net::Async::Matrix', '>= 0.11';
requires 'Net::Async::Matrix', '>= 0.11
_002
';
requires 'Net::Async::Matrix::Utils';
requires 'Net::Async::Matrix::Utils';
requires 'Net::Async::WebSocket::Protocol', 0;
requires 'Net::Async::WebSocket::Protocol', 0;
requires 'Data::UUID', 0;
requires 'Data::UUID', 0;
...
...
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