[asterisk-commits] oej: branch oej/kill-the-user r127686 - /team/oej/kill-the-user/channels/

SVN commits to the Asterisk project asterisk-commits at lists.digium.com
Thu Jul 3 05:04:30 CDT 2008


Author: oej
Date: Thu Jul  3 05:04:29 2008
New Revision: 127686

URL: http://svn.digium.com/view/asterisk?view=rev&rev=127686
Log:
Look, it compiles. Wonder if it works too :-)

Modified:
    team/oej/kill-the-user/channels/chan_sip.c

Modified: team/oej/kill-the-user/channels/chan_sip.c
URL: http://svn.digium.com/view/asterisk/team/oej/kill-the-user/channels/chan_sip.c?view=diff&rev=127686&r1=127685&r2=127686
==============================================================================
--- team/oej/kill-the-user/channels/chan_sip.c (original)
+++ team/oej/kill-the-user/channels/chan_sip.c Thu Jul  3 05:04:29 2008
@@ -1636,26 +1636,6 @@
 }
 
 /*!
- * \note The only member of the user used here is the name field
- */
-static int user_hash_cb(const void *obj, const int flags)
-{
-	const struct sip_user *user = obj;
-
-	return ast_str_hash(user->name);
-}
-
-/*!
- * \note The only member of the user used here is the name field
- */
-static int user_cmp_cb(void *obj, void *arg, int flags)
-{
-	struct sip_user *user = obj, *user2 = arg;
-
-	return !strcasecmp(user->name, user2->name) ? CMP_MATCH : 0;
-}
-
-/*!
  * \note The only member of the dialog used here callid string
  */
 static int dialog_hash_cb(const void *obj, const int flags)
@@ -1991,7 +1971,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 peeronly);
+static struct sip_peer *build_peer(const char *name, struct ast_variable *v, struct ast_variable *alt, int realtime, int ispeer);
 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);
@@ -3930,7 +3910,7 @@
 
 
 	/* Peer found in realtime, now build it in memory */
-	peer = build_peer(newpeername, var, varregs, TRUE);
+	peer = build_peer(newpeername, var, varregs, TRUE, FALSE);
 	if (!peer) {
 		if(peerlist)
 			ast_config_destroy(peerlist);
@@ -11967,7 +11947,6 @@
 	char iused[40];
 	int showall = FALSE;
 	struct ao2_iterator i;
-	struct sip_user *user;
 	struct sip_peer *peer;
 	
 	switch (cmd) {
@@ -12285,7 +12264,6 @@
 static char *_sip_dbdump(int fd, int *total, struct mansession *s, const struct message *m, int argc, const char *argv[])
 {
 	struct sip_peer *peer;
-	struct sip_user *user;
 	struct ao2_iterator i;
 	char fname[1024];
 	const char *id;
@@ -12319,7 +12297,7 @@
 	i = ao2_iterator_init(peers, 0);
 	while ((peer = ao2_t_iterator_next(&i, "iterate thru peers table"))) {	
 
-		user = find_user(peer->name,realtimepeers);
+		peer = find_peer(peer->name, NULL, realtimepeers, TRUE); 
 
 		ao2_lock(peer);
 
@@ -12339,9 +12317,9 @@
 			fprintf(f1,",amaflags");
 		fprintf(f1,",`call-limit`");
 		if (peer->callgroup)
-			fprintf(f1,",callgroup");
-		if (user && !ast_strlen_zero(user->cid_num))
-			fprintf(f1,",callerid");
+			fprintf(f1,", callgroup");
+		if (!ast_strlen_zero(peer->cid_num))
+			fprintf(f1,", callerid");
 		if (ast_test_flag(&peer->flags[0], SIP_REINVITE))
 			fprintf(f1,",canreinvite");
 		if (!ast_strlen_zero(peer->context))
@@ -12411,10 +12389,7 @@
 		if (ast_test_flag(&peer->flags[0], SIP_NAT)) {
 			fprintf(f1,",'%s'",nat2strconfig(ast_test_flag(&peer->flags[0], SIP_NAT)));
 		}
-		if (user)
-			fprintf(f1,",'friend'");
-		else
-			fprintf(f1,",'peer'");
+		fprintf(f1,",'peer'");
 		if (!ast_strlen_zero(peer->accountcode))
 			fprintf(f1,",'%s'", peer->accountcode);
 		if (peer->amaflags)
@@ -12425,8 +12400,6 @@
 			
 			fprintf(f1,",'%s'", ast_print_group(buf, sizeof(buf), peer->callgroup));
 		}
-		if (user && !ast_strlen_zero(user->cid_num))
-			fprintf(f1,",\"%s<%s>\"", user->cid_name, user->cid_num);
 		if (ast_test_flag(&peer->flags[0], SIP_REINVITE)) {
 			switch (ast_test_flag(&peer->flags[0], SIP_REINVITE)) {
 			case SIP_REINVITE_NONE:
@@ -12724,16 +12697,6 @@
 #undef FORMAT2
 }
 
-static int user_dump_func(void *userobj, void *arg, int flags)
-{
-	struct sip_user *user = userobj;
-	int refc = ao2_t_ref(userobj, 0, "");
-	int *fd = arg;
-	
-	ast_cli(*fd, "name: %s\ntype: user\nobjflags: %d\nrefcount: %d\n\n", user->name, 0, refc);
-	return 0;
-}
-
 static int peer_dump_func(void *userobj, void *arg, int flags)
 {
 	struct sip_peer *peer = userobj;
@@ -13171,7 +13134,7 @@
 		return CLI_SHOWUSAGE;
 
 	load_realtime = (argc == 5 && !strcmp(argv[4], "load")) ? TRUE : FALSE;
-	if ((peer = find_peer(argv[3], NULL, load_realtime))) {
+	if ((peer = find_peer(argv[3], NULL, load_realtime, FALSE))) {
 		sip_poke_peer(peer, 1);
 		unref_peer(peer, "qualify: done with peer");
 	} else if (type == 0) {
@@ -20971,8 +20934,6 @@
 		ASTOBJ_CONTAINER_DESTROYALL(&regl, sip_registry_destroy);
 		ast_debug(4, "--------------- Done destroying registry list\n");
 		ao2_t_callback(peers, OBJ_NODATA, peer_markall_func, 0, "callback to mark all peers");
-		/* reinstate the user table */
-		users = ao2_t_container_alloc(hash_user_size, user_hash_cb, user_cmp_cb, "allocate users");
 	}
 	
 	/* Reset certificate handling for TLS sessions */
@@ -21051,8 +21012,8 @@
 	global_rtpkeepalive = 0;
 	global_allowtransfer = TRANSFER_OPENFORALL;	/* Merrily accept all transfers by default */
 	global_rtautoclear = 120;
-	ast_set_flag(&global_flags[1], SIP_PAGE2_ALLOWSUBSCRIBE);	/* Default for peers, users: TRUE */
-	ast_set_flag(&global_flags[1], SIP_PAGE2_ALLOWOVERLAP);		/* Default for peers, users: TRUE */
+	ast_set_flag(&global_flags[1], SIP_PAGE2_ALLOWSUBSCRIBE);	/* Default for all devices: TRUE */
+	ast_set_flag(&global_flags[1], SIP_PAGE2_ALLOWOVERLAP);		/* Default for all devices: TRUE */
 	sip_cfg.peer_rtupdate = TRUE;
 
 	/* Session-Timers */
@@ -21061,7 +21022,7 @@
 	global_min_se  = DEFAULT_MIN_SE;
 	global_max_se  = DEFAULT_MAX_SE;
 
-	/* Initialize some reasonable defaults at SIP reload (used both for channel and as default for peers and users */
+	/* Initialize some reasonable defaults at SIP reload (used both for channel and as default for devices */
 	ast_copy_string(default_context, DEFAULT_CONTEXT, sizeof(default_context));
 	default_subscribecontext[0] = '\0';
 	default_language[0] = '\0';




More information about the asterisk-commits mailing list