summaryrefslogtreecommitdiff
path: root/channels/sip/include
diff options
context:
space:
mode:
authorDavid Vossel <dvossel@digium.com>2010-07-26 20:00:52 +0000
committerDavid Vossel <dvossel@digium.com>2010-07-26 20:00:52 +0000
commit4a98994542bb56bc7252cf70a3394311fd01e968 (patch)
tree5f612d10ca48c649bb42845e9402e2e9aa80e4e0 /channels/sip/include
parent4bd366a92660f8b650c7c640d76659326dc90751 (diff)
Merged revisions 279568 via svnmerge from
https://origsvn.digium.com/svn/asterisk/branches/1.8 ........ r279568 | dvossel | 2010-07-26 14:59:03 -0500 (Mon, 26 Jul 2010) | 21 lines 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/trunk@279569 65c4cc65-6c06-0410-ace0-fbb531ad65f3
Diffstat (limited to 'channels/sip/include')
-rw-r--r--channels/sip/include/reqresp_parser.h6
-rw-r--r--channels/sip/include/sip.h3
2 files changed, 9 insertions, 0 deletions
diff --git a/channels/sip/include/reqresp_parser.h b/channels/sip/include/reqresp_parser.h
index 2957151aa..8c8c59ad6 100644
--- a/channels/sip/include/reqresp_parser.h
+++ b/channels/sip/include/reqresp_parser.h
@@ -165,4 +165,10 @@ int sip_reqresp_parser_init(void);
*/
void sip_reqresp_parser_exit(void);
+/*!
+ * \brief Parse the VIA header into it's parts.
+ *
+ * \note This will modify the string
+ */
+void get_viabranch(char *via, char **sent_by, char **branch);
#endif
diff --git a/channels/sip/include/sip.h b/channels/sip/include/sip.h
index 6da0c44dc..0e207ca23 100644
--- a/channels/sip/include/sip.h
+++ b/channels/sip/include/sip.h
@@ -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 */