Outbound registration over WSS from Asterisk (PJSIP) not working, falls back to TLS

I’m trying to use Asterisk (PJSIP) version 20.4.0 to register with an external SIP server using WebSocket Secure (WSS). However, even though my transport configuration explicitly specifies WSS, Asterisk seems to fallback to regular SIP over TLS instead.

My current configuration:

[transport-wss]
type=transport
protocol=wss
bind=0.0.0.0:443
cert_file=/etc/asterisk/keys/asterisk.crt
priv_key_file=/etc/asterisk/keys/asterisk.key
method=tlsv1_2

[my-registration]
type=registration
server_uri=sips:my.sip.server:443\;transport=wss\;ws_path=/ws
client_uri=sips:username@my.sip.server\;transport=wss
contact_user=username
transport=transport-wss
endpoint=my-endpoint
line=yes

[my-endpoint]
type=endpoint
transport=transport-wss

Observed behavior:

  • Asterisk recognizes the transport as WSS (pjsip show transport transport-wss shows correct output).
  • The registration requests are sent via TLS instead of WSS (confirmed via pjsip set logger on).

Troubleshooting already performed:

  • Verified the remote SIP server’s WSS endpoint is available (wss://my.sip.server:443/ws returns expected WebSocket headers).
  • Verified that Asterisk modules (res_http_websocket.so, res_pjsip_transport_websocket.so, res_crypto.so) are loaded correctly.
  • Verified TLS connection works fine independently (using SIP over TLS).

Questions:

  • Does PJSIP (Asterisk) support sending outbound REGISTER requests over WSS at all?
  • If yes, what am I missing in my configuration?

Any insights or guidance would be greatly appreciated. Thanks!

Asterisk does not support outgoing Websocket connections for SIP.

Thank you for the quick and clear response! Really appreciate it.

This topic was automatically closed 30 days after the last reply. New replies are no longer allowed.