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:
David Vossel
2010-07-26 19:59:03 +00:00
parent c9b697f67d
commit 610151af27
4 changed files with 387 additions and 41 deletions

View File

@@ -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