I found that error occurred because the connection to be used  has been obsolete after kamailio restarting,
the log showed that the socket port from WebRTC Client side is still the old one rather than current connection re-connected,
so I attempt to replace the destination port of D-URI with the new one , and the hang-up works!

Now I'm investigating why the old connection information was used (and still there), 
and how to refresh the new one in the server.


2018-01-30 19:03 GMT+08:00 Jack Wang <antirazin@gmail.com>:
mistake the key state checked.

correct:

              websocket:ws_sip_current_connections = 1


2018-01-30 18:44 GMT+08:00 Jack Wang <antirazin@gmail.com>:
For some reasons, 
My settings will cause kamailio to be restarted even if there were connections connected to it.
And when one SIP client in a connection wanted to hangup the call with a WebRTC Client (SIP over websocket) after the proxy-restarting,
local client was closed, however , the other side was not.
From the log below it seems that the connection missed.

Jan 30 18:19:31 ./kamailio[27857]: WARNING: <core> [msg_translator.c:2777]: via_builder(): TCP/TLS connection (id: 0) for WebSocket could not be found
Jan 30 18:19:31 ./kamailio[27857]: ERROR: tm [t_msgbuilder.c:1365]: assemble_via(): assemble_via: via building failed
Jan 30 18:19:31 ./kamailio[27857]: ERROR: tm [t_msgbuilder.c:1545]: build_uac_req(): build_uac_req(): Error while assembling Via
Jan 30 18:19:31 ./kamailio[27857]: ERROR: tm [uac.c:379]: t_uac_prepare(): t_uac: Error while building message

So,
Is it equivalent to connection ID missing?
And is there any way to make Websocket  found the connection?

Btw, after proxy-restarting for seconds , I typed `sh kamctl stats` :

websocket:ws_current_connections = 1

It showed that the WebRTC Client will re-connect automatically,
So I think this connection could be found by proxy,
Any suggestion?



Thanks :)