[asterisk-commits] rizzo: branch rizzo/astobj2 r47245 - /team/rizzo/astobj2/channels/chan_sip.c

asterisk-commits at lists.digium.com asterisk-commits at lists.digium.com
Tue Nov 7 04:29:57 MST 2006


Author: rizzo
Date: Tue Nov  7 05:29:56 2006
New Revision: 47245

URL: http://svn.digium.com/view/asterisk?rev=47245&view=rev
Log:
As done for peers, replace ASTOBJ_UNREF(user, sip_destroy_user)
with unref_user(user).
Same motivations, same advantages.


Modified:
    team/rizzo/astobj2/channels/chan_sip.c

Modified: team/rizzo/astobj2/channels/chan_sip.c
URL: http://svn.digium.com/view/asterisk/team/rizzo/astobj2/channels/chan_sip.c?rev=47245&r1=47244&r2=47245&view=diff
==============================================================================
--- team/rizzo/astobj2/channels/chan_sip.c (original)
+++ team/rizzo/astobj2/channels/chan_sip.c Tue Nov  7 05:29:56 2006
@@ -1615,6 +1615,11 @@
 	ASTOBJ_UNREF(peer, sip_destroy_peer);
 }
 
+static void unref_user(struct sip_user *user)
+{
+	ASTOBJ_UNREF(user, sip_destroy_user);
+}
+
 /*! \brief Interface structure with callbacks used to connect to UDPTL module*/
 static struct ast_udptl_protocol sip_udptl = {
 	type: "SIP",
@@ -3127,7 +3132,7 @@
 			if (*inuse >= *call_limit) {
 				ast_log(LOG_ERROR, "Call %s %s '%s' rejected due to usage limit of %d\n", outgoing ? "to" : "from", u ? "user":"peer", name, *call_limit);
 				if (u)
-					ASTOBJ_UNREF(u, sip_destroy_user);
+					unref_user(u);
 				else
 					unref_peer(p);
 				return -1; 
@@ -3166,7 +3171,7 @@
 		ast_device_state_changed("SIP/%s", p->name);
 		unref_peer(p);
 	} else /* u must be set */
-		ASTOBJ_UNREF(u, sip_destroy_user);
+		unref_user(u);
 	return 0;
 }
 
@@ -8981,7 +8986,7 @@
 		if (debug)
 			ast_verbose("Found user '%s' for '%s', but fails host access\n",
 				user->name, of);
-		ASTOBJ_UNREF(user,sip_destroy_user);
+		unref_user(user);
 		return AUTH_DONT_KNOW;
 	}
 	if (debug)
@@ -9057,7 +9062,7 @@
 			p->vrtp = NULL;
 		}
 	}
-	ASTOBJ_UNREF(user, sip_destroy_user);
+	unref_user(user);
 	return res;
 }
 
@@ -9916,7 +9921,7 @@
 					ASTOBJ_CONTAINER_LINK(&userl, user);
 				} else
 					ast_cli(fd, "User '%s' pruned.\n", name);
-				ASTOBJ_UNREF(user, sip_destroy_user);
+				unref_user(user);
 			} else
 				ast_cli(fd, "User '%s' not found.\n", name);
 		}
@@ -10269,7 +10274,7 @@
  				ast_cli(fd, "                 %s = %s\n", v->name, v->value);
 		}
 		ast_cli(fd,"\n");
-		ASTOBJ_UNREF(user,sip_destroy_user);
+		unref_user(user);
 	} else {
 		ast_cli(fd,"User %s not found.\n", argv[3]);
 		ast_cli(fd,"\n");
@@ -16413,7 +16418,7 @@
 				user = build_user(cat, ast_variable_browse(cfg, cat), 0);
 				if (user) {
 					ASTOBJ_CONTAINER_LINK(&userl,user);
-					ASTOBJ_UNREF(user, sip_destroy_user);
+					unref_user(user);
 					user_count++;
 				}
 			}



More information about the asterisk-commits mailing list