[asterisk-commits] twilson: trunk r350223 - in /trunk: addons/ apps/ bridges/ channels/ funcs/ i...

SVN commits to the Asterisk project asterisk-commits at lists.digium.com
Mon Jan 9 16:15:59 CST 2012


Author: twilson
Date: Mon Jan  9 16:15:50 2012
New Revision: 350223

URL: http://svnview.digium.com/svn/asterisk?view=rev&rev=350223
Log:
Replace direct access to channel name with accessor functions

There are many benefits to making the ast_channel an opaque handle, from
increasing maintainability to presenting ways to kill masquerades. This patch
kicks things off by taking things a field at a time, renaming the field to
'__do_not_use_${fieldname}' and then writing setters/getters and converting the
existing code to using them. When all fields are done, we can move ast_channel
to a C file from channel.h and lop off the '__do_not_use_'.

This patch sets up main/channel_interal_api.c to be the only file that actually
accesses the ast_channel's fields directly. The intent would be for any API
functions in channel.c to use the accessor functions. No more monkeying around
with channel internals. We should use our own APIs.

The interesting changes in this patch are the addition of
channel_internal_api.c, the moving of the AST_DATA stuff from channel.c to
channel_internal_api.c (note: the AST_DATA stuff will have to be reworked to
use accessor functions when ast_channel is really opaque), and some re-working
of the way channel iterators/callbacks are handled so as to avoid creating fake
ast_channels on the stack to pass in matching data by directly accessing fields
(since "name" is a stringfield and the fake channel doesn't init the
stringfields, you can't use the ast_channel_name_set() function). I went with
ast_channel_name(chan) for a getter, and ast_channel_name_set(chan, name) for a
setter.

The majority of the grunt-work for this change was done by writing a semantic
patch using Coccinelle ( http://coccinelle.lip6.fr/ ).

Review: https://reviewboard.asterisk.org/r/1655/

Added:
    trunk/main/channel_internal_api.c   (with props)
Modified:
    trunk/addons/chan_mobile.c
    trunk/addons/chan_ooh323.c
    trunk/apps/app_adsiprog.c
    trunk/apps/app_alarmreceiver.c
    trunk/apps/app_amd.c
    trunk/apps/app_chanisavail.c
    trunk/apps/app_chanspy.c
    trunk/apps/app_confbridge.c
    trunk/apps/app_dahdibarge.c
    trunk/apps/app_dahdiras.c
    trunk/apps/app_dial.c
    trunk/apps/app_directed_pickup.c
    trunk/apps/app_disa.c
    trunk/apps/app_dumpchan.c
    trunk/apps/app_externalivr.c
    trunk/apps/app_fax.c
    trunk/apps/app_flash.c
    trunk/apps/app_followme.c
    trunk/apps/app_getcpeid.c
    trunk/apps/app_jack.c
    trunk/apps/app_macro.c
    trunk/apps/app_meetme.c
    trunk/apps/app_milliwatt.c
    trunk/apps/app_minivm.c
    trunk/apps/app_mixmonitor.c
    trunk/apps/app_page.c
    trunk/apps/app_parkandannounce.c
    trunk/apps/app_playback.c
    trunk/apps/app_queue.c
    trunk/apps/app_readexten.c
    trunk/apps/app_record.c
    trunk/apps/app_rpt.c
    trunk/apps/app_sms.c
    trunk/apps/app_softhangup.c
    trunk/apps/app_stack.c
    trunk/apps/app_talkdetect.c
    trunk/apps/app_test.c
    trunk/apps/app_voicemail.c
    trunk/apps/app_waitforsilence.c
    trunk/bridges/bridge_multiplexed.c
    trunk/channels/chan_agent.c
    trunk/channels/chan_alsa.c
    trunk/channels/chan_console.c
    trunk/channels/chan_dahdi.c
    trunk/channels/chan_gtalk.c
    trunk/channels/chan_h323.c
    trunk/channels/chan_iax2.c
    trunk/channels/chan_jingle.c
    trunk/channels/chan_local.c
    trunk/channels/chan_mgcp.c
    trunk/channels/chan_misdn.c
    trunk/channels/chan_nbs.c
    trunk/channels/chan_oss.c
    trunk/channels/chan_phone.c
    trunk/channels/chan_sip.c
    trunk/channels/chan_skinny.c
    trunk/channels/chan_unistim.c
    trunk/channels/chan_usbradio.c
    trunk/channels/chan_vpb.cc
    trunk/channels/console_video.c
    trunk/channels/sig_analog.c
    trunk/channels/sig_pri.c
    trunk/channels/sig_ss7.c
    trunk/funcs/func_audiohookinherit.c
    trunk/funcs/func_channel.c
    trunk/funcs/func_frame_trace.c
    trunk/funcs/func_global.c
    trunk/funcs/func_groupcount.c
    trunk/funcs/func_lock.c
    trunk/include/asterisk/channel.h
    trunk/main/abstract_jb.c
    trunk/main/aoc.c
    trunk/main/app.c
    trunk/main/autochan.c
    trunk/main/bridging.c
    trunk/main/ccss.c
    trunk/main/cdr.c
    trunk/main/cel.c
    trunk/main/channel.c
    trunk/main/cli.c
    trunk/main/dial.c
    trunk/main/dsp.c
    trunk/main/features.c
    trunk/main/file.c
    trunk/main/indications.c
    trunk/main/manager.c
    trunk/main/pbx.c
    trunk/main/rtp_engine.c
    trunk/main/say.c
    trunk/main/udptl.c
    trunk/pbx/pbx_dundi.c
    trunk/pbx/pbx_lua.c
    trunk/pbx/pbx_realtime.c
    trunk/res/res_adsi.c
    trunk/res/res_agi.c
    trunk/res/res_calendar.c
    trunk/res/res_fax.c
    trunk/res/res_jabber.c
    trunk/res/res_monitor.c
    trunk/res/res_musiconhold.c
    trunk/res/res_mutestream.c
    trunk/res/snmp/agent.c

Modified: trunk/addons/chan_mobile.c
URL: http://svnview.digium.com/svn/asterisk/trunk/addons/chan_mobile.c?view=diff&rev=350223&r1=350222&r2=350223
==============================================================================
--- trunk/addons/chan_mobile.c (original)
+++ trunk/addons/chan_mobile.c Mon Jan  9 16:15:50 2012
@@ -960,11 +960,11 @@
 	}
 
 	if ((ast->_state != AST_STATE_DOWN) && (ast->_state != AST_STATE_RESERVED)) {
-		ast_log(LOG_WARNING, "mbl_call called on %s, neither down nor reserved\n", ast->name);
+		ast_log(LOG_WARNING, "mbl_call called on %s, neither down nor reserved\n", ast_channel_name(ast));
 		return -1;
 	}
 
-	ast_debug(1, "Calling %s on %s\n", dest, ast->name);
+	ast_debug(1, "Calling %s on %s\n", dest, ast_channel_name(ast));
 
 	ast_mutex_lock(&pvt->lock);
 	if (pvt->type == MBL_TYPE_PHONE) {

Modified: trunk/addons/chan_ooh323.c
URL: http://svnview.digium.com/svn/asterisk/trunk/addons/chan_ooh323.c?view=diff&rev=350223&r1=350222&r2=350223
==============================================================================
--- trunk/addons/chan_ooh323.c (original)
+++ trunk/addons/chan_ooh323.c Mon Jan  9 16:15:50 2012
@@ -469,7 +469,7 @@
 		ast_setstate(ch, state);
 		if (state != AST_STATE_DOWN) {
          		if (ast_pbx_start(ch)) {
-				ast_log(LOG_WARNING, "Unable to start PBX on %s\n", ch->name);
+				ast_log(LOG_WARNING, "Unable to start PBX on %s\n", ast_channel_name(ch));
             			ast_channel_unlock(ch);
 				ast_hangup(ch);
 				ch = NULL;
@@ -477,7 +477,7 @@
 	 	}
 
 		manager_event(EVENT_FLAG_SYSTEM, "ChannelUpdate", "Channel: %s\r\nChanneltype: %s\r\n"
-				"CallRef: %d\r\n", ch->name, "OOH323", i->call_reference);
+				"CallRef: %d\r\n", ast_channel_name(ch), "OOH323", i->call_reference);
 	} else
 		ast_log(LOG_WARNING, "Unable to allocate channel structure\n");
 
@@ -927,7 +927,7 @@
 
    	if ((ast->_state != AST_STATE_DOWN) && (ast->_state != AST_STATE_RESERVED)) {
 		ast_log(LOG_WARNING, "ooh323_call called on %s, neither down nor "
-								"reserved\n", ast->name);
+								"reserved\n", ast_channel_name(ast));
 		return -1;
 	}
 	ast_mutex_lock(&p->lock);
@@ -1096,7 +1096,7 @@
 			}
 			ast_setstate(ast, AST_STATE_UP);
       			if (option_debug)
-				ast_debug(1, "ooh323_answer(%s)\n", ast->name);
+				ast_debug(1, "ooh323_answer(%s)\n", ast_channel_name(ast));
 			ast_channel_unlock(ast);
 			ooAnswerCall(p->callToken);
 		}
@@ -1141,7 +1141,7 @@
 
 		if (f->frametype == AST_FRAME_MODEM) {
 			ast_debug(1, "Send UDPTL %d/%d len %d for %s\n",
-				f->frametype, f->subclass.integer, f->datalen, ast->name);
+				f->frametype, f->subclass.integer, f->datalen, ast_channel_name(ast));
 			if (p->udptl)
 				res = ast_udptl_write(p->udptl, f);
 			ast_mutex_unlock(&p->lock);
@@ -1388,7 +1388,7 @@
 	ast_mutex_lock(&p->lock);
 
 	if (gH323Debug)
-		ast_verb(0, "----- ooh323_queryoption %d on channel %s\n", option, ast->name);
+		ast_verb(0, "----- ooh323_queryoption %d on channel %s\n", option, ast_channel_name(ast));
 	 
 	switch (option) {
 
@@ -1418,7 +1418,7 @@
 			cp = (char *) data;
 			*cp = p->vad ? 1 : 0;
 			ast_debug(1, "Reporting digit detection %sabled on %s\n",
-							 *cp ? "en" : "dis", ast->name);
+							 *cp ? "en" : "dis", ast_channel_name(ast));
 
 			res = 0;
 			break;
@@ -1428,7 +1428,7 @@
 	}
 
 	if (gH323Debug)
-		ast_verb(0, "+++++ ooh323_queryoption %d on channel %s\n", option, ast->name);
+		ast_verb(0, "+++++ ooh323_queryoption %d on channel %s\n", option, ast_channel_name(ast));
 	 
    	ast_mutex_unlock(&p->lock);
 
@@ -2103,7 +2103,7 @@
 			ast_queue_control(c, AST_CONTROL_ANSWER);
    			ast_channel_unlock(p->owner);
 			manager_event(EVENT_FLAG_SYSTEM,"ChannelUpdate","Channel: %s\r\nChanneltype: %s\r\n"
-				"CallRef: %d\r\n", c->name, "OOH323", p->call_reference);
+				"CallRef: %d\r\n", ast_channel_name(c), "OOH323", p->call_reference);
 		}
 		ast_mutex_unlock(&p->lock);
 
@@ -3844,7 +3844,7 @@
             			ast_debug(1, "Failed to grab lock, trying again\n");
 				DEADLOCK_AVOIDANCE(&cur->lock);
          		}           
-			ast_debug(1, "Detaching from %s\n", cur->owner->name);
+			ast_debug(1, "Detaching from %s\n", ast_channel_name(cur->owner));
 			cur->owner->tech_pvt = NULL;
 			ast_channel_unlock(cur->owner);
 			cur->owner = NULL;
@@ -4179,7 +4179,7 @@
 	int mode;
 
 	if (gH323Debug)
-		ast_verb(0, "---   ooh323_set_peer - %s\n", chan->name);
+		ast_verb(0, "---   ooh323_set_peer - %s\n", ast_channel_name(chan));
 
 	if (!rtp) {
 		return 0;
@@ -4469,7 +4469,7 @@
 	ast_sockaddr_set_port(&them, remotePort);
 
 	ast_udptl_set_peer(p->udptl, &them);
-	ast_udptl_set_tag(p->udptl, "%s", p->owner->name);
+	ast_udptl_set_tag(p->udptl, "%s", ast_channel_name(p->owner));
 	p->t38_tx_enable = 1;
 	p->lastTxT38 = time(NULL);
 	if (p->t38support == T38_ENABLED) {
@@ -4592,7 +4592,7 @@
 		f = ast_udptl_read(p->udptl);		/* UDPTL t.38 data */
 		if (gH323Debug) {
 			 ast_debug(1, "Got UDPTL %d/%d len %d for %s\n",
-				f->frametype, f->subclass.integer, f->datalen, ast->name);
+				f->frametype, f->subclass.integer, f->datalen, ast_channel_name(ast));
 		}
 		break;
 
@@ -4633,10 +4633,10 @@
 			if ((strcmp(p->owner->exten, "fax")) &&
 			    (ast_exists_extension(p->owner, target_context, "fax", 1,
 		            S_COR(p->owner->caller.id.number.valid, p->owner->caller.id.number.str, NULL)))) {
-				ast_verb(2, "Redirecting '%s' to fax extension due to CNG detection\n", p->owner->name);
+				ast_verb(2, "Redirecting '%s' to fax extension due to CNG detection\n", ast_channel_name(p->owner));
 				pbx_builtin_setvar_helper(p->owner, "FAXEXTEN", p->owner->exten);
 				if (ast_async_goto(p->owner, target_context, "fax", 1)) {
-					ast_log(LOG_NOTICE, "Failed to async goto '%s' into fax of '%s'\n", p->owner->name,target_context);
+					ast_log(LOG_NOTICE, "Failed to async goto '%s' into fax of '%s'\n", ast_channel_name(p->owner),target_context);
 				}
 				p->faxdetected = 1;
 				if (dfr) {
@@ -4711,10 +4711,10 @@
                         	if ((strcmp(p->owner->exten, "fax")) &&
                             		(ast_exists_extension(p->owner, target_context, "fax", 1,
                             		S_COR(p->owner->caller.id.number.valid, p->owner->caller.id.number.str, NULL)))) {
-                                	ast_verb(2, "Redirecting '%s' to fax extension due to CNG detection\n", p->owner->name);
+                                	ast_verb(2, "Redirecting '%s' to fax extension due to CNG detection\n", ast_channel_name(p->owner));
                                 	pbx_builtin_setvar_helper(p->owner, "FAXEXTEN", p->owner->exten);
                                 	if (ast_async_goto(p->owner, target_context, "fax", 1)) {
-                                        	ast_log(LOG_NOTICE, "Failed to async goto '%s' into fax of '%s'\n", p->owner->name,target_context);
+                                        	ast_log(LOG_NOTICE, "Failed to async goto '%s' into fax of '%s'\n", ast_channel_name(p->owner),target_context);
 					}
                                 }
                                 p->faxdetected = 1;

Modified: trunk/apps/app_adsiprog.c
URL: http://svnview.digium.com/svn/asterisk/trunk/apps/app_adsiprog.c?view=diff&rev=350223&r1=350222&r2=350223
==============================================================================
--- trunk/apps/app_adsiprog.c (original)
+++ trunk/apps/app_adsiprog.c Mon Jan  9 16:15:50 2012
@@ -1469,7 +1469,7 @@
 	if (ast_adsi_begin_download(chan, scr->desc, scr->fdn, scr->sec, scr->ver)) {
 		/* User rejected us for some reason */
 		ast_verb(3, "User rejected download attempt\n");
-		ast_log(LOG_NOTICE, "User rejected download on channel %s\n", chan->name);
+		ast_log(LOG_NOTICE, "User rejected download on channel %s\n", ast_channel_name(chan));
 		ast_free(scr);
 		return -1;
 	}
@@ -1554,7 +1554,7 @@
 	if (ast_adsi_end_download(chan)) {
 		/* Download failed for some reason */
 		ast_verb(3, "Download attempt failed\n");
-		ast_log(LOG_NOTICE, "Download failed on %s\n", chan->name);
+		ast_log(LOG_NOTICE, "Download failed on %s\n", ast_channel_name(chan));
 		ast_free(scr);
 		return -1;
 	}

Modified: trunk/apps/app_alarmreceiver.c
URL: http://svnview.digium.com/svn/asterisk/trunk/apps/app_alarmreceiver.c?view=diff&rev=350223&r1=350222&r2=350223
==============================================================================
--- trunk/apps/app_alarmreceiver.c (original)
+++ trunk/apps/app_alarmreceiver.c Mon Jan  9 16:15:50 2012
@@ -210,8 +210,8 @@
 				break;
 			}
 			if (ast_write(chan, &wf)) {
-				ast_verb(4, "AlarmReceiver: Failed to write frame on %s\n", chan->name);
-				ast_log(LOG_WARNING, "AlarmReceiver Failed to write frame on %s\n",chan->name);
+				ast_verb(4, "AlarmReceiver: Failed to write frame on %s\n", ast_channel_name(chan));
+				ast_log(LOG_WARNING, "AlarmReceiver Failed to write frame on %s\n",ast_channel_name(chan));
 				res = -1;
 				ast_frfree(f);
 				break;
@@ -245,8 +245,8 @@
 	for (;;) {
 		/* if outa time, leave */
 		if (ast_tvdiff_ms(ast_tvnow(), lastdigittime) > ((i > 0) ? sdto : fdto)) {
-			ast_verb(4, "AlarmReceiver: DTMF Digit Timeout on %s\n", chan->name);
-			ast_debug(1,"AlarmReceiver: DTMF timeout on chan %s\n",chan->name);
+			ast_verb(4, "AlarmReceiver: DTMF Digit Timeout on %s\n", ast_channel_name(chan));
+			ast_debug(1,"AlarmReceiver: DTMF timeout on chan %s\n",ast_channel_name(chan));
 			res = 1;
 			break;
 		}
@@ -583,12 +583,12 @@
 	ast_verb(4, "AlarmReceiver: Setting read and write formats to ULAW\n");
 
 	if (ast_set_write_format_by_id(chan,AST_FORMAT_ULAW)) {
-		ast_log(LOG_WARNING, "AlarmReceiver: Unable to set write format to Mu-law on %s\n",chan->name);
+		ast_log(LOG_WARNING, "AlarmReceiver: Unable to set write format to Mu-law on %s\n",ast_channel_name(chan));
 		return -1;
 	}
 
 	if (ast_set_read_format_by_id(chan,AST_FORMAT_ULAW)) {
-		ast_log(LOG_WARNING, "AlarmReceiver: Unable to set read format to Mu-law on %s\n",chan->name);
+		ast_log(LOG_WARNING, "AlarmReceiver: Unable to set read format to Mu-law on %s\n",ast_channel_name(chan));
 		return -1;
 	}
 

Modified: trunk/apps/app_amd.c
URL: http://svnview.digium.com/svn/asterisk/trunk/apps/app_amd.c?view=diff&rev=350223&r1=350222&r2=350223
==============================================================================
--- trunk/apps/app_amd.c (original)
+++ trunk/apps/app_amd.c Mon Jan  9 16:15:50 2012
@@ -192,7 +192,7 @@
 	);
 
 	ast_format_clear(&readFormat);
-	ast_verb(3, "AMD: %s %s %s (Fmt: %s)\n", chan->name,
+	ast_verb(3, "AMD: %s %s %s (Fmt: %s)\n", ast_channel_name(chan),
 		S_COR(chan->caller.ani.number.valid, chan->caller.ani.number.str, "(N/A)"),
 		S_COR(chan->redirecting.from.number.valid, chan->redirecting.from.number.str, "(N/A)"),
 		ast_getformatname(&chan->readformat));
@@ -246,7 +246,7 @@
 	/* Set read format to signed linear so we get signed linear frames in */
 	ast_format_copy(&readFormat, &chan->readformat);
 	if (ast_set_read_format_by_id(chan, AST_FORMAT_SLINEAR) < 0 ) {
-		ast_log(LOG_WARNING, "AMD: Channel [%s]. Unable to set to linear mode, giving up\n", chan->name );
+		ast_log(LOG_WARNING, "AMD: Channel [%s]. Unable to set to linear mode, giving up\n", ast_channel_name(chan));
 		pbx_builtin_setvar_helper(chan , "AMDSTATUS", "");
 		pbx_builtin_setvar_helper(chan , "AMDCAUSE", "");
 		return;
@@ -254,7 +254,7 @@
 
 	/* Create a new DSP that will detect the silence */
 	if (!(silenceDetector = ast_dsp_new())) {
-		ast_log(LOG_WARNING, "AMD: Channel [%s]. Unable to create silence detector :(\n", chan->name );
+		ast_log(LOG_WARNING, "AMD: Channel [%s]. Unable to create silence detector :(\n", ast_channel_name(chan));
 		pbx_builtin_setvar_helper(chan , "AMDSTATUS", "");
 		pbx_builtin_setvar_helper(chan , "AMDCAUSE", "");
 		return;
@@ -268,7 +268,7 @@
 
 		/* If we fail to read in a frame, that means they hung up */
 		if (!(f = ast_read(chan))) {
-			ast_verb(3, "AMD: Channel [%s]. HANGUP\n", chan->name);
+			ast_verb(3, "AMD: Channel [%s]. HANGUP\n", ast_channel_name(chan));
 			ast_debug(1, "Got hangup\n");
 			strcpy(amdStatus, "HANGUP");
 			res = 1;
@@ -285,7 +285,7 @@
 
 			iTotalTime += framelength;
 			if (iTotalTime >= totalAnalysisTime) {
-				ast_verb(3, "AMD: Channel [%s]. Too long...\n", chan->name );
+				ast_verb(3, "AMD: Channel [%s]. Too long...\n", ast_channel_name(chan));
 				ast_frfree(f);
 				strcpy(amdStatus , "NOTSURE");
 				sprintf(amdCause , "TOOLONG-%d", iTotalTime);
@@ -305,11 +305,11 @@
 				
 				if (silenceDuration >= betweenWordsSilence) {
 					if (currentState != STATE_IN_SILENCE ) {
-						ast_verb(3, "AMD: Channel [%s]. Changed state to STATE_IN_SILENCE\n", chan->name);
+						ast_verb(3, "AMD: Channel [%s]. Changed state to STATE_IN_SILENCE\n", ast_channel_name(chan));
 					}
 					/* Find words less than word duration */
 					if (consecutiveVoiceDuration < minimumWordLength && consecutiveVoiceDuration > 0){
-						ast_verb(3, "AMD: Channel [%s]. Short Word Duration: %d\n", chan->name, consecutiveVoiceDuration);
+						ast_verb(3, "AMD: Channel [%s]. Short Word Duration: %d\n", ast_channel_name(chan), consecutiveVoiceDuration);
 					}
 					currentState  = STATE_IN_SILENCE;
 					consecutiveVoiceDuration = 0;
@@ -317,7 +317,7 @@
 
 				if (inInitialSilence == 1  && silenceDuration >= initialSilence) {
 					ast_verb(3, "AMD: Channel [%s]. ANSWERING MACHINE: silenceDuration:%d initialSilence:%d\n",
-						chan->name, silenceDuration, initialSilence);
+						ast_channel_name(chan), silenceDuration, initialSilence);
 					ast_frfree(f);
 					strcpy(amdStatus , "MACHINE");
 					sprintf(amdCause , "INITIALSILENCE-%d-%d", silenceDuration, initialSilence);
@@ -327,7 +327,7 @@
 				
 				if (silenceDuration >= afterGreetingSilence  &&  inGreeting == 1) {
 					ast_verb(3, "AMD: Channel [%s]. HUMAN: silenceDuration:%d afterGreetingSilence:%d\n",
-						chan->name, silenceDuration, afterGreetingSilence);
+						ast_channel_name(chan), silenceDuration, afterGreetingSilence);
 					ast_frfree(f);
 					strcpy(amdStatus , "HUMAN");
 					sprintf(amdCause , "HUMAN-%d-%d", silenceDuration, afterGreetingSilence);
@@ -343,18 +343,18 @@
 				   number of words if my previous state was Silence, which means that I moved into a word. */
 				if (consecutiveVoiceDuration >= minimumWordLength && currentState == STATE_IN_SILENCE) {
 					iWordsCount++;
-					ast_verb(3, "AMD: Channel [%s]. Word detected. iWordsCount:%d\n", chan->name, iWordsCount);
+					ast_verb(3, "AMD: Channel [%s]. Word detected. iWordsCount:%d\n", ast_channel_name(chan), iWordsCount);
 					currentState = STATE_IN_WORD;
 				}
 				if (consecutiveVoiceDuration >= maximumWordLength){
-					ast_verb(3, "AMD: Channel [%s]. Maximum Word Length detected. [%d]\n", chan->name, consecutiveVoiceDuration);
+					ast_verb(3, "AMD: Channel [%s]. Maximum Word Length detected. [%d]\n", ast_channel_name(chan), consecutiveVoiceDuration);
 					ast_frfree(f);
 					strcpy(amdStatus , "MACHINE");
 					sprintf(amdCause , "MAXWORDLENGTH-%d", consecutiveVoiceDuration);
 					break;
 				}
 				if (iWordsCount >= maximumNumberOfWords) {
-					ast_verb(3, "AMD: Channel [%s]. ANSWERING MACHINE: iWordsCount:%d\n", chan->name, iWordsCount);
+					ast_verb(3, "AMD: Channel [%s]. ANSWERING MACHINE: iWordsCount:%d\n", ast_channel_name(chan), iWordsCount);
 					ast_frfree(f);
 					strcpy(amdStatus , "MACHINE");
 					sprintf(amdCause , "MAXWORDS-%d-%d", iWordsCount, maximumNumberOfWords);
@@ -363,7 +363,7 @@
 				}
 
 				if (inGreeting == 1 && voiceDuration >= greeting) {
-					ast_verb(3, "AMD: Channel [%s]. ANSWERING MACHINE: voiceDuration:%d greeting:%d\n", chan->name, voiceDuration, greeting);
+					ast_verb(3, "AMD: Channel [%s]. ANSWERING MACHINE: voiceDuration:%d greeting:%d\n", ast_channel_name(chan), voiceDuration, greeting);
 					ast_frfree(f);
 					strcpy(amdStatus , "MACHINE");
 					sprintf(amdCause , "LONGGREETING-%d-%d", voiceDuration, greeting);
@@ -373,13 +373,13 @@
 
 				if (voiceDuration >= minimumWordLength ) {
 					if (silenceDuration > 0)
-						ast_verb(3, "AMD: Channel [%s]. Detected Talk, previous silence duration: %d\n", chan->name, silenceDuration);
+						ast_verb(3, "AMD: Channel [%s]. Detected Talk, previous silence duration: %d\n", ast_channel_name(chan), silenceDuration);
 					silenceDuration = 0;
 				}
 				if (consecutiveVoiceDuration >= minimumWordLength && inGreeting == 0) {
 					/* Only go in here once to change the greeting flag when we detect the 1st word */
 					if (silenceDuration > 0)
-						ast_verb(3, "AMD: Channel [%s]. Before Greeting Time:  silenceDuration: %d voiceDuration: %d\n", chan->name, silenceDuration, voiceDuration);
+						ast_verb(3, "AMD: Channel [%s]. Before Greeting Time:  silenceDuration: %d voiceDuration: %d\n", ast_channel_name(chan), silenceDuration, voiceDuration);
 					inInitialSilence = 0;
 					inGreeting = 1;
 				}
@@ -391,7 +391,7 @@
 	
 	if (!res) {
 		/* It took too long to get a frame back. Giving up. */
-		ast_verb(3, "AMD: Channel [%s]. Too long...\n", chan->name);
+		ast_verb(3, "AMD: Channel [%s]. Too long...\n", ast_channel_name(chan));
 		strcpy(amdStatus , "NOTSURE");
 		sprintf(amdCause , "TOOLONG-%d", iTotalTime);
 	}
@@ -402,7 +402,7 @@
 
 	/* Restore channel read format */
 	if (readFormat.id && ast_set_read_format(chan, &readFormat))
-		ast_log(LOG_WARNING, "AMD: Unable to restore read format on '%s'\n", chan->name);
+		ast_log(LOG_WARNING, "AMD: Unable to restore read format on '%s'\n", ast_channel_name(chan));
 
 	/* Free the DSP used to detect silence */
 	ast_dsp_free(silenceDetector);

Modified: trunk/apps/app_chanisavail.c
URL: http://svnview.digium.com/svn/asterisk/trunk/apps/app_chanisavail.c?view=diff&rev=350223&r1=350222&r2=350223
==============================================================================
--- trunk/apps/app_chanisavail.c (original)
+++ trunk/apps/app_chanisavail.c Mon Jan  9 16:15:50 2012
@@ -170,7 +170,7 @@
 			snprintf(tmp, sizeof(tmp), "%d", status);
 			ast_str_append(&tmp_availstat, 0, "%s%s", ast_str_strlen(tmp_availstat) ? "&" : "", tmp);
 			if ((inuse <= 1) && (tempchan = ast_request(tech, chan->nativeformats, chan, number, &status))) {
-					ast_str_append(&tmp_availchan, 0, "%s%s", ast_str_strlen(tmp_availchan) ? "&" : "", tempchan->name);
+					ast_str_append(&tmp_availchan, 0, "%s%s", ast_str_strlen(tmp_availchan) ? "&" : "", ast_channel_name(tempchan));
 					
 					snprintf(tmp, sizeof(tmp), "%s/%s", tech, number);
 					ast_str_append(&tmp_availorig, 0, "%s%s", ast_str_strlen(tmp_availorig) ? "&" : "", tmp);

Modified: trunk/apps/app_chanspy.c
URL: http://svnview.digium.com/svn/asterisk/trunk/apps/app_chanspy.c?view=diff&rev=350223&r1=350222&r2=350223
==============================================================================
--- trunk/apps/app_chanspy.c (original)
+++ trunk/apps/app_chanspy.c Mon Jan  9 16:15:50 2012
@@ -484,7 +484,7 @@
 	int res = 0;
 	struct ast_channel *peer = NULL;
 
-	ast_log(LOG_NOTICE, "Attaching %s to %s\n", spychan_name, autochan->chan->name);
+	ast_log(LOG_NOTICE, "Attaching %s to %s\n", spychan_name, ast_channel_name(autochan->chan));
 
 	ast_set_flag(audiohook, AST_AUDIOHOOK_TRIGGER_SYNC | AST_AUDIOHOOK_SMALL_QUEUE);
 	res = ast_audiohook_attach(autochan->chan, audiohook);
@@ -524,7 +524,7 @@
 	struct ast_channel *chans[] = { chan, spyee_autochan->chan };
 
 	ast_channel_lock(chan);
-	spyer_name = ast_strdupa(chan->name);
+	spyer_name = ast_strdupa(ast_channel_name(chan));
 	ast_channel_unlock(chan);
 
 	/* We now hold the channel lock on spyee */
@@ -534,7 +534,7 @@
 	}
 
 	ast_channel_lock(spyee_autochan->chan);
-	name = ast_strdupa(spyee_autochan->chan->name);
+	name = ast_strdupa(ast_channel_name(spyee_autochan->chan));
 	ast_channel_unlock(spyee_autochan->chan);
 
 	ast_verb(2, "Spying on channel %s\n", name);
@@ -685,7 +685,7 @@
 			(*volfactor)++;
 			if (*volfactor > 4)
 				*volfactor = -4;
-			ast_verb(3, "Setting spy volume on %s to %d\n", chan->name, *volfactor);
+			ast_verb(3, "Setting spy volume on %s to %d\n", ast_channel_name(chan), *volfactor);
 
 			csth.volfactor = *volfactor;
 			csth.spy_audiohook.options.read_volume = csth.volfactor;
@@ -747,7 +747,7 @@
 		return NULL;
 	}
 
-	if (!strncmp(next->name, "DAHDI/pseudo", pseudo_len)) {
+	if (!strncmp(ast_channel_name(next), "DAHDI/pseudo", pseudo_len)) {
 		goto redo;
 	} else if (next == chan) {
 		goto redo;
@@ -925,7 +925,7 @@
 
 				snprintf(buffer, sizeof(buffer) - 1, ":%s:", myenforced);
 
-				ast_copy_string(ext + 1, autochan->chan->name, sizeof(ext) - 1);
+				ast_copy_string(ext + 1, ast_channel_name(autochan->chan), sizeof(ext) - 1);
 				if ((end = strchr(ext, '-'))) {
 					*end++ = ':';
 					*end = '\0';
@@ -943,7 +943,7 @@
 			}
 
 			strcpy(peer_name, "spy-");
-			strncat(peer_name, autochan->chan->name, AST_NAME_STRLEN - 4 - 1);
+			strncat(peer_name, ast_channel_name(autochan->chan), AST_NAME_STRLEN - 4 - 1);
 			ptr = strchr(peer_name, '/');
 			*ptr++ = '\0';
 			ptr = strsep(&ptr, "-");

Modified: trunk/apps/app_confbridge.c
URL: http://svnview.digium.com/svn/asterisk/trunk/apps/app_confbridge.c?view=diff&rev=350223&r1=350222&r2=350223
==============================================================================
--- trunk/apps/app_confbridge.c (original)
+++ trunk/apps/app_confbridge.c Mon Jan  9 16:15:50 2012
@@ -545,7 +545,7 @@
 		"Conference: %s\r\n"
 		"CallerIDnum: %s\r\n"
 		"CallerIDname: %s\r\n",
-		chan->name,
+		ast_channel_name(chan),
 		chan->uniqueid,
 		conf_name,
 		S_COR(chan->caller.id.number.valid, chan->caller.id.number.str, "<unknown>"),
@@ -561,7 +561,7 @@
 		"Conference: %s\r\n"
 		"CallerIDnum: %s\r\n"
 		"CallerIDname: %s\r\n",
-		chan->name,
+		ast_channel_name(chan),
 		chan->uniqueid,
 		conf_name,
 		S_COR(chan->caller.id.number.valid, chan->caller.id.number.str, "<unknown>"),
@@ -1165,7 +1165,7 @@
 		ast_say_number(conference_bridge->playback_chan, say_number, "", conference_bridge->playback_chan->language, NULL);
 	}
 
-	ast_debug(1, "Departing underlying channel '%s' from bridge '%p'\n", underlying_channel->name, conference_bridge->bridge);
+	ast_debug(1, "Departing underlying channel '%s' from bridge '%p'\n", ast_channel_name(underlying_channel), conference_bridge->bridge);
 	ast_bridge_depart(conference_bridge->bridge, underlying_channel);
 
 	ast_mutex_unlock(&conference_bridge->playback_lock);
@@ -1228,7 +1228,7 @@
 	      "Uniqueid: %s\r\n"
 	      "Conference: %s\r\n"
 	      "TalkingStatus: %s\r\n",
-	      bridge_channel->chan->name, bridge_channel->chan->uniqueid, conf_name, talking ? "on" : "off");
+	      ast_channel_name(bridge_channel->chan), bridge_channel->chan->uniqueid, conf_name, talking ? "on" : "off");
 }
 
 static int conf_get_pin(struct ast_channel *chan, struct conference_bridge_user *conference_bridge_user)
@@ -1548,7 +1548,7 @@
 	/* Mute or unmute yourself, note we only allow manipulation if they aren't waiting for a marked user or if marked users exist */
 	if (!ast_test_flag(&conference_bridge_user->u_profile, USER_OPT_WAITMARKED) || conference_bridge->markedusers) {
 		conference_bridge_user->features.mute = (!conference_bridge_user->features.mute ? 1 : 0);
-		ast_test_suite_event_notify("CONF_MUTE", "Message: participant %s %s\r\nConference: %s\r\nChannel: %s", chan->name, conference_bridge_user->features.mute ? "muted" : "unmuted", conference_bridge_user->b_profile.name, chan->name);
+		ast_test_suite_event_notify("CONF_MUTE", "Message: participant %s %s\r\nConference: %s\r\nChannel: %s", ast_channel_name(chan), conference_bridge_user->features.mute ? "muted" : "unmuted", conference_bridge_user->b_profile.name, ast_channel_name(chan));
 	}
 	return ast_stream_and_wait(chan, (conference_bridge_user->features.mute ?
 		conf_get_sound(CONF_SOUND_MUTED, conference_bridge_user->b_profile.sounds) :
@@ -1684,7 +1684,7 @@
 			conf_get_sound(CONF_SOUND_ERROR_MENU, conference_bridge_user->b_profile.sounds),
 			"");
 		ast_log(LOG_WARNING, "Only admin users can use the kick_last menu action. Channel %s of conf %s is not an admin.\n",
-			bridge_channel->chan->name,
+			ast_channel_name(bridge_channel->chan),
 			conference_bridge->name);
 		return -1;
 	}
@@ -1938,12 +1938,12 @@
 	}
 	ao2_lock(bridge);
 	AST_LIST_TRAVERSE(&bridge->users_list, participant, list) {
-		if (!strncmp(a->argv[3], participant->chan->name, strlen(participant->chan->name))) {
+		if (!strncmp(a->argv[3], ast_channel_name(participant->chan), strlen(ast_channel_name(participant->chan)))) {
 			break;
 		}
 	}
 	if (participant) {
-		ast_cli(a->fd, "Kicking %s from confbridge %s\n", participant->chan->name, bridge->name);
+		ast_cli(a->fd, "Kicking %s from confbridge %s\n", ast_channel_name(participant->chan), bridge->name);
 		participant->kicked = 1;
 		ast_bridge_remove(bridge->bridge, participant->chan);
 	}
@@ -1996,7 +1996,7 @@
 		ast_cli(a->fd, "============================= ================ ================ ================ ================\n");
 		ao2_lock(bridge);
 		AST_LIST_TRAVERSE(&bridge->users_list, participant, list) {
-			ast_cli(a->fd, "%-29s ", participant->chan->name);
+			ast_cli(a->fd, "%-29s ", ast_channel_name(participant->chan));
 			ast_cli(a->fd, "%-17s", participant->u_profile.name);
 			ast_cli(a->fd, "%-17s", participant->b_profile.name);
 			ast_cli(a->fd, "%-17s", participant->menu_name);
@@ -2057,13 +2057,13 @@
 	}
 	ao2_lock(bridge);
 	AST_LIST_TRAVERSE(&bridge->users_list, participant, list) {
-		if (!strncmp(user, participant->chan->name, strlen(user))) {
+		if (!strncmp(user, ast_channel_name(participant->chan), strlen(user))) {
 			break;
 		}
 	}
 	if (participant) {
 		participant->features.mute = mute;
-		ast_test_suite_event_notify("CONF_MUTE", "Message: participant %s %s\r\nConference: %s\r\nChannel: %s", participant->chan->name, participant->features.mute ? "muted" : "unmuted", bridge->b_profile.name, participant->chan->name);
+		ast_test_suite_event_notify("CONF_MUTE", "Message: participant %s %s\r\nConference: %s\r\nChannel: %s", ast_channel_name(participant->chan), participant->features.mute ? "muted" : "unmuted", bridge->b_profile.name, ast_channel_name(participant->chan));
 	} else {
 		res = -2;;
 	}
@@ -2340,7 +2340,7 @@
 			bridge->name,
 			S_COR(participant->chan->caller.id.number.valid, participant->chan->caller.id.number.str, "<unknown>"),
 			S_COR(participant->chan->caller.id.name.valid, participant->chan->caller.id.name.str, "<no name>"),
-			participant->chan->name,
+			ast_channel_name(participant->chan),
 			ast_test_flag(&participant->u_profile, USER_OPT_ADMIN) ? "Yes" : "No",
 			ast_test_flag(&participant->u_profile, USER_OPT_MARKEDUSER) ? "Yes" : "No");
 	}
@@ -2508,7 +2508,7 @@
 
 	ao2_lock(bridge);
 	AST_LIST_TRAVERSE(&bridge->users_list, participant, list) {
-		if (!strcasecmp(participant->chan->name, channel)) {
+		if (!strcasecmp(ast_channel_name(participant->chan), channel)) {
 			participant->kicked = 1;
 			ast_bridge_remove(bridge->bridge, participant->chan);
 			found = 1;
@@ -2635,7 +2635,7 @@
 	/* find channel and set as video src. */
 	ao2_lock(bridge);
 	AST_LIST_TRAVERSE(&bridge->users_list, participant, list) {
-		if (!strncmp(channel, participant->chan->name, strlen(channel))) {
+		if (!strncmp(channel, ast_channel_name(participant->chan), strlen(channel))) {
 			ast_bridge_set_single_src_video_mode(bridge->bridge, participant->chan);
 			break;
 		}

Modified: trunk/apps/app_dahdibarge.c
URL: http://svnview.digium.com/svn/asterisk/trunk/apps/app_dahdibarge.c?view=diff&rev=350223&r1=350222&r2=350223
==============================================================================
--- trunk/apps/app_dahdibarge.c (original)
+++ trunk/apps/app_dahdibarge.c Mon Jan  9 16:15:50 2012
@@ -117,13 +117,13 @@
 
 	/* Set it into U-law mode (write) */
 	if (ast_set_write_format_by_id(chan, AST_FORMAT_ULAW) < 0) {
-		ast_log(LOG_WARNING, "Unable to set '%s' to write ulaw mode\n", chan->name);
+		ast_log(LOG_WARNING, "Unable to set '%s' to write ulaw mode\n", ast_channel_name(chan));
 		goto outrun;
 	}
 
 	/* Set it into U-law mode (read) */
 	if (ast_set_read_format_by_id(chan, AST_FORMAT_ULAW) < 0) {
-		ast_log(LOG_WARNING, "Unable to set '%s' to read ulaw mode\n", chan->name);
+		ast_log(LOG_WARNING, "Unable to set '%s' to read ulaw mode\n", ast_channel_name(chan));
 		goto outrun;
 	}
 	ast_indicate(chan, -1);
@@ -192,7 +192,7 @@
 		close(fd);
 		goto outrun;
 	}
-	ast_debug(1, "Placed channel %s in DAHDI channel %d monitor\n", chan->name, confno);
+	ast_debug(1, "Placed channel %s in DAHDI channel %d monitor\n", ast_channel_name(chan), confno);
 
 	for(;;) {
 		outfd = -1;

Modified: trunk/apps/app_dahdiras.c
URL: http://svnview.digium.com/svn/asterisk/trunk/apps/app_dahdiras.c?view=diff&rev=350223&r1=350222&r2=350223
==============================================================================
--- trunk/apps/app_dahdiras.c (original)
+++ trunk/apps/app_dahdiras.c Mon Jan  9 16:15:50 2012
@@ -141,7 +141,7 @@
 	
 	res = ioctl(chan->fds[0], DAHDI_GET_BUFINFO, &savebi);
 	if(res) {
-		ast_log(LOG_WARNING, "Unable to check buffer policy on channel %s\n", chan->name);
+		ast_log(LOG_WARNING, "Unable to check buffer policy on channel %s\n", ast_channel_name(chan));
 		return;
 	}
 
@@ -154,7 +154,7 @@
 			if (!res) {
 				/* Check for hangup */
 				if (ast_check_hangup(chan) && !signalled) {
-					ast_debug(1, "Channel '%s' hungup.  Signalling RAS at %d to die...\n", chan->name, pid);
+					ast_debug(1, "Channel '%s' hungup.  Signalling RAS at %d to die...\n", ast_channel_name(chan), pid);
 					kill(pid, SIGTERM);
 					signalled=1;
 				}
@@ -166,12 +166,12 @@
 				ast_log(LOG_WARNING, "wait4 returned %d: %s\n", res, strerror(errno));
 			}
 			if (WIFEXITED(status)) {
-				ast_verb(3, "RAS on %s terminated with status %d\n", chan->name, WEXITSTATUS(status));
+				ast_verb(3, "RAS on %s terminated with status %d\n", ast_channel_name(chan), WEXITSTATUS(status));
 			} else if (WIFSIGNALED(status)) {
 				ast_verb(3, "RAS on %s terminated with signal %d\n", 
-					 chan->name, WTERMSIG(status));
+					 ast_channel_name(chan), WTERMSIG(status));
 			} else {
-				ast_verb(3, "RAS on %s terminated weirdly.\n", chan->name);
+				ast_verb(3, "RAS on %s terminated weirdly.\n", ast_channel_name(chan));
 			}
 			/* Throw back into audio mode */
 			x = 1;
@@ -180,7 +180,7 @@
 			/* Restore saved values */
 			res = ioctl(chan->fds[0], DAHDI_SET_BUFINFO, &savebi);
 			if (res < 0) {
-				ast_log(LOG_WARNING, "Unable to set buffer policy on channel %s\n", chan->name);
+				ast_log(LOG_WARNING, "Unable to set buffer policy on channel %s\n", ast_channel_name(chan));
 			}
 			break;
 		}
@@ -205,17 +205,17 @@
 	if (strcasecmp(chan->tech->type, "DAHDI")) {
 		/* If it's not a DAHDI channel, we're done.  Wait a couple of
 		   seconds and then hangup... */
-		ast_verb(2, "Channel %s is not a DAHDI channel\n", chan->name);
+		ast_verb(2, "Channel %s is not a DAHDI channel\n", ast_channel_name(chan));
 		sleep(2);
 	} else {
 		memset(&dahdip, 0, sizeof(dahdip));
 		if (ioctl(chan->fds[0], DAHDI_GET_PARAMS, &dahdip)) {
 			ast_log(LOG_WARNING, "Unable to get DAHDI parameters\n");
 		} else if (dahdip.sigtype != DAHDI_SIG_CLEAR) {
-			ast_verb(2, "Channel %s is not a clear channel\n", chan->name);
+			ast_verb(2, "Channel %s is not a clear channel\n", ast_channel_name(chan));
 		} else {
 			/* Everything should be okay.  Run PPP. */
-			ast_verb(3, "Starting RAS on %s\n", chan->name);
+			ast_verb(3, "Starting RAS on %s\n", ast_channel_name(chan));
 			/* Execute RAS */
 			run_ras(chan, args);
 		}

Modified: trunk/apps/app_dial.c
URL: http://svnview.digium.com/svn/asterisk/trunk/apps/app_dial.c?view=diff&rev=350223&r1=350222&r2=350223
==============================================================================
--- trunk/apps/app_dial.c (original)
+++ trunk/apps/app_dial.c Mon Jan  9 16:15:50 2012
@@ -801,7 +801,7 @@
 		"UniqueID: %s\r\n"
 		"DestUniqueID: %s\r\n"
 		"Dialstring: %s\r\n",
-		src->name, dst->name,
+		ast_channel_name(src), ast_channel_name(dst),
 		S_COR(src->caller.id.number.valid, src->caller.id.number.str, "<unknown>"),
 		S_COR(src->caller.id.name.valid, src->caller.id.name.str, "<unknown>"),
 		S_COR(src->connected.id.number.valid, src->connected.id.number.str, "<unknown>"),
@@ -817,7 +817,7 @@
 		"Channel: %s\r\n"
 		"UniqueID: %s\r\n"
 		"DialStatus: %s\r\n",
-		src->name, src->uniqueid, dialstatus);
+		ast_channel_name(src), src->uniqueid, dialstatus);
 }
 
 /*!
@@ -861,10 +861,10 @@
 	ast_cel_report_event(in, AST_CEL_FORWARD, NULL, c->call_forward, NULL);
 
 	/* Before processing channel, go ahead and check for forwarding */
-	ast_verb(3, "Now forwarding %s to '%s/%s' (thanks to %s)\n", in->name, tech, stuff, c->name);
+	ast_verb(3, "Now forwarding %s to '%s/%s' (thanks to %s)\n", ast_channel_name(in), tech, stuff, ast_channel_name(c));
 	/* If we have been told to ignore forwards, just set this channel to null and continue processing extensions normally */
 	if (ast_test_flag64(peerflags, OPT_IGNORE_FORWARDING)) {
-		ast_verb(3, "Forwarding %s to '%s/%s' prevented.\n", in->name, tech, stuff);
+		ast_verb(3, "Forwarding %s to '%s/%s' prevented.\n", ast_channel_name(in), tech, stuff);
 		c = o->chan = NULL;
 		cause = AST_CAUSE_BUSY;
 	} else {
@@ -880,7 +880,7 @@
 			 * any Dial operations that happen later won't record CC interfaces.
 			 */
 			ast_ignore_cc(o->chan);
-			ast_log(LOG_NOTICE, "Not accepting call completion offers from call-forward recipient %s\n", o->chan->name);
+			ast_log(LOG_NOTICE, "Not accepting call completion offers from call-forward recipient %s\n", ast_channel_name(o->chan));
 		} else
 			ast_log(LOG_NOTICE,
 				"Forwarding failed to create channel to dial '%s/%s' (cause = %d)\n",
@@ -1102,7 +1102,7 @@
 				continue;
 			if (ast_test_flag64(o, DIAL_STILLGOING) && c->_state == AST_STATE_UP) {
 				if (!peer) {
-					ast_verb(3, "%s answered %s\n", c->name, in->name);
+					ast_verb(3, "%s answered %s\n", ast_channel_name(c), ast_channel_name(in));
 					if (!single && !ast_test_flag64(peerflags, OPT_IGNORE_CONNECTEDLINE)) {
 						if (o->pending_connected_update) {
 							if (ast_channel_connected_line_macro(c, in, &o->connected, 1, 0)) {
@@ -1172,7 +1172,7 @@
 				case AST_CONTROL_ANSWER:
 					/* This is our guy if someone answered. */
 					if (!peer) {
-						ast_verb(3, "%s answered %s\n", c->name, in->name);
+						ast_verb(3, "%s answered %s\n", ast_channel_name(c), ast_channel_name(in));
 						if (!single && !ast_test_flag64(peerflags, OPT_IGNORE_CONNECTEDLINE)) {
 							if (o->pending_connected_update) {
 								if (ast_channel_connected_line_macro(c, in, &o->connected, 1, 0)) {
@@ -1218,7 +1218,7 @@
 					c->hangupcause = AST_CAUSE_NORMAL_CLEARING;
 					break;
 				case AST_CONTROL_BUSY:
-					ast_verb(3, "%s is busy\n", c->name);
+					ast_verb(3, "%s is busy\n", ast_channel_name(c));
 					in->hangupcause = c->hangupcause;
 					ast_hangup(c);
 					c = o->chan = NULL;
@@ -1226,7 +1226,7 @@
 					handle_cause(AST_CAUSE_BUSY, &num);
 					break;

[... 11347 lines stripped ...]



More information about the asterisk-commits mailing list