mirror of
https://github.com/asterisk/asterisk.git
synced 2025-10-09 22:45:49 +00:00
transaction matching using top most Via header
This patch modifies the way chan_sip.c does transaction to dialog matching. Asterisk now stores information in the top most Via header of the initial incoming request and compares that against other Requests that have the same call-id. This results in Asterisk being able to detect a forked call in which it has received multiple legs of the fork. I completely stripped out the previous matching code and made the comparisons a little more explicit and easier to understand. My comments in the code should offer all the details involving this patch. This patch also fixes a bug with the usage of the OBJ-MULTIPLE flag to find multiple dialogs with the same call-id. Since the callback function was returning (CMP_MATCH | CMP_STOP) only the first item found was being returned. I fixed this by making a new callback function for finding multiple dialogs that only returns (CMP_MATCH) on a match allowing for multiple items to be returned. Review: https://reviewboard.asterisk.org/r/776/ git-svn-id: https://origsvn.digium.com/svn/asterisk/branches/1.8@279568 65c4cc65-6c06-0410-ace0-fbb531ad65f3
This commit is contained in:
@@ -910,6 +910,8 @@ struct sip_pvt {
|
||||
int method; /*!< SIP method that opened this dialog */
|
||||
AST_DECLARE_STRING_FIELDS(
|
||||
AST_STRING_FIELD(callid); /*!< Global CallID */
|
||||
AST_STRING_FIELD(initviabranch); /*!< The branch ID from the topmost Via header in the initial request */
|
||||
AST_STRING_FIELD(initviasentby); /*!< The sent-by from the topmost Via header in the initial request */
|
||||
AST_STRING_FIELD(randdata); /*!< Random data */
|
||||
AST_STRING_FIELD(accountcode); /*!< Account code */
|
||||
AST_STRING_FIELD(realm); /*!< Authorization realm */
|
||||
@@ -958,6 +960,7 @@ struct sip_pvt {
|
||||
struct sip_socket socket; /*!< The socket used for this dialog */
|
||||
unsigned int ocseq; /*!< Current outgoing seqno */
|
||||
unsigned int icseq; /*!< Current incoming seqno */
|
||||
unsigned int init_icseq; /*!< Initial incoming seqno from first request */
|
||||
ast_group_t callgroup; /*!< Call group */
|
||||
ast_group_t pickupgroup; /*!< Pickup group */
|
||||
int lastinvite; /*!< Last Cseq of invite */
|
||||
|
Reference in New Issue
Block a user