Module: sip-router
Branch: master
Commit: e6a50c5c0957a5ad3e08e57ede5be775a41ac24f
URL: http://git.sip-router.org/cgi-bin/gitweb.cgi/sip-router/?a=commit;h=e6a50c5c0957a5ad3e08e57ede5be775a41ac24f
Author: pd <peter.dunkley@crocodile-rcs.com>
Committer: pd <peter.dunkley@crocodile-rcs.com>
Date: Mon Jan 30 17:06:42 2012 +0000
modules_k/presence: Improved handling of retransmitted SUBSCRIBE requests
- handle_subscribe() doesn't handle retransmitted SUBSCRIBEs properly. This was
noticed with back-end SUBSCRIBEs from RLS under heavy load (also tried TCP
here but under-load this caused a different set of problems with buffer
sizes and buffers taking too long to process).
- Although this was originally observed with RLS back-end SUBSCRIBEs it
appears to be a general issue when UDP is used.
- There were two main problems:
1) On an un-SUBSCRIBE the record in the hash-table or DB will be removed. If
the un-SUBSCRIBE is retransmitted there is no record to be found and
handle_subscribe() fails.
2) After fixing 1, and on re-SUBSCRIBE, remote CSeq's with lower than
expected values cause failures. This can also happen when there are
retransmissions.
- The fix was to catch both these cases and treat them as a special class of
error. In these two cases and when the protocol is UDP, a correct-looking
2XX response is sent, but no further processing (database updates, sending
NOTIFY, and so on) is performed on the SUBSCRIBE request.
- Also modified the query in get_database_info() to just use Call-ID, To-tag,
and From-tag for dialog matching (so it duplicates the query from
get_stored_info()) as the query that was there looked a little aggressive.