res_pjsip_transport_websocket: Ensure secure Websocket clients can be called.

This change enforces the transport in the Contact header for Websocket clients.
Previously a client may provide a transport of 'ws' when it is actually using
a transport of 'wss'. This would cause outgoing calls to fail as the existing
connection could not be found.


git-svn-id: http://svn.asterisk.org/svn/asterisk/branches/12@421931 f38db490-d61c-443f-a65b-d21fe96a405b
res_pjsip_transport_websocket: Fix a progressive memory growth.

The packet structure used to receive messages was using the transport
pool. This meant that for each parsing the pool would grow accordingly.
Since memory can not be reclaimed without resetting it this would
cause the memory pool to grow and grow.

This change uses a specific memory pool for the packet structure and
resets it to a fresh state after the message has been received and
handled.


git-svn-id: http://svn.asterisk.org/svn/asterisk/branches/12@421939 f38db490-d61c-443f-a65b-d21fe96a405b
res_pjsip_transport_websocket: Attach the Websocket module on outgoing INVITEs.

In order to alter the Contact header on in-dialog requests and responses the
Websocket module must be attached on outgoing INVITEs. The Contact header is
modified so that the PJSIP transport layer can find and use the existing
Websocket connection based on the source IP address, port, and transport.

ASTERISK-24143 #close
Reported by: Aleksei Kulakov


git-svn-id: http://svn.asterisk.org/svn/asterisk/branches/12@421955 f38db490-d61c-443f-a65b-d21fe96a405b