From 16b08444dae47eded183f63300908b49cf6b2c1a Mon Sep 17 00:00:00 2001 From: Richard Mudgett Date: Thu, 26 May 2016 17:35:04 -0500 Subject: pjsip_distributor.c: Consistently pick a serializer for messages. Incoming messages that are not part of a dialog or a recognized response to one of our requests need to be sent to a consistent serializer. Under load we may be queueing retransmissions before we can process the original message. We don't need to throw these messages onto random serializers and cause reentrancy and message sequencing problems. * Created a pool of pjsip/distributor serializers that get picked by hashing the call-id and remote tag strings of the received messages. * Made ast_sip_destroy_distributor() destroy items in the reverse order of creation. ASTERISK-26088 Reported by: Richard Mudgett Change-Id: I2ce769389fc060d9f379977f559026fbcb632407 --- include/asterisk/res_pjsip.h | 11 +++++++++++ 1 file changed, 11 insertions(+) (limited to 'include') diff --git a/include/asterisk/res_pjsip.h b/include/asterisk/res_pjsip.h index b64ad624b..e3eab7cb4 100644 --- a/include/asterisk/res_pjsip.h +++ b/include/asterisk/res_pjsip.h @@ -1335,6 +1335,17 @@ struct ast_taskprocessor *ast_sip_create_serializer_group(struct ast_serializer_ */ struct ast_taskprocessor *ast_sip_create_serializer_group_named(const char *name, struct ast_serializer_shutdown_group *shutdown_group); +/*! + * \brief Determine the distributor serializer for the SIP message. + * \since 13.10.0 + * + * \param rdata The incoming message. + * + * \retval Calculated distributor serializer on success. + * \retval NULL on error. + */ +struct ast_taskprocessor *ast_sip_get_distributor_serializer(pjsip_rx_data *rdata); + /*! * \brief Set a serializer on a SIP dialog so requests and responses are automatically serialized * -- cgit v1.2.3