Hello all !
I'm trying to use an API from OVH to get phone calls, from this page
https://events.voip.ovh.net/v2/documentation#!/default/post_sessionUsing long poll is OK with synapse, I get an ID, and then I make a long poll http get with (.../session/{id}/events/{method})
I'd like to use websockets, but I tried to create one using TTCPBlockSocket from synapse, but it failed.
I know I have to send commands to "upgrade" the connection, but I just cannot manage to connect to the server
procedure TOVHWebSocket.Execute;
// TOVHWebSocket is a thread
begin
Socket := TTCPBlockSocket.Create;
Socket.Connect(FHost, IntToStr(FPort));
socket.SSLDoCOnnect;
Socket.OnStatus := @Self.Status;
if socket.LastError<>0 then log(socket.LastErrorDesc);
while not Terminated do
begin
while Socket.CanRead(1000) do
begin
sleep(1000);
log(Socket.RecvString(1000));
end;
sleep(100);
end;
Socket.Free;
end;
I get these errors
Network subsystem is unusable
Error, 10038,Socket operation on nonsocket
Error, 10022,Invalid argument
Error, 10022,Invalid argument
I think I'm not using the right ssl plugin, or I completely misunderstand how it works...
Could someone help me please ?
Thanks !
Best regards