pjsip_distributor.c: Consistently pick a serializer for messages.
authorRichard Mudgett <rmudgett@digium.com>
Thu, 26 May 2016 22:35:04 +0000 (17:35 -0500)
committerRichard Mudgett <rmudgett@digium.com>
Thu, 9 Jun 2016 15:32:06 +0000 (10:32 -0500)
commit2ff26e97467fabc390cf887fcda84f2e26b83895
tree5a0cb6a56c30b6fde4f061857a71cee9ada8d699
parentdf2791da8f15aca4608e9bc748b43776c7797340
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
res/res_pjsip/pjsip_distributor.c