Hi Riccardo,
You can easily do this without any programming. You need 2 things in server side. You don't need node.js as asterisk has built in support for websocket. I have used latest software of sipml5 and asterisk.
The extension.conf of Asterisk should have the following lines.
exten => 300,1,Answer
exten => 300,2,Record(/var/lib/asterisk/sounds/en/ntest:ulaw,,20)
exten => 300,3,Wait(3)
exten => 300,4,Playback(ntest)
exten => 300,5,Hangup
Although you can install and configure turnserver but you don't need for this purpose.
I have made this for my children and they enjoyed it very much.
Installing
sipml5 is very easy. you just need to put it on webserver. Installing asterisk is not straight forward. You need SRTP and ICE support.
You will many get help from internet about installing these. Please verify your asterisk log to be sure that these are working properly.
Thanks,
Shakeeb