[asterisk-commits] junky: branch junky/cli-tls r209393 - in /team/junky/cli-tls: channels/ main/

SVN commits to the Asterisk project asterisk-commits at lists.digium.com
Mon Jul 27 21:51:23 CDT 2009


Author: junky
Date: Mon Jul 27 21:51:17 2009
New Revision: 209393

URL: http://svn.asterisk.org/svn-view/asterisk?view=rev&rev=209393
Log:
when calling ast_channel_alloc(), we must call ast_tls_add_channel() to add that newly created channel to the tls container
this is the patch for all channel drivers (except chan_sip)


Modified:
    team/junky/cli-tls/channels/chan_agent.c
    team/junky/cli-tls/channels/chan_alsa.c
    team/junky/cli-tls/channels/chan_bridge.c
    team/junky/cli-tls/channels/chan_dahdi.c
    team/junky/cli-tls/channels/chan_gtalk.c
    team/junky/cli-tls/channels/chan_h323.c
    team/junky/cli-tls/channels/chan_iax2.c
    team/junky/cli-tls/channels/chan_jingle.c
    team/junky/cli-tls/channels/chan_local.c
    team/junky/cli-tls/channels/chan_mgcp.c
    team/junky/cli-tls/channels/chan_misdn.c
    team/junky/cli-tls/channels/chan_multicast_rtp.c
    team/junky/cli-tls/channels/chan_nbs.c
    team/junky/cli-tls/channels/chan_oss.c
    team/junky/cli-tls/channels/chan_phone.c
    team/junky/cli-tls/channels/chan_skinny.c
    team/junky/cli-tls/channels/chan_unistim.c
    team/junky/cli-tls/channels/chan_usbradio.c
    team/junky/cli-tls/channels/chan_vpb.cc
    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=209393&r1=209392&r2=209393
==============================================================================
--- team/junky/cli-tls/channels/chan_agent.c (original)
+++ team/junky/cli-tls/channels/chan_agent.c Mon Jul 27 21:51:17 2009
@@ -1004,7 +1004,7 @@
 		ast_log(LOG_WARNING, "Unable to allocate agent channel structure\n");
 		return NULL;
 	}
-
+	ast_tls_add_channel(tmp);
 	tmp->tech = &agent_tech;
 	if (p->chan) {
 		tmp->nativeformats = p->chan->nativeformats;

Modified: team/junky/cli-tls/channels/chan_alsa.c
URL: http://svn.asterisk.org/svn-view/asterisk/team/junky/cli-tls/channels/chan_alsa.c?view=diff&rev=209393&r1=209392&r2=209393
==============================================================================
--- team/junky/cli-tls/channels/chan_alsa.c (original)
+++ team/junky/cli-tls/channels/chan_alsa.c Mon Jul 27 21:51:17 2009
@@ -538,7 +538,8 @@
 
 	if (!(tmp = ast_channel_alloc(1, state, 0, 0, "", p->exten, p->context, linkedid, 0, "ALSA/%s", indevname)))
 		return NULL;
-
+	
+	ast_tls_add_channel(tmp);
 	tmp->tech = &alsa_tech;
 	ast_channel_set_fd(tmp, 0, readdev);
 	tmp->nativeformats = AST_FORMAT_SLINEAR;

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=209393&r1=209392&r2=209393
==============================================================================
--- team/junky/cli-tls/channels/chan_bridge.c (original)
+++ team/junky/cli-tls/channels/chan_bridge.c Mon Jul 27 21:51:17 2009
@@ -209,6 +209,10 @@
 		return NULL;
 	}
 
+	/* Adding these 2 newly created channels to TLS container */
+	ast_tls_add_channel(p->input);
+	ast_tls_add_channel(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_dahdi.c
URL: http://svn.asterisk.org/svn-view/asterisk/team/junky/cli-tls/channels/chan_dahdi.c?view=diff&rev=209393&r1=209392&r2=209393
==============================================================================
--- team/junky/cli-tls/channels/chan_dahdi.c (original)
+++ team/junky/cli-tls/channels/chan_dahdi.c Mon Jul 27 21:51:17 2009
@@ -7944,6 +7944,7 @@
 	tmp = ast_channel_alloc(0, state, i->cid_num, i->cid_name, i->accountcode, i->exten, i->context, linkedid, i->amaflags, "DAHDI/%s", ast_str_buffer(chan_name));
 	if (!tmp)
 		return NULL;
+	ast_tls_add_channel(tmp);
 	tmp->tech = &dahdi_tech;
 	memset(&ps, 0, sizeof(ps));
 	ps.channo = i->channel;

Modified: team/junky/cli-tls/channels/chan_gtalk.c
URL: http://svn.asterisk.org/svn-view/asterisk/team/junky/cli-tls/channels/chan_gtalk.c?view=diff&rev=209393&r1=209392&r2=209393
==============================================================================
--- team/junky/cli-tls/channels/chan_gtalk.c (original)
+++ team/junky/cli-tls/channels/chan_gtalk.c Mon Jul 27 21:51:17 2009
@@ -1002,6 +1002,7 @@
 		ast_log(LOG_WARNING, "Unable to allocate Gtalk channel structure!\n");
 		return NULL;
 	}
+	ast_tls_add_channel(tmp);
 	tmp->tech = &gtalk_tech;
 
 	/* Select our native format based on codec preference until we receive

Modified: team/junky/cli-tls/channels/chan_h323.c
URL: http://svn.asterisk.org/svn-view/asterisk/team/junky/cli-tls/channels/chan_h323.c?view=diff&rev=209393&r1=209392&r2=209393
==============================================================================
--- team/junky/cli-tls/channels/chan_h323.c (original)
+++ team/junky/cli-tls/channels/chan_h323.c Mon Jul 27 21:51:17 2009
@@ -1017,6 +1017,8 @@
 	ast_module_ref(ast_module_info->self);
 	ast_mutex_lock(&pvt->lock);
 	if (ch) {
+		ast_tls_add_channel(ch);
+
 		ch->tech = &oh323_tech;
 		if (!(fmt = pvt->jointcapability) && !(fmt = pvt->options.capability))
 			fmt = global_options.capability;

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=209393&r1=209392&r2=209393
==============================================================================
--- team/junky/cli-tls/channels/chan_iax2.c (original)
+++ team/junky/cli-tls/channels/chan_iax2.c Mon Jul 27 21:51:17 2009
@@ -4545,6 +4545,7 @@
 	iax2_ami_channelupdate(i);
 	if (!tmp)
 		return NULL;
+	ast_tls_add_channel(tmp);
 	tmp->tech = &iax2_tech;
 	/* We can support any format by default, until we get restricted */
 	tmp->nativeformats = capability;
@@ -8009,6 +8010,10 @@
 	chan1m = ast_channel_alloc(0, AST_STATE_DOWN, 0, 0, chan2->accountcode, chan1->exten, chan1->context, chan1->linkedid, chan1->amaflags, "Parking/%s", chan1->name);
 	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);
+
 		/* Make formats okay */
 		chan1m->readformat = chan1->readformat;
 		chan1m->writeformat = chan1->writeformat;

Modified: team/junky/cli-tls/channels/chan_jingle.c
URL: http://svn.asterisk.org/svn-view/asterisk/team/junky/cli-tls/channels/chan_jingle.c?view=diff&rev=209393&r1=209392&r2=209393
==============================================================================
--- team/junky/cli-tls/channels/chan_jingle.c (original)
+++ team/junky/cli-tls/channels/chan_jingle.c Mon Jul 27 21:51:17 2009
@@ -805,6 +805,7 @@
 		ast_log(LOG_WARNING, "Unable to allocate Jingle channel structure!\n");
 		return NULL;
 	}
+	ast_tls_add_channel(tmp);
 	tmp->tech = &jingle_tech;
 
 	/* Select our native format based on codec preference until we receive

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=209393&r1=209392&r2=209393
==============================================================================
--- team/junky/cli-tls/channels/chan_local.c (original)
+++ team/junky/cli-tls/channels/chan_local.c Mon Jul 27 21:51:17 2009
@@ -806,7 +806,7 @@
 		ast_log(LOG_WARNING, "Unable to allocate channel structure(s)\n");
 		return NULL;
 	}
-
+	ast_tls_add_channel(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=209393&r1=209392&r2=209393
==============================================================================
--- team/junky/cli-tls/channels/chan_mgcp.c (original)
+++ team/junky/cli-tls/channels/chan_mgcp.c Mon Jul 27 21:51:17 2009
@@ -1474,6 +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);
 		tmp->tech = &mgcp_tech;
 		tmp->nativeformats = i->capability;
 		if (!tmp->nativeformats)

Modified: team/junky/cli-tls/channels/chan_misdn.c
URL: http://svn.asterisk.org/svn-view/asterisk/team/junky/cli-tls/channels/chan_misdn.c?view=diff&rev=209393&r1=209392&r2=209393
==============================================================================
--- team/junky/cli-tls/channels/chan_misdn.c (original)
+++ team/junky/cli-tls/channels/chan_misdn.c Mon Jul 27 21:51:17 2009
@@ -7789,6 +7789,7 @@
 
 	tmp = ast_channel_alloc(1, state, cid_num, cid_name, "", exten, "", linkedid, 0, "%s/%s%d-u%d", misdn_type, c ? "" : "tmp", chan_offset + c, glob_channel++);
 	if (tmp) {
+		ast_tls_add_channel(tmp);
 		chan_misdn_log(2, 0, " --> * NEW CHANNEL dialed:%s caller:%s\n", exten, callerid);
 
 		tmp->nativeformats = prefformat;

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=209393&r1=209392&r2=209393
==============================================================================
--- team/junky/cli-tls/channels/chan_multicast_rtp.c (original)
+++ team/junky/cli-tls/channels/chan_multicast_rtp.c Mon Jul 27 21:51:17 2009
@@ -144,8 +144,10 @@
 		ast_rtp_instance_destroy(instance);
 		goto failure;
 	}
-
+	
 	ast_rtp_instance_set_remote_address(instance, &destination_address);
+	
+	ast_tls_add_channel(chan);
 
 	chan->tech = &multicast_rtp_tech;
 	chan->nativeformats = fmt;

Modified: team/junky/cli-tls/channels/chan_nbs.c
URL: http://svn.asterisk.org/svn-view/asterisk/team/junky/cli-tls/channels/chan_nbs.c?view=diff&rev=209393&r1=209392&r2=209393
==============================================================================
--- team/junky/cli-tls/channels/chan_nbs.c (original)
+++ team/junky/cli-tls/channels/chan_nbs.c Mon Jul 27 21:51:17 2009
@@ -224,6 +224,7 @@
 	struct ast_channel *tmp;
 	tmp = ast_channel_alloc(1, state, 0, 0, "", "s", context, linkedid, 0, "NBS/%s", i->stream);
 	if (tmp) {
+		ast_tls_add_channel(tmp);
 		tmp->tech = &nbs_tech;
 		ast_channel_set_fd(tmp, 0, nbs_fd(i->nbs));
 		tmp->nativeformats = prefformat;

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=209393&r1=209392&r2=209393
==============================================================================
--- team/junky/cli-tls/channels/chan_oss.c (original)
+++ team/junky/cli-tls/channels/chan_oss.c Mon Jul 27 21:51:17 2009
@@ -797,9 +797,9 @@
 	c = ast_channel_alloc(1, state, o->cid_num, o->cid_name, "", ext, ctx, linkedid, 0, "Console/%s", o->device + 5);
 	if (c == NULL)
 		return NULL;
-	/* TODO add that newly created channel to the TLS container
-	*/
+	/* Add that newly created channel to the TLS container */
 	ast_tls_add_channel(c);
+
 	c->tech = &oss_tech;
 	if (o->sounddev < 0)
 		setformat(o, O_RDWR);

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=209393&r1=209392&r2=209393
==============================================================================
--- team/junky/cli-tls/channels/chan_phone.c (original)
+++ team/junky/cli-tls/channels/chan_phone.c Mon Jul 27 21:51:17 2009
@@ -850,6 +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);
 		tmp->tech = cur_tech;
 		ast_channel_set_fd(tmp, 0, i->fd);
 		/* XXX Switching formats silently causes kernel panics XXX */

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=209393&r1=209392&r2=209393
==============================================================================
--- team/junky/cli-tls/channels/chan_skinny.c (original)
+++ team/junky/cli-tls/channels/chan_skinny.c Mon Jul 27 21:51:17 2009
@@ -4366,6 +4366,7 @@
 		ast_log(LOG_WARNING, "Unable to allocate channel structure\n");
 		return NULL;
 	} else {
+		ast_tls_add_channel(tmp);
 		sub = ast_calloc(1, sizeof(*sub));
 		if (!sub) {
 			ast_log(LOG_WARNING, "Unable to allocate Skinny subchannel\n");

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=209393&r1=209392&r2=209393
==============================================================================
--- team/junky/cli-tls/channels/chan_unistim.c (original)
+++ team/junky/cli-tls/channels/chan_unistim.c Mon Jul 27 21:51:17 2009
@@ -4445,6 +4445,7 @@
 		ast_log(LOG_WARNING, "Unable to allocate channel structure\n");
 		return NULL;
 	}
+	ast_tls_add_channel(tmp);
 
 	tmp->nativeformats = l->capability;
 	if (!tmp->nativeformats)

Modified: team/junky/cli-tls/channels/chan_usbradio.c
URL: http://svn.asterisk.org/svn-view/asterisk/team/junky/cli-tls/channels/chan_usbradio.c?view=diff&rev=209393&r1=209392&r2=209393
==============================================================================
--- team/junky/cli-tls/channels/chan_usbradio.c (original)
+++ team/junky/cli-tls/channels/chan_usbradio.c Mon Jul 27 21:51:17 2009
@@ -2194,6 +2194,7 @@
 	c = ast_channel_alloc(1, state, o->cid_num, o->cid_name, "", ext, ctx, linkedid, 0, "Radio/%s", o->name);
 	if (c == NULL)
 		return NULL;
+	ast_tls_add_channel(c);
 	c->tech = &usbradio_tech;
 	if (o->sounddev < 0)
 		setformat(o, O_RDWR);

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=209393&r1=209392&r2=209393
==============================================================================
--- team/junky/cli-tls/channels/chan_vpb.cc (original)
+++ team/junky/cli-tls/channels/chan_vpb.cc Mon Jul 27 21:51:17 2009
@@ -2480,6 +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);
 		if (use_ast_ind == 1){
 			tmp->tech = &vpb_tech_indicate;
 		} else {

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=209393&r1=209392&r2=209393
==============================================================================
--- team/junky/cli-tls/main/pbx.c (original)
+++ team/junky/cli-tls/main/pbx.c Mon Jul 27 21:51:17 2009
@@ -7701,6 +7701,7 @@
 		if (!tmpchan) {
 			res = -1;
 		} else {
+			ast_tls_add_channel(tmpchan);
 			if (chan->cdr) {
 				ast_cdr_discard(tmpchan->cdr);
 				tmpchan->cdr = ast_cdr_dup(chan->cdr);  /* share the love */
@@ -8366,6 +8367,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);
 					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