[asterisk-commits] junky: branch junky/cli-tls r212239 - in /team/junky/cli-tls: channels/ inclu...

SVN commits to the Asterisk project asterisk-commits at lists.digium.com
Thu Aug 13 20:36:36 CDT 2009


Author: junky
Date: Thu Aug 13 20:36:31 2009
New Revision: 212239

URL: http://svn.asterisk.org/svn-view/asterisk?view=rev&rev=212239
Log:
rename the ast_tls_add_channel() and remove() functions to:
ast_channel_threadassoc_add( )
ast_channel_threadassoc_del( )

return for NULL previously to save indentation.
remove unused functions

Thanks to everyone for review.


Modified:
    team/junky/cli-tls/channels/chan_agent.c
    team/junky/cli-tls/channels/chan_bridge.c
    team/junky/cli-tls/channels/chan_iax2.c
    team/junky/cli-tls/channels/chan_local.c
    team/junky/cli-tls/channels/chan_mgcp.c
    team/junky/cli-tls/channels/chan_multicast_rtp.c
    team/junky/cli-tls/channels/chan_oss.c
    team/junky/cli-tls/channels/chan_phone.c
    team/junky/cli-tls/channels/chan_sip.c
    team/junky/cli-tls/channels/chan_skinny.c
    team/junky/cli-tls/channels/chan_unistim.c
    team/junky/cli-tls/channels/chan_vpb.cc
    team/junky/cli-tls/include/asterisk/logger.h
    team/junky/cli-tls/main/logger.c
    team/junky/cli-tls/main/pbx.c

Modified: team/junky/cli-tls/channels/chan_agent.c
URL: http://svn.asterisk.org/svn-view/asterisk/team/junky/cli-tls/channels/chan_agent.c?view=diff&rev=212239&r1=212238&r2=212239
==============================================================================
--- team/junky/cli-tls/channels/chan_agent.c (original)
+++ team/junky/cli-tls/channels/chan_agent.c Thu Aug 13 20:36:31 2009
@@ -1004,7 +1004,7 @@
 		ast_log(LOG_WARNING, "Unable to allocate agent channel structure\n");
 		return NULL;
 	}
-	ast_tls_add_channel(tmp);
+	ast_channel_threadassoc_add(tmp);
 	tmp->tech = &agent_tech;
 	if (p->chan) {
 		tmp->nativeformats = p->chan->nativeformats;

Modified: team/junky/cli-tls/channels/chan_bridge.c
URL: http://svn.asterisk.org/svn-view/asterisk/team/junky/cli-tls/channels/chan_bridge.c?view=diff&rev=212239&r1=212238&r2=212239
==============================================================================
--- team/junky/cli-tls/channels/chan_bridge.c (original)
+++ team/junky/cli-tls/channels/chan_bridge.c Thu Aug 13 20:36:31 2009
@@ -210,8 +210,8 @@
 	}
 
 	/* Adding these 2 newly created channels to TLS container */
-	ast_tls_add_channel(p->input);
-	ast_tls_add_channel(p->output);
+	ast_channel_threadassoc_add(p->input);
+	ast_channel_threadassoc_add(p->output);
 
 	/* Setup the lock on the pvt structure, we will need that */
 	ast_mutex_init(&p->lock);

Modified: team/junky/cli-tls/channels/chan_iax2.c
URL: http://svn.asterisk.org/svn-view/asterisk/team/junky/cli-tls/channels/chan_iax2.c?view=diff&rev=212239&r1=212238&r2=212239
==============================================================================
--- team/junky/cli-tls/channels/chan_iax2.c (original)
+++ team/junky/cli-tls/channels/chan_iax2.c Thu Aug 13 20:36:31 2009
@@ -4545,7 +4545,7 @@
 	iax2_ami_channelupdate(i);
 	if (!tmp)
 		return NULL;
-	ast_tls_add_channel(tmp);
+	ast_channel_threadassoc_add(tmp);
 	tmp->tech = &iax2_tech;
 	/* We can support any format by default, until we get restricted */
 	tmp->nativeformats = capability;
@@ -4630,6 +4630,7 @@
 			i->owner = NULL;
 			return NULL;
 		}
+		ast_channel_threadassoc_del(tmp);
 	}
 
 	ast_module_ref(ast_module_info->self);
@@ -8011,8 +8012,8 @@
 	chan2m = ast_channel_alloc(0, AST_STATE_DOWN, 0, 0, chan2->accountcode, chan2->exten, chan2->context, chan2->linkedid, chan2->amaflags, "IAXPeer/%s", chan2->name);
 	if (chan2m && chan1m) {
 		/* Adding these 2 newly channels created to the TLS container */
-		ast_tls_add_channel(chan1m);
-		ast_tls_add_channel(chan2m);
+		ast_channel_threadassoc_add(chan1m);
+		ast_channel_threadassoc_add(chan2m);
 
 		/* Make formats okay */
 		chan1m->readformat = chan1->readformat;

Modified: team/junky/cli-tls/channels/chan_local.c
URL: http://svn.asterisk.org/svn-view/asterisk/team/junky/cli-tls/channels/chan_local.c?view=diff&rev=212239&r1=212238&r2=212239
==============================================================================
--- team/junky/cli-tls/channels/chan_local.c (original)
+++ team/junky/cli-tls/channels/chan_local.c Thu Aug 13 20:36:31 2009
@@ -625,6 +625,8 @@
 	if (!(res = ast_pbx_start(p->chan)))
 		ast_set_flag(p, LOCAL_LAUNCHED_PBX);
 
+	ast_channel_threadassoc_del(ast);
+
 	ast_mutex_unlock(&p->lock);
 	ast_channel_unlock(p->chan);
 	return res;
@@ -806,7 +808,7 @@
 		ast_log(LOG_WARNING, "Unable to allocate channel structure(s)\n");
 		return NULL;
 	}
-	ast_tls_add_channel(tmp);
+	ast_channel_threadassoc_add(tmp);
 	tmp2->tech = tmp->tech = &local_tech;
 
 	tmp->nativeformats = p->reqformat;

Modified: team/junky/cli-tls/channels/chan_mgcp.c
URL: http://svn.asterisk.org/svn-view/asterisk/team/junky/cli-tls/channels/chan_mgcp.c?view=diff&rev=212239&r1=212238&r2=212239
==============================================================================
--- team/junky/cli-tls/channels/chan_mgcp.c (original)
+++ team/junky/cli-tls/channels/chan_mgcp.c Thu Aug 13 20:36:31 2009
@@ -1474,7 +1474,7 @@
 
 	tmp = ast_channel_alloc(1, state, i->cid_num, i->cid_name, linkedid, i->accountcode, i->exten, i->context, i->amaflags, "MGCP/%s@%s-%d", i->name, i->parent->name, sub->id);
 	if (tmp) {
-		ast_tls_add_channel(tmp);
+		ast_channel_threadassoc_add(tmp);
 		tmp->tech = &mgcp_tech;
 		tmp->nativeformats = i->capability;
 		if (!tmp->nativeformats)
@@ -1526,6 +1526,7 @@
 				ast_hangup(tmp);
 				tmp = NULL;
 			}
+			ast_channel_threadassoc_del(tmp);
 		}
 		ast_verb(3, "MGCP mgcp_new(%s) created in state: %s\n",
 				tmp->name, ast_state2str(state));

Modified: team/junky/cli-tls/channels/chan_multicast_rtp.c
URL: http://svn.asterisk.org/svn-view/asterisk/team/junky/cli-tls/channels/chan_multicast_rtp.c?view=diff&rev=212239&r1=212238&r2=212239
==============================================================================
--- team/junky/cli-tls/channels/chan_multicast_rtp.c (original)
+++ team/junky/cli-tls/channels/chan_multicast_rtp.c Thu Aug 13 20:36:31 2009
@@ -147,7 +147,7 @@
 	
 	ast_rtp_instance_set_remote_address(instance, &destination_address);
 	
-	ast_tls_add_channel(chan);
+	ast_channel_threadassoc_add(chan);
 
 	chan->tech = &multicast_rtp_tech;
 	chan->nativeformats = fmt;

Modified: team/junky/cli-tls/channels/chan_oss.c
URL: http://svn.asterisk.org/svn-view/asterisk/team/junky/cli-tls/channels/chan_oss.c?view=diff&rev=212239&r1=212238&r2=212239
==============================================================================
--- team/junky/cli-tls/channels/chan_oss.c (original)
+++ team/junky/cli-tls/channels/chan_oss.c Thu Aug 13 20:36:31 2009
@@ -791,7 +791,7 @@
 	if (c == NULL)
 		return NULL;
 	/* Add that newly created channel to the TLS container */
-	ast_tls_add_channel(c);
+	ast_channel_threadassoc_add(c);
 
 	c->tech = &oss_tech;
 	if (o->sounddev < 0)
@@ -823,6 +823,7 @@
 			ast_hangup(c);
 			o->owner = c = NULL;
 		}
+		ast_channel_threadassoc_del(c);
 	}
 	console_video_start(get_video_desc(c), c); /* XXX cleanup */
 

Modified: team/junky/cli-tls/channels/chan_phone.c
URL: http://svn.asterisk.org/svn-view/asterisk/team/junky/cli-tls/channels/chan_phone.c?view=diff&rev=212239&r1=212238&r2=212239
==============================================================================
--- team/junky/cli-tls/channels/chan_phone.c (original)
+++ team/junky/cli-tls/channels/chan_phone.c Thu Aug 13 20:36:31 2009
@@ -850,7 +850,7 @@
 	struct phone_codec_data queried_codec;
 	tmp = ast_channel_alloc(1, state, i->cid_num, i->cid_name, "", i->ext, i->context, linkedid, 0, "Phone/%s", i->dev + 5);
 	if (tmp) {
-		ast_tls_add_channel(tmp);
+		ast_channel_threadassoc_add(tmp);
 		tmp->tech = cur_tech;
 		ast_channel_set_fd(tmp, 0, i->fd);
 		/* XXX Switching formats silently causes kernel panics XXX */
@@ -900,6 +900,7 @@
 				ast_log(LOG_WARNING, "Unable to start PBX on %s\n", tmp->name);
 				ast_hangup(tmp);
 			}
+			ast_channel_threadassoc_del(tmp);
 		}
 	} else
 		ast_log(LOG_WARNING, "Unable to allocate channel structure\n");

Modified: team/junky/cli-tls/channels/chan_sip.c
URL: http://svn.asterisk.org/svn-view/asterisk/team/junky/cli-tls/channels/chan_sip.c?view=diff&rev=212239&r1=212238&r2=212239
==============================================================================
--- team/junky/cli-tls/channels/chan_sip.c (original)
+++ team/junky/cli-tls/channels/chan_sip.c Thu Aug 13 20:36:31 2009
@@ -6581,6 +6581,8 @@
 		sip_pvt_lock(i);
 		return NULL;
 	}
+	ast_channel_threadassoc_add(tmp);
+
 	sip_pvt_lock(i);
 
 	tmp->tech = ( ast_test_flag(&i->flags[0], SIP_DTMF) == SIP_DTMF_INFO || ast_test_flag(&i->flags[0], SIP_DTMF) == SIP_DTMF_SHORTINFO) ?  &sip_tech_info : &sip_tech;
@@ -6723,6 +6725,8 @@
 		ast_hangup(tmp);
 		tmp = NULL;
 	}
+
+	ast_channel_threadassoc_del(tmp);
 
 	if (i->do_history)
 		append_history(i, "NewChan", "Channel %s - from %s", tmp->name, i->callid);
@@ -19055,6 +19059,10 @@
 		return -1;
 	}
 
+	
+	ast_channel_threadassoc_add(transferer);
+	ast_channel_threadassoc_add(transferee);
+
 	/* Make formats okay */
 	transferee->readformat = chan1->readformat;
 	transferee->writeformat = chan1->writeformat;
@@ -20579,6 +20587,7 @@
 				enum ast_pbx_result result;
 
 				result = ast_pbx_start(c);
+				ast_channel_threadassoc_del(c);
 
 				switch(result) {
 				case AST_PBX_FAILED:

Modified: team/junky/cli-tls/channels/chan_skinny.c
URL: http://svn.asterisk.org/svn-view/asterisk/team/junky/cli-tls/channels/chan_skinny.c?view=diff&rev=212239&r1=212238&r2=212239
==============================================================================
--- team/junky/cli-tls/channels/chan_skinny.c (original)
+++ team/junky/cli-tls/channels/chan_skinny.c Thu Aug 13 20:36:31 2009
@@ -4369,7 +4369,7 @@
 		ast_log(LOG_WARNING, "Unable to allocate channel structure\n");
 		return NULL;
 	} else {
-		ast_tls_add_channel(tmp);
+		ast_channel_threadassoc_add(tmp);
 		sub = ast_calloc(1, sizeof(*sub));
 		if (!sub) {
 			ast_log(LOG_WARNING, "Unable to allocate Skinny subchannel\n");
@@ -4454,6 +4454,7 @@
 				ast_hangup(tmp);
 				tmp = NULL;
 			}
+			ast_channel_threadassoc_del(tmp);
 		}
 	}
 	return tmp;

Modified: team/junky/cli-tls/channels/chan_unistim.c
URL: http://svn.asterisk.org/svn-view/asterisk/team/junky/cli-tls/channels/chan_unistim.c?view=diff&rev=212239&r1=212238&r2=212239
==============================================================================
--- team/junky/cli-tls/channels/chan_unistim.c (original)
+++ team/junky/cli-tls/channels/chan_unistim.c Thu Aug 13 20:36:31 2009
@@ -4445,7 +4445,7 @@
 		ast_log(LOG_WARNING, "Unable to allocate channel structure\n");
 		return NULL;
 	}
-	ast_tls_add_channel(tmp);
+	ast_channel_threadassoc_add(tmp);
 
 	tmp->nativeformats = l->capability;
 	if (!tmp->nativeformats)
@@ -4503,6 +4503,7 @@
 			ast_hangup(tmp);
 			tmp = NULL;
 		}
+		ast_channel_threadassoc_del(tmp);
 	}
 
 	return tmp;

Modified: team/junky/cli-tls/channels/chan_vpb.cc
URL: http://svn.asterisk.org/svn-view/asterisk/team/junky/cli-tls/channels/chan_vpb.cc?view=diff&rev=212239&r1=212238&r2=212239
==============================================================================
--- team/junky/cli-tls/channels/chan_vpb.cc (original)
+++ team/junky/cli-tls/channels/chan_vpb.cc Thu Aug 13 20:36:31 2009
@@ -2480,7 +2480,7 @@
 	    
 	tmp = ast_channel_alloc(1, state, 0, 0, "", me->ext, me->context, linkedid, 0, "%s", me->dev);
 	if (tmp) {
-		ast_tls_add_channel(tmp);
+		ast_channel_threadassoc_add(tmp);
 		if (use_ast_ind == 1){
 			tmp->tech = &vpb_tech_indicate;
 		} else {
@@ -2535,6 +2535,7 @@
 				ast_log(LOG_WARNING, "Unable to start PBX on %s\n", tmp->name);
 				ast_hangup(tmp);
 		   	}
+			ast_channel_threadassoc_del(tmp);
 		}
 	} else {
 		ast_log(LOG_WARNING, "Unable to allocate channel structure\n");

Modified: team/junky/cli-tls/include/asterisk/logger.h
URL: http://svn.asterisk.org/svn-view/asterisk/team/junky/cli-tls/include/asterisk/logger.h?view=diff&rev=212239&r1=212238&r2=212239
==============================================================================
--- team/junky/cli-tls/include/asterisk/logger.h (original)
+++ team/junky/cli-tls/include/asterisk/logger.h Thu Aug 13 20:36:31 2009
@@ -213,9 +213,9 @@
 void ast_logger_unregister_level(const char *name);
 
 /* To add a channel to a TLS object */
-int ast_tls_add_channel(struct ast_channel *chan);
-
-int ast_tls_remove_channel(struct ast_channel *chan);
+int ast_channel_threadassoc_add(struct ast_channel *chan);
+
+int ast_channel_threadassoc_del(struct ast_channel *chan);
 
 int ast_is_string_match_cli_filters(void);
 struct ast_cli_filter *ast_filter_get_by_name(const char *name);

Modified: team/junky/cli-tls/main/logger.c
URL: http://svn.asterisk.org/svn-view/asterisk/team/junky/cli-tls/main/logger.c?view=diff&rev=212239&r1=212238&r2=212239
==============================================================================
--- team/junky/cli-tls/main/logger.c (original)
+++ team/junky/cli-tls/main/logger.c Thu Aug 13 20:36:31 2009
@@ -1121,7 +1121,7 @@
 	}
 
 	count = ast_filter_add(type,name);	
-        astman_append(s, "Response: Success\r\n%s", idText);
+        astman_append(s, "Response: Success\r\n%s\r\n", idText);
         return 0;
 }
 
@@ -1138,9 +1138,13 @@
                 idText[0] = '\0';
         }
 
+	if (ast_strlen_zero(name)) {
+		astman_send_error(s, m, "FilterRemove must provide a name.");
+		return -1;
+	}
 	count = ast_filter_remove(name);
 	if (count > 0) {
-	        astman_append(s, "Response: Success\r\n%s", idText);
+	        astman_append(s, "Response: Success\r\n%s\r\n", idText);
 	} else {
 		astman_send_error(s, m, "That filter doesn't exist");	
 	}
@@ -1163,7 +1167,7 @@
                 astman_append(s,"%s\n", filter->name);
         }
 
-        astman_append(s, "Response: Success\r\n%s", idText);
+        astman_append(s, "Response: Success\r\n%s\r\n", idText);
         return 0;
 }
 
@@ -1720,31 +1724,30 @@
 
 //http://pastebin.ca/1474652
 /* Function used to add a specific channel to the TLS container */
-int ast_tls_add_channel(struct ast_channel *chan){
+int ast_channel_threadassoc_add(struct ast_channel *chan){
         struct logger_filter_list_item *filter;
-        int res = 0;
-
-        if ((channels = ast_threadstorage_get(&filter_channels, sizeof(*channels)))) {
-		my_printf("Adding channel(%s) to channels_list\n", chan->name);
-		filter = ast_calloc(1, sizeof(*filter));
-		if (!filter) {
-			return -1;
-		}
-		filter->chan = ast_channel_ref(chan);
-		my_printf("TLS channel name is:%s\n", filter->chan->name);
-		AST_LIST_INSERT_HEAD(channels, filter, next);
-        } else {
-		res = -1;
-	}
-	return res;
+	channels = ast_threadstorage_get(&filter_channels, sizeof(*channels));
+
+        if (!channels) {
+		return -1;
+	}
+	my_printf("Adding channel(%s) to channels_list\n", chan->name);
+	filter = ast_calloc(1, sizeof(*filter));
+	if (!filter) {
+		return -1;
+	}
+	filter->chan = ast_channel_ref(chan);
+	my_printf("TLS channel name is:%s\n", filter->chan->name);
+	AST_LIST_INSERT_HEAD(channels, filter, next);
+	return 0;
 }
 
 /* Function used to remove a specific channel from the TLS container 
 Will be used for different channel driver monitor threads
 */
-int ast_tls_remove_channel(struct ast_channel *chan){
+int ast_channel_threadassoc_del(struct ast_channel *chan){
 	struct logger_filter_list_item *filter;
-	int res = 0;
+	int res = -1;
 
 	channels = ast_threadstorage_get(&filter_channels, sizeof(*channels));
 	if (!channels) {
@@ -1753,10 +1756,10 @@
 	AST_LIST_TRAVERSE_SAFE_BEGIN(channels, filter, next) {
 		if (!strcmp(filter->chan->name, chan->name)) {
 			AST_LIST_REMOVE_CURRENT(next);
-			ast_log(LOG_WARNING, "%s have been sucessfully removed from CLI filter list.\n", chan->name);
+			ast_log(LOG_DEBUG, "%s have been sucessfully removed from CLI filter list.\n", chan->name);
 			ast_channel_unref(chan);
 			ast_free(filter);
-			res=1;
+			res=0;
 			break;
 		}
 	}
@@ -1799,46 +1802,48 @@
 	char *comparator = NULL;
 	char *comparee = NULL;
 
-        if ((channels = ast_threadstorage_get(&filter_channels, sizeof(*channels)))) {
-                my_printf("chan is there!!!!!\n");
-
-                AST_LIST_TRAVERSE_SAFE_BEGIN(channels, filter, next) {
-                        junky_printf("filter!!!\n");
-                        if (filter->chan) {
-				my_printf("chan is %s\n", filter->chan->name);
-
-                                AST_LIST_TRAVERSE(&ast_cli_filters, c, filter_list) {
-					if ( c->type == 1 ) {
-						comparator = ast_strdup(filter->chan->name);
-						comparee = ast_strdup(c->name);
-					} else if (c->type == 2) {
-						comparator = ast_strdup(filter->chan->cid.cid_num);
-						comparee = ast_strdup(c->name);
-					} else if (c->type == 3) {
-						comparator = ast_strdup(filter->chan->accountcode);
-						comparee = ast_strdup(c->name);
-					}
-
-					my_printf("filter name=[%s] type=[%d] comparator=[%s] comparee=[%s]\n",c->name, c->type, comparator, comparee);
-
-					if (strncmp(comparator, comparee, strlen(comparee))) {
-						my_printf("Ignore %s, since this is not in filter list\n", filter->chan->name);
-						res = 1;
-					} else {
-						my_printf("%s match my filter, so continue\n", filter->chan->name);
-						res = 0;
-						break;
-					}
-					ast_free(comparator);
-					ast_free(comparee);
-                                }
-                        }
-                }
-                AST_LIST_TRAVERSE_SAFE_END;
-
-        } else {
-		printf("chan NOT THERE\n");
-	}
+
+	channels = ast_threadstorage_get(&filter_channels, sizeof(*channels));
+        if (!channels) {
+		return res;
+	}
+
+	my_printf("chan is there!!!!!\n");
+
+	AST_LIST_TRAVERSE_SAFE_BEGIN(channels, filter, next) {
+		junky_printf("filter!!!\n");
+		if (!filter->chan) {
+			return res;
+		}
+		my_printf("chan is %s\n", filter->chan->name);
+	
+		AST_LIST_TRAVERSE(&ast_cli_filters, c, filter_list) {
+			if ( c->type == 1 ) {
+				comparator = ast_strdup(filter->chan->name);
+				comparee = ast_strdup(c->name);
+			} else if (c->type == 2) {
+				comparator = ast_strdup(filter->chan->cid.cid_num);
+				comparee = ast_strdup(c->name);
+			} else if (c->type == 3) {
+				comparator = ast_strdup(filter->chan->accountcode);
+				comparee = ast_strdup(c->name);
+			}
+
+			my_printf("filter name=[%s] type=[%d] comparator=[%s] comparee=[%s]\n",c->name, c->type, comparator, comparee);
+			if (strncmp(comparator, comparee, strlen(comparee))) {
+				my_printf("Ignore %s, since this is not in filter list\n", filter->chan->name);
+				res = 1;
+			} else {
+				my_printf("%s match my filter, so continue\n", filter->chan->name);
+				res = 0;
+				break;
+			}
+			ast_free(comparator);
+			ast_free(comparee);
+		}
+	}
+	AST_LIST_TRAVERSE_SAFE_END;
+
 
 	my_printf("I return %d\n",res);
 	return res;

Modified: team/junky/cli-tls/main/pbx.c
URL: http://svn.asterisk.org/svn-view/asterisk/team/junky/cli-tls/main/pbx.c?view=diff&rev=212239&r1=212238&r2=212239
==============================================================================
--- team/junky/cli-tls/main/pbx.c (original)
+++ team/junky/cli-tls/main/pbx.c Thu Aug 13 20:36:31 2009
@@ -3124,56 +3124,6 @@
 	.read = acf_exception_read,
 };
 
-/* Temporary debug function */
-static char *handle_ts_show_channels(struct ast_cli_entry *e, int cmd, struct ast_cli_args *a)
-{
-        //struct logger_filter_list_item *filter;
-
-        switch (cmd) {
-        case CLI_INIT:
-                e->command = "ts show channels";
-                e->usage =
-                        "Usage: ts show channels\n"
-                        "       List All TLS channels\n";
-                return NULL;
-        case CLI_GENERATE:
-                return NULL;
-        }
-
-        if (a->argc != 3) {
-                return CLI_SHOWUSAGE;
-        }
-
-	/*
-                AST_LIST_TRAVERSE_SAFE_BEGIN(channels, filter, next) {
-                        ast_log(LOG_WARNING, "filter!!!\n");
-                        if (filter->chan) {
-                                ast_log(LOG_WARNING, "chan is %s\n", filter->chan->name);
-                        }
-                }
-                AST_LIST_TRAVERSE_SAFE_END;
-	return CLI_SUCCESS;
-	*/
-	/*
-        if ((channels = ast_threadstorage_get(&filter_channels, sizeof(*channels)))) {
-		ast_log(LOG_WARNING, "filter is there\n");
-		//AST_LIST_TRAVERSE_SAFE_BEGIN(&filter->list, chan, chan_list) {
-		AST_LIST_TRAVERSE_SAFE_BEGIN(channels, filter, next) {
-			ast_log(LOG_WARNING, "filter!!!\n");
-			if (filter->chan) {
-				ast_log(LOG_WARNING, "chan is %s\n", filter->chan->name);
-			}
-		}
-		AST_LIST_TRAVERSE_SAFE_END;
-	}
-        AST_LIST_TRAVERSE(&ast_channels, filter, next) {
-                ast_cli(a->fd, "TLS channel name=%s\n", filter->chan->name);
-        }
-	*/
-
-        return CLI_SUCCESS;
-}
-
 
 static char *handle_show_functions(struct ast_cli_entry *e, int cmd, struct ast_cli_args *a)
 {
@@ -4936,7 +4886,7 @@
 	 */
 	struct ast_channel *c = data;
 
-	ast_tls_add_channel(c);
+	ast_channel_threadassoc_add(c);
 
 	__ast_pbx_run(c, NULL);
 	decrease_call_count();
@@ -6722,7 +6672,6 @@
 	AST_CLI_DEFINE(handle_debug_dialplan, "Show fast extension pattern matching data structures"),
 	AST_CLI_DEFINE(handle_unset_extenpatternmatchnew, "Use the Old extension pattern matching algorithm."),
 	AST_CLI_DEFINE(handle_set_extenpatternmatchnew, "Use the New extension pattern matching algorithm."),
-	AST_CLI_DEFINE(handle_ts_show_channels, "List all TLS channels"),
 };
 
 static void unreference_cached_app(struct ast_app *app)
@@ -7701,7 +7650,7 @@
 		if (!tmpchan) {
 			res = -1;
 		} else {
-			ast_tls_add_channel(tmpchan);
+			ast_channel_threadassoc_add(tmpchan);
 			if (chan->cdr) {
 				ast_cdr_discard(tmpchan->cdr);
 				tmpchan->cdr = ast_cdr_dup(chan->cdr);  /* share the love */
@@ -8367,7 +8316,7 @@
 				chan = ast_channel_alloc(0, AST_STATE_DOWN, 0, 0, "", "", "", NULL, 0, "OutgoingSpoolFailed");
 				if (chan) {
 					char failed_reason[4] = "";
-					ast_tls_add_channel(chan);
+					ast_channel_threadassoc_add(chan);
 					if (!ast_strlen_zero(context))
 						ast_copy_string(chan->context, context, sizeof(chan->context));
 					set_ext_pri(chan, "failed", 1);




More information about the asterisk-commits mailing list