[asterisk-commits] russell: branch group/sip-object-matching r179120 - /team/group/sip-object-ma...

SVN commits to the Asterisk project asterisk-commits at lists.digium.com
Fri Feb 27 14:21:23 CST 2009


Author: russell
Date: Fri Feb 27 14:20:35 2009
New Revision: 179120

URL: http://svn.digium.com/svn-view/asterisk?view=rev&rev=179120
Log:
Remove unused ispeer argument to build_peer()

Modified:
    team/group/sip-object-matching/channels/chan_sip.c

Modified: team/group/sip-object-matching/channels/chan_sip.c
URL: http://svn.digium.com/svn-view/asterisk/team/group/sip-object-matching/channels/chan_sip.c?view=diff&rev=179120&r1=179119&r2=179120
==============================================================================
--- team/group/sip-object-matching/channels/chan_sip.c (original)
+++ team/group/sip-object-matching/channels/chan_sip.c Fri Feb 27 14:20:35 2009
@@ -2438,7 +2438,7 @@
 
 /*--- Device object handling */
 static struct sip_peer *temp_peer(const char *name);
-static struct sip_peer *build_peer(const char *name, struct ast_variable *v, struct ast_variable *alt, int realtime, int ispeer);
+static struct sip_peer *build_peer(const char *name, struct ast_variable *v, struct ast_variable *alt, int realtime);
 static int update_call_counter(struct sip_pvt *fup, int event);
 static void sip_destroy_peer(struct sip_peer *peer);
 static void sip_destroy_peer_fn(void *peer);
@@ -4469,7 +4469,7 @@
 
 
 	/* Peer found in realtime, now build it in memory */
-	peer = build_peer(newpeername, var, varregs, TRUE, FALSE);
+	peer = build_peer(newpeername, var, varregs, TRUE);
 	if (!peer) {
 		if(peerlist)
 			ast_config_destroy(peerlist);
@@ -22486,7 +22486,7 @@
 }
 
 /*! \brief Build peer from configuration (file or realtime static/dynamic) */
-static struct sip_peer *build_peer(const char *name, struct ast_variable *v, struct ast_variable *alt, int realtime, int ispeer)
+static struct sip_peer *build_peer(const char *name, struct ast_variable *v, struct ast_variable *alt, int realtime)
 {
 	struct sip_peer *peer = NULL;
 	struct ast_ha *oldha = NULL;
@@ -23675,7 +23675,7 @@
 				hassip = ast_variable_retrieve(ucfg, cat, "hassip");
 				registersip = ast_variable_retrieve(ucfg, cat, "registersip");
 				if (ast_true(hassip) || (!hassip && genhassip)) {
-					peer = build_peer(cat, gen, ast_variable_browse(ucfg, cat), 0, FALSE);
+					peer = build_peer(cat, gen, ast_variable_browse(ucfg, cat), 0);
 					if (peer) {
 						ao2_t_link(peers, peer, "link peer into peer table");
 						if ((peer->type & SIP_TYPE_PEER) && peer->addr.sin_addr.s_addr) {
@@ -23727,27 +23727,24 @@
 			ast_log(LOG_WARNING, "Section '%s' lacks type\n", cat);
 			continue;
 		} else {
-			int is_peer = 0;
 			if (!strcasecmp(utype, "user")) {
-				is_peer = 1;
+				;
 			} else if (!strcasecmp(utype, "friend")) {
-				is_peer = 1;
-			} else if (!strcasecmp(utype, "peer"))
-				is_peer = 2;
-			else {
+				;
+			} else if (!strcasecmp(utype, "peer")) {
+				;
+			} else {
 				ast_log(LOG_WARNING, "Unknown type '%s' for '%s' in %s\n", utype, cat, "sip.conf");
 				continue;
 			}
-			if (is_peer) {
-				peer = build_peer(cat, ast_variable_browse(cfg, cat), NULL, 0, is_peer == 2);
-				if (peer) {
-					ao2_t_link(peers, peer, "link peer into peers table");
-					if ((peer->type & SIP_TYPE_PEER) && peer->addr.sin_addr.s_addr) {
-						ao2_t_link(peers_by_ip, peer, "link peer into peers_by_ip table");
-					}
-					unref_peer(peer, "unref the result of the build_peer call. Now, the links from the tables are the only ones left.");
-					peer_count++;
+			peer = build_peer(cat, ast_variable_browse(cfg, cat), NULL, 0);
+			if (peer) {
+				ao2_t_link(peers, peer, "link peer into peers table");
+				if ((peer->type & SIP_TYPE_PEER) && peer->addr.sin_addr.s_addr) {
+					ao2_t_link(peers_by_ip, peer, "link peer into peers_by_ip table");
 				}
+				unref_peer(peer, "unref the result of the build_peer call. Now, the links from the tables are the only ones left.");
+				peer_count++;
 			}
 		}
 	}




More information about the asterisk-commits mailing list