res_pjsip_transport_websocket: Fix security events and simplify implementation.

Transport type determination for security events has been simplified to use
the type present on the message itself instead of searching through configured
transports to find the transport used.

The actual WebSocket transport has also been simplified. It now leverages the
existing PJSIP transport manager for finding the active WebSocket transport
for outgoing messages. This removes the need for res_pjsip_transport_websocket
to store a mapping itself.

(closes issue ASTERISK-22897)
Reported by: Max E. Reyes Vera J.

Review: https://reviewboard.asterisk.org/r/3036/ 


git-svn-id: https://origsvn.digium.com/svn/asterisk/branches/12@403256 65c4cc65-6c06-0410-ace0-fbb531ad65f3
This commit is contained in:
Joshua Colp
2013-12-01 19:56:38 +00:00
parent 021f49bad7
commit e0cfdf5655
6 changed files with 33 additions and 238 deletions

View File

@@ -179,17 +179,6 @@ struct ast_sip_contact_status {
int64_t rtt;
};
/*!
* \brief A transport to be used for messages to a contact
*/
struct ast_sip_contact_transport {
AST_DECLARE_STRING_FIELDS(
/*! Full URI of the contact */
AST_STRING_FIELD(uri);
);
pjsip_transport *transport;
};
/*!
* \brief A SIP address of record
*/
@@ -889,37 +878,6 @@ struct ast_sip_contact *ast_sip_location_retrieve_contact_from_aor_list(const ch
*/
struct ast_sip_contact *ast_sip_location_retrieve_contact(const char *contact_name);
/*!
* \brief Add a transport for a contact to use
*/
void ast_sip_location_add_contact_transport(struct ast_sip_contact_transport *ct);
/*!
* \brief Delete a transport for a contact that went away
*/
void ast_sip_location_delete_contact_transport(struct ast_sip_contact_transport *ct);
/*!
* \brief Retrieve a contact_transport, by URI
*
* \param contact_uri URI of the contact
*
* \retval NULL if not found
* \retval non-NULL if found
*/
struct ast_sip_contact_transport *ast_sip_location_retrieve_contact_transport_by_uri(const char *contact_uri);
/*!
* \brief Retrieve a contact_transport, by transport
*
* \param transport transport the contact uses
*
* \retval NULL if not found
* \retval non-NULL if found
*/
struct ast_sip_contact_transport *ast_sip_location_retrieve_contact_transport_by_transport(pjsip_transport *transport);
/*!
* \brief Add a new contact to an AOR
*