[asterisk-commits] dvossel: branch dvossel/sip_request_transaction_matching r275775 - /team/dvos...

SVN commits to the Asterisk project asterisk-commits at lists.digium.com
Mon Jul 12 15:43:33 CDT 2010


Author: dvossel
Date: Mon Jul 12 15:43:29 2010
New Revision: 275775

URL: http://svnview.digium.com/svn/asterisk?view=rev&rev=275775
Log:
fixes already existing bug with returning multiple dialogs during transaction matching

Modified:
    team/dvossel/sip_request_transaction_matching/channels/chan_sip.c

Modified: team/dvossel/sip_request_transaction_matching/channels/chan_sip.c
URL: http://svnview.digium.com/svn/asterisk/team/dvossel/sip_request_transaction_matching/channels/chan_sip.c?view=diff&rev=275775&r1=275774&r2=275775
==============================================================================
--- team/dvossel/sip_request_transaction_matching/channels/chan_sip.c (original)
+++ team/dvossel/sip_request_transaction_matching/channels/chan_sip.c Mon Jul 12 15:43:29 2010
@@ -1315,6 +1315,7 @@
 static int restart_monitor(void);
 static void peer_mailboxes_to_str(struct ast_str **mailbox_str, struct sip_peer *peer);
 static struct ast_variable *copy_vars(struct ast_variable *src);
+static int dialog_find_multiple(void *obj, void *arg, int flags);
 /* static int sip_addrcmp(char *name, struct sockaddr_in *sin);	Support for peer matching */
 static int sip_refer_allocate(struct sip_pvt *p);
 static int sip_notify_allocate(struct sip_pvt *p);
@@ -7095,8 +7096,7 @@
 		struct sip_pvt tmp_dialog = {
 			.callid = callid,
 		};
-		struct ao2_iterator *iterator = ao2_t_find(dialogs, &tmp_dialog, OBJ_POINTER | OBJ_MULTIPLE,
-							   "pedantic ao2_find in dialogs");
+		struct ao2_iterator *iterator = ao2_t_callback(dialogs, OBJ_POINTER | OBJ_MULTIPLE, dialog_find_multiple, &tmp_dialog, "pedantic ao2_find in dialogs");
 		/* Iterate a list of dialogs already matched by Call-id */
 		while (iterator && (sip_pvt_ptr = ao2_iterator_next(iterator))) {
 			if (req->method == SIP_RESPONSE) {
@@ -27660,16 +27660,24 @@
 }
 
 /*!
+ * \note Same as dialog_cmp_cb, except without the CMP_STOP on match
+ */
+static int dialog_find_multiple(void *obj, void *arg, int flags)
+{
+	struct sip_pvt *pvt = obj, *pvt2 = arg;
+
+	return !strcasecmp(pvt->callid, pvt2->callid) ? CMP_MATCH : 0;
+}
+
+/*!
  * \note The only member of the dialog used here callid string
  */
 static int dialog_cmp_cb(void *obj, void *arg, int flags)
 {
 	struct sip_pvt *pvt = obj, *pvt2 = arg;
-	
+
 	return !strcasecmp(pvt->callid, pvt2->callid) ? CMP_MATCH | CMP_STOP : 0;
 }
-
-
 
 /*! \brief SIP Cli commands definition */
 static struct ast_cli_entry cli_sip[] = {




More information about the asterisk-commits mailing list