I wrote a small SIP client for a special purpose. Basically it connects to port 5060 using function fsockopen()
fsockopen()
$fp = fsockopen(\"10.0.0.1\", 5060,
This is enough to open a TLS connection:
$context = stream_context_create(); $fp = stream_socket_client('tls://'.$host.':'.$port, $errno, $errstr, 30, STREAM_CLIENT_CONNECT, $context)
if the certificates are in their place. If they are not, follow the instructions linked by Filippos.