summaryrefslogtreecommitdiff
path: root/channels
diff options
context:
space:
mode:
Diffstat (limited to 'channels')
-rw-r--r--channels/chan_agent.c46
-rw-r--r--channels/chan_alsa.c4
-rw-r--r--channels/chan_console.c2
-rw-r--r--channels/chan_dahdi.c210
-rw-r--r--channels/chan_gtalk.c10
-rw-r--r--channels/chan_h323.c32
-rw-r--r--channels/chan_iax2.c70
-rw-r--r--channels/chan_jingle.c6
-rw-r--r--channels/chan_local.c8
-rw-r--r--channels/chan_mgcp.c48
-rw-r--r--channels/chan_misdn.c56
-rw-r--r--channels/chan_nbs.c12
-rw-r--r--channels/chan_oss.c6
-rw-r--r--channels/chan_phone.c20
-rw-r--r--channels/chan_sip.c152
-rw-r--r--channels/chan_skinny.c44
-rw-r--r--channels/chan_unistim.c24
-rw-r--r--channels/chan_usbradio.c22
-rw-r--r--channels/chan_vpb.cc62
-rw-r--r--channels/console_video.c2
-rw-r--r--channels/sig_analog.c76
-rw-r--r--channels/sig_pri.c52
-rw-r--r--channels/sig_ss7.c8
23 files changed, 486 insertions, 486 deletions
diff --git a/channels/chan_agent.c b/channels/chan_agent.c
index 13f080ebb..75aceacc7 100644
--- a/channels/chan_agent.c
+++ b/channels/chan_agent.c
@@ -606,7 +606,7 @@ static struct ast_frame *agent_read(struct ast_channel *ast)
case AST_FRAME_CONTROL:
if (f->subclass.integer == AST_CONTROL_ANSWER) {
if (p->ackcall) {
- ast_verb(3, "%s answered, waiting for '%c' to acknowledge\n", p->chan->name, p->acceptdtmf);
+ ast_verb(3, "%s answered, waiting for '%c' to acknowledge\n", ast_channel_name(p->chan), p->acceptdtmf);
/* Don't pass answer along */
ast_frfree(f);
f = &ast_null_frame;
@@ -628,7 +628,7 @@ static struct ast_frame *agent_read(struct ast_channel *ast)
break;
case AST_FRAME_DTMF_END:
if (!p->acknowledged && (f->subclass.integer == p->acceptdtmf)) {
- ast_verb(3, "%s acknowledged\n", p->chan->name);
+ ast_verb(3, "%s acknowledged\n", ast_channel_name(p->chan));
p->acknowledged = 1;
ast_frfree(f);
f = &answer_frame;
@@ -656,7 +656,7 @@ static struct ast_frame *agent_read(struct ast_channel *ast)
if (strcasecmp(p->chan->tech->type, "Local")) {
p->chan->_bridge = ast;
if (p->chan)
- ast_debug(1, "Bridge on '%s' being set to '%s' (3)\n", p->chan->name, p->chan->_bridge->name);
+ ast_debug(1, "Bridge on '%s' being set to '%s' (3)\n", ast_channel_name(p->chan), ast_channel_name(p->chan->_bridge));
}
}
ast_mutex_unlock(&p->lock);
@@ -703,7 +703,7 @@ static int agent_write(struct ast_channel *ast, struct ast_frame *f)
} else {
ast_debug(1, "Dropping one incompatible %s frame on '%s' to '%s'\n",
f->frametype == AST_FRAME_VOICE ? "audio" : "video",
- ast->name, p->chan->name);
+ ast_channel_name(ast), ast_channel_name(p->chan));
res = 0;
}
}
@@ -794,7 +794,7 @@ static int agent_call(struct ast_channel *ast, char *dest, int timeout)
ast_mutex_unlock(&p->lock);
return res;
}
- ast_verb(3, "agent_call, call to agent '%s' call on '%s'\n", p->agent, p->chan->name);
+ ast_verb(3, "agent_call, call to agent '%s' call on '%s'\n", p->agent, ast_channel_name(p->chan));
ast_debug(3, "Playing beep, lang '%s'\n", p->chan->language);
chan = p->chan;
@@ -878,7 +878,7 @@ int agent_set_base_channel(struct ast_channel *chan, struct ast_channel *base)
}
p = chan->tech_pvt;
if (!p) {
- ast_log(LOG_ERROR, "whoa, channel %s is missing his tech_pvt structure!!.\n", chan->name);
+ ast_log(LOG_ERROR, "whoa, channel %s is missing his tech_pvt structure!!.\n", ast_channel_name(chan));
return -1;
}
p->chan = base;
@@ -1035,7 +1035,7 @@ static struct ast_channel *agent_bridgedchannel(struct ast_channel *chan, struct
ret = p->chan;
}
- ast_debug(1, "Asked for bridged channel on '%s'/'%s', returning '%s'\n", chan->name, bridge->name, ret ? ret->name : "<none>");
+ ast_debug(1, "Asked for bridged channel on '%s'/'%s', returning '%s'\n", ast_channel_name(chan), ast_channel_name(bridge), ret ? ast_channel_name(ret) : "<none>");
return ret;
}
@@ -1268,7 +1268,7 @@ static int check_availability(struct agent_pvt *newlyavailable, int needlock)
}
ast_mutex_lock(&p->lock);
if (!p->abouttograb && p->pending && ((p->group && (newlyavailable->group & p->group)) || !strcmp(p->agent, newlyavailable->agent))) {
- ast_debug(1, "Call '%s' looks like a winner for agent '%s'\n", p->owner->name, newlyavailable->agent);
+ ast_debug(1, "Call '%s' looks like a winner for agent '%s'\n", ast_channel_name(p->owner), newlyavailable->agent);
/* We found a pending call, time to merge */
chan = agent_new(newlyavailable, AST_STATE_DOWN, p->owner ? p->owner->linkedid : NULL);
parent = p->owner;
@@ -1330,7 +1330,7 @@ static int check_beep(struct agent_pvt *newlyavailable, int needlock)
}
ast_mutex_lock(&p->lock);
if (!p->abouttograb && p->pending && ((p->group && (newlyavailable->group & p->group)) || !strcmp(p->agent, newlyavailable->agent))) {
- ast_debug(1, "Call '%s' looks like a would-be winner for agent '%s'\n", p->owner->name, newlyavailable->agent);
+ ast_debug(1, "Call '%s' looks like a would-be winner for agent '%s'\n", ast_channel_name(p->owner), newlyavailable->agent);
ast_mutex_unlock(&p->lock);
break;
}
@@ -1528,13 +1528,13 @@ static int action_agents(struct mansession *s, const struct message *m)
status = "AGENT_UNKNOWN";
if (p->chan) {
- loginChan = ast_strdupa(p->chan->name);
+ loginChan = ast_strdupa(ast_channel_name(p->chan));
if (p->owner && p->owner->_bridge) {
talkingto = S_COR(p->chan->caller.id.number.valid,
p->chan->caller.id.number.str, "n/a");
ast_channel_lock(p->owner);
if ((bridge = ast_bridged_channel(p->owner))) {
- talkingtoChan = ast_strdupa(bridge->name);
+ talkingtoChan = ast_strdupa(ast_channel_name(bridge));
} else {
talkingtoChan = "n/a";
}
@@ -1739,9 +1739,9 @@ static char *agents_show(struct ast_cli_entry *e, int cmd, struct ast_cli_args *
else
username[0] = '\0';
if (p->chan) {
- snprintf(location, sizeof(location), "logged in on %s", p->chan->name);
+ snprintf(location, sizeof(location), "logged in on %s", ast_channel_name(p->chan));
if (p->owner && ast_bridged_channel(p->owner))
- snprintf(talkingto, sizeof(talkingto), " talking to %s", ast_bridged_channel(p->owner)->name);
+ snprintf(talkingto, sizeof(talkingto), " talking to %s", ast_channel_name(ast_bridged_channel(p->owner)));
else
strcpy(talkingto, " is idle");
online_agents++;
@@ -1803,9 +1803,9 @@ static char *agents_show_online(struct ast_cli_entry *e, int cmd, struct ast_cli
else
username[0] = '\0';
if (p->chan) {
- snprintf(location, sizeof(location), "logged in on %s", p->chan->name);
+ snprintf(location, sizeof(location), "logged in on %s", ast_channel_name(p->chan));
if (p->owner && ast_bridged_channel(p->owner))
- snprintf(talkingto, sizeof(talkingto), " talking to %s", ast_bridged_channel(p->owner)->name);
+ snprintf(talkingto, sizeof(talkingto), " talking to %s", ast_channel_name(ast_bridged_channel(p->owner)));
else
strcpy(talkingto, " is idle");
agent_status = 1;
@@ -1887,7 +1887,7 @@ static int login_exec(struct ast_channel *chan, const char *data)
if (max_login_tries < 0)
max_login_tries = 0;
tmpoptions=pbx_builtin_getvar_helper(chan, "AGENTMAXLOGINTRIES");
- ast_verb(3, "Saw variable AGENTMAXLOGINTRIES=%s, setting max_login_tries to: %d on Channel '%s'.\n",tmpoptions,max_login_tries,chan->name);
+ ast_verb(3, "Saw variable AGENTMAXLOGINTRIES=%s, setting max_login_tries to: %d on Channel '%s'.\n",tmpoptions,max_login_tries,ast_channel_name(chan));
}
if (!ast_strlen_zero(pbx_builtin_getvar_helper(chan, "AGENTUPDATECDR"))) {
if (ast_true(pbx_builtin_getvar_helper(chan, "AGENTUPDATECDR")))
@@ -1895,12 +1895,12 @@ static int login_exec(struct ast_channel *chan, const char *data)
else
update_cdr = 0;
tmpoptions=pbx_builtin_getvar_helper(chan, "AGENTUPDATECDR");
- ast_verb(3, "Saw variable AGENTUPDATECDR=%s, setting update_cdr to: %d on Channel '%s'.\n",tmpoptions,update_cdr,chan->name);
+ ast_verb(3, "Saw variable AGENTUPDATECDR=%s, setting update_cdr to: %d on Channel '%s'.\n",tmpoptions,update_cdr,ast_channel_name(chan));
}
if (!ast_strlen_zero(pbx_builtin_getvar_helper(chan, "AGENTGOODBYE"))) {
strcpy(agent_goodbye, pbx_builtin_getvar_helper(chan, "AGENTGOODBYE"));
tmpoptions=pbx_builtin_getvar_helper(chan, "AGENTGOODBYE");
- ast_verb(3, "Saw variable AGENTGOODBYE=%s, setting agent_goodbye to: %s on Channel '%s'.\n",tmpoptions,agent_goodbye,chan->name);
+ ast_verb(3, "Saw variable AGENTGOODBYE=%s, setting agent_goodbye to: %s on Channel '%s'.\n",tmpoptions,agent_goodbye,ast_channel_name(chan));
}
ast_channel_unlock(chan);
/* End Channel Specific Login Overrides */
@@ -2043,10 +2043,10 @@ static int login_exec(struct ast_channel *chan, const char *data)
"Agent: %s\r\n"
"Channel: %s\r\n"
"Uniqueid: %s\r\n",
- p->agent, chan->name, chan->uniqueid);
+ p->agent, ast_channel_name(chan), chan->uniqueid);
if (update_cdr && chan->cdr)
snprintf(chan->cdr->channel, sizeof(chan->cdr->channel), "Agent/%s", p->agent);
- ast_queue_log("NONE", chan->uniqueid, agent, "AGENTLOGIN", "%s", chan->name);
+ ast_queue_log("NONE", chan->uniqueid, agent, "AGENTLOGIN", "%s", ast_channel_name(chan));
ast_verb(2, "Agent '%s' logged in (format %s/%s)\n", p->agent,
ast_getformatname(&chan->readformat), ast_getformatname(&chan->writeformat));
/* Login this channel and wait for it to go away */
@@ -2136,7 +2136,7 @@ static int login_exec(struct ast_channel *chan, const char *data)
"Logintime: %ld\r\n"
"Uniqueid: %s\r\n",
p->agent, logintime, chan->uniqueid);
- ast_queue_log("NONE", chan->uniqueid, agent, "AGENTLOGOFF", "%s|%ld", chan->name, logintime);
+ ast_queue_log("NONE", chan->uniqueid, agent, "AGENTLOGOFF", "%s|%ld", ast_channel_name(chan), logintime);
ast_verb(2, "Agent '%s' logged out\n", p->agent);
/* If there is no owner, go ahead and kill it now */
ast_devstate_changed(AST_DEVICE_UNAVAILABLE, "Agent/%s", p->agent);
@@ -2345,7 +2345,7 @@ static int function_agent(struct ast_channel *chan, const char *cmd, char *data,
else if (!strcasecmp(args.item, "channel")) {
if (agent->chan) {
ast_channel_lock(agent->chan);
- ast_copy_string(buf, agent->chan->name, len);
+ ast_copy_string(buf, ast_channel_name(agent->chan), len);
ast_channel_unlock(agent->chan);
tmp = strrchr(buf, '-');
if (tmp)
@@ -2354,7 +2354,7 @@ static int function_agent(struct ast_channel *chan, const char *cmd, char *data,
} else if (!strcasecmp(args.item, "fullchannel")) {
if (agent->chan) {
ast_channel_lock(agent->chan);
- ast_copy_string(buf, agent->chan->name, len);
+ ast_copy_string(buf, ast_channel_name(agent->chan), len);
ast_channel_unlock(agent->chan);
}
} else if (!strcasecmp(args.item, "exten")) {
diff --git a/channels/chan_alsa.c b/channels/chan_alsa.c
index bd9aea599..8f380909a 100644
--- a/channels/chan_alsa.c
+++ b/channels/chan_alsa.c
@@ -554,7 +554,7 @@ static int alsa_indicate(struct ast_channel *chan, int cond, const void *data, s
ast_moh_stop(chan);
break;
default:
- ast_log(LOG_WARNING, "Don't know how to display condition %d on %s\n", cond, chan->name);
+ ast_log(LOG_WARNING, "Don't know how to display condition %d on %s\n", cond, ast_channel_name(chan));
res = -1;
}
@@ -588,7 +588,7 @@ static struct ast_channel *alsa_new(struct chan_alsa_pvt *p, int state, const ch
ast_jb_configure(tmp, &global_jbconf);
if (state != AST_STATE_DOWN) {
if (ast_pbx_start(tmp)) {
- ast_log(LOG_WARNING, "Unable to start PBX on %s\n", tmp->name);
+ ast_log(LOG_WARNING, "Unable to start PBX on %s\n", ast_channel_name(tmp));
ast_hangup(tmp);
tmp = NULL;
}
diff --git a/channels/chan_console.c b/channels/chan_console.c
index 7a40f9be6..7e2301073 100644
--- a/channels/chan_console.c
+++ b/channels/chan_console.c
@@ -621,7 +621,7 @@ static int console_indicate(struct ast_channel *chan, int cond, const void *data
break;
default:
ast_log(LOG_WARNING, "Don't know how to display condition %d on %s\n",
- cond, chan->name);
+ cond, ast_channel_name(chan));
/* The core will play inband indications for us if appropriate */
res = -1;
}
diff --git a/channels/chan_dahdi.c b/channels/chan_dahdi.c
index ce5b28bf2..da167d64e 100644
--- a/channels/chan_dahdi.c
+++ b/channels/chan_dahdi.c
@@ -2060,7 +2060,7 @@ static void my_handle_dtmf(void *pvt, struct ast_channel *ast, enum analog_sub a
ast_debug(1, "%s DTMF digit: 0x%02X '%c' on %s\n",
f->frametype == AST_FRAME_DTMF_BEGIN ? "Begin" : "End",
- f->subclass.integer, f->subclass.integer, ast->name);
+ f->subclass.integer, f->subclass.integer, ast_channel_name(ast));
if (f->subclass.integer == 'f') {
if (f->frametype == AST_FRAME_DTMF_END) {
@@ -2076,7 +2076,7 @@ static void my_handle_dtmf(void *pvt, struct ast_channel *ast, enum analog_sub a
int res;
if ((res = ioctl(p->subs[idx].dfd, DAHDI_SET_BUFINFO, &bi)) < 0) {
- ast_log(LOG_WARNING, "Channel '%s' unable to set buffer policy, reason: %s\n", ast->name, strerror(errno));
+ ast_log(LOG_WARNING, "Channel '%s' unable to set buffer policy, reason: %s\n", ast_channel_name(ast), strerror(errno));
} else {
p->bufferoverrideinuse = 1;
}
@@ -2085,7 +2085,7 @@ static void my_handle_dtmf(void *pvt, struct ast_channel *ast, enum analog_sub a
if (p->dsp) {
p->dsp_features &= ~DSP_FEATURE_FAX_DETECT;
ast_dsp_set_features(p->dsp, p->dsp_features);
- ast_debug(1, "Disabling FAX tone detection on %s after tone received\n", ast->name);
+ ast_debug(1, "Disabling FAX tone detection on %s after tone received\n", ast_channel_name(ast));
}
if (strcmp(ast->exten, "fax")) {
const char *target_context = S_OR(ast->macrocontext, ast->context);
@@ -2100,11 +2100,11 @@ static void my_handle_dtmf(void *pvt, struct ast_channel *ast, enum analog_sub a
S_COR(ast->caller.id.number.valid, ast->caller.id.number.str, NULL))) {
ast_channel_lock(ast);
ast_mutex_lock(&p->lock);
- ast_verb(3, "Redirecting %s to fax extension\n", ast->name);
+ ast_verb(3, "Redirecting %s to fax extension\n", ast_channel_name(ast));
/* Save the DID/DNIS when we transfer the fax call to a "fax" extension */
pbx_builtin_setvar_helper(ast, "FAXEXTEN", ast->exten);
if (ast_async_goto(ast, target_context, "fax", 1))
- ast_log(LOG_WARNING, "Failed to async goto '%s' into fax of '%s'\n", ast->name, target_context);
+ ast_log(LOG_WARNING, "Failed to async goto '%s' into fax of '%s'\n", ast_channel_name(ast), target_context);
} else {
ast_channel_lock(ast);
ast_mutex_lock(&p->lock);
@@ -2172,7 +2172,7 @@ static void dahdi_ami_channel_event(struct dahdi_pvt *p, struct ast_channel *cha
"Uniqueid: %s\r\n"
"DAHDISpan: %d\r\n"
"DAHDIChannel: %s\r\n",
- chan->name,
+ ast_channel_name(chan),
chan->uniqueid,
p->span,
ch_name);
@@ -2254,11 +2254,11 @@ static void my_set_cadence(void *pvt, int *cidrings, struct ast_channel *ast)
/* Choose proper cadence */
if ((p->distinctivering > 0) && (p->distinctivering <= num_cadence)) {
if (ioctl(p->subs[SUB_REAL].dfd, DAHDI_SETCADENCE, &cadences[p->distinctivering - 1]))
- ast_log(LOG_WARNING, "Unable to set distinctive ring cadence %d on '%s': %s\n", p->distinctivering, ast->name, strerror(errno));
+ ast_log(LOG_WARNING, "Unable to set distinctive ring cadence %d on '%s': %s\n", p->distinctivering, ast_channel_name(ast), strerror(errno));
*cidrings = cidrings[p->distinctivering - 1];
} else {
if (ioctl(p->subs[SUB_REAL].dfd, DAHDI_SETCADENCE, NULL))
- ast_log(LOG_WARNING, "Unable to reset default ring on '%s': %s\n", ast->name, strerror(errno));
+ ast_log(LOG_WARNING, "Unable to reset default ring on '%s': %s\n", ast_channel_name(ast), strerror(errno));
*cidrings = p->sendcalleridafter;
}
}
@@ -2989,7 +2989,7 @@ static int my_dial_digits(void *pvt, enum analog_sub sub, struct analog_dialoper
res = ioctl(p->subs[index].dfd, DAHDI_DIAL, &ddop);
if (res == -1) {
- ast_debug(1, "DAHDI_DIAL ioctl failed on %s: %s\n", p->owner->name, strerror(errno));
+ ast_debug(1, "DAHDI_DIAL ioctl failed on %s: %s\n", ast_channel_name(p->owner), strerror(errno));
}
return res;
@@ -3715,7 +3715,7 @@ static int _dahdi_get_index(struct ast_channel *ast, struct dahdi_pvt *p, int nu
if (!nullok)
ast_log(LOG_WARNING,
"Unable to get index for '%s' on channel %d (%s(), line %lu)\n",
- ast ? ast->name : "", p->channel, fname, line);
+ ast ? ast_channel_name(ast) : "", p->channel, fname, line);
}
return res;
}
@@ -3824,12 +3824,12 @@ static openr2_calling_party_category_t dahdi_r2_get_channel_category(struct ast_
struct dahdi_pvt *p = c->tech_pvt;
if (ast_strlen_zero(catstr)) {
ast_debug(1, "No MFC/R2 category specified for chan %s, using default %s\n",
- c->name, openr2_proto_get_category_string(p->mfcr2_category));
+ ast_channel_name(c), openr2_proto_get_category_string(p->mfcr2_category));
return p->mfcr2_category;
}
if ((cat = openr2_proto_get_category(catstr)) == OR2_CALLING_PARTY_CATEGORY_UNKNOWN) {
ast_log(LOG_WARNING, "Invalid category specified '%s' for chan %s, using default %s\n",
- catstr, c->name, openr2_proto_get_category_string(p->mfcr2_category));
+ catstr, ast_channel_name(c), openr2_proto_get_category_string(p->mfcr2_category));
return p->mfcr2_category;
}
ast_debug(1, "Using category %s\n", catstr);
@@ -5367,7 +5367,7 @@ static int dahdi_call(struct ast_channel *ast, char *rdest, int timeout)
return 0;
}
if ((ast->_state != AST_STATE_DOWN) && (ast->_state != AST_STATE_RESERVED)) {
- ast_log(LOG_WARNING, "dahdi_call called on %s, neither down nor reserved\n", ast->name);
+ ast_log(LOG_WARNING, "dahdi_call called on %s, neither down nor reserved\n", ast_channel_name(ast));
ast_mutex_unlock(&p->lock);
return -1;
}
@@ -5937,7 +5937,7 @@ static int dahdi_send_callrerouting_facility_exec(struct ast_channel *chan, cons
break;
default:
ast_debug(1, "callrerouting attempted on non-ISDN channel %s\n",
- chan->name);
+ ast_channel_name(chan));
return -1;
}
@@ -6009,13 +6009,13 @@ static int dahdi_accept_r2_call_exec(struct ast_channel *chan, const char *data)
ast_mutex_lock(&p->lock);
if (!p->mfcr2 || !p->mfcr2call) {
ast_mutex_unlock(&p->lock);
- ast_debug(1, "Channel %s does not seems to be an R2 active channel!\n", chan->name);
+ ast_debug(1, "Channel %s does not seems to be an R2 active channel!\n", ast_channel_name(chan));
return -1;
}
if (p->mfcr2_call_accepted) {
ast_mutex_unlock(&p->lock);
- ast_debug(1, "MFC/R2 call already accepted on channel %s!\n", chan->name);
+ ast_debug(1, "MFC/R2 call already accepted on channel %s!\n", ast_channel_name(chan));
return 0;
}
accept_mode = ast_true(args.charge) ? OR2_CALL_WITH_CHARGE : OR2_CALL_NO_CHARGE;
@@ -6037,7 +6037,7 @@ static int dahdi_accept_r2_call_exec(struct ast_channel *chan, const char *data)
}
res = ast_waitfor(chan, timeout);
if (res < 0) {
- ast_debug(1, "ast_waitfor failed on channel %s, going out ...\n", chan->name);
+ ast_debug(1, "ast_waitfor failed on channel %s, going out ...\n", ast_channel_name(chan));
res = -1;
break;
}
@@ -6046,12 +6046,12 @@ static int dahdi_accept_r2_call_exec(struct ast_channel *chan, const char *data)
}
f = ast_read(chan);
if (!f) {
- ast_debug(1, "No frame read on channel %s, going out ...\n", chan->name);
+ ast_debug(1, "No frame read on channel %s, going out ...\n", ast_channel_name(chan));
res = -1;
break;
}
if (f->frametype == AST_FRAME_CONTROL && f->subclass.integer == AST_CONTROL_HANGUP) {
- ast_debug(1, "Got HANGUP frame on channel %s, going out ...\n", chan->name);
+ ast_debug(1, "Got HANGUP frame on channel %s, going out ...\n", ast_channel_name(chan));
ast_frfree(f);
res = -1;
break;
@@ -6123,7 +6123,7 @@ static int revert_fax_buffers(struct dahdi_pvt *p, struct ast_channel *ast)
int bpres;
if ((bpres = ioctl(p->subs[SUB_REAL].dfd, DAHDI_SET_BUFINFO, &bi)) < 0) {
- ast_log(LOG_WARNING, "Channel '%s' unable to revert buffer policy: %s\n", ast->name, strerror(errno));
+ ast_log(LOG_WARNING, "Channel '%s' unable to revert buffer policy: %s\n", ast_channel_name(ast), strerror(errno));
}
p->bufferoverrideinuse = 0;
return bpres;
@@ -6141,7 +6141,7 @@ static int dahdi_hangup(struct ast_channel *ast)
struct dahdi_pvt *p = ast->tech_pvt;
struct dahdi_params par;
- ast_debug(1, "dahdi_hangup(%s)\n", ast->name);
+ ast_debug(1, "dahdi_hangup(%s)\n", ast_channel_name(ast));
if (!ast->tech_pvt) {
ast_log(LOG_WARNING, "Asked to hangup channel not connected\n");
return 0;
@@ -6465,7 +6465,7 @@ static int dahdi_hangup(struct ast_channel *ast)
break;
}
if (res < 0) {
- ast_log(LOG_WARNING, "Unable to hangup line %s\n", ast->name);
+ ast_log(LOG_WARNING, "Unable to hangup line %s\n", ast_channel_name(ast));
}
switch (p->sig) {
case SIG_FXOGS:
@@ -6538,7 +6538,7 @@ hangup_out:
p->cidspill = NULL;
ast_mutex_unlock(&p->lock);
- ast_verb(3, "Hungup '%s'\n", ast->name);
+ ast_verb(3, "Hungup '%s'\n", ast_channel_name(ast));
ast_mutex_lock(&iflock);
if (p->restartpending) {
@@ -6664,12 +6664,12 @@ static int dahdi_queryoption(struct ast_channel *chan, int option, void *data, i
case AST_OPTION_DIGIT_DETECT:
cp = (char *) data;
*cp = p->ignoredtmf ? 0 : 1;
- ast_debug(1, "Reporting digit detection %sabled on %s\n", *cp ? "en" : "dis", chan->name);
+ ast_debug(1, "Reporting digit detection %sabled on %s\n", *cp ? "en" : "dis", ast_channel_name(chan));
break;
case AST_OPTION_FAX_DETECT:
cp = (char *) data;
*cp = (p->dsp_features & DSP_FEATURE_FAX_DETECT) ? 0 : 1;
- ast_debug(1, "Reporting fax tone detection %sabled on %s\n", *cp ? "en" : "dis", chan->name);
+ ast_debug(1, "Reporting fax tone detection %sabled on %s\n", *cp ? "en" : "dis", ast_channel_name(chan));
break;
case AST_OPTION_CC_AGENT_TYPE:
#if defined(HAVE_PRI)
@@ -6714,7 +6714,7 @@ static int dahdi_setoption(struct ast_channel *chan, int option, void *data, int
ast_log(LOG_WARNING, "No index in TXGAIN?\n");
return -1;
}
- ast_debug(1, "Setting actual tx gain on %s to %f\n", chan->name, p->txgain + (float) *scp);
+ ast_debug(1, "Setting actual tx gain on %s to %f\n", ast_channel_name(chan), p->txgain + (float) *scp);
return set_actual_txgain(p->subs[idx].dfd, p->txgain + (float) *scp, p->txdrc, p->law);
case AST_OPTION_RXGAIN:
scp = (signed char *) data;
@@ -6723,7 +6723,7 @@ static int dahdi_setoption(struct ast_channel *chan, int option, void *data, int
ast_log(LOG_WARNING, "No index in RXGAIN?\n");
return -1;
}
- ast_debug(1, "Setting actual rx gain on %s to %f\n", chan->name, p->rxgain + (float) *scp);
+ ast_debug(1, "Setting actual rx gain on %s to %f\n", ast_channel_name(chan), p->rxgain + (float) *scp);
return set_actual_rxgain(p->subs[idx].dfd, p->rxgain + (float) *scp, p->rxdrc, p->law);
case AST_OPTION_TONE_VERIFY:
if (!p->dsp)
@@ -6731,15 +6731,15 @@ static int dahdi_setoption(struct ast_channel *chan, int option, void *data, int
cp = (char *) data;
switch (*cp) {
case 1:
- ast_debug(1, "Set option TONE VERIFY, mode: MUTECONF(1) on %s\n",chan->name);
+ ast_debug(1, "Set option TONE VERIFY, mode: MUTECONF(1) on %s\n",ast_channel_name(chan));
ast_dsp_set_digitmode(p->dsp, DSP_DIGITMODE_MUTECONF | p->dtmfrelax); /* set mute mode if desired */
break;
case 2:
- ast_debug(1, "Set option TONE VERIFY, mode: MUTECONF/MAX(2) on %s\n",chan->name);
+ ast_debug(1, "Set option TONE VERIFY, mode: MUTECONF/MAX(2) on %s\n",ast_channel_name(chan));
ast_dsp_set_digitmode(p->dsp, DSP_DIGITMODE_MUTECONF | DSP_DIGITMODE_MUTEMAX | p->dtmfrelax); /* set mute mode if desired */
break;
default:
- ast_debug(1, "Set option TONE VERIFY, mode: OFF(0) on %s\n",chan->name);
+ ast_debug(1, "Set option TONE VERIFY, mode: OFF(0) on %s\n",ast_channel_name(chan));
ast_dsp_set_digitmode(p->dsp, DSP_DIGITMODE_DTMF | p->dtmfrelax); /* set mute mode if desired */
break;
}
@@ -6749,14 +6749,14 @@ static int dahdi_setoption(struct ast_channel *chan, int option, void *data, int
cp = (char *) data;
p->mate = 0;
if (!*cp) { /* turn it off */
- ast_debug(1, "Set option TDD MODE, value: OFF(0) on %s\n",chan->name);
+ ast_debug(1, "Set option TDD MODE, value: OFF(0) on %s\n",ast_channel_name(chan));
if (p->tdd)
tdd_free(p->tdd);
p->tdd = 0;
break;
}
ast_debug(1, "Set option TDD MODE, value: %s(%d) on %s\n",
- (*cp == 2) ? "MATE" : "ON", (int) *cp, chan->name);
+ (*cp == 2) ? "MATE" : "ON", (int) *cp, ast_channel_name(chan));
dahdi_disable_ec(p);
/* otherwise, turn it on */
if (!p->didtdd) { /* if havent done it yet */
@@ -6823,7 +6823,7 @@ static int dahdi_setoption(struct ast_channel *chan, int option, void *data, int
break;
cp = (char *) data;
ast_debug(1, "Set option RELAX DTMF, value: %s(%d) on %s\n",
- *cp ? "ON" : "OFF", (int) *cp, chan->name);
+ *cp ? "ON" : "OFF", (int) *cp, ast_channel_name(chan));
ast_dsp_set_digitmode(p->dsp, ((*cp) ? DSP_DIGITMODE_RELAXDTMF : DSP_DIGITMODE_DTMF) | p->dtmfrelax);
break;
case AST_OPTION_AUDIO_MODE: /* Set AUDIO mode (or not) */
@@ -6837,11 +6837,11 @@ static int dahdi_setoption(struct ast_channel *chan, int option, void *data, int
cp = (char *) data;
if (!*cp) {
- ast_debug(1, "Set option AUDIO MODE, value: OFF(0) on %s\n", chan->name);
+ ast_debug(1, "Set option AUDIO MODE, value: OFF(0) on %s\n", ast_channel_name(chan));
x = 0;
dahdi_disable_ec(p);
} else {
- ast_debug(1, "Set option AUDIO MODE, value: ON(1) on %s\n", chan->name);
+ ast_debug(1, "Set option AUDIO MODE, value: ON(1) on %s\n", ast_channel_name(chan));
x = 1;
}
if (ioctl(p->subs[SUB_REAL].dfd, DAHDI_AUDIOMODE, &x) == -1)
@@ -6868,21 +6868,21 @@ static int dahdi_setoption(struct ast_channel *chan, int option, void *data, int
p->oprmode = -oprmode->mode;
}
ast_debug(1, "Set Operator Services mode, value: %d on %s/%s\n",
- oprmode->mode, chan->name,oprmode->peer->name);
+ oprmode->mode, ast_channel_name(chan),ast_channel_name(oprmode->peer));
break;
case AST_OPTION_ECHOCAN:
cp = (char *) data;
if (*cp) {
- ast_debug(1, "Enabling echo cancellation on %s\n", chan->name);
+ ast_debug(1, "Enabling echo cancellation on %s\n", ast_channel_name(chan));
dahdi_enable_ec(p);
} else {
- ast_debug(1, "Disabling echo cancellation on %s\n", chan->name);
+ ast_debug(1, "Disabling echo cancellation on %s\n", ast_channel_name(chan));
dahdi_disable_ec(p);
}
break;
case AST_OPTION_DIGIT_DETECT:
cp = (char *) data;
- ast_debug(1, "%sabling digit detection on %s\n", *cp ? "En" : "Dis", chan->name);
+ ast_debug(1, "%sabling digit detection on %s\n", *cp ? "En" : "Dis", ast_channel_name(chan));
if (*cp) {
enable_dtmf_detect(p);
} else {
@@ -6892,7 +6892,7 @@ static int dahdi_setoption(struct ast_channel *chan, int option, void *data, int
case AST_OPTION_FAX_DETECT:
cp = (char *) data;
if (p->dsp) {
- ast_debug(1, "%sabling fax tone detection on %s\n", *cp ? "En" : "Dis", chan->name);
+ ast_debug(1, "%sabling fax tone detection on %s\n", *cp ? "En" : "Dis", ast_channel_name(chan));
if (*cp) {
p->dsp_features |= DSP_FEATURE_FAX_DETECT;
} else {
@@ -7372,12 +7372,12 @@ static enum ast_bridge_result dahdi_bridge(struct ast_channel *c0, struct ast_ch
(p1->subs[SUB_REAL].owner->_state == AST_STATE_RINGING)) {
ast_debug(1,
"Playing ringback on %d/%d(%s) since %d/%d(%s) is in a ringing three-way\n",
- p0->channel, oi0, c0->name, p1->channel, oi1, c1->name);
+ p0->channel, oi0, ast_channel_name(c0), p1->channel, oi1, ast_channel_name(c1));
tone_zone_play_tone(p0->subs[oi0].dfd, DAHDI_TONE_RINGTONE);
os1 = p1->subs[SUB_REAL].owner->_state;
} else {
ast_debug(1, "Stopping tones on %d/%d(%s) talking to %d/%d(%s)\n",
- p0->channel, oi0, c0->name, p1->channel, oi1, c1->name);
+ p0->channel, oi0, ast_channel_name(c0), p1->channel, oi1, ast_channel_name(c1));
tone_zone_play_tone(p0->subs[oi0].dfd, -1);
}
if ((oi0 == SUB_THREEWAY) &&
@@ -7387,12 +7387,12 @@ static enum ast_bridge_result dahdi_bridge(struct ast_channel *c0, struct ast_ch
(p0->subs[SUB_REAL].owner->_state == AST_STATE_RINGING)) {
ast_debug(1,
"Playing ringback on %d/%d(%s) since %d/%d(%s) is in a ringing three-way\n",
- p1->channel, oi1, c1->name, p0->channel, oi0, c0->name);
+ p1->channel, oi1, ast_channel_name(c1), p0->channel, oi0, ast_channel_name(c0));
tone_zone_play_tone(p1->subs[oi1].dfd, DAHDI_TONE_RINGTONE);
os0 = p0->subs[SUB_REAL].owner->_state;
} else {
ast_debug(1, "Stopping tones on %d/%d(%s) talking to %d/%d(%s)\n",
- p1->channel, oi1, c1->name, p0->channel, oi0, c0->name);
+ p1->channel, oi1, ast_channel_name(c1), p0->channel, oi0, ast_channel_name(c0));
tone_zone_play_tone(p1->subs[oi1].dfd, -1);
}
if ((oi0 == SUB_REAL) && (oi1 == SUB_REAL)) {
@@ -7425,7 +7425,7 @@ static enum ast_bridge_result dahdi_bridge(struct ast_channel *c0, struct ast_ch
return AST_BRIDGE_FAILED;
}
- ast_verb(3, "Native bridging %s and %s\n", c0->name, c1->name);
+ ast_verb(3, "Native bridging %s and %s\n", ast_channel_name(c0), ast_channel_name(c1));
if (!(flags & AST_BRIDGE_DTMF_CHANNEL_0) && (oi0 == SUB_REAL))
disable_dtmf_detect(op0);
@@ -7541,7 +7541,7 @@ static enum ast_bridge_result dahdi_bridge(struct ast_channel *c0, struct ast_ch
break;
default:
ast_debug(1, "Chan '%s' is discarding frame of frametype:%d\n",
- who->name, f->frametype);
+ ast_channel_name(who), f->frametype);
break;
}
ast_frfree(f);
@@ -7575,7 +7575,7 @@ static int dahdi_fixup(struct ast_channel *oldchan, struct ast_channel *newchan)
ast_mutex_lock(&p->lock);
- ast_debug(1, "New owner for channel %d is %s\n", p->channel, newchan->name);
+ ast_debug(1, "New owner for channel %d is %s\n", p->channel, ast_channel_name(newchan));
if (p->owner == oldchan) {
p->owner = newchan;
}
@@ -7658,7 +7658,7 @@ static int attempt_transfer(struct dahdi_pvt *p)
}
if (ast_channel_masquerade(p->subs[SUB_THREEWAY].owner, ast_bridged_channel(p->subs[SUB_REAL].owner))) {
ast_log(LOG_WARNING, "Unable to masquerade %s as %s\n",
- ast_bridged_channel(p->subs[SUB_REAL].owner)->name, p->subs[SUB_THREEWAY].owner->name);
+ ast_channel_name(ast_bridged_channel(p->subs[SUB_REAL].owner)), ast_channel_name(p->subs[SUB_THREEWAY].owner));
return -1;
}
/* Orphan the channel after releasing the lock */
@@ -7674,7 +7674,7 @@ static int attempt_transfer(struct dahdi_pvt *p)
}
if (ast_channel_masquerade(p->subs[SUB_REAL].owner, ast_bridged_channel(p->subs[SUB_THREEWAY].owner))) {
ast_log(LOG_WARNING, "Unable to masquerade %s as %s\n",
- ast_bridged_channel(p->subs[SUB_THREEWAY].owner)->name, p->subs[SUB_REAL].owner->name);
+ ast_channel_name(ast_bridged_channel(p->subs[SUB_THREEWAY].owner)), ast_channel_name(p->subs[SUB_REAL].owner));
return -1;
}
/* Three-way is now the REAL */
@@ -7685,7 +7685,7 @@ static int attempt_transfer(struct dahdi_pvt *p)
return 1;
} else {
ast_debug(1, "Neither %s nor %s are in a bridge, nothing to transfer\n",
- p->subs[SUB_REAL].owner->name, p->subs[SUB_THREEWAY].owner->name);
+ ast_channel_name(p->subs[SUB_REAL].owner), ast_channel_name(p->subs[SUB_THREEWAY].owner));
p->subs[SUB_THREEWAY].owner->_softhangup |= AST_SOFTHANGUP_DEV;
return -1;
}
@@ -7752,11 +7752,11 @@ static void dahdi_handle_dtmf(struct ast_channel *ast, int idx, struct ast_frame
ast_debug(1, "%s DTMF digit: 0x%02X '%c' on %s\n",
f->frametype == AST_FRAME_DTMF_BEGIN ? "Begin" : "End",
- f->subclass.integer, f->subclass.integer, ast->name);
+ f->subclass.integer, f->subclass.integer, ast_channel_name(ast));
if (p->confirmanswer) {
if (f->frametype == AST_FRAME_DTMF_END) {
- ast_debug(1, "Confirm answer on %s!\n", ast->name);
+ ast_debug(1, "Confirm answer on %s!\n", ast_channel_name(ast));
/* Upon receiving a DTMF digit, consider this an answer confirmation instead
of a DTMF digit */
p->subs[idx].f.frametype = AST_FRAME_CONTROL;
@@ -7795,7 +7795,7 @@ static void dahdi_handle_dtmf(struct ast_channel *ast, int idx, struct ast_frame
int res;
if ((res = ioctl(p->subs[idx].dfd, DAHDI_SET_BUFINFO, &bi)) < 0) {
- ast_log(LOG_WARNING, "Channel '%s' unable to set buffer policy, reason: %s\n", ast->name, strerror(errno));
+ ast_log(LOG_WARNING, "Channel '%s' unable to set buffer policy, reason: %s\n", ast_channel_name(ast), strerror(errno));
} else {
p->bufferoverrideinuse = 1;
}
@@ -7804,7 +7804,7 @@ static void dahdi_handle_dtmf(struct ast_channel *ast, int idx, struct ast_frame
if (p->dsp) {
p->dsp_features &= ~DSP_FEATURE_FAX_DETECT;
ast_dsp_set_features(p->dsp, p->dsp_features);
- ast_debug(1, "Disabling FAX tone detection on %s after tone received\n", ast->name);
+ ast_debug(1, "Disabling FAX tone detection on %s after tone received\n", ast_channel_name(ast));
}
if (strcmp(ast->exten, "fax")) {
const char *target_context = S_OR(ast->macrocontext, ast->context);
@@ -7819,11 +7819,11 @@ static void dahdi_handle_dtmf(struct ast_channel *ast, int idx, struct ast_frame
S_COR(ast->caller.id.number.valid, ast->caller.id.number.str, NULL))) {
ast_channel_lock(ast);
ast_mutex_lock(&p->lock);
- ast_verb(3, "Redirecting %s to fax extension\n", ast->name);
+ ast_verb(3, "Redirecting %s to fax extension\n", ast_channel_name(ast));
/* Save the DID/DNIS when we transfer the fax call to a "fax" extension */
pbx_builtin_setvar_helper(ast, "FAXEXTEN", ast->exten);
if (ast_async_goto(ast, target_context, "fax", 1))
- ast_log(LOG_WARNING, "Failed to async goto '%s' into fax of '%s'\n", ast->name, target_context);
+ ast_log(LOG_WARNING, "Failed to async goto '%s' into fax of '%s'\n", ast_channel_name(ast), target_context);
} else {
ast_channel_lock(ast);
ast_mutex_lock(&p->lock);
@@ -7985,7 +7985,7 @@ static struct ast_frame *dahdi_handle_event(struct ast_channel *ast)
if (p->inalarm) break;
if ((p->radio || (p->oprmode < 0))) break;
if (ioctl(p->subs[idx].dfd,DAHDI_DIALING,&x) == -1) {
- ast_debug(1, "DAHDI_DIALING ioctl failed on %s: %s\n",ast->name, strerror(errno));
+ ast_debug(1, "DAHDI_DIALING ioctl failed on %s: %s\n",ast_channel_name(ast), strerror(errno));
return NULL;
}
if (!x) { /* if not still dialing in driver */
@@ -8441,7 +8441,7 @@ static struct ast_frame *dahdi_handle_event(struct ast_channel *ast)
swap_subs(p, SUB_REAL, SUB_CALLWAIT);
tone_zone_play_tone(p->subs[SUB_REAL].dfd, -1);
p->owner = p->subs[SUB_REAL].owner;
- ast_debug(1, "Making %s the new owner\n", p->owner->name);
+ ast_debug(1, "Making %s the new owner\n", ast_channel_name(p->owner));
if (p->owner->_state == AST_STATE_RINGING) {
ast_setstate(p->owner, AST_STATE_UP);
p->subs[SUB_REAL].needanswer = 1;
@@ -8546,7 +8546,7 @@ static struct ast_frame *dahdi_handle_event(struct ast_channel *ast)
p->owner = p->subs[SUB_REAL].owner;
}
/* Drop the last call and stop the conference */
- ast_verb(3, "Dropping three-way call on %s\n", p->subs[SUB_THREEWAY].owner->name);
+ ast_verb(3, "Dropping three-way call on %s\n", ast_channel_name(p->subs[SUB_THREEWAY].owner));
p->subs[SUB_THREEWAY].owner->_softhangup |= AST_SOFTHANGUP_DEV;
p->subs[SUB_REAL].inthreeway = 0;
p->subs[SUB_THREEWAY].inthreeway = 0;
@@ -8557,8 +8557,8 @@ static struct ast_frame *dahdi_handle_event(struct ast_channel *ast)
int otherindex = SUB_THREEWAY;
ast_verb(3, "Building conference call with %s and %s\n",
- p->subs[SUB_THREEWAY].owner->name,
- p->subs[SUB_REAL].owner->name);
+ ast_channel_name(p->subs[SUB_THREEWAY].owner),
+ ast_channel_name(p->subs[SUB_REAL].owner));
/* Put them in the threeway, and flip */
p->subs[SUB_THREEWAY].inthreeway = 1;
p->subs[SUB_REAL].inthreeway = 1;
@@ -8571,7 +8571,7 @@ static struct ast_frame *dahdi_handle_event(struct ast_channel *ast)
p->subs[otherindex].needunhold = 1;
p->owner = p->subs[SUB_REAL].owner;
} else {
- ast_verb(3, "Dumping incomplete call on on %s\n", p->subs[SUB_THREEWAY].owner->name);
+ ast_verb(3, "Dumping incomplete call on on %s\n", ast_channel_name(p->subs[SUB_THREEWAY].owner));
swap_subs(p, SUB_THREEWAY, SUB_REAL);
p->subs[SUB_THREEWAY].owner->_softhangup |= AST_SOFTHANGUP_DEV;
p->owner = p->subs[SUB_REAL].owner;
@@ -8777,7 +8777,7 @@ static struct ast_frame *__dahdi_exception(struct ast_channel *ast)
case DAHDI_EVENT_ONHOOK:
dahdi_disable_ec(p);
if (p->owner) {
- ast_verb(3, "Channel %s still has call, ringing phone\n", p->owner->name);
+ ast_verb(3, "Channel %s still has call, ringing phone\n", ast_channel_name(p->owner));
dahdi_ring_phone(p);
p->callwaitingrepeat = 0;
p->cidcwexpire = 0;
@@ -8802,7 +8802,7 @@ static struct ast_frame *__dahdi_exception(struct ast_channel *ast)
case DAHDI_EVENT_WINKFLASH:
p->flashtime = ast_tvnow();
if (p->owner) {
- ast_verb(3, "Channel %d flashed to other channel %s\n", p->channel, p->owner->name);
+ ast_verb(3, "Channel %d flashed to other channel %s\n", p->channel, ast_channel_name(p->owner));
if (p->owner->_state != AST_STATE_UP) {
/* Answer if necessary */
usedindex = dahdi_get_index(p->owner, p, 0);
@@ -8831,7 +8831,7 @@ static struct ast_frame *__dahdi_exception(struct ast_channel *ast)
ast_debug(1, "Exception on %d, channel %d\n", ast->fds[0],p->channel);
/* If it's not us, return NULL immediately */
if (ast != p->owner) {
- ast_log(LOG_WARNING, "We're %s, not %s\n", ast->name, p->owner->name);
+ ast_log(LOG_WARNING, "We're %s, not %s\n", ast_channel_name(ast), ast_channel_name(p->owner));
f = &p->subs[idx].f;
return f;
}
@@ -8839,7 +8839,7 @@ static struct ast_frame *__dahdi_exception(struct ast_channel *ast)
/* tell the cdr this zap device hung up */
if (f == NULL) {
- ast_set_hangupsource(ast, ast->name, 0);
+ ast_set_hangupsource(ast, ast_channel_name(ast), 0);
}
return f;
@@ -9019,7 +9019,7 @@ static struct ast_frame *dahdi_read(struct ast_channel *ast)
p->subs[idx].f.frametype = AST_FRAME_CONTROL;
p->subs[idx].f.subclass.integer = AST_CONTROL_HOLD;
ast_mutex_unlock(&p->lock);
- ast_debug(1, "Sending hold on '%s'\n", ast->name);
+ ast_debug(1, "Sending hold on '%s'\n", ast_channel_name(ast));
return &p->subs[idx].f;
}
@@ -9029,7 +9029,7 @@ static struct ast_frame *dahdi_read(struct ast_channel *ast)
p->subs[idx].f.frametype = AST_FRAME_CONTROL;
p->subs[idx].f.subclass.integer = AST_CONTROL_UNHOLD;
ast_mutex_unlock(&p->lock);
- ast_debug(1, "Sending unhold on '%s'\n", ast->name);
+ ast_debug(1, "Sending unhold on '%s'\n", ast_channel_name(ast));
return &p->subs[idx].f;
}
@@ -9210,7 +9210,7 @@ static struct ast_frame *dahdi_read(struct ast_channel *ast)
/* Don't accept in-band DTMF when in overlap dial mode */
ast_debug(1, "Absorbing inband %s DTMF digit: 0x%02X '%c' on %s\n",
f->frametype == AST_FRAME_DTMF_BEGIN ? "begin" : "end",
- f->subclass.integer, f->subclass.integer, ast->name);
+ f->subclass.integer, f->subclass.integer, ast_channel_name(ast));
f->frametype = AST_FRAME_NULL;
f->subclass.integer = 0;
@@ -9313,7 +9313,7 @@ static int dahdi_write(struct ast_channel *ast, struct ast_frame *frame)
int idx;
idx = dahdi_get_index(ast, p, 0);
if (idx < 0) {
- ast_log(LOG_WARNING, "%s doesn't really exist?\n", ast->name);
+ ast_log(LOG_WARNING, "%s doesn't really exist?\n", ast_channel_name(ast));
return -1;
}
@@ -9330,16 +9330,16 @@ static int dahdi_write(struct ast_channel *ast, struct ast_frame *frame)
return -1;
}
if (p->dialing) {
- ast_debug(1, "Dropping frame since I'm still dialing on %s...\n",ast->name);
+ ast_debug(1, "Dropping frame since I'm still dialing on %s...\n",ast_channel_name(ast));
return 0;
}
if (!p->owner) {
- ast_debug(1, "Dropping frame since there is no active owner on %s...\n",ast->name);
+ ast_debug(1, "Dropping frame since there is no active owner on %s...\n",ast_channel_name(ast));
return 0;
}
if (p->cidspill) {
ast_debug(1, "Dropping frame since I've still got a callerid spill on %s...\n",
- ast->name);
+ ast_channel_name(ast));
return 0;
}
/* Return if it's not valid data */
@@ -9379,7 +9379,7 @@ static int dahdi_indicate(struct ast_channel *chan, int condition, const void *d
int func = DAHDI_FLASH;
ast_mutex_lock(&p->lock);
- ast_debug(1, "Requested indication %d on channel %s\n", condition, chan->name);
+ ast_debug(1, "Requested indication %d on channel %s\n", condition, ast_channel_name(chan));
switch (p->sig) {
#if defined(HAVE_PRI)
case SIG_PRI_LIB_HANDLE_CASES:
@@ -9422,17 +9422,17 @@ static int dahdi_indicate(struct ast_channel *chan, int condition, const void *d
}
break;
case AST_CONTROL_INCOMPLETE:
- ast_debug(1, "Received AST_CONTROL_INCOMPLETE on %s\n", chan->name);
+ ast_debug(1, "Received AST_CONTROL_INCOMPLETE on %s\n", ast_channel_name(chan));
/* act as a progress or proceeding, allowing the caller to enter additional numbers */
res = 0;
break;
case AST_CONTROL_PROCEEDING:
- ast_debug(1, "Received AST_CONTROL_PROCEEDING on %s\n", chan->name);
+ ast_debug(1, "Received AST_CONTROL_PROCEEDING on %s\n", ast_channel_name(chan));
/* don't continue in ast_indicate */
res = 0;
break;
case AST_CONTROL_PROGRESS:
- ast_debug(1, "Received AST_CONTROL_PROGRESS on %s\n", chan->name);
+ ast_debug(1, "Received AST_CONTROL_PROGRESS on %s\n", ast_channel_name(chan));
/* don't continue in ast_indicate */
res = 0;
break;
@@ -9472,7 +9472,7 @@ static int dahdi_indicate(struct ast_channel *chan, int condition, const void *d
p->dop.dialstr[0] = '\0';
if ((ioctl(p->subs[SUB_REAL].dfd,DAHDI_HOOK,&func) == -1) && (errno != EINPROGRESS)) {
ast_log(LOG_WARNING, "Unable to flash external trunk on channel %s: %s\n",
- chan->name, strerror(errno));
+ ast_channel_name(chan), strerror(errno));
} else
res = 0;
} else
@@ -9530,7 +9530,7 @@ static struct ast_str *create_channel_name(struct dahdi_pvt *i)
ast_str_set(&chan_name, 0, "%d-%d", i->channel, y);
for (x = 0; x < 3; ++x) {
if (i->subs[x].owner && !strcasecmp(ast_str_buffer(chan_name),
- i->subs[x].owner->name + 6)) {
+ ast_channel_name(i->subs[x].owner) + 6)) {
break;
}
}
@@ -9637,7 +9637,7 @@ static struct ast_channel *dahdi_new(struct dahdi_pvt *i, int state, int startpb
}
if (features) {
if (i->dsp) {
- ast_debug(1, "Already have a dsp on %s?\n", tmp->name);
+ ast_debug(1, "Already have a dsp on %s?\n", ast_channel_name(tmp));
} else {
if (i->channel != CHAN_PSEUDO)
i->dsp = ast_dsp_new();
@@ -9732,7 +9732,7 @@ static struct ast_channel *dahdi_new(struct dahdi_pvt *i, int state, int startpb
ast_jb_configure(tmp, &global_jbconf);
/* Set initial device state */
- ast_copy_string(device_name, tmp->name, sizeof(device_name));
+ ast_copy_string(device_name, ast_channel_name(tmp), sizeof(device_name));
dashptr = strrchr(device_name, '-');
if (dashptr) {
*dashptr = '\0';
@@ -9752,7 +9752,7 @@ static struct ast_channel *dahdi_new(struct dahdi_pvt *i, int state, int startpb
}
#endif
if (ast_pbx_start(tmp)) {
- ast_log(LOG_WARNING, "Unable to start PBX on %s\n", tmp->name);
+ ast_log(LOG_WARNING, "Unable to start PBX on %s\n", ast_channel_name(tmp));
ast_hangup(tmp);
return NULL;
}
@@ -9892,11 +9892,11 @@ static void *analog_ss_thread(void *data)
even get started here, abort safely
*/
if (!p) {
- ast_log(LOG_WARNING, "Channel became a zombie before simple switch could be started (%s)\n", chan->name);
+ ast_log(LOG_WARNING, "Channel became a zombie before simple switch could be started (%s)\n", ast_channel_name(chan));
ast_hangup(chan);
goto quit;
}
- ast_verb(3, "Starting simple switch on '%s'\n", chan->name);
+ ast_verb(3, "Starting simple switch on '%s'\n", ast_channel_name(chan));
idx = dahdi_get_index(chan, p, 1);
if (idx < 0) {
ast_log(LOG_WARNING, "Huh?\n");
@@ -10256,13 +10256,13 @@ static void *analog_ss_thread(void *data)
ast_hangup(chan);
goto quit;
} else if (p->callwaiting && !strcmp(exten, "*70")) {
- ast_verb(3, "Disabling call waiting on %s\n", chan->name);
+ ast_verb(3, "Disabling call waiting on %s\n", ast_channel_name(chan));
/* Disable call waiting if enabled */
p->callwaiting = 0;
res = tone_zone_play_tone(p->subs[idx].dfd, DAHDI_TONE_DIALRECALL);
if (res) {
ast_log(LOG_WARNING, "Unable to do dial recall on channel %s: %s\n",
- chan->name, strerror(errno));
+ ast_channel_name(chan), strerror(errno));
}
len = 0;
ioctl(p->subs[idx].dfd,DAHDI_CONFDIAG,&len);
@@ -10298,7 +10298,7 @@ static void *analog_ss_thread(void *data)
}
} else if (!p->hidecallerid && !strcmp(exten, "*67")) {
- ast_verb(3, "Disabling Caller*ID on %s\n", chan->name);
+ ast_verb(3, "Disabling Caller*ID on %s\n", ast_channel_name(chan));
/* Disable Caller*ID if enabled */
p->hidecallerid = 1;
ast_party_number_free(&chan->caller.id.number);
@@ -10308,7 +10308,7 @@ static void *analog_ss_thread(void *data)
res = tone_zone_play_tone(p->subs[idx].dfd, DAHDI_TONE_DIALRECALL);
if (res) {
ast_log(LOG_WARNING, "Unable to do dial recall on channel %s: %s\n",
- chan->name, strerror(errno));
+ ast_channel_name(chan), strerror(errno));
}
len = 0;
memset(exten, 0, sizeof(exten));
@@ -10349,17 +10349,17 @@ static void *analog_ss_thread(void *data)
and we're parking the first call. */
ast_masq_park_call_exten(ast_bridged_channel(p->subs[SUB_THREEWAY].owner),
chan, exten, chan->context, 0, NULL);
- ast_verb(3, "Parking call to '%s'\n", chan->name);
+ ast_verb(3, "Parking call to '%s'\n", ast_channel_name(chan));
break;
} else if (p->hidecallerid && !strcmp(exten, "*82")) {
- ast_verb(3, "Enabling Caller*ID on %s\n", chan->name);
+ ast_verb(3, "Enabling Caller*ID on %s\n", ast_channel_name(chan));
/* Enable Caller*ID if enabled */
p->hidecallerid = 0;
ast_set_callerid(chan, p->cid_num, p->cid_name, NULL);
res = tone_zone_play_tone(p->subs[idx].dfd, DAHDI_TONE_DIALRECALL);
if (res) {
ast_log(LOG_WARNING, "Unable to do dial recall on channel %s: %s\n",
- chan->name, strerror(errno));
+ ast_channel_name(chan), strerror(errno));
}
len = 0;
memset(exten, 0, sizeof(exten));
@@ -10381,7 +10381,7 @@ static void *analog_ss_thread(void *data)
/* flash hookswitch */
if ((ioctl(pbridge->subs[SUB_REAL].dfd,DAHDI_HOOK,&func) == -1) && (errno != EINPROGRESS)) {
ast_log(LOG_WARNING, "Unable to flash external trunk on channel %s: %s\n",
- nbridge->name, strerror(errno));
+ ast_channel_name(nbridge), strerror(errno));
}
swap_subs(p, SUB_REAL, SUB_THREEWAY);
unalloc_sub(p, SUB_THREEWAY);
@@ -10429,7 +10429,7 @@ static void *analog_ss_thread(void *data)
else if (smdi_msg->type == 'N')
pbx_builtin_setvar_helper(chan, "_SMDI_VM_TYPE", "u");
- ast_debug(1, "Received SMDI message on %s\n", chan->name);
+ ast_debug(1, "Received SMDI message on %s\n", ast_channel_name(chan));
} else {
ast_log(LOG_WARNING, "SMDI enabled but no SMDI message present\n");
}
@@ -10447,7 +10447,7 @@ static void *analog_ss_thread(void *data)
if (p->cid_signalling == CID_SIG_DTMF) {
int k = 0;
cs = NULL;
- ast_debug(1, "Receiving DTMF cid on channel %s\n", chan->name);
+ ast_debug(1, "Receiving DTMF cid on channel %s\n", ast_channel_name(chan));
dahdi_setlinear(p->subs[idx].dfd, 0);
/*
* We are the only party interested in the Rx stream since
@@ -10559,7 +10559,7 @@ static void *analog_ss_thread(void *data)
*/
ast_log(LOG_WARNING,
"Failed to decode CallerID on channel '%s'\n",
- chan->name);
+ ast_channel_name(chan));
break;
} else if (res)
break;
@@ -10702,7 +10702,7 @@ static void *analog_ss_thread(void *data)
"state, but I have nothing to do. "
"Terminating simple switch, should be "
"restarted by the actual ring.\n",
- chan->name);
+ ast_channel_name(chan));
ast_hangup(chan);
goto quit;
}
@@ -10832,7 +10832,7 @@ static void *analog_ss_thread(void *data)
*/
ast_log(LOG_WARNING,
"Failed to decode CallerID on channel '%s'\n",
- chan->name);
+ ast_channel_name(chan));
break;
} else if (res)
break;
@@ -10939,7 +10939,7 @@ static void *analog_ss_thread(void *data)
restore_gains(p);
#endif
if (res < 0) {
- ast_log(LOG_WARNING, "CallerID returned with error on channel '%s'\n", chan->name);
+ ast_log(LOG_WARNING, "CallerID returned with error on channel '%s'\n", ast_channel_name(chan));
}
} else
ast_log(LOG_WARNING, "Unable to get caller ID space\n");
@@ -15017,7 +15017,7 @@ retry:
goto retry;
}
if (option_debug > 2)
- ast_verbose("Softhanging up on %s\n", p->owner->name);
+ ast_verbose("Softhanging up on %s\n", ast_channel_name(p->owner));
ast_softhangup_nolock(p->owner, AST_SOFTHANGUP_EXPLICIT);
p->restartpending = 1;
num_restart_pending++;
@@ -15312,10 +15312,10 @@ static char *dahdi_show_channel(struct ast_cli_entry *e, int cmd, struct ast_cli
ast_cli(a->fd, "InAlarm: %d\n", tmp->inalarm);
ast_cli(a->fd, "Signalling Type: %s\n", sig2str(tmp->sig));
ast_cli(a->fd, "Radio: %d\n", tmp->radio);
- ast_cli(a->fd, "Owner: %s\n", tmp->owner ? tmp->owner->name : "<None>");
- ast_cli(a->fd, "Real: %s%s%s\n", tmp->subs[SUB_REAL].owner ? tmp->subs[SUB_REAL].owner->name : "<None>", tmp->subs[SUB_REAL].inthreeway ? " (Confed)" : "", tmp->subs[SUB_REAL].linear ? " (Linear)" : "");
- ast_cli(a->fd, "Callwait: %s%s%s\n", tmp->subs[SUB_CALLWAIT].owner ? tmp->subs[SUB_CALLWAIT].owner->name : "<None>", tmp->subs[SUB_CALLWAIT].inthreeway ? " (Confed)" : "", tmp->subs[SUB_CALLWAIT].linear ? " (Linear)" : "");
- ast_cli(a->fd, "Threeway: %s%s%s\n", tmp->subs[SUB_THREEWAY].owner ? tmp->subs[SUB_THREEWAY].owner->name : "<None>", tmp->subs[SUB_THREEWAY].inthreeway ? " (Confed)" : "", tmp->subs[SUB_THREEWAY].linear ? " (Linear)" : "");
+ ast_cli(a->fd, "Owner: %s\n", tmp->owner ? ast_channel_name(tmp->owner) : "<None>");
+ ast_cli(a->fd, "Real: %s%s%s\n", tmp->subs[SUB_REAL].owner ? ast_channel_name(tmp->subs[SUB_REAL].owner) : "<None>", tmp->subs[SUB_REAL].inthreeway ? " (Confed)" : "", tmp->subs[SUB_REAL].linear ? " (Linear)" : "");
+ ast_cli(a->fd, "Callwait: %s%s%s\n", tmp->subs[SUB_CALLWAIT].owner ? ast_channel_name(tmp->subs[SUB_CALLWAIT].owner) : "<None>", tmp->subs[SUB_CALLWAIT].inthreeway ? " (Confed)" : "", tmp->subs[SUB_CALLWAIT].linear ? " (Linear)" : "");
+ ast_cli(a->fd, "Threeway: %s%s%s\n", tmp->subs[SUB_THREEWAY].owner ? ast_channel_name(tmp->subs[SUB_THREEWAY].owner) : "<None>", tmp->subs[SUB_THREEWAY].inthreeway ? " (Confed)" : "", tmp->subs[SUB_THREEWAY].linear ? " (Linear)" : "");
ast_cli(a->fd, "Confno: %d\n", tmp->confno);
ast_cli(a->fd, "Propagated Conference: %d\n", tmp->propconfno);
ast_cli(a->fd, "Real in conference: %d\n", tmp->inconference);
@@ -15825,7 +15825,7 @@ static int dahdi_fake_event(struct dahdi_pvt *p, int mode)
p->fake_event = DAHDI_EVENT_ONHOOK;
break;
default:
- ast_log(LOG_WARNING, "I don't know how to handle transfer event with this: %d on channel %s\n",mode, p->owner->name);
+ ast_log(LOG_WARNING, "I don't know how to handle transfer event with this: %d on channel %s\n",mode, ast_channel_name(p->owner));
}
}
return 0;
@@ -16028,7 +16028,7 @@ static int action_dahdishowchannels(struct mansession *s, const struct message *
"%s"
"\r\n",
tmp->channel,
- tmp->owner->name,
+ ast_channel_name(tmp->owner),
tmp->owner->uniqueid,
tmp->owner->accountcode,
sig2str(tmp->sig),
diff --git a/channels/chan_gtalk.c b/channels/chan_gtalk.c
index 855c89ba2..21b80e254 100644
--- a/channels/chan_gtalk.c
+++ b/channels/chan_gtalk.c
@@ -537,7 +537,7 @@ static int gtalk_answer(struct ast_channel *ast)
ast_mutex_lock(&p->lock);
gtalk_invite(p, p->them, p->us,p->sid, 0);
manager_event(EVENT_FLAG_SYSTEM, "ChannelUpdate", "Channel: %s\r\nChanneltype: %s\r\nGtalk-SID: %s\r\n",
- ast->name, "GTALK", p->sid);
+ ast_channel_name(ast), "GTALK", p->sid);
ast_mutex_unlock(&p->lock);
return res;
}
@@ -1202,14 +1202,14 @@ static struct ast_channel *gtalk_new(struct gtalk *client, struct gtalk_pvt *i,
if (i->rtp)
ast_jb_configure(tmp, &global_jbconf);
if (state != AST_STATE_DOWN && ast_pbx_start(tmp)) {
- ast_log(LOG_WARNING, "Unable to start PBX on %s\n", tmp->name);
+ ast_log(LOG_WARNING, "Unable to start PBX on %s\n", ast_channel_name(tmp));
tmp->hangupcause = AST_CAUSE_SWITCH_CONGESTION;
ast_hangup(tmp);
tmp = NULL;
} else {
manager_event(EVENT_FLAG_SYSTEM, "ChannelUpdate",
"Channel: %s\r\nChanneltype: %s\r\nGtalk-SID: %s\r\n",
- i->owner ? i->owner->name : "", "Gtalk", i->sid);
+ i->owner ? ast_channel_name(i->owner) : "", "Gtalk", i->sid);
}
return tmp;
}
@@ -1857,7 +1857,7 @@ static int gtalk_call(struct ast_channel *ast, char *dest, int timeout)
struct gtalk_pvt *p = ast->tech_pvt;
if ((ast->_state != AST_STATE_DOWN) && (ast->_state != AST_STATE_RESERVED)) {
- ast_log(LOG_WARNING, "gtalk_call called on %s, neither down nor reserved\n", ast->name);
+ ast_log(LOG_WARNING, "gtalk_call called on %s, neither down nor reserved\n", ast_channel_name(ast));
return -1;
}
@@ -1989,7 +1989,7 @@ static char *gtalk_show_channels(struct ast_cli_entry *e, int cmd, struct ast_cl
}
if (chan)
ast_cli(a->fd, FORMAT,
- chan->name,
+ ast_channel_name(chan),
jid,
resource,
ast_getformatname(&chan->readformat),
diff --git a/channels/chan_h323.c b/channels/chan_h323.c
index 5f2872086..7999bc40a 100644
--- a/channels/chan_h323.c
+++ b/channels/chan_h323.c
@@ -344,14 +344,14 @@ static void __oh323_update_info(struct ast_channel *c, struct oh323_pvt *pvt)
h323_format chan_nativeformats_bits = ast_format_cap_to_old_bitfield(c->nativeformats);
if (chan_nativeformats_bits != pvt->nativeformats) {
if (h323debug)
- ast_debug(1, "Preparing %s for new native format\n", c->name);
+ ast_debug(1, "Preparing %s for new native format\n", ast_channel_name(c));
ast_format_cap_from_old_bitfield(c->nativeformats, pvt->nativeformats);
ast_set_read_format(c, &c->readformat);
ast_set_write_format(c, &c->writeformat);
}
if (pvt->needhangup) {
if (h323debug)
- ast_debug(1, "Process pending hangup for %s\n", c->name);
+ ast_debug(1, "Process pending hangup for %s\n", ast_channel_name(c));
c->_softhangup |= AST_SOFTHANGUP_DEV;
c->hangupcause = pvt->hangupcause;
ast_queue_hangup_with_cause(c, pvt->hangupcause);
@@ -471,7 +471,7 @@ static void __oh323_destroy(struct oh323_pvt *pvt)
if (pvt->owner) {
ast_channel_lock(pvt->owner);
if (h323debug)
- ast_debug(1, "Detaching from %s\n", pvt->owner->name);
+ ast_debug(1, "Detaching from %s\n", ast_channel_name(pvt->owner));
pvt->owner->tech_pvt = NULL;
ast_channel_unlock(pvt->owner);
}
@@ -499,7 +499,7 @@ static void __oh323_destroy(struct oh323_pvt *pvt)
static void oh323_destroy(struct oh323_pvt *pvt)
{
if (h323debug) {
- ast_debug(1, "Destroying channel %s\n", (pvt->owner ? pvt->owner->name : "<unknown>"));
+ ast_debug(1, "Destroying channel %s\n", (pvt->owner ? ast_channel_name(pvt->owner) : "<unknown>"));
}
ast_mutex_lock(&iflock);
ast_mutex_lock(&pvt->lock);
@@ -522,14 +522,14 @@ static int oh323_digit_begin(struct ast_channel *c, char digit)
/*|| ((pvt->options.dtmfmode & H323_DTMF_CISCO) && pvt->dtmf_pt[1]))*/)) {
/* out-of-band DTMF */
if (h323debug) {
- ast_log(LOG_DTMF, "Begin sending out-of-band digit %c on %s\n", digit, c->name);
+ ast_log(LOG_DTMF, "Begin sending out-of-band digit %c on %s\n", digit, ast_channel_name(c));
}
ast_rtp_instance_dtmf_begin(pvt->rtp, digit);
ast_mutex_unlock(&pvt->lock);
} else if (pvt->txDtmfDigit != digit) {
/* in-band DTMF */
if (h323debug) {
- ast_log(LOG_DTMF, "Begin sending inband digit %c on %s\n", digit, c->name);
+ ast_log(LOG_DTMF, "Begin sending inband digit %c on %s\n", digit, ast_channel_name(c));
}
pvt->txDtmfDigit = digit;
token = pvt->cd.call_token ? ast_strdup(pvt->cd.call_token) : NULL;
@@ -561,14 +561,14 @@ static int oh323_digit_end(struct ast_channel *c, char digit, unsigned int durat
if (pvt->rtp && (pvt->options.dtmfmode & H323_DTMF_RFC2833) && ((pvt->dtmf_pt[0] > 0) || (pvt->dtmf_pt[0] > 0))) {
/* out-of-band DTMF */
if (h323debug) {
- ast_log(LOG_DTMF, "End sending out-of-band digit %c on %s, duration %d\n", digit, c->name, duration);
+ ast_log(LOG_DTMF, "End sending out-of-band digit %c on %s, duration %d\n", digit, ast_channel_name(c), duration);
}
ast_rtp_instance_dtmf_end(pvt->rtp, digit);
ast_mutex_unlock(&pvt->lock);
} else {
/* in-band DTMF */
if (h323debug) {
- ast_log(LOG_DTMF, "End sending inband digit %c on %s, duration %d\n", digit, c->name, duration);
+ ast_log(LOG_DTMF, "End sending inband digit %c on %s, duration %d\n", digit, ast_channel_name(c), duration);
}
pvt->txDtmfDigit = ' ';
token = pvt->cd.call_token ? ast_strdup(pvt->cd.call_token) : NULL;
@@ -595,10 +595,10 @@ static int oh323_call(struct ast_channel *c, char *dest, int timeout)
char called_addr[1024];
if (h323debug) {
- ast_debug(1, "Calling to %s on %s\n", dest, c->name);
+ ast_debug(1, "Calling to %s on %s\n", dest, ast_channel_name(c));
}
if ((c->_state != AST_STATE_DOWN) && (c->_state != AST_STATE_RESERVED)) {
- ast_log(LOG_WARNING, "Line is already in use (%s)\n", c->name);
+ ast_log(LOG_WARNING, "Line is already in use (%s)\n", ast_channel_name(c));
return -1;
}
ast_mutex_lock(&pvt->lock);
@@ -660,7 +660,7 @@ static int oh323_call(struct ast_channel *c, char *dest, int timeout)
ast_mutex_unlock(&pvt->lock);
res = h323_make_call(called_addr, &(pvt->cd), &pvt->options);
if (res) {
- ast_log(LOG_NOTICE, "h323_make_call failed(%s)\n", c->name);
+ ast_log(LOG_NOTICE, "h323_make_call failed(%s)\n", ast_channel_name(c));
return -1;
}
oh323_update_info(c);
@@ -674,7 +674,7 @@ static int oh323_answer(struct ast_channel *c)
char *token;
if (h323debug)
- ast_debug(1, "Answering on %s\n", c->name);
+ ast_debug(1, "Answering on %s\n", ast_channel_name(c));
ast_mutex_lock(&pvt->lock);
token = pvt->cd.call_token ? ast_strdup(pvt->cd.call_token) : NULL;
@@ -698,7 +698,7 @@ static int oh323_hangup(struct ast_channel *c)
if (h323debug)
- ast_debug(1, "Hanging up and scheduling destroy of call %s\n", c->name);
+ ast_debug(1, "Hanging up and scheduling destroy of call %s\n", ast_channel_name(c));
if (!c->tech_pvt) {
ast_log(LOG_WARNING, "Asked to hangup channel not connected\n");
@@ -831,7 +831,7 @@ static struct ast_frame *oh323_read(struct ast_channel *c)
fr = &ast_null_frame;
break;
default:
- ast_log(LOG_ERROR, "Unable to handle fd %d on channel %s\n", c->fdno, c->name);
+ ast_log(LOG_ERROR, "Unable to handle fd %d on channel %s\n", c->fdno, ast_channel_name(c));
fr = &ast_null_frame;
break;
}
@@ -886,7 +886,7 @@ static int oh323_indicate(struct ast_channel *c, int condition, const void *data
ast_mutex_unlock(&pvt->lock);
if (h323debug)
- ast_debug(1, "OH323: Indicating %d on %s (%s)\n", condition, token, c->name);
+ ast_debug(1, "OH323: Indicating %d on %s (%s)\n", condition, token, ast_channel_name(c));
switch(condition) {
case AST_CONTROL_RINGING:
@@ -1127,7 +1127,7 @@ static struct ast_channel *__oh323_new(struct oh323_pvt *pvt, int state, const c
ch->transfercapability = pvt->cd.transfer_capability;
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_hangup(ch);
ch = NULL;
}
diff --git a/channels/chan_iax2.c b/channels/chan_iax2.c
index 34d6536f9..c799955a0 100644
--- a/channels/chan_iax2.c
+++ b/channels/chan_iax2.c
@@ -1323,7 +1323,7 @@ static void iax2_ami_channelupdate(struct chan_iax2_pvt *pvt)
{
manager_event(EVENT_FLAG_SYSTEM, "ChannelUpdate",
"Channel: %s\r\nChanneltype: IAX2\r\nIAX2-callno-local: %d\r\nIAX2-callno-remote: %d\r\nIAX2-peer: %s\r\n",
- pvt->owner ? pvt->owner->name : "",
+ pvt->owner ? ast_channel_name(pvt->owner) : "",
pvt->callno, pvt->peercallno, pvt->peer ? pvt->peer : "");
}
@@ -3560,7 +3560,7 @@ static void __attempt_transmit(const void *data)
iax2_destroy(callno);
} else {
if (iaxs[callno]->owner)
- ast_log(LOG_WARNING, "Max retries exceeded to host %s on %s (type = %d, subclass = %u, ts=%d, seqno=%d)\n", ast_inet_ntoa(iaxs[f->callno]->addr.sin_addr),iaxs[f->callno]->owner->name , f->af.frametype, f->af.subclass.integer, f->ts, f->oseqno);
+ ast_log(LOG_WARNING, "Max retries exceeded to host %s on %s (type = %d, subclass = %u, ts=%d, seqno=%d)\n", ast_inet_ntoa(iaxs[f->callno]->addr.sin_addr),ast_channel_name(iaxs[f->callno]->owner), f->af.frametype, f->af.subclass.integer, f->ts, f->oseqno);
iaxs[callno]->error = ETIMEDOUT;
if (iaxs[callno]->owner) {
struct ast_frame fr = { AST_FRAME_CONTROL, { AST_CONTROL_HANGUP }, .data.uint32 = AST_CAUSE_DESTINATION_OUT_OF_ORDER };
@@ -5092,7 +5092,7 @@ static int iax2_call(struct ast_channel *c, char *dest, int timeout)
iax2_format iax2_tmpfmt;
if ((c->_state != AST_STATE_DOWN) && (c->_state != AST_STATE_RESERVED)) {
- ast_log(LOG_WARNING, "Channel is already in use (%s)?\n", c->name);
+ ast_log(LOG_WARNING, "Channel is already in use (%s)?\n", ast_channel_name(c));
return -1;
}
@@ -5292,7 +5292,7 @@ static int iax2_hangup(struct ast_channel *c)
memset(&ied, 0, sizeof(ied));
ast_mutex_lock(&iaxsl[callno]);
if (callno && iaxs[callno]) {
- ast_debug(1, "We're hanging up %s now...\n", c->name);
+ ast_debug(1, "We're hanging up %s now...\n", ast_channel_name(c));
alreadygone = ast_test_flag64(iaxs[callno], IAX_ALREADYGONE);
/* Send the hangup unless we have had a transmission error or are already gone */
iax_ie_append_byte(&ied, IAX_IE_CAUSECODE, (unsigned char)c->hangupcause);
@@ -5309,7 +5309,7 @@ static int iax2_hangup(struct ast_channel *c)
iax2_predestroy(callno);
/* If we were already gone to begin with, destroy us now */
if (iaxs[callno] && alreadygone) {
- ast_debug(1, "Really destroying %s now...\n", c->name);
+ ast_debug(1, "Really destroying %s now...\n", ast_channel_name(c));
iax2_destroy(callno);
} else if (iaxs[callno]) {
if (ast_sched_add(sched, 10000, scheduled_destroy, CALLNO_TO_PTR(callno)) < 0) {
@@ -5325,7 +5325,7 @@ static int iax2_hangup(struct ast_channel *c)
c->tech_pvt = NULL;
}
ast_mutex_unlock(&iaxsl[callno]);
- ast_verb(3, "Hungup '%s'\n", c->name);
+ ast_verb(3, "Hungup '%s'\n", ast_channel_name(c));
return 0;
}
@@ -5752,7 +5752,7 @@ static int iax2_transfer(struct ast_channel *c, const char *dest)
iax_ie_append_str(&ied, IAX_IE_CALLED_NUMBER, tmp);
if (context)
iax_ie_append_str(&ied, IAX_IE_CALLED_CONTEXT, context);
- ast_debug(1, "Transferring '%s' to '%s'\n", c->name, dest);
+ ast_debug(1, "Transferring '%s' to '%s'\n", ast_channel_name(c), dest);
ast_queue_control_data(c, AST_CONTROL_TRANSFER, &message, sizeof(message));
return send_command_locked(callno, AST_FRAME_IAX, IAX_COMMAND_TRANSFER, 0, ied.buf, ied.pos, -1);
}
@@ -5902,7 +5902,7 @@ static struct ast_channel *ast_iax2_new(int callno, int state, iax2_format capab
if (state != AST_STATE_DOWN) {
if (ast_pbx_start(tmp)) {
- ast_log(LOG_WARNING, "Unable to start PBX on %s\n", tmp->name);
+ ast_log(LOG_WARNING, "Unable to start PBX on %s\n", ast_channel_name(tmp));
ast_hangup(tmp);
i->owner = NULL;
return NULL;
@@ -7275,7 +7275,7 @@ static char *handle_cli_iax2_show_channels(struct ast_cli_entry *e, int cmd, str
iax_frame_subclass2str(iaxs[x]->last_iax_message & ~MARK_IAX_SUBCLASS_TX, last_message, sizeof(last_message));
lag = iaxs[x]->remote_rr.delay;
ast_cli(a->fd, FORMAT,
- iaxs[x]->owner ? iaxs[x]->owner->name : "(None)",
+ iaxs[x]->owner ? ast_channel_name(iaxs[x]->owner) : "(None)",
ast_inet_ntoa(iaxs[x]->addr.sin_addr),
S_OR(iaxs[x]->username, "(None)"),
iaxs[x]->callno, iaxs[x]->peercallno,
@@ -7333,7 +7333,7 @@ static int ast_cli_netstats(struct mansession *s, int fd, int limit_fmt)
}
if (s)
astman_append(s, limit_fmt ? ACN_FORMAT1 : ACN_FORMAT2,
- iaxs[x]->owner ? iaxs[x]->owner->name : "(None)",
+ iaxs[x]->owner ? ast_channel_name(iaxs[x]->owner) : "(None)",
iaxs[x]->pingtime,
localjitter,
localdelay,
@@ -7355,7 +7355,7 @@ static int ast_cli_netstats(struct mansession *s, int fd, int limit_fmt)
last_message);
else
ast_cli(fd, limit_fmt ? ACN_FORMAT1 : ACN_FORMAT2,
- iaxs[x]->owner ? iaxs[x]->owner->name : "(None)",
+ iaxs[x]->owner ? ast_channel_name(iaxs[x]->owner) : "(None)",
iaxs[x]->pingtime,
localjitter,
localdelay,
@@ -9366,7 +9366,7 @@ static void *iax_park_thread(void *stuff)
d = stuff;
ast_debug(4, "IAX Park: Transferer channel %s, Transferee %s\n",
- d->chan2->name, d->chan1->name);
+ ast_channel_name(d->chan2), ast_channel_name(d->chan1));
res = ast_park_call_exten(d->chan1, d->chan2, d->park_exten, d->park_context, 0, &ext);
if (res) {
@@ -9390,8 +9390,8 @@ static int iax_park(struct ast_channel *chan1, struct ast_channel *chan2, const
struct ast_channel *chan1m, *chan2m;/* Chan2m: The transferer, chan1m: The transferee */
pthread_t th;
- 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);
+ chan1m = ast_channel_alloc(0, AST_STATE_DOWN, 0, 0, chan2->accountcode, chan1->exten, chan1->context, chan1->linkedid, chan1->amaflags, "Parking/%s", ast_channel_name(chan1));
+ chan2m = ast_channel_alloc(0, AST_STATE_DOWN, 0, 0, chan2->accountcode, chan2->exten, chan2->context, chan2->linkedid, chan2->amaflags, "IAXPeer/%s", ast_channel_name(chan2));
d = ast_calloc(1, sizeof(*d));
if (!chan1m || !chan2m || !d) {
if (chan1m) {
@@ -9550,7 +9550,7 @@ static void log_jitterstats(unsigned short callno)
jb_info jbinfo;
ast_mutex_lock(&iaxsl[callno]);
- if (iaxs[callno] && iaxs[callno]->owner && iaxs[callno]->owner->name) {
+ if (iaxs[callno] && iaxs[callno]->owner && ast_channel_name(iaxs[callno]->owner)) {
if(ast_test_flag64(iaxs[callno], IAX_USEJITTERBUF)) {
jb_getinfo(iaxs[callno]->jb, &jbinfo);
localjitter = jbinfo.jitter;
@@ -9562,7 +9562,7 @@ static void log_jitterstats(unsigned short callno)
localpackets = jbinfo.frames_in;
}
ast_debug(3, "JB STATS:%s ping=%d ljitterms=%d ljbdelayms=%d ltotlost=%d lrecentlosspct=%d ldropped=%d looo=%d lrecvd=%d rjitterms=%d rjbdelayms=%d rtotlost=%d rrecentlosspct=%d rdropped=%d rooo=%d rrecvd=%d\n",
- iaxs[callno]->owner->name,
+ ast_channel_name(iaxs[callno]->owner),
iaxs[callno]->pingtime,
localjitter,
localdelay,
@@ -9579,7 +9579,7 @@ static void log_jitterstats(unsigned short callno)
iaxs[callno]->remote_rr.ooo,
iaxs[callno]->remote_rr.packets);
manager_event(EVENT_FLAG_REPORTING, "JitterBufStats", "Owner: %s\r\nPing: %d\r\nLocalJitter: %d\r\nLocalJBDelay: %d\r\nLocalTotalLost: %d\r\nLocalLossPercent: %d\r\nLocalDropped: %d\r\nLocalooo: %d\r\nLocalReceived: %d\r\nRemoteJitter: %d\r\nRemoteJBDelay: %d\r\nRemoteTotalLost: %d\r\nRemoteLossPercent: %d\r\nRemoteDropped: %d\r\nRemoteooo: %d\r\nRemoteReceived: %d\r\n",
- iaxs[callno]->owner->name,
+ ast_channel_name(iaxs[callno]->owner),
iaxs[callno]->pingtime,
localjitter,
localdelay,
@@ -9946,7 +9946,7 @@ static void set_hangup_source_and_cause(int callno, unsigned char causecode)
if (causecode) {
iaxs[callno]->owner->hangupcause = causecode;
}
- ast_set_hangupsource(iaxs[callno]->owner, iaxs[callno]->owner->name, 0);
+ ast_set_hangupsource(iaxs[callno]->owner, ast_channel_name(iaxs[callno]->owner), 0);
ast_channel_unlock(iaxs[callno]->owner);
}
}
@@ -10495,7 +10495,7 @@ static int socket_process(struct iax2_thread *thread)
"Status: On\r\n"
"Channel: %s\r\n"
"Uniqueid: %s\r\n",
- iaxs[fr->callno]->owner->name,
+ ast_channel_name(iaxs[fr->callno]->owner),
iaxs[fr->callno]->owner->uniqueid);
}
@@ -10532,7 +10532,7 @@ static int socket_process(struct iax2_thread *thread)
"Status: Off\r\n"
"Channel: %s\r\n"
"Uniqueid: %s\r\n",
- iaxs[fr->callno]->owner->name,
+ ast_channel_name(iaxs[fr->callno]->owner),
iaxs[fr->callno]->owner->uniqueid);
}
@@ -10858,24 +10858,24 @@ static int socket_process(struct iax2_thread *thread)
ast_mutex_unlock(&iaxsl[fr->callno]);
/* Set BLINDTRANSFER channel variables */
- pbx_builtin_setvar_helper(owner, "BLINDTRANSFER", bridged_chan->name);
- pbx_builtin_setvar_helper(bridged_chan, "BLINDTRANSFER", owner->name);
+ pbx_builtin_setvar_helper(owner, "BLINDTRANSFER", ast_channel_name(bridged_chan));
+ pbx_builtin_setvar_helper(bridged_chan, "BLINDTRANSFER", ast_channel_name(owner));
/* DO NOT hold any locks while calling ast_parking_ext_valid() */
if (ast_parking_ext_valid(ies.called_number, owner, context)) {
- ast_debug(1, "Parking call '%s'\n", bridged_chan->name);
+ ast_debug(1, "Parking call '%s'\n", ast_channel_name(bridged_chan));
if (iax_park(bridged_chan, owner, ies.called_number, context)) {
ast_log(LOG_WARNING, "Failed to park call '%s'\n",
- bridged_chan->name);
+ ast_channel_name(bridged_chan));
}
} else {
if (ast_async_goto(bridged_chan, context, ies.called_number, 1)) {
ast_log(LOG_WARNING,
"Async goto of '%s' to '%s@%s' failed\n",
- bridged_chan->name, ies.called_number, context);
+ ast_channel_name(bridged_chan), ies.called_number, context);
} else {
ast_debug(1, "Async goto of '%s' to '%s@%s' started\n",
- bridged_chan->name, ies.called_number, context);
+ ast_channel_name(bridged_chan), ies.called_number, context);
}
}
ast_channel_unref(owner);
@@ -11040,7 +11040,7 @@ static int socket_process(struct iax2_thread *thread)
break;
case IAX_COMMAND_AUTHREQ:
if (ast_test_flag(&iaxs[fr->callno]->state, IAX_STATE_STARTED | IAX_STATE_TBD)) {
- ast_log(LOG_WARNING, "Call on %s is already up, can't start on it\n", iaxs[fr->callno]->owner ? iaxs[fr->callno]->owner->name : "<Unknown>");
+ ast_log(LOG_WARNING, "Call on %s is already up, can't start on it\n", iaxs[fr->callno]->owner ? ast_channel_name(iaxs[fr->callno]->owner) : "<Unknown>");
break;
}
if (authenticate_reply(iaxs[fr->callno], &iaxs[fr->callno]->addr, &ies, iaxs[fr->callno]->secret, iaxs[fr->callno]->outkey)) {
@@ -11059,7 +11059,7 @@ static int socket_process(struct iax2_thread *thread)
send_command_immediate(iaxs[fr->callno], AST_FRAME_IAX, IAX_COMMAND_ACK, fr->ts, NULL, 0,fr->iseqno);
/* Ignore once we've started */
if (ast_test_flag(&iaxs[fr->callno]->state, IAX_STATE_STARTED | IAX_STATE_TBD)) {
- ast_log(LOG_WARNING, "Call on %s is already up, can't start on it\n", iaxs[fr->callno]->owner ? iaxs[fr->callno]->owner->name : "<Unknown>");
+ ast_log(LOG_WARNING, "Call on %s is already up, can't start on it\n", iaxs[fr->callno]->owner ? ast_channel_name(iaxs[fr->callno]->owner) : "<Unknown>");
break;
}
if (authenticate_verify(iaxs[fr->callno], &ies)) {
@@ -11417,7 +11417,7 @@ immediatedial:
break;
case IAX_COMMAND_TXREJ:
iaxs[fr->callno]->transferring = 0;
- ast_verb(3, "Channel '%s' unable to transfer\n", iaxs[fr->callno]->owner ? iaxs[fr->callno]->owner->name : "<Unknown>");
+ ast_verb(3, "Channel '%s' unable to transfer\n", iaxs[fr->callno]->owner ? ast_channel_name(iaxs[fr->callno]->owner) : "<Unknown>");
memset(&iaxs[fr->callno]->transfer, 0, sizeof(iaxs[fr->callno]->transfer));
if (iaxs[fr->callno]->bridgecallno) {
if (iaxs[iaxs[fr->callno]->bridgecallno]->transferring) {
@@ -11433,14 +11433,14 @@ immediatedial:
iaxs[fr->callno]->transferring = TRANSFER_MREADY;
else
iaxs[fr->callno]->transferring = TRANSFER_READY;
- ast_verb(3, "Channel '%s' ready to transfer\n", iaxs[fr->callno]->owner ? iaxs[fr->callno]->owner->name : "<Unknown>");
+ ast_verb(3, "Channel '%s' ready to transfer\n", iaxs[fr->callno]->owner ? ast_channel_name(iaxs[fr->callno]->owner) : "<Unknown>");
if (iaxs[fr->callno]->bridgecallno) {
if ((iaxs[iaxs[fr->callno]->bridgecallno]->transferring == TRANSFER_READY) ||
(iaxs[iaxs[fr->callno]->bridgecallno]->transferring == TRANSFER_MREADY)) {
/* They're both ready, now release them. */
if (iaxs[fr->callno]->transferring == TRANSFER_MREADY) {
- ast_verb(3, "Attempting media bridge of %s and %s\n", iaxs[fr->callno]->owner ? iaxs[fr->callno]->owner->name : "<Unknown>",
- iaxs[iaxs[fr->callno]->bridgecallno]->owner ? iaxs[iaxs[fr->callno]->bridgecallno]->owner->name : "<Unknown>");
+ ast_verb(3, "Attempting media bridge of %s and %s\n", iaxs[fr->callno]->owner ? ast_channel_name(iaxs[fr->callno]->owner) : "<Unknown>",
+ iaxs[iaxs[fr->callno]->bridgecallno]->owner ? ast_channel_name(iaxs[iaxs[fr->callno]->bridgecallno]->owner) : "<Unknown>");
iaxs[iaxs[fr->callno]->bridgecallno]->transferring = TRANSFER_MEDIA;
iaxs[fr->callno]->transferring = TRANSFER_MEDIA;
@@ -11452,8 +11452,8 @@ immediatedial:
send_command(iaxs[fr->callno], AST_FRAME_IAX, IAX_COMMAND_TXMEDIA, 0, ied0.buf, ied0.pos, -1);
send_command(iaxs[iaxs[fr->callno]->bridgecallno], AST_FRAME_IAX, IAX_COMMAND_TXMEDIA, 0, ied1.buf, ied1.pos, -1);
} else {
- ast_verb(3, "Releasing %s and %s\n", iaxs[fr->callno]->owner ? iaxs[fr->callno]->owner->name : "<Unknown>",
- iaxs[iaxs[fr->callno]->bridgecallno]->owner ? iaxs[iaxs[fr->callno]->bridgecallno]->owner->name : "<Unknown>");
+ ast_verb(3, "Releasing %s and %s\n", iaxs[fr->callno]->owner ? ast_channel_name(iaxs[fr->callno]->owner) : "<Unknown>",
+ iaxs[iaxs[fr->callno]->bridgecallno]->owner ? ast_channel_name(iaxs[iaxs[fr->callno]->bridgecallno]->owner) : "<Unknown>");
iaxs[iaxs[fr->callno]->bridgecallno]->transferring = TRANSFER_RELEASED;
iaxs[fr->callno]->transferring = TRANSFER_RELEASED;
@@ -12238,7 +12238,7 @@ static struct ast_channel *iax2_request(const char *type, struct ast_format_cap
char tmp[256];
char tmp2[256];
ast_log(LOG_WARNING, "Unable to create translator path for %s to %s on %s\n",
- ast_getformatname_multiple(tmp, sizeof(tmp), c->nativeformats), ast_getformatname_multiple(tmp2, sizeof(tmp2), cap), c->name);
+ ast_getformatname_multiple(tmp, sizeof(tmp), c->nativeformats), ast_getformatname_multiple(tmp2, sizeof(tmp2), cap), ast_channel_name(c));
ast_hangup(c);
return NULL;
}
diff --git a/channels/chan_jingle.c b/channels/chan_jingle.c
index 233ec7e2e..aad52e3cc 100644
--- a/channels/chan_jingle.c
+++ b/channels/chan_jingle.c
@@ -916,7 +916,7 @@ static struct ast_channel *jingle_new(struct jingle *client, struct jingle_pvt *
if (i->rtp)
ast_jb_configure(tmp, &global_jbconf);
if (state != AST_STATE_DOWN && ast_pbx_start(tmp)) {
- ast_log(LOG_WARNING, "Unable to start PBX on %s\n", tmp->name);
+ ast_log(LOG_WARNING, "Unable to start PBX on %s\n", ast_channel_name(tmp));
tmp->hangupcause = AST_CAUSE_SWITCH_CONGESTION;
ast_hangup(tmp);
tmp = NULL;
@@ -1503,7 +1503,7 @@ static int jingle_call(struct ast_channel *ast, char *dest, int timeout)
struct jingle_pvt *p = ast->tech_pvt;
if ((ast->_state != AST_STATE_DOWN) && (ast->_state != AST_STATE_RESERVED)) {
- ast_log(LOG_WARNING, "jingle_call called on %s, neither down nor reserved\n", ast->name);
+ ast_log(LOG_WARNING, "jingle_call called on %s, neither down nor reserved\n", ast_channel_name(ast));
return -1;
}
@@ -1632,7 +1632,7 @@ static char *jingle_show_channels(struct ast_cli_entry *e, int cmd, struct ast_c
}
if (chan)
ast_cli(a->fd, FORMAT,
- chan->name,
+ ast_channel_name(chan),
jid,
resource,
ast_getformatname(&chan->readformat),
diff --git a/channels/chan_local.c b/channels/chan_local.c
index 25ac5ae11..69e6841e9 100644
--- a/channels/chan_local.c
+++ b/channels/chan_local.c
@@ -326,7 +326,7 @@ static struct ast_channel *local_bridgedchannel(struct ast_channel *chan, struct
if (!p) {
ast_debug(1, "Asked for bridged channel on '%s'/'%s', returning <none>\n",
- chan->name, bridge->name);
+ ast_channel_name(chan), ast_channel_name(bridge));
return NULL;
}
@@ -607,7 +607,7 @@ static int local_write(struct ast_channel *ast, struct ast_frame *f)
if (!ast_test_flag(p, LOCAL_ALREADY_MASQED)) {
res = local_queue_frame(p, isoutbound, f, ast, 1);
} else {
- ast_debug(1, "Not posting to queue since already masked on '%s'\n", ast->name);
+ ast_debug(1, "Not posting to queue since already masked on '%s'\n", ast_channel_name(ast));
res = 0;
}
ao2_unlock(p);
@@ -917,7 +917,7 @@ static int local_call(struct ast_channel *ast, char *dest, int timeout)
"Context: %s\r\n"
"Exten: %s\r\n"
"LocalOptimization: %s\r\n",
- p->owner->name, p->chan->name, p->owner->uniqueid, p->chan->uniqueid,
+ ast_channel_name(p->owner), ast_channel_name(p->chan), p->owner->uniqueid, p->chan->uniqueid,
p->context, p->exten,
ast_test_flag(p, LOCAL_NO_OPTIMIZATION) ? "Yes" : "No");
@@ -1234,7 +1234,7 @@ static char *locals_show(struct ast_cli_entry *e, int cmd, struct ast_cli_args *
it = ao2_iterator_init(locals, 0);
while ((p = ao2_iterator_next(&it))) {
ao2_lock(p);
- ast_cli(a->fd, "%s -- %s@%s\n", p->owner ? p->owner->name : "<unowned>", p->exten, p->context);
+ ast_cli(a->fd, "%s -- %s@%s\n", p->owner ? ast_channel_name(p->owner) : "<unowned>", p->exten, p->context);
ao2_unlock(p);
ao2_ref(p, -1);
}
diff --git a/channels/chan_mgcp.c b/channels/chan_mgcp.c
index 9df36eb7a..8c3ddd0ce 100644
--- a/channels/chan_mgcp.c
+++ b/channels/chan_mgcp.c
@@ -842,7 +842,7 @@ static int mgcp_call(struct ast_channel *ast, char *dest, int timeout)
struct varshead *headp;
struct ast_var_t *current;
- ast_debug(3, "MGCP mgcp_call(%s)\n", ast->name);
+ ast_debug(3, "MGCP mgcp_call(%s)\n", ast_channel_name(ast));
sub = ast->tech_pvt;
p = sub->parent;
headp = &ast->varshead;
@@ -877,7 +877,7 @@ static int mgcp_call(struct ast_channel *ast, char *dest, int timeout)
}
if ((ast->_state != AST_STATE_DOWN) && (ast->_state != AST_STATE_RESERVED)) {
- ast_log(LOG_WARNING, "mgcp_call called on %s, neither down nor reserved\n", ast->name);
+ ast_log(LOG_WARNING, "mgcp_call called on %s, neither down nor reserved\n", ast_channel_name(ast));
ast_mutex_unlock(&sub->lock);
return -1;
}
@@ -923,7 +923,7 @@ static int mgcp_hangup(struct ast_channel *ast)
struct mgcp_endpoint *p = sub->parent;
struct ast_channel *bridged;
- ast_debug(1, "mgcp_hangup(%s)\n", ast->name);
+ ast_debug(1, "mgcp_hangup(%s)\n", ast_channel_name(ast));
if (!ast->tech_pvt) {
ast_debug(1, "Asked to hangup channel not connected\n");
return 0;
@@ -933,7 +933,7 @@ static int mgcp_hangup(struct ast_channel *ast)
return 0;
}
ast_mutex_lock(&sub->lock);
- ast_debug(3, "MGCP mgcp_hangup(%s) on %s@%s\n", ast->name, p->name, p->parent->name);
+ ast_debug(3, "MGCP mgcp_hangup(%s) on %s@%s\n", ast_channel_name(ast), p->name, p->parent->name);
if ((p->dtmfmode & MGCP_DTMF_INBAND) && p->dsp) {
/* check whether other channel is active. */
@@ -1017,16 +1017,16 @@ static int mgcp_hangup(struct ast_channel *ast)
if ((p->hookstate == MGCP_ONHOOK) && (!sub->next->rtp)) {
p->hidecallerid = 0;
if (p->hascallwaiting && !p->callwaiting) {
- ast_verb(3, "Enabling call waiting on %s\n", ast->name);
+ ast_verb(3, "Enabling call waiting on %s\n", ast_channel_name(ast));
p->callwaiting = -1;
}
if (has_voicemail(p)) {
ast_debug(3, "MGCP mgcp_hangup(%s) on %s@%s set vmwi(+)\n",
- ast->name, p->name, p->parent->name);
+ ast_channel_name(ast), p->name, p->parent->name);
transmit_notify_request(sub, "L/vmwi(+)");
} else {
ast_debug(3, "MGCP mgcp_hangup(%s) on %s@%s set vmwi(-)\n",
- ast->name, p->name, p->parent->name);
+ ast_channel_name(ast), p->name, p->parent->name);
transmit_notify_request(sub, "L/vmwi(-)");
}
}
@@ -1186,10 +1186,10 @@ static int mgcp_answer(struct ast_channel *ast)
transmit_modify_request(sub);
}
ast_verb(3, "MGCP mgcp_answer(%s) on %s@%s-%d\n",
- ast->name, p->name, p->parent->name, sub->id);
+ ast_channel_name(ast), p->name, p->parent->name, sub->id);
if (ast->_state != AST_STATE_UP) {
ast_setstate(ast, AST_STATE_UP);
- ast_debug(1, "mgcp_answer(%s)\n", ast->name);
+ ast_debug(1, "mgcp_answer(%s)\n", ast_channel_name(ast));
transmit_notify_request(sub, "");
transmit_modify_request(sub);
}
@@ -1284,7 +1284,7 @@ static int mgcp_fixup(struct ast_channel *oldchan, struct ast_channel *newchan)
struct mgcp_subchannel *sub = newchan->tech_pvt;
ast_mutex_lock(&sub->lock);
- ast_log(LOG_NOTICE, "mgcp_fixup(%s, %s)\n", oldchan->name, newchan->name);
+ ast_log(LOG_NOTICE, "mgcp_fixup(%s, %s)\n", ast_channel_name(oldchan), ast_channel_name(newchan));
if (sub->owner != oldchan) {
ast_mutex_unlock(&sub->lock);
ast_log(LOG_WARNING, "old channel wasn't %p but was %p\n", oldchan, sub->owner);
@@ -1441,7 +1441,7 @@ static int mgcp_indicate(struct ast_channel *ast, int ind, const void *data, siz
int res = 0;
ast_debug(3, "MGCP asked to indicate %d '%s' condition on channel %s\n",
- ind, control2str(ind), ast->name);
+ ind, control2str(ind), ast_channel_name(ast));
ast_mutex_lock(&sub->lock);
switch(ind) {
case AST_CONTROL_RINGING:
@@ -1560,13 +1560,13 @@ static struct ast_channel *mgcp_new(struct mgcp_subchannel *sub, int state, cons
}
if (state != AST_STATE_DOWN) {
if (ast_pbx_start(tmp)) {
- ast_log(LOG_WARNING, "Unable to start PBX on %s\n", tmp->name);
+ ast_log(LOG_WARNING, "Unable to start PBX on %s\n", ast_channel_name(tmp));
ast_hangup(tmp);
tmp = NULL;
}
}
ast_verb(3, "MGCP mgcp_new(%s) created in state: %s\n",
- tmp->name, ast_state2str(state));
+ ast_channel_name(tmp), ast_state2str(state));
} else {
ast_log(LOG_WARNING, "Unable to allocate channel structure\n");
}
@@ -3004,7 +3004,7 @@ static void *mgcp_ss(void *data)
/* Record this as the forwarding extension */
ast_copy_string(p->call_forward, p->dtmf_buf, sizeof(p->call_forward));
ast_verb(3, "Setting call forward to '%s' on channel %s\n",
- p->call_forward, chan->name);
+ p->call_forward, ast_channel_name(chan));
/*res = tone_zone_play_tone(p->subs[index].zfd, DAHDI_TONE_DIALRECALL);*/
transmit_notify_request(sub, "L/sl");
if (res)
@@ -3057,7 +3057,7 @@ static void *mgcp_ss(void *data)
memset(p->dtmf_buf, 0, sizeof(p->dtmf_buf));
return NULL;
} else if (p->hascallwaiting && p->callwaiting && !strcmp(p->dtmf_buf, "*70")) {
- ast_verb(3, "Disabling call waiting on %s\n", chan->name);
+ ast_verb(3, "Disabling call waiting on %s\n", ast_channel_name(chan));
/* Disable call waiting if enabled */
p->callwaiting = 0;
/*res = tone_zone_play_tone(p->subs[index].zfd, DAHDI_TONE_DIALRECALL);*/
@@ -3079,7 +3079,7 @@ static void *mgcp_ss(void *data)
ast_hangup(chan);
return NULL;
} else if (!p->hidecallerid && !strcmp(p->dtmf_buf, "*67")) {
- ast_verb(3, "Disabling Caller*ID on %s\n", chan->name);
+ ast_verb(3, "Disabling Caller*ID on %s\n", ast_channel_name(chan));
/* Disable Caller*ID if enabled */
p->hidecallerid = 1;
ast_set_callerid(chan, "", "", NULL);
@@ -3099,7 +3099,7 @@ static void *mgcp_ss(void *data)
break;
} else if (!strcmp(p->dtmf_buf, "*78")) {
/* Do not disturb */
- ast_verb(3, "Enabled DND on channel %s\n", chan->name);
+ ast_verb(3, "Enabled DND on channel %s\n", ast_channel_name(chan));
/*res = tone_zone_play_tone(p->subs[index].zfd, DAHDI_TONE_DIALRECALL);*/
transmit_notify_request(sub, "L/sl");
p->dnd = 1;
@@ -3108,7 +3108,7 @@ static void *mgcp_ss(void *data)
len = 0;
} else if (!strcmp(p->dtmf_buf, "*79")) {
/* Do not disturb */
- ast_verb(3, "Disabled DND on channel %s\n", chan->name);
+ ast_verb(3, "Disabled DND on channel %s\n", ast_channel_name(chan));
/*res = tone_zone_play_tone(p->subs[index].zfd, DAHDI_TONE_DIALRECALL);*/
transmit_notify_request(sub, "L/sl");
p->dnd = 0;
@@ -3122,7 +3122,7 @@ static void *mgcp_ss(void *data)
memset(p->dtmf_buf, 0, sizeof(p->dtmf_buf));
len = 0;
} else if (p->cancallforward && !strcmp(p->dtmf_buf, "*73")) {
- ast_verb(3, "Cancelling call forwarding on channel %s\n", chan->name);
+ ast_verb(3, "Cancelling call forwarding on channel %s\n", ast_channel_name(chan));
/*res = tone_zone_play_tone(p->subs[index].zfd, DAHDI_TONE_DIALRECALL);*/
transmit_notify_request(sub, "L/sl");
memset(p->call_forward, 0, sizeof(p->call_forward));
@@ -3135,7 +3135,7 @@ static void *mgcp_ss(void *data)
and we're parking the first call. */
ast_masq_park_call_exten(ast_bridged_channel(sub->next->owner), chan,
p->dtmf_buf, chan->context, 0, NULL);
- ast_verb(3, "Parking call to '%s'\n", chan->name);
+ ast_verb(3, "Parking call to '%s'\n", ast_channel_name(chan));
break;
} else if (!ast_strlen_zero(p->lastcallerid) && !strcmp(p->dtmf_buf, "*60")) {
ast_verb(3, "Blacklisting number %s\n", p->lastcallerid);
@@ -3147,7 +3147,7 @@ static void *mgcp_ss(void *data)
len = 0;
}
} else if (p->hidecallerid && !strcmp(p->dtmf_buf, "*82")) {
- ast_verb(3, "Enabling Caller*ID on %s\n", chan->name);
+ ast_verb(3, "Enabling Caller*ID on %s\n", ast_channel_name(chan));
/* Enable Caller*ID if enabled */
p->hidecallerid = 0;
ast_set_callerid(chan, p->cid_num, p->cid_name, NULL);
@@ -3234,7 +3234,7 @@ static int attempt_transfer(struct mgcp_endpoint *p)
}
if (ast_channel_masquerade(p->sub->next->owner, ast_bridged_channel(p->sub->owner))) {
ast_log(LOG_WARNING, "Unable to masquerade %s as %s\n",
- ast_bridged_channel(p->sub->owner)->name, p->sub->next->owner->name);
+ ast_channel_name(ast_bridged_channel(p->sub->owner)), ast_channel_name(p->sub->next->owner));
return -1;
}
/* Orphan the channel */
@@ -3246,7 +3246,7 @@ static int attempt_transfer(struct mgcp_endpoint *p)
ast_queue_control(p->sub->next->owner, AST_CONTROL_UNHOLD);
if (ast_channel_masquerade(p->sub->owner, ast_bridged_channel(p->sub->next->owner))) {
ast_log(LOG_WARNING, "Unable to masquerade %s as %s\n",
- ast_bridged_channel(p->sub->next->owner)->name, p->sub->owner->name);
+ ast_channel_name(ast_bridged_channel(p->sub->next->owner)), ast_channel_name(p->sub->owner));
return -1;
}
/*swap_subs(p, SUB_THREEWAY, SUB_REAL);*/
@@ -3257,7 +3257,7 @@ static int attempt_transfer(struct mgcp_endpoint *p)
return 1;
} else {
ast_debug(1, "Neither %s nor %s are in a bridge, nothing to transfer\n",
- p->sub->owner->name, p->sub->next->owner->name);
+ ast_channel_name(p->sub->owner), ast_channel_name(p->sub->next->owner));
p->sub->next->owner->_softhangup |= AST_SOFTHANGUP_DEV;
if (p->sub->next->owner) {
p->sub->next->alreadygone = 1;
diff --git a/channels/chan_misdn.c b/channels/chan_misdn.c
index 30b104452..a9614344a 100644
--- a/channels/chan_misdn.c
+++ b/channels/chan_misdn.c
@@ -762,7 +762,7 @@ static struct chan_list *get_chan_by_ast_name(const char *name)
ast_mutex_lock(&cl_te_lock);
for (tmp = cl_te; tmp; tmp = tmp->next) {
- if (tmp->ast && strcmp(tmp->ast->name, name) == 0) {
+ if (tmp->ast && strcmp(ast_channel_name(tmp->ast), name) == 0) {
chan_list_ref(tmp, "Found chan_list by ast name");
ast_mutex_unlock(&cl_te_lock);
return tmp;
@@ -3682,7 +3682,7 @@ static void send_digit_to_chan(struct chan_list *cl, char digit)
ast_playtones_start(chan, 0, dtmf_tones[15], 0);
} else {
/* not handled */
- ast_debug(1, "Unable to handle DTMF tone '%c' for '%s'\n", digit, chan->name);
+ ast_debug(1, "Unable to handle DTMF tone '%c' for '%s'\n", digit, ast_channel_name(chan));
}
}
@@ -4178,7 +4178,7 @@ static void print_bc_info(int fd, struct chan_list *help, struct misdn_bchannel
#endif
" --> notone : rx %d tx:%d\n"
" --> bc_hold: %d\n",
- help->ast->name,
+ ast_channel_name(help->ast),
help->l3id,
help->addr,
bc->addr,
@@ -4296,7 +4296,7 @@ static char *handle_cli_misdn_show_channel(struct ast_cli_entry *e, int cmd, str
struct ast_channel *ast = help->ast;
if (bc && ast) {
- if (!strcasecmp(ast->name, a->argv[3])) {
+ if (!strcasecmp(ast_channel_name(ast), a->argv[3])) {
print_bc_info(a->fd, help, bc);
break;
}
@@ -6507,7 +6507,7 @@ static int misdn_call(struct ast_channel *ast, char *dest, int timeout)
}
if (((ast->_state != AST_STATE_DOWN) && (ast->_state != AST_STATE_RESERVED)) || !dest) {
- ast_log(LOG_WARNING, " --> ! misdn_call called on %s, neither down nor reserved (or dest==NULL)\n", ast->name);
+ ast_log(LOG_WARNING, " --> ! misdn_call called on %s, neither down nor reserved (or dest==NULL)\n", ast_channel_name(ast));
ast->hangupcause = AST_CAUSE_NORMAL_TEMPORARY_FAILURE;
ast_setstate(ast, AST_STATE_DOWN);
return -1;
@@ -6515,7 +6515,7 @@ static int misdn_call(struct ast_channel *ast, char *dest, int timeout)
ch = MISDN_ASTERISK_TECH_PVT(ast);
if (!ch) {
- ast_log(LOG_WARNING, " --> ! misdn_call called on %s, chan_list *ch==NULL\n", ast->name);
+ ast_log(LOG_WARNING, " --> ! misdn_call called on %s, chan_list *ch==NULL\n", ast_channel_name(ast));
ast->hangupcause = AST_CAUSE_NORMAL_TEMPORARY_FAILURE;
ast_setstate(ast, AST_STATE_DOWN);
return -1;
@@ -6523,7 +6523,7 @@ static int misdn_call(struct ast_channel *ast, char *dest, int timeout)
newbc = ch->bc;
if (!newbc) {
- ast_log(LOG_WARNING, " --> ! misdn_call called on %s, newbc==NULL\n", ast->name);
+ ast_log(LOG_WARNING, " --> ! misdn_call called on %s, newbc==NULL\n", ast_channel_name(ast));
ast->hangupcause = AST_CAUSE_NORMAL_TEMPORARY_FAILURE;
ast_setstate(ast, AST_STATE_DOWN);
return -1;
@@ -6545,7 +6545,7 @@ static int misdn_call(struct ast_channel *ast, char *dest, int timeout)
cc_record = misdn_cc_find_by_id(ch->record_id);
if (!cc_record) {
AST_LIST_UNLOCK(&misdn_cc_records_db);
- ast_log(LOG_WARNING, " --> ! misdn_call called on %s, cc_record==NULL\n", ast->name);
+ ast_log(LOG_WARNING, " --> ! misdn_call called on %s, cc_record==NULL\n", ast_channel_name(ast));
ast->hangupcause = AST_CAUSE_NORMAL_TEMPORARY_FAILURE;
ast_setstate(ast, AST_STATE_DOWN);
return -1;
@@ -6572,7 +6572,7 @@ static int misdn_call(struct ast_channel *ast, char *dest, int timeout)
ast_copy_string(ast->exten, newbc->dialed.number, sizeof(ast->exten));
chan_misdn_log(1, port, "* Call completion to: %s\n", newbc->dialed.number);
- chan_misdn_log(2, port, " --> * tech:%s context:%s\n", ast->name, ast->context);
+ chan_misdn_log(2, port, " --> * tech:%s context:%s\n", ast_channel_name(ast), ast->context);
} else
#endif /* defined(AST_MISDN_ENHANCEMENTS) */
{
@@ -6591,7 +6591,7 @@ static int misdn_call(struct ast_channel *ast, char *dest, int timeout)
}
chan_misdn_log(1, port, "* CALL: %s\n", dest);
- chan_misdn_log(2, port, " --> * dialed:%s tech:%s context:%s\n", args.ext, ast->name, ast->context);
+ chan_misdn_log(2, port, " --> * dialed:%s tech:%s context:%s\n", args.ext, ast_channel_name(ast), ast->context);
ast_copy_string(ast->exten, args.ext, sizeof(ast->exten));
ast_copy_string(newbc->dialed.number, args.ext, sizeof(newbc->dialed.number));
@@ -6915,16 +6915,16 @@ static int misdn_indication(struct ast_channel *ast, int cond, const void *data,
if (!p->bc) {
if (p->hold.state == MISDN_HOLD_IDLE) {
chan_misdn_log(1, 0, "* IND : Indication [%d] ignored on %s\n", cond,
- ast->name);
+ ast_channel_name(ast));
ast_log(LOG_WARNING, "Private Pointer but no bc ?\n");
} else {
chan_misdn_log(1, 0, "* IND : Indication [%d] ignored on hold %s\n",
- cond, ast->name);
+ cond, ast_channel_name(ast));
}
return -1;
}
- chan_misdn_log(5, p->bc->port, "* IND : Indication [%d] on %s\n\n", cond, ast->name);
+ chan_misdn_log(5, p->bc->port, "* IND : Indication [%d] on %s\n\n", cond, ast_channel_name(ast));
switch (cond) {
case AST_CONTROL_BUSY:
@@ -7052,7 +7052,7 @@ static int misdn_hangup(struct ast_channel *ast)
return -1;
}
- ast_debug(1, "misdn_hangup(%s)\n", ast->name);
+ ast_debug(1, "misdn_hangup(%s)\n", ast_channel_name(ast));
/* Take the ast_channel's tech_pvt reference. */
ast_mutex_lock(&release_lock);
@@ -7076,7 +7076,7 @@ static int misdn_hangup(struct ast_channel *ast)
bc = misdn_lib_find_held_bc(p->hold.port, p->l3id);
if (!bc) {
chan_misdn_log(4, p->hold.port,
- "misdn_hangup: Could not find held bc for (%s)\n", ast->name);
+ "misdn_hangup: Could not find held bc for (%s)\n", ast_channel_name(ast));
release_chan_early(p);
ast_mutex_unlock(&release_lock);
chan_list_unref(p, "Release ast_channel reference");
@@ -7234,7 +7234,7 @@ static int misdn_hangup(struct ast_channel *ast)
}
p->state = MISDN_CLEANING;
- chan_misdn_log(3, bc->port, " --> Channel: %s hungup new state:%s\n", ast->name,
+ chan_misdn_log(3, bc->port, " --> Channel: %s hungup new state:%s\n", ast_channel_name(ast),
misdn_get_ch_state(p));
ast_mutex_unlock(&release_lock);
@@ -7265,7 +7265,7 @@ static struct ast_frame *process_ast_dsp(struct chan_list *tmp, struct ast_frame
if (!tmp->faxhandled) {
struct ast_channel *ast = tmp->ast;
tmp->faxhandled++;
- chan_misdn_log(0, tmp->bc->port, "Fax detected, preparing %s for fax transfer.\n", ast->name);
+ chan_misdn_log(0, tmp->bc->port, "Fax detected, preparing %s for fax transfer.\n", ast_channel_name(ast));
tmp->bc->rxgain = 0;
isdn_lib_update_rxgain(tmp->bc);
tmp->bc->txgain = 0;
@@ -7286,11 +7286,11 @@ static struct ast_frame *process_ast_dsp(struct chan_list *tmp, struct ast_frame
context = ast_strlen_zero(context_tmp) ? (ast_strlen_zero(ast->macrocontext) ? ast->context : ast->macrocontext) : context_tmp;
if (ast_exists_extension(ast, context, "fax", 1,
S_COR(ast->caller.id.number.valid, ast->caller.id.number.str, NULL))) {
- ast_verb(3, "Redirecting %s to fax extension (context:%s)\n", ast->name, context);
+ ast_verb(3, "Redirecting %s to fax extension (context:%s)\n", ast_channel_name(ast), context);
/* Save the DID/DNIS when we transfer the fax call to a "fax" extension */
pbx_builtin_setvar_helper(ast,"FAXEXTEN",ast->exten);
if (ast_async_goto(ast, context, "fax", 1)) {
- ast_log(LOG_WARNING, "Failed to async goto '%s' into fax of '%s'\n", ast->name, context);
+ ast_log(LOG_WARNING, "Failed to async goto '%s' into fax of '%s'\n", ast_channel_name(ast), context);
}
} else {
ast_log(LOG_NOTICE, "Fax detected but no fax extension, context:%s exten:%s\n", context, ast->exten);
@@ -7300,7 +7300,7 @@ static struct ast_frame *process_ast_dsp(struct chan_list *tmp, struct ast_frame
}
break;
case 2:
- ast_verb(3, "Not redirecting %s to fax extension, nojump is set.\n", ast->name);
+ ast_verb(3, "Not redirecting %s to fax extension, nojump is set.\n", ast_channel_name(ast));
break;
default:
break;
@@ -7554,7 +7554,7 @@ static enum ast_bridge_result misdn_bridge(struct ast_channel *c0,
misdn_lib_bridge(ch1->bc, ch2->bc);
}
- ast_verb(3, "Native bridging %s and %s\n", c0->name, c1->name);
+ ast_verb(3, "Native bridging %s and %s\n", ast_channel_name(c0), ast_channel_name(c1));
chan_misdn_log(1, ch1->bc->port, "* Making Native Bridge between \"%s\" <%s> and \"%s\" <%s>\n",
ch1->bc->caller.name,
@@ -8100,10 +8100,10 @@ static void update_name(struct ast_channel *tmp, int port, int c)
}
snprintf(newname, sizeof(newname), "%s/%d-", misdn_type, chan_offset + c);
- if (strncmp(tmp->name, newname, strlen(newname))) {
+ if (strncmp(ast_channel_name(tmp), newname, strlen(newname))) {
snprintf(newname, sizeof(newname), "%s/%d-u%d", misdn_type, chan_offset + c, glob_channel++);
ast_change_name(tmp, newname);
- chan_misdn_log(3, port, " --> updating channel name to [%s]\n", tmp->name);
+ chan_misdn_log(3, port, " --> updating channel name to [%s]\n", ast_channel_name(tmp));
}
}
@@ -8578,7 +8578,7 @@ static int misdn_attempt_transfer(struct chan_list *active_ch, struct chan_list
target = active_ch->ast;
chan_misdn_log(1, held_ch->hold.port, "TRANSFERRING %s to %s\n",
- held_ch->ast->name, target->name);
+ ast_channel_name(held_ch->ast), ast_channel_name(target));
ast_party_connected_line_init(&target_colp);
ast_party_connected_line_copy(&target_colp, &target->connected);
@@ -8929,10 +8929,10 @@ static void misdn_cc_pbx_notify(long record_id, const struct misdn_cc_notify *no
chan->dialed.number.str = ast_strdup(notify->exten);
if (ast_pbx_start(chan)) {
- ast_log(LOG_WARNING, "Unable to start pbx channel %s!\n", chan->name);
+ ast_log(LOG_WARNING, "Unable to start pbx channel %s!\n", ast_channel_name(chan));
ast_channel_release(chan);
} else {
- ast_verb(1, "Started pbx for call completion notify channel %s\n", chan->name);
+ ast_verb(1, "Started pbx for call completion notify channel %s\n", ast_channel_name(chan));
}
}
#endif /* defined(AST_MISDN_ENHANCEMENTS) */
@@ -11587,7 +11587,7 @@ static int misdn_command_cc_deactivate(struct ast_channel *chan, struct misdn_co
AST_LIST_UNLOCK(&misdn_cc_records_db);
if (error_str) {
ast_verb(1, "%s(%s) diagnostic '%s' on channel %s\n",
- misdn_command_name, subcommand->name, error_str, chan->name);
+ misdn_command_name, subcommand->name, error_str, ast_channel_name(chan));
pbx_builtin_setvar_helper(chan, MISDN_ERROR_MSG, error_str);
}
@@ -11907,7 +11907,7 @@ static int misdn_command_cc_request(struct ast_channel *chan, struct misdn_comma
AST_LIST_UNLOCK(&misdn_cc_records_db);
if (error_str) {
ast_verb(1, "%s(%s) diagnostic '%s' on channel %s\n",
- misdn_command_name, subcommand->name, error_str, chan->name);
+ misdn_command_name, subcommand->name, error_str, ast_channel_name(chan));
pbx_builtin_setvar_helper(chan, MISDN_ERROR_MSG, error_str);
pbx_builtin_setvar_helper(chan, MISDN_CC_STATUS, "ERROR");
} else {
diff --git a/channels/chan_nbs.c b/channels/chan_nbs.c
index 3ff97dde7..d9885c14e 100644
--- a/channels/chan_nbs.c
+++ b/channels/chan_nbs.c
@@ -90,16 +90,16 @@ static int nbs_call(struct ast_channel *ast, char *dest, int timeout)
p = ast->tech_pvt;
if ((ast->_state != AST_STATE_DOWN) && (ast->_state != AST_STATE_RESERVED)) {
- ast_log(LOG_WARNING, "nbs_call called on %s, neither down nor reserved\n", ast->name);
+ ast_log(LOG_WARNING, "nbs_call called on %s, neither down nor reserved\n", ast_channel_name(ast));
return -1;
}
/* When we call, it just works, really, there's no destination... Just
ring the phone and wait for someone to answer */
- ast_debug(1, "Calling %s on %s\n", dest, ast->name);
+ ast_debug(1, "Calling %s on %s\n", dest, ast_channel_name(ast));
/* If we can't connect, return congestion */
if (nbs_connect(p->nbs)) {
- ast_log(LOG_WARNING, "NBS Connection failed on %s\n", ast->name);
+ ast_log(LOG_WARNING, "NBS Connection failed on %s\n", ast_channel_name(ast));
ast_queue_control(ast, AST_CONTROL_CONGESTION);
} else {
ast_setstate(ast, AST_STATE_RINGING);
@@ -165,7 +165,7 @@ static int nbs_hangup(struct ast_channel *ast)
{
struct nbs_pvt *p;
p = ast->tech_pvt;
- ast_debug(1, "nbs_hangup(%s)\n", ast->name);
+ ast_debug(1, "nbs_hangup(%s)\n", ast_channel_name(ast));
if (!ast->tech_pvt) {
ast_log(LOG_WARNING, "Asked to hangup channel not connected\n");
return 0;
@@ -191,7 +191,7 @@ static struct ast_frame *nbs_xread(struct ast_channel *ast)
p->fr.delivery.tv_sec = 0;
p->fr.delivery.tv_usec = 0;
- ast_debug(1, "Returning null frame on %s\n", ast->name);
+ ast_debug(1, "Returning null frame on %s\n", ast_channel_name(ast));
return &p->fr;
}
@@ -241,7 +241,7 @@ static struct ast_channel *nbs_new(struct nbs_pvt *i, int state, const char *lin
i->u = ast_module_user_add(tmp);
if (state != AST_STATE_DOWN) {
if (ast_pbx_start(tmp)) {
- ast_log(LOG_WARNING, "Unable to start PBX on %s\n", tmp->name);
+ ast_log(LOG_WARNING, "Unable to start PBX on %s\n", ast_channel_name(tmp));
ast_hangup(tmp);
}
}
diff --git a/channels/chan_oss.c b/channels/chan_oss.c
index 17894ab6f..f74a3ae36 100644
--- a/channels/chan_oss.c
+++ b/channels/chan_oss.c
@@ -775,7 +775,7 @@ static int oss_indicate(struct ast_channel *c, int cond, const void *data, size_
ast_moh_stop(c);
break;
default:
- ast_log(LOG_WARNING, "Don't know how to display condition %d on %s\n", cond, c->name);
+ ast_log(LOG_WARNING, "Don't know how to display condition %d on %s\n", cond, ast_channel_name(c));
return -1;
}
@@ -824,7 +824,7 @@ static struct ast_channel *oss_new(struct chan_oss_pvt *o, char *ext, char *ctx,
ast_jb_configure(c, &global_jbconf);
if (state != AST_STATE_DOWN) {
if (ast_pbx_start(c)) {
- ast_log(LOG_WARNING, "Unable to start PBX on %s\n", c->name);
+ ast_log(LOG_WARNING, "Unable to start PBX on %s\n", ast_channel_name(c));
ast_hangup(c);
o->owner = c = NULL;
}
@@ -1198,7 +1198,7 @@ static char *console_transfer(struct ast_cli_entry *e, int cmd, struct ast_cli_a
S_COR(b->caller.id.number.valid, b->caller.id.number.str, NULL))) {
ast_cli(a->fd, "No such extension exists\n");
} else {
- ast_cli(a->fd, "Whee, transferring %s to %s@%s.\n", b->name, ext, ctx);
+ ast_cli(a->fd, "Whee, transferring %s to %s@%s.\n", ast_channel_name(b), ext, ctx);
if (ast_async_goto(b, ctx, ext, 1))
ast_cli(a->fd, "Failed to transfer :(\n");
}
diff --git a/channels/chan_phone.c b/channels/chan_phone.c
index 6acb7a184..1281f149a 100644
--- a/channels/chan_phone.c
+++ b/channels/chan_phone.c
@@ -204,7 +204,7 @@ static int phone_indicate(struct ast_channel *chan, int condition, const void *d
{
struct phone_pvt *p = chan->tech_pvt;
int res=-1;
- ast_debug(1, "Requested indication %d on channel %s\n", condition, chan->name);
+ ast_debug(1, "Requested indication %d on channel %s\n", condition, ast_channel_name(chan));
switch(condition) {
case AST_CONTROL_FLASH:
ioctl(p->fd, IXJCTL_PSTN_SET_STATE, PSTN_ON_HOOK);
@@ -223,7 +223,7 @@ static int phone_indicate(struct ast_channel *chan, int condition, const void *d
res = 0;
break;
default:
- ast_log(LOG_WARNING, "Condition %d is not supported on channel %s\n", condition, chan->name);
+ ast_log(LOG_WARNING, "Condition %d is not supported on channel %s\n", condition, ast_channel_name(chan));
}
return res;
}
@@ -315,10 +315,10 @@ static int phone_call(struct ast_channel *ast, char *dest, int timeout)
p = ast->tech_pvt;
if ((ast->_state != AST_STATE_DOWN) && (ast->_state != AST_STATE_RESERVED)) {
- ast_log(LOG_WARNING, "phone_call called on %s, neither down nor reserved\n", ast->name);
+ ast_log(LOG_WARNING, "phone_call called on %s, neither down nor reserved\n", ast_channel_name(ast));
return -1;
}
- ast_debug(1, "Ringing %s on %s (%d)\n", dest, ast->name, ast->fds[0]);
+ ast_debug(1, "Ringing %s on %s (%d)\n", dest, ast_channel_name(ast), ast->fds[0]);
start = IXJ_PHONE_RING_START(cid);
if (start == -1)
@@ -343,7 +343,7 @@ static int phone_hangup(struct ast_channel *ast)
{
struct phone_pvt *p;
p = ast->tech_pvt;
- ast_debug(1, "phone_hangup(%s)\n", ast->name);
+ ast_debug(1, "phone_hangup(%s)\n", ast_channel_name(ast));
if (!ast->tech_pvt) {
ast_log(LOG_WARNING, "Asked to hangup channel not connected\n");
return 0;
@@ -362,7 +362,7 @@ static int phone_hangup(struct ast_channel *ast)
/* If it's an FXO, hang them up */
if (p->mode == MODE_FXO) {
if (ioctl(p->fd, PHONE_PSTN_SET_STATE, PSTN_ON_HOOK))
- ast_debug(1, "ioctl(PHONE_PSTN_SET_STATE) failed on %s (%s)\n",ast->name, strerror(errno));
+ ast_debug(1, "ioctl(PHONE_PSTN_SET_STATE) failed on %s (%s)\n",ast_channel_name(ast), strerror(errno));
}
/* If they're off hook, give a busy signal */
@@ -379,7 +379,7 @@ static int phone_hangup(struct ast_channel *ast)
memset(p->ext, 0, sizeof(p->ext));
((struct phone_pvt *)(ast->tech_pvt))->owner = NULL;
ast_module_unref(ast_module_info->self);
- ast_verb(3, "Hungup '%s'\n", ast->name);
+ ast_verb(3, "Hungup '%s'\n", ast_channel_name(ast));
ast->tech_pvt = NULL;
ast_setstate(ast, AST_STATE_DOWN);
restart_monitor();
@@ -460,12 +460,12 @@ static int phone_answer(struct ast_channel *ast)
/* In case it's a LineJack, take it off hook */
if (p->mode == MODE_FXO) {
if (ioctl(p->fd, PHONE_PSTN_SET_STATE, PSTN_OFF_HOOK))
- ast_debug(1, "ioctl(PHONE_PSTN_SET_STATE) failed on %s (%s)\n", ast->name, strerror(errno));
+ ast_debug(1, "ioctl(PHONE_PSTN_SET_STATE) failed on %s (%s)\n", ast_channel_name(ast), strerror(errno));
else
ast_debug(1, "Took linejack off hook\n");
}
phone_setup(ast);
- ast_debug(1, "phone_answer(%s)\n", ast->name);
+ ast_debug(1, "phone_answer(%s)\n", ast_channel_name(ast));
ast->rings = 0;
ast_setstate(ast, AST_STATE_UP);
return 0;
@@ -897,7 +897,7 @@ static struct ast_channel *phone_new(struct phone_pvt *i, int state, char *cntx,
i->cpt = 1;
}
if (ast_pbx_start(tmp)) {
- ast_log(LOG_WARNING, "Unable to start PBX on %s\n", tmp->name);
+ ast_log(LOG_WARNING, "Unable to start PBX on %s\n", ast_channel_name(tmp));
ast_hangup(tmp);
}
}
diff --git a/channels/chan_sip.c b/channels/chan_sip.c
index f4ed077ec..43c942032 100644
--- a/channels/chan_sip.c
+++ b/channels/chan_sip.c
@@ -2966,7 +2966,7 @@ void dialog_unlink_all(struct sip_pvt *dialog)
/* Unlink us from the owner (channel) if we have one */
owner = sip_pvt_lock_full(dialog);
if (owner) {
- ast_debug(1, "Detaching from channel %s\n", owner->name);
+ ast_debug(1, "Detaching from channel %s\n", ast_channel_name(owner));
owner->tech_pvt = dialog_unref(owner->tech_pvt, "resetting channel dialog ptr in unlink_all");
ast_channel_unlock(owner);
ast_channel_unref(owner);
@@ -4290,7 +4290,7 @@ static int sip_setoption(struct ast_channel *chan, int option, void *data, int d
(ast_test_flag(&p->flags[0], SIP_DTMF) == SIP_DTMF_AUTO)) {
char *cp = (char *) data;
- ast_debug(1, "%sabling digit detection on %s\n", *cp ? "En" : "Dis", chan->name);
+ ast_debug(1, "%sabling digit detection on %s\n", *cp ? "En" : "Dis", ast_channel_name(chan));
if (*cp) {
enable_dsp_detect(p);
} else {
@@ -4359,7 +4359,7 @@ static int sip_queryoption(struct ast_channel *chan, int option, void *data, int
case AST_OPTION_DIGIT_DETECT:
cp = (char *) data;
*cp = p->dsp ? 1 : 0;
- ast_debug(1, "Reporting digit detection %sabled on %s\n", *cp ? "en" : "dis", chan->name);
+ ast_debug(1, "Reporting digit detection %sabled on %s\n", *cp ? "en" : "dis", ast_channel_name(chan));
break;
case AST_OPTION_SECURE_SIGNALING:
*((unsigned int *) data) = p->req_secure_signaling;
@@ -4464,7 +4464,7 @@ static int sip_sendtext(struct ast_channel *ast, const char *text)
return(0);
}
if (debug)
- ast_verbose("Sending text %s on %s\n", text, ast->name);
+ ast_verbose("Sending text %s on %s\n", text, ast_channel_name(ast));
transmit_message_with_text(dialog, text, 0, 0);
return 0;
}
@@ -5099,7 +5099,7 @@ static void change_t38_state(struct sip_pvt *p, int state)
return;
p->t38.state = state;
- ast_debug(2, "T38 state changed to %d on channel %s\n", p->t38.state, chan ? chan->name : "<none>");
+ ast_debug(2, "T38 state changed to %d on channel %s\n", p->t38.state, chan ? ast_channel_name(chan) : "<none>");
/* If no channel was provided we can't send off a control frame */
if (!chan)
@@ -5111,13 +5111,13 @@ static void change_t38_state(struct sip_pvt *p, int state)
parameters = p->t38.their_parms;
parameters.max_ifp = ast_udptl_get_far_max_ifp(p->udptl);
parameters.request_response = AST_T38_REQUEST_NEGOTIATE;
- ast_udptl_set_tag(p->udptl, "%s", chan->name);
+ ast_udptl_set_tag(p->udptl, "%s", ast_channel_name(chan));
break;
case T38_ENABLED:
parameters = p->t38.their_parms;
parameters.max_ifp = ast_udptl_get_far_max_ifp(p->udptl);
parameters.request_response = AST_T38_NEGOTIATED;
- ast_udptl_set_tag(p->udptl, "%s", chan->name);
+ ast_udptl_set_tag(p->udptl, "%s", ast_channel_name(chan));
break;
case T38_REJECTED:
case T38_DISABLED:
@@ -5533,7 +5533,7 @@ static int sip_call(struct ast_channel *ast, char *dest, int timeout)
char uri[SIPBUFSIZE] = "";
if ((ast->_state != AST_STATE_DOWN) && (ast->_state != AST_STATE_RESERVED)) {
- ast_log(LOG_WARNING, "sip_call called on %s, neither down nor reserved\n", ast->name);
+ ast_log(LOG_WARNING, "sip_call called on %s, neither down nor reserved\n", ast_channel_name(ast));
return -1;
}
@@ -5751,7 +5751,7 @@ void __sip_destroy(struct sip_pvt *p, int lockowner, int lockdialoglist)
if (p->owner) {
if (lockowner)
ast_channel_lock(p->owner);
- ast_debug(1, "Detaching from %s\n", p->owner->name);
+ ast_debug(1, "Detaching from %s\n", ast_channel_name(p->owner));
p->owner->tech_pvt = NULL;
/* Make sure that the channel knows its backend is going away */
p->owner->_softhangup |= AST_SOFTHANGUP_DEV;
@@ -6267,11 +6267,11 @@ static int sip_hangup(struct ast_channel *ast)
if (ast_test_flag(ast, AST_FLAG_ZOMBIE)) {
if (p->refer)
- ast_debug(1, "SIP Transfer: Hanging up Zombie channel %s after transfer ... Call-ID: %s\n", ast->name, p->callid);
+ ast_debug(1, "SIP Transfer: Hanging up Zombie channel %s after transfer ... Call-ID: %s\n", ast_channel_name(ast), p->callid);
else
ast_debug(1, "Hanging up zombie call. Be scared.\n");
} else
- ast_debug(1, "Hangup call %s, SIP callid %s\n", ast->name, p->callid);
+ ast_debug(1, "Hangup call %s, SIP callid %s\n", ast_channel_name(ast), p->callid);
sip_pvt_lock(p);
if (ast_test_flag(&p->flags[0], SIP_INC_COUNT) || ast_test_flag(&p->flags[1], SIP_PAGE2_CALL_ONHOLD)) {
@@ -6474,7 +6474,7 @@ static int sip_answer(struct ast_channel *ast)
try_suggested_sip_codec(p);
ast_setstate(ast, AST_STATE_UP);
- ast_debug(1, "SIP answering channel: %s\n", ast->name);
+ ast_debug(1, "SIP answering channel: %s\n", ast_channel_name(ast));
ast_rtp_instance_update_source(p->rtp);
res = transmit_response_with_sdp(p, "200 OK", &p->initreq, XMIT_CRITICAL, FALSE, TRUE);
ast_set_flag(&p->flags[1], SIP_PAGE2_DIALOG_ESTABLISHED);
@@ -6604,16 +6604,16 @@ static int sip_fixup(struct ast_channel *oldchan, struct ast_channel *newchan)
if (!newchan || !newchan->tech_pvt) {
if (!newchan)
- ast_log(LOG_WARNING, "No new channel! Fixup of %s failed.\n", oldchan->name);
+ ast_log(LOG_WARNING, "No new channel! Fixup of %s failed.\n", ast_channel_name(oldchan));
else
- ast_log(LOG_WARNING, "No SIP tech_pvt! Fixup of %s failed.\n", oldchan->name);
+ ast_log(LOG_WARNING, "No SIP tech_pvt! Fixup of %s failed.\n", ast_channel_name(oldchan));
return -1;
}
p = newchan->tech_pvt;
sip_pvt_lock(p);
- append_history(p, "Masq", "Old channel: %s\n", oldchan->name);
- append_history(p, "Masq (cont)", "...new owner: %s\n", newchan->name);
+ append_history(p, "Masq", "Old channel: %s\n", ast_channel_name(oldchan));
+ append_history(p, "Masq (cont)", "...new owner: %s\n", ast_channel_name(newchan));
if (p->owner != oldchan)
ast_log(LOG_WARNING, "old channel wasn't %p but was %p\n", oldchan, p->owner);
else {
@@ -6627,7 +6627,7 @@ static int sip_fixup(struct ast_channel *oldchan, struct ast_channel *newchan)
sip_set_rtp_peer(newchan, NULL, NULL, 0, 0, 0);
ret = 0;
}
- ast_debug(3, "SIP Fixup: New owner for dialogue %s: %s (Old parent: %s)\n", p->callid, p->owner->name, oldchan->name);
+ ast_debug(3, "SIP Fixup: New owner for dialogue %s: %s (Old parent: %s)\n", p->callid, ast_channel_name(p->owner), ast_channel_name(oldchan));
sip_pvt_unlock(p);
return ret;
@@ -6927,7 +6927,7 @@ static int sip_indicate(struct ast_channel *ast, int condition, const void *data
* just says they are waiting to get AOC-E before completely tearing
* the call down. Since SIP does not support this at the moment go
* ahead and terminate the call here to avoid an unnecessary timeout. */
- ast_debug(1, "AOC-E termination request received on %s. This is not yet supported on sip. Continue with hangup \n", p->owner->name);
+ ast_debug(1, "AOC-E termination request received on %s. This is not yet supported on sip. Continue with hangup \n", ast_channel_name(p->owner));
ast_softhangup_nolock(p->owner, AST_SOFTHANGUP_DEV);
}
break;
@@ -7174,14 +7174,14 @@ static struct ast_channel *sip_new(struct sip_pvt *i, int state, const char *tit
}
if (i->do_history) {
- append_history(i, "NewChan", "Channel %s - from %s", tmp->name, i->callid);
+ append_history(i, "NewChan", "Channel %s - from %s", ast_channel_name(tmp), i->callid);
}
/* Inform manager user about new channel and their SIP call ID */
if (sip_cfg.callevents) {
manager_event(EVENT_FLAG_SYSTEM, "ChannelUpdate",
"Channel: %s\r\nUniqueid: %s\r\nChanneltype: %s\r\nSIPcallid: %s\r\nSIPfullcontact: %s\r\n",
- tmp->name, tmp->uniqueid, "SIP", i->callid, i->fullcontact);
+ ast_channel_name(tmp), tmp->uniqueid, "SIP", i->callid, i->fullcontact);
}
return tmp;
@@ -7413,7 +7413,7 @@ static struct ast_frame *sip_rtp_read(struct ast_channel *ast, struct sip_pvt *p
if (f && !ast_format_cap_iscompatible(p->owner->nativeformats, &f->subclass.format)) {
if (!ast_format_cap_iscompatible(p->jointcaps, &f->subclass.format)) {
ast_debug(1, "Bogus frame of format '%s' received from '%s'!\n",
- ast_getformatname(&f->subclass.format), p->owner->name);
+ ast_getformatname(&f->subclass.format), ast_channel_name(p->owner));
return &ast_null_frame;
}
ast_debug(1, "Oooh, format changed to %s\n",
@@ -7428,7 +7428,7 @@ static struct ast_frame *sip_rtp_read(struct ast_channel *ast, struct sip_pvt *p
f = ast_dsp_process(p->owner, p->dsp, f);
if (f && f->frametype == AST_FRAME_DTMF) {
if (f->subclass.integer == 'f') {
- ast_debug(1, "Fax CNG detected on %s\n", ast->name);
+ ast_debug(1, "Fax CNG detected on %s\n", ast_channel_name(ast));
*faxdetect = 1;
/* If we only needed this DSP for fax detection purposes we can just drop it now */
if (ast_test_flag(&p->flags[0], SIP_DTMF) == SIP_DTMF_INBAND) {
@@ -7472,10 +7472,10 @@ static struct ast_frame *sip_read(struct ast_channel *ast)
S_COR(ast->caller.id.number.valid, ast->caller.id.number.str, NULL))) {
ast_channel_lock(ast);
sip_pvt_lock(p);
- ast_verb(2, "Redirecting '%s' to fax extension due to CNG detection\n", ast->name);
+ ast_verb(2, "Redirecting '%s' to fax extension due to CNG detection\n", ast_channel_name(ast));
pbx_builtin_setvar_helper(ast, "FAXEXTEN", ast->exten);
if (ast_async_goto(ast, target_context, "fax", 1)) {
- ast_log(LOG_NOTICE, "Failed to async goto '%s' into fax of '%s'\n", ast->name, target_context);
+ ast_log(LOG_NOTICE, "Failed to async goto '%s' into fax of '%s'\n", ast_channel_name(ast), target_context);
}
fr = &ast_null_frame;
} else {
@@ -8764,7 +8764,7 @@ static void change_hold_state(struct sip_pvt *dialog, struct sip_request *req, i
"Channel: %s\r\n"
"Uniqueid: %s\r\n",
holdstate ? "On" : "Off",
- dialog->owner->name,
+ ast_channel_name(dialog->owner),
dialog->owner->uniqueid);
append_history(dialog, holdstate ? "Hold" : "Unhold", "%s", req->data->str);
if (!holdstate) { /* Put off remote hold */
@@ -9427,10 +9427,10 @@ static int process_sdp(struct sip_pvt *p, struct sip_request *req, int t38action
ast_channel_unlock(p->owner);
if (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 peer T.38 re-INVITE\n", p->owner->name);
+ ast_verb(2, "Redirecting '%s' to fax extension due to peer T.38 re-INVITE\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);
}
} else {
ast_log(LOG_NOTICE, "T.38 re-INVITE detected but no fax extension\n");
@@ -12471,7 +12471,7 @@ static int transmit_invite(struct sip_pvt *p, int sipmethod, int sdp, int init,
if (sdp) {
memset(p->offered_media, 0, sizeof(p->offered_media));
if (p->udptl && p->t38.state == T38_LOCAL_REINVITE) {
- ast_debug(1, "T38 is in state %d on channel %s\n", p->t38.state, p->owner ? p->owner->name : "<none>");
+ ast_debug(1, "T38 is in state %d on channel %s\n", p->t38.state, p->owner ? ast_channel_name(p->owner) : "<none>");
add_sdp(&req, p, FALSE, FALSE, TRUE);
} else if (p->rtp) {
try_suggested_sip_codec(p);
@@ -13132,7 +13132,7 @@ static void update_connectedline(struct sip_pvt *p, const void *data, size_t dat
send_response(p, &resp, XMIT_UNRELIABLE, 0);
ast_set_flag(&p->flags[0], SIP_PROGRESS_SENT);
} else {
- ast_debug(1, "Unable able to send update to '%s' in state '%s'\n", p->owner->name, ast_state2str(p->owner->_state));
+ ast_debug(1, "Unable able to send update to '%s' in state '%s'\n", ast_channel_name(p->owner), ast_state2str(p->owner->_state));
}
}
}
@@ -18871,7 +18871,7 @@ static char *sip_show_channel(struct ast_cli_entry *e, int cmd, struct ast_cli_a
}
ast_cli(a->fd, " Curr. trans. direction: %s\n", ast_test_flag(&cur->flags[0], SIP_OUTGOING) ? "Outgoing" : "Incoming");
ast_cli(a->fd, " Call-ID: %s\n", cur->callid);
- ast_cli(a->fd, " Owner channel ID: %s\n", cur->owner ? cur->owner->name : "<none>");
+ ast_cli(a->fd, " Owner channel ID: %s\n", cur->owner ? ast_channel_name(cur->owner) : "<none>");
ast_cli(a->fd, " Our Codec Capability: %s\n", ast_getformatname_multiple(formatbuf, sizeof(formatbuf), cur->caps));
ast_cli(a->fd, " Non-Codec Capability (DTMF): %d\n", cur->noncodeccapability);
ast_cli(a->fd, " Their Codec Capability: %s\n", ast_getformatname_multiple(formatbuf, sizeof(formatbuf), cur->peercaps));
@@ -20591,7 +20591,7 @@ static void handle_response_invite(struct sip_pvt *p, int resp, const char *rest
if (sip_cfg.callevents) {
manager_event(EVENT_FLAG_SYSTEM, "ChannelUpdate",
"Channel: %s\r\nChanneltype: %s\r\nUniqueid: %s\r\nSIPcallid: %s\r\nSIPfullcontact: %s\r\nPeername: %s\r\n",
- p->owner->name, "SIP", p->owner->uniqueid, p->callid, p->fullcontact, p->peername);
+ ast_channel_name(p->owner), "SIP", p->owner->uniqueid, p->callid, p->fullcontact, p->peername);
}
} else { /* RE-invite */
if (p->t38.state == T38_DISABLED || p->t38.state == T38_REJECTED) {
@@ -20678,7 +20678,7 @@ static void handle_response_invite(struct sip_pvt *p, int resp, const char *rest
xmitres = transmit_request(p, SIP_ACK, seqno, XMIT_UNRELIABLE, FALSE);
ast_log(LOG_WARNING, "Received response: \"Forbidden\" from '%s'\n", sip_get_header(&p->initreq, "From"));
if (!req->ignore && p->owner) {
- ast_set_hangupsource(p->owner, p->owner->name, 0);
+ ast_set_hangupsource(p->owner, ast_channel_name(p->owner), 0);
ast_queue_control(p->owner, AST_CONTROL_CONGESTION);
}
pvt_set_needdestroy(p, "received 403 response");
@@ -20688,7 +20688,7 @@ static void handle_response_invite(struct sip_pvt *p, int resp, const char *rest
case 404: /* Not found */
xmitres = transmit_request(p, SIP_ACK, seqno, XMIT_UNRELIABLE, FALSE);
if (p->owner && !req->ignore) {
- ast_set_hangupsource(p->owner, p->owner->name, 0);
+ ast_set_hangupsource(p->owner, ast_channel_name(p->owner), 0);
ast_queue_control(p->owner, AST_CONTROL_CONGESTION);
}
sip_alreadygone(p);
@@ -20809,7 +20809,7 @@ static void handle_response_notify(struct sip_pvt *p, int resp, const char *rest
/* They got the notify, this is the end */
if (p->owner) {
if (!p->refer) {
- ast_log(LOG_WARNING, "Notify answer on an owned channel? - %s\n", p->owner->name);
+ ast_log(LOG_WARNING, "Notify answer on an owned channel? - %s\n", ast_channel_name(p->owner));
ast_queue_hangup_with_cause(p->owner, AST_CAUSE_NORMAL_UNSPECIFIED);
} else {
ast_debug(4, "Got OK on REFER Notify message\n");
@@ -21727,7 +21727,7 @@ static void handle_response(struct sip_pvt *p, int resp, const char *rest, struc
}
}
} else
- ast_log(LOG_NOTICE, "Don't know how to handle a %d %s response from %s\n", resp, rest, p->owner ? p->owner->name : ast_sockaddr_stringify(&p->sa));
+ ast_log(LOG_NOTICE, "Don't know how to handle a %d %s response from %s\n", resp, rest, p->owner ? ast_channel_name(p->owner) : ast_sockaddr_stringify(&p->sa));
}
} else {
/* Responses to OUTGOING SIP requests on INCOMING calls
@@ -21851,7 +21851,7 @@ static void *sip_park_thread(void *stuff)
transferee = d->chan1;
transferer = d->chan2;
- ast_debug(4, "SIP Park: Transferer channel %s, Transferee %s\n", transferer->name, transferee->name);
+ ast_debug(4, "SIP Park: Transferer channel %s, Transferee %s\n", ast_channel_name(transferer), ast_channel_name(transferee));
res = ast_park_call_exten(transferee, transferer, d->park_exten, d->park_context, 0, &ext);
@@ -21894,8 +21894,8 @@ static int sip_park(struct ast_channel *chan1, struct ast_channel *chan2, struct
struct ast_channel *transferee, *transferer;
pthread_t th;
- transferee = ast_channel_alloc(0, AST_STATE_DOWN, 0, 0, chan1->accountcode, chan1->exten, chan1->context, chan1->linkedid, chan1->amaflags, "Parking/%s", chan1->name);
- transferer = ast_channel_alloc(0, AST_STATE_DOWN, 0, 0, chan2->accountcode, chan2->exten, chan2->context, chan2->linkedid, chan2->amaflags, "SIPPeer/%s", chan2->name);
+ transferee = ast_channel_alloc(0, AST_STATE_DOWN, 0, 0, chan1->accountcode, chan1->exten, chan1->context, chan1->linkedid, chan1->amaflags, "Parking/%s", ast_channel_name(chan1));
+ transferer = ast_channel_alloc(0, AST_STATE_DOWN, 0, 0, chan2->accountcode, chan2->exten, chan2->context, chan2->linkedid, chan2->amaflags, "SIPPeer/%s", ast_channel_name(chan2));
d = ast_calloc(1, sizeof(*d));
if (!transferee || !transferer || !d) {
if (transferee) {
@@ -22010,11 +22010,11 @@ static int sip_pickup(struct ast_channel *chan)
ast_channel_ref(chan);
if (ast_pthread_create_detached_background(&threadid, NULL, sip_pickup_thread, chan)) {
- ast_debug(1, "Unable to start Group pickup thread on channel %s\n", chan->name);
+ ast_debug(1, "Unable to start Group pickup thread on channel %s\n", ast_channel_name(chan));
ast_channel_unref(chan);
return -1;
}
- ast_debug(1, "Started Group pickup thread on channel %s\n", chan->name);
+ ast_debug(1, "Started Group pickup thread on channel %s\n", ast_channel_name(chan));
return 0;
}
@@ -22047,19 +22047,19 @@ static int attempt_transfer(struct sip_dual *transferer, struct sip_dual *target
all channels to the transferer */
ast_debug(4, "Sip transfer:--------------------\n");
if (transferer->chan1)
- ast_debug(4, "-- Transferer to PBX channel: %s State %s\n", transferer->chan1->name, ast_state2str(transferer->chan1->_state));
+ ast_debug(4, "-- Transferer to PBX channel: %s State %s\n", ast_channel_name(transferer->chan1), ast_state2str(transferer->chan1->_state));
else
ast_debug(4, "-- No transferer first channel - odd??? \n");
if (target->chan1)
- ast_debug(4, "-- Transferer to PBX second channel (target): %s State %s\n", target->chan1->name, ast_state2str(target->chan1->_state));
+ ast_debug(4, "-- Transferer to PBX second channel (target): %s State %s\n", ast_channel_name(target->chan1), ast_state2str(target->chan1->_state));
else
ast_debug(4, "-- No target first channel ---\n");
if (transferer->chan2)
- ast_debug(4, "-- Bridged call to transferee: %s State %s\n", transferer->chan2->name, ast_state2str(transferer->chan2->_state));
+ ast_debug(4, "-- Bridged call to transferee: %s State %s\n", ast_channel_name(transferer->chan2), ast_state2str(transferer->chan2->_state));
else
ast_debug(4, "-- No bridged call to transferee\n");
if (target->chan2)
- ast_debug(4, "-- Bridged call to transfer target: %s State %s\n", target->chan2 ? target->chan2->name : "<none>", target->chan2 ? ast_state2str(target->chan2->_state) : "(none)");
+ ast_debug(4, "-- Bridged call to transfer target: %s State %s\n", target->chan2 ? ast_channel_name(target->chan2) : "<none>", target->chan2 ? ast_state2str(target->chan2->_state) : "(none)");
else
ast_debug(4, "-- No target second channel ---\n");
ast_debug(4, "-- END Sip transfer:--------------------\n");
@@ -22084,9 +22084,9 @@ static int attempt_transfer(struct sip_dual *transferer, struct sip_dual *target
if (peerd)
ast_quiet_chan(peerd);
- ast_debug(4, "SIP transfer: trying to masquerade %s into %s\n", peerc->name, peerb->name);
+ ast_debug(4, "SIP transfer: trying to masquerade %s into %s\n", ast_channel_name(peerc), ast_channel_name(peerb));
if (ast_channel_masquerade(peerb, peerc)) {
- ast_log(LOG_WARNING, "Failed to masquerade %s into %s\n", peerb->name, peerc->name);
+ ast_log(LOG_WARNING, "Failed to masquerade %s into %s\n", ast_channel_name(peerb), ast_channel_name(peerc));
res = -1;
} else
ast_debug(4, "SIP transfer: Succeeded to masquerade channels.\n");
@@ -22458,7 +22458,7 @@ static int handle_invite_replaces(struct sip_pvt *p, struct sip_request *req, in
if (!(targetcall = ast_bridged_channel(replacecall))) {
/* We have no bridge */
if (!earlyreplace) {
- ast_debug(2, " Attended transfer attempted to replace call with no bridge (maybe ringing). Channel %s!\n", replacecall->name);
+ ast_debug(2, " Attended transfer attempted to replace call with no bridge (maybe ringing). Channel %s!\n", ast_channel_name(replacecall));
oneleggedreplace = 1;
}
}
@@ -22466,9 +22466,9 @@ static int handle_invite_replaces(struct sip_pvt *p, struct sip_request *req, in
ast_debug(4, "SIP transfer: Target channel is in ringing state\n");
if (targetcall)
- ast_debug(4, "SIP transfer: Invite Replace incoming channel should bridge to channel %s while hanging up channel %s\n", targetcall->name, replacecall->name);
+ ast_debug(4, "SIP transfer: Invite Replace incoming channel should bridge to channel %s while hanging up channel %s\n", ast_channel_name(targetcall), ast_channel_name(replacecall));
else
- ast_debug(4, "SIP transfer: Invite Replace incoming channel should replace and hang up channel %s (one call leg)\n", replacecall->name);
+ ast_debug(4, "SIP transfer: Invite Replace incoming channel should replace and hang up channel %s (one call leg)\n", ast_channel_name(replacecall));
if (req->ignore) {
ast_log(LOG_NOTICE, "Ignoring this INVITE with replaces in a stupid way.\n");
@@ -22521,7 +22521,7 @@ static int handle_invite_replaces(struct sip_pvt *p, struct sip_request *req, in
/* Stop music on hold and other generators */
ast_quiet_chan(replacecall);
ast_quiet_chan(targetcall);
- ast_debug(4, "Invite/Replaces: preparing to masquerade %s into %s\n", c->name, replacecall->name);
+ ast_debug(4, "Invite/Replaces: preparing to masquerade %s into %s\n", ast_channel_name(c), ast_channel_name(replacecall));
/* Make sure that the masq does not free our PVT for the old call */
if (! earlyreplace && ! oneleggedreplace )
@@ -22531,7 +22531,7 @@ static int handle_invite_replaces(struct sip_pvt *p, struct sip_request *req, in
if(ast_channel_masquerade(replacecall, c))
ast_log(LOG_ERROR, "Failed to masquerade C into Replacecall\n");
else
- ast_debug(4, "Invite/Replaces: Going to masquerade %s into %s\n", c->name, replacecall->name);
+ ast_debug(4, "Invite/Replaces: Going to masquerade %s into %s\n", ast_channel_name(c), ast_channel_name(replacecall));
/* C should now be in place of replacecall. all channel locks and pvt locks should be removed
* before issuing the masq. Since we are unlocking both the pvt (p) and its owner channel (c)
@@ -23406,7 +23406,7 @@ static int handle_request_invite(struct sip_pvt *p, struct sip_request *req, int
switch(c_state) {
case AST_STATE_DOWN:
- ast_debug(2, "%s: New call is still down.... Trying... \n", c->name);
+ ast_debug(2, "%s: New call is still down.... Trying... \n", ast_channel_name(c));
transmit_provisional_response(p, "100 Trying", req, 0);
p->invitestate = INV_PROCEEDING;
ast_setstate(c, AST_STATE_RING);
@@ -23444,7 +23444,7 @@ static int handle_request_invite(struct sip_pvt *p, struct sip_request *req, int
}
} else { /* Pickup call in call group */
if (sip_pickup(c)) {
- ast_log(LOG_WARNING, "Failed to start Group pickup by %s\n", c->name);
+ ast_log(LOG_WARNING, "Failed to start Group pickup by %s\n", ast_channel_name(c));
transmit_response_reliable(p, "480 Temporarily Unavailable", req);
sip_alreadygone(p);
c->hangupcause = AST_CAUSE_FAILURE;
@@ -23470,7 +23470,7 @@ static int handle_request_invite(struct sip_pvt *p, struct sip_request *req, int
p->invitestate = INV_PROCEEDING;
break;
case AST_STATE_UP:
- ast_debug(2, "%s: This call is UP.... \n", c->name);
+ ast_debug(2, "%s: This call is UP.... \n", ast_channel_name(c));
transmit_response(p, "100 Trying", req);
@@ -23607,9 +23607,9 @@ static int local_attended_transfer(struct sip_pvt *transferer, struct sip_dual *
/* Transfer */
if (sipdebug) {
if (current->chan2) /* We have two bridges */
- ast_debug(4, "SIP attended transfer: trying to bridge %s and %s\n", target.chan1->name, current->chan2->name);
+ ast_debug(4, "SIP attended transfer: trying to bridge %s and %s\n", ast_channel_name(target.chan1), ast_channel_name(current->chan2));
else /* One bridge, propably transfer of IVR/voicemail etc */
- ast_debug(4, "SIP attended transfer: trying to make %s take over (masq) %s\n", target.chan1->name, current->chan1->name);
+ ast_debug(4, "SIP attended transfer: trying to make %s take over (masq) %s\n", ast_channel_name(target.chan1), ast_channel_name(current->chan1));
}
ast_set_flag(&transferer->flags[0], SIP_DEFER_BYE_ON_TRANSFER); /* Delay hangup */
@@ -23627,10 +23627,10 @@ static int local_attended_transfer(struct sip_pvt *transferer, struct sip_dual *
"SIP-Callid: %s\r\n"
"TargetChannel: %s\r\n"
"TargetUniqueid: %s\r\n",
- transferer->owner->name,
+ ast_channel_name(transferer->owner),
transferer->owner->uniqueid,
transferer->callid,
- target.chan1->name,
+ ast_channel_name(target.chan1),
target.chan1->uniqueid);
ast_party_connected_line_init(&connected_to_transferee);
ast_party_connected_line_init(&connected_to_target);
@@ -23957,8 +23957,8 @@ static int handle_request_refer(struct sip_pvt *p, struct sip_request *req, int
if (sipdebug) {
ast_debug(3, "SIP %s transfer: Transferer channel %s, transferee channel %s\n",
p->refer->attendedtransfer ? "attended" : "blind",
- current.chan1->name,
- current.chan2 ? current.chan2->name : "<none>");
+ ast_channel_name(current.chan1),
+ current.chan2 ? ast_channel_name(current.chan2) : "<none>");
}
if (!current.chan2 && !p->refer->attendedtransfer) {
@@ -23977,7 +23977,7 @@ static int handle_request_refer(struct sip_pvt *p, struct sip_request *req, int
if (current.chan2) {
if (sipdebug) {
- ast_debug(4, "Got SIP transfer, applying to bridged peer '%s'\n", current.chan2->name);
+ ast_debug(4, "Got SIP transfer, applying to bridged peer '%s'\n", ast_channel_name(current.chan2));
}
ast_queue_control(current.chan1, AST_CONTROL_UNHOLD);
}
@@ -24033,15 +24033,15 @@ static int handle_request_refer(struct sip_pvt *p, struct sip_request *req, int
"TargetUniqueid: %s\r\n"
"TransferExten: %s\r\n"
"Transfer2Parking: Yes\r\n",
- current.chan1->name,
+ ast_channel_name(current.chan1),
current.chan1->uniqueid,
callid,
- current.chan2->name,
+ ast_channel_name(current.chan2),
current.chan2->uniqueid,
refer_to);
if (sipdebug) {
- ast_debug(4, "SIP transfer to parking: trying to park %s. Parked by %s\n", current.chan2->name, current.chan1->name);
+ ast_debug(4, "SIP transfer to parking: trying to park %s. Parked by %s\n", ast_channel_name(current.chan2), ast_channel_name(current.chan1));
}
/* DO NOT hold any locks while calling sip_park */
@@ -24058,12 +24058,12 @@ static int handle_request_refer(struct sip_pvt *p, struct sip_request *req, int
* Locks should not be held while calling pbx_builtin_setvar_helper. This function
* locks the channel being passed into it.*/
if (current.chan1 && current.chan2) {
- ast_debug(3, "chan1->name: %s\n", current.chan1->name);
- pbx_builtin_setvar_helper(current.chan1, "BLINDTRANSFER", current.chan2->name);
+ ast_debug(3, "chan1->name: %s\n", ast_channel_name(current.chan1));
+ pbx_builtin_setvar_helper(current.chan1, "BLINDTRANSFER", ast_channel_name(current.chan2));
}
if (current.chan2) {
- pbx_builtin_setvar_helper(current.chan2, "BLINDTRANSFER", current.chan1->name);
+ pbx_builtin_setvar_helper(current.chan2, "BLINDTRANSFER", ast_channel_name(current.chan1));
pbx_builtin_setvar_helper(current.chan2, "SIPDOMAIN", refer_to_domain);
pbx_builtin_setvar_helper(current.chan2, "SIPTRANSFER", "yes");
/* One for the new channel */
@@ -24140,10 +24140,10 @@ static int handle_request_refer(struct sip_pvt *p, struct sip_request *req, int
"TargetUniqueid: %s\r\n"
"TransferExten: %s\r\n"
"TransferContext: %s\r\n",
- current.chan1->name,
+ ast_channel_name(current.chan1),
current.chan1->uniqueid,
callid,
- current.chan2->name,
+ ast_channel_name(current.chan2),
current.chan2->uniqueid,
refer_to,
refer_to_context);
@@ -24222,7 +24222,7 @@ static int handle_request_cancel(struct sip_pvt *p, struct sip_request *req)
stop_media_flows(p); /* Immediately stop RTP, VRTP and UDPTL as applicable */
if (p->owner) {
- ast_set_hangupsource(p->owner, p->owner->name, 0);
+ ast_set_hangupsource(p->owner, ast_channel_name(p->owner), 0);
ast_queue_hangup(p->owner);
}
else
@@ -24380,7 +24380,7 @@ static int handle_request_bye(struct sip_pvt *p, struct sip_request *req)
ast_queue_hangup_with_cause(p->owner, AST_CAUSE_PROTOCOL_ERROR);
}
} else if (p->owner) {
- ast_set_hangupsource(p->owner, p->owner->name, 0);
+ ast_set_hangupsource(p->owner, ast_channel_name(p->owner), 0);
ast_queue_hangup(p->owner);
sip_scheddestroy_final(p, DEFAULT_TRANS_TIMEOUT);
ast_debug(3, "Received bye, issuing owner hangup\n");
@@ -25648,7 +25648,7 @@ static int handle_incoming(struct sip_pvt *p, struct sip_request *req, struct as
if (global_store_sip_cause && p->owner) {
struct ast_channel *owner = p->owner;
- snprintf(causevar, sizeof(causevar), "MASTER_CHANNEL(HASH(SIP_CAUSE,%s))", owner->name);
+ snprintf(causevar, sizeof(causevar), "MASTER_CHANNEL(HASH(SIP_CAUSE,%s))", ast_channel_name(owner));
snprintf(causeval, sizeof(causeval), "SIP %s", REQ_OFFSET_TO_STR(req, rlPart2));
ast_channel_ref(owner);
@@ -26358,7 +26358,7 @@ static int check_rtp_timeout(struct sip_pvt *dialog, time_t t)
return 0;
}
ast_log(LOG_NOTICE, "Disconnecting call '%s' for lack of RTP activity in %ld seconds\n",
- dialog->owner->name, (long) (t - dialog->lastrtprx));
+ ast_channel_name(dialog->owner), (long) (t - dialog->lastrtprx));
/* Issue a softhangup */
ast_softhangup_nolock(dialog->owner, AST_SOFTHANGUP_DEV);
ast_channel_unlock(dialog->owner);
@@ -27242,7 +27242,7 @@ static struct ast_channel *sip_request_call(const char *type, struct ast_format_
if (sip_cfg.callevents)
manager_event(EVENT_FLAG_SYSTEM, "ChannelUpdate",
"Channel: %s\r\nChanneltype: %s\r\nSIPcallid: %s\r\nSIPfullcontact: %s\r\nPeername: %s\r\n",
- p->owner? p->owner->name : "", "SIP", p->callid, p->fullcontact, p->peername);
+ p->owner? ast_channel_name(p->owner) : "", "SIP", p->callid, p->fullcontact, p->peername);
sip_pvt_unlock(p);
if (!tmpc) {
dialog_unlink_all(p);
@@ -29732,7 +29732,7 @@ static int sip_set_udptl_peer(struct ast_channel *chan, struct ast_udptl *udptl)
sip_pvt_lock(p);
if (p->owner != chan) {
/* I suppose it could be argued that if this happens it is a bug. */
- ast_debug(1, "The private is not owned by channel %s anymore.\n", chan->name);
+ ast_debug(1, "The private is not owned by channel %s anymore.\n", ast_channel_name(chan));
sip_pvt_unlock(p);
ast_channel_unlock(chan);
return 0;
@@ -29874,7 +29874,7 @@ static int sip_set_rtp_peer(struct ast_channel *chan, struct ast_rtp_instance *i
sip_pvt_lock(p);
if (p->owner != chan) {
/* I suppose it could be argued that if this happens it is a bug. */
- ast_debug(1, "The private is not owned by channel %s anymore.\n", chan->name);
+ ast_debug(1, "The private is not owned by channel %s anymore.\n", ast_channel_name(chan));
sip_pvt_unlock(p);
ast_channel_unlock(chan);
return 0;
diff --git a/channels/chan_skinny.c b/channels/chan_skinny.c
index 896f38ebf..05ee648ba 100644
--- a/channels/chan_skinny.c
+++ b/channels/chan_skinny.c
@@ -3234,7 +3234,7 @@ static enum ast_rtp_glue_result skinny_get_rtp_peer(struct ast_channel *c, struc
enum ast_rtp_glue_result res = AST_RTP_GLUE_RESULT_REMOTE;
if (skinnydebug)
- ast_verb(1, "skinny_get_rtp_peer() Channel = %s\n", c->name);
+ ast_verb(1, "skinny_get_rtp_peer() Channel = %s\n", ast_channel_name(c));
if (!(sub = c->tech_pvt))
@@ -3863,8 +3863,8 @@ static char *_skinny_show_lines(int fd, int *total, struct mansession *s, const
AST_LIST_TRAVERSE(&l->sub, sub, list) {
ast_cli(fd, " %s> %s to %s\n",
(sub == l->activesub?"Active ":"Inactive"),
- sub->owner->name,
- (ast_bridged_channel(sub->owner)?ast_bridged_channel(sub->owner)->name:"")
+ ast_channel_name(sub->owner),
+ (ast_bridged_channel(sub->owner)?ast_channel_name(ast_bridged_channel(sub->owner)):"")
);
}
}
@@ -4293,7 +4293,7 @@ static void *skinny_ss(void *data)
/* Record this as the forwarding extension */
set_callforwards(l, sub->exten, l->getforward);
ast_verb(3, "Setting call forward (%d) to '%s' on channel %s\n",
- l->cfwdtype, sub->exten, c->name);
+ l->cfwdtype, sub->exten, ast_channel_name(c));
transmit_start_tone(d, SKINNY_DIALTONE, l->instance, sub->callid);
transmit_lamp_indication(d, STIMULUS_FORWARDALL, 1, SKINNY_LAMP_ON);
transmit_displaynotify(d, "CFwd enabled", 10);
@@ -4377,12 +4377,12 @@ static int skinny_call(struct ast_channel *ast, char *dest, int timeout)
}
if ((ast->_state != AST_STATE_DOWN) && (ast->_state != AST_STATE_RESERVED)) {
- ast_log(LOG_WARNING, "skinny_call called on %s, neither down nor reserved\n", ast->name);
+ ast_log(LOG_WARNING, "skinny_call called on %s, neither down nor reserved\n", ast_channel_name(ast));
return -1;
}
if (skinnydebug)
- ast_verb(3, "skinny_call(%s)\n", ast->name);
+ ast_verb(3, "skinny_call(%s)\n", ast_channel_name(ast));
if (l->dnd) {
ast_queue_control(ast, AST_CONTROL_BUSY);
@@ -4467,7 +4467,7 @@ static int skinny_answer(struct ast_channel *ast)
if (sub->blindxfer) {
if (skinnydebug)
ast_debug(1, "skinny_answer(%s) on %s@%s-%d with BlindXFER, transferring\n",
- ast->name, l->name, d->name, sub->callid);
+ ast_channel_name(ast), l->name, d->name, sub->callid);
ast_setstate(ast, AST_STATE_UP);
skinny_transfer(sub);
return 0;
@@ -4476,7 +4476,7 @@ static int skinny_answer(struct ast_channel *ast)
sub->cxmode = SKINNY_CX_SENDRECV;
if (skinnydebug)
- ast_verb(1, "skinny_answer(%s) on %s@%s-%d\n", ast->name, l->name, d->name, sub->callid);
+ ast_verb(1, "skinny_answer(%s) on %s@%s-%d\n", ast_channel_name(ast), l->name, d->name, sub->callid);
setsubstate(sub, SUBSTATE_CONNECTED);
@@ -4576,7 +4576,7 @@ static int skinny_write(struct ast_channel *ast, struct ast_frame *frame)
static int skinny_fixup(struct ast_channel *oldchan, struct ast_channel *newchan)
{
struct skinny_subchannel *sub = newchan->tech_pvt;
- ast_log(LOG_NOTICE, "skinny_fixup(%s, %s)\n", oldchan->name, newchan->name);
+ ast_log(LOG_NOTICE, "skinny_fixup(%s, %s)\n", ast_channel_name(oldchan), ast_channel_name(newchan));
if (sub->owner != oldchan) {
ast_log(LOG_WARNING, "old channel wasn't %p but was %p\n", oldchan, sub->owner);
return -1;
@@ -4716,9 +4716,9 @@ static int skinny_transfer(struct skinny_subchannel *sub)
if (skinnydebug) {
ast_debug(1, "Transferee channels (local/remote): %s and %s\n",
- xferee->owner->name, ast_bridged_channel(xferee->owner)?ast_bridged_channel(xferee->owner)->name:"");
+ ast_channel_name(xferee->owner), ast_bridged_channel(xferee->owner)?ast_channel_name(ast_bridged_channel(xferee->owner)):"");
ast_debug(1, "Transferor channels (local/remote): %s and %s\n",
- xferor->owner->name, ast_bridged_channel(xferor->owner)?ast_bridged_channel(xferor->owner)->name:"");
+ ast_channel_name(xferor->owner), ast_bridged_channel(xferor->owner)?ast_channel_name(ast_bridged_channel(xferor->owner)):"");
}
if (ast_bridged_channel(xferor->owner)) {
if (ast_bridged_channel(xferee->owner)) {
@@ -4733,10 +4733,10 @@ static int skinny_transfer(struct skinny_subchannel *sub)
}
if (skinnydebug)
ast_debug(1, "Transfer Masquerading %s to %s\n",
- xferee->owner->name, ast_bridged_channel(xferor->owner)?ast_bridged_channel(xferor->owner)->name:"");
+ ast_channel_name(xferee->owner), ast_bridged_channel(xferor->owner)?ast_channel_name(ast_bridged_channel(xferor->owner)):"");
if (ast_channel_masquerade(xferee->owner, ast_bridged_channel(xferor->owner))) {
ast_log(LOG_WARNING, "Unable to masquerade %s as %s\n",
- ast_bridged_channel(xferor->owner)->name, xferee->owner->name);
+ ast_channel_name(ast_bridged_channel(xferor->owner)), ast_channel_name(xferee->owner));
return -1;
}
} else if (ast_bridged_channel(xferee->owner)) {
@@ -4750,16 +4750,16 @@ static int skinny_transfer(struct skinny_subchannel *sub)
}
if (skinnydebug)
ast_debug(1, "Transfer Masquerading %s to %s\n",
- xferor->owner->name, ast_bridged_channel(xferee->owner)?ast_bridged_channel(xferee->owner)->name:"");
+ ast_channel_name(xferor->owner), ast_bridged_channel(xferee->owner)?ast_channel_name(ast_bridged_channel(xferee->owner)):"");
if (ast_channel_masquerade(xferor->owner, ast_bridged_channel(xferee->owner))) {
ast_log(LOG_WARNING, "Unable to masquerade %s as %s\n",
- ast_bridged_channel(xferee->owner)->name, xferor->owner->name);
+ ast_channel_name(ast_bridged_channel(xferee->owner)), ast_channel_name(xferor->owner));
return -1;
}
return 0;
} else {
ast_debug(1, "Neither %s nor %s are in a bridge, nothing to transfer\n",
- xferor->owner->name, xferee->owner->name);
+ ast_channel_name(xferor->owner), ast_channel_name(xferee->owner));
}
}
return 0;
@@ -4773,17 +4773,17 @@ static int skinny_indicate(struct ast_channel *ast, int ind, const void *data, s
struct skinnysession *s = d->session;
if (!s) {
- ast_log(LOG_NOTICE, "Asked to indicate '%s' condition on channel %s, but session does not exist.\n", control2str(ind), ast->name);
+ ast_log(LOG_NOTICE, "Asked to indicate '%s' condition on channel %s, but session does not exist.\n", control2str(ind), ast_channel_name(ast));
return -1;
}
if (skinnydebug)
- ast_verb(3, "Asked to indicate '%s' condition on channel %s\n", control2str(ind), ast->name);
+ ast_verb(3, "Asked to indicate '%s' condition on channel %s\n", control2str(ind), ast_channel_name(ast));
switch(ind) {
case AST_CONTROL_RINGING:
if (sub->blindxfer) {
if (skinnydebug)
- ast_debug(1, "Channel %s set up for Blind Xfer, so Xfer rather than ring device\n", ast->name);
+ ast_debug(1, "Channel %s set up for Blind Xfer, so Xfer rather than ring device\n", ast_channel_name(ast));
skinny_transfer(sub);
break;
}
@@ -4951,7 +4951,7 @@ static struct ast_channel *skinny_new(struct skinny_line *l, struct skinny_subli
if (state != AST_STATE_DOWN) {
if (ast_pbx_start(tmp)) {
- ast_log(LOG_WARNING, "Unable to start PBX on %s\n", tmp->name);
+ ast_log(LOG_WARNING, "Unable to start PBX on %s\n", ast_channel_name(tmp));
ast_hangup(tmp);
tmp = NULL;
}
@@ -5895,7 +5895,7 @@ static int handle_stimulus_message(struct skinny_req *req, struct skinnysession
setsubstate(sub, SUBSTATE_CONNECTED);
} else {
if (sub && sub->owner) {
- ast_debug(1, "Current subchannel [%s] already has owner\n", sub->owner->name);
+ ast_debug(1, "Current subchannel [%s] already has owner\n", ast_channel_name(sub->owner));
} else {
c = skinny_new(l, NULL, AST_STATE_DOWN, NULL, SKINNY_OUTGOING);
if (c) {
@@ -5970,7 +5970,7 @@ static int handle_offhook_message(struct skinny_req *req, struct skinnysession *
transmit_definetimedate(d);
if (sub && sub->owner) {
- ast_debug(1, "Current sub [%s] already has owner\n", sub->owner->name);
+ ast_debug(1, "Current sub [%s] already has owner\n", ast_channel_name(sub->owner));
} else {
c = skinny_new(l, NULL, AST_STATE_DOWN, NULL, SKINNY_OUTGOING);
if (c) {
diff --git a/channels/chan_unistim.c b/channels/chan_unistim.c
index ac4d559a9..45267724e 100644
--- a/channels/chan_unistim.c
+++ b/channels/chan_unistim.c
@@ -1972,8 +1972,8 @@ static int attempt_transfer(struct unistim_subchannel *p1, struct unistim_subcha
peerc->cdr = NULL;
if (ast_channel_masquerade(peerb, peerc)) {
- ast_log(LOG_WARNING, "Failed to masquerade %s into %s\n", peerb->name,
- peerc->name);
+ ast_log(LOG_WARNING, "Failed to masquerade %s into %s\n", ast_channel_name(peerb),
+ ast_channel_name(peerc));
res = -1;
}
return res;
@@ -2507,10 +2507,10 @@ static void HandleCallOutgoing(struct unistimsession *s)
}
if (unistimdebug)
ast_verb(0, "Started three way call on channel %p (%s) subchan %d\n",
- p->subs[SUB_THREEWAY]->owner, p->subs[SUB_THREEWAY]->owner->name,
+ p->subs[SUB_THREEWAY]->owner, ast_channel_name(p->subs[SUB_THREEWAY]->owner),
p->subs[SUB_THREEWAY]->subtype);
} else
- ast_debug(1, "Current sub [%s] already has owner\n", sub->owner->name);
+ ast_debug(1, "Current sub [%s] already has owner\n", ast_channel_name(sub->owner));
}
return;
}
@@ -3759,12 +3759,12 @@ static int unistim_call(struct ast_channel *ast, char *dest, int timeout)
sub = ast->tech_pvt;
if ((ast->_state != AST_STATE_DOWN) && (ast->_state != AST_STATE_RESERVED)) {
ast_log(LOG_WARNING, "unistim_call called on %s, neither down nor reserved\n",
- ast->name);
+ ast_channel_name(ast));
return -1;
}
if (unistimdebug)
- ast_verb(3, "unistim_call(%s)\n", ast->name);
+ ast_verb(3, "unistim_call(%s)\n", ast_channel_name(ast));
session->state = STATE_RINGING;
Sendicon(TEXT_LINE0, FAV_ICON_NONE, session);
@@ -3839,7 +3839,7 @@ static int unistim_hangup(struct ast_channel *ast)
}
l = sub->parent;
if (unistimdebug)
- ast_verb(0, "unistim_hangup(%s) on %s@%s\n", ast->name, l->name, l->parent->name);
+ ast_verb(0, "unistim_hangup(%s) on %s@%s\n", ast_channel_name(ast), l->name, l->parent->name);
if ((l->subs[SUB_THREEWAY]) && (sub->subtype == SUB_REAL)) {
if (unistimdebug)
@@ -3938,7 +3938,7 @@ static int unistim_answer(struct ast_channel *ast)
if ((!sub->rtp) && (!l->subs[SUB_THREEWAY]))
start_rtp(sub);
if (unistimdebug)
- ast_verb(0, "unistim_answer(%s) on %s@%s-%d\n", ast->name, l->name,
+ ast_verb(0, "unistim_answer(%s) on %s@%s-%d\n", ast_channel_name(ast), l->name,
l->parent->name, sub->subtype);
send_text(TEXT_LINE2, TEXT_NORMAL, l->parent->session, "is now on-line");
if (l->subs[SUB_THREEWAY])
@@ -4115,11 +4115,11 @@ static int unistim_fixup(struct ast_channel *oldchan, struct ast_channel *newcha
ast_mutex_lock(&p->lock);
ast_debug(1, "New owner for channel USTM/%s@%s-%d is %s\n", l->name,
- l->parent->name, p->subtype, newchan->name);
+ l->parent->name, p->subtype, ast_channel_name(newchan));
if (p->owner != oldchan) {
ast_log(LOG_WARNING, "old channel wasn't %s (%p) but was %s (%p)\n",
- oldchan->name, oldchan, p->owner->name, p->owner);
+ ast_channel_name(oldchan), oldchan, ast_channel_name(p->owner), p->owner);
return -1;
}
@@ -4188,7 +4188,7 @@ static int unistim_indicate(struct ast_channel *ast, int ind, const void *data,
if (unistimdebug) {
ast_verb(3, "Asked to indicate '%s' condition on channel %s\n",
- control2str(ind), ast->name);
+ control2str(ind), ast_channel_name(ast));
}
s = channel_to_session(ast);
@@ -4621,7 +4621,7 @@ static struct ast_channel *unistim_new(struct unistim_subchannel *sub, int state
if (unistimdebug)
ast_verb(0, "Starting pbx in unistim_new\n");
if (ast_pbx_start(tmp)) {
- ast_log(LOG_WARNING, "Unable to start PBX on %s\n", tmp->name);
+ ast_log(LOG_WARNING, "Unable to start PBX on %s\n", ast_channel_name(tmp));
ast_hangup(tmp);
tmp = NULL;
}
diff --git a/channels/chan_usbradio.c b/channels/chan_usbradio.c
index a6cc03a66..541a325f3 100644
--- a/channels/chan_usbradio.c
+++ b/channels/chan_usbradio.c
@@ -1845,13 +1845,13 @@ static struct ast_frame *usbradio_read(struct ast_channel *c)
if(!o->pmrChan->txPttIn)
{
o->pmrChan->txPttIn=1;
- if(o->debuglevel) ast_log(LOG_NOTICE,"txPttIn = %i, chan %s\n",o->pmrChan->txPttIn,o->owner->name);
+ if(o->debuglevel) ast_log(LOG_NOTICE,"txPttIn = %i, chan %s\n",o->pmrChan->txPttIn,ast_channel_name(o->owner));
}
}
else if(o->pmrChan->txPttIn)
{
o->pmrChan->txPttIn=0;
- if(o->debuglevel) ast_log(LOG_NOTICE,"txPttIn = %i, chan %s\n",o->pmrChan->txPttIn,o->owner->name);
+ if(o->debuglevel) ast_log(LOG_NOTICE,"txPttIn = %i, chan %s\n",o->pmrChan->txPttIn,ast_channel_name(o->owner));
}
oldpttout = o->pmrChan->txPttOut;
@@ -1862,7 +1862,7 @@ static struct ast_frame *usbradio_read(struct ast_channel *c)
if (oldpttout != o->pmrChan->txPttOut)
{
- if(o->debuglevel) ast_log(LOG_NOTICE,"txPttOut = %i, chan %s\n",o->pmrChan->txPttOut,o->owner->name);
+ if(o->debuglevel) ast_log(LOG_NOTICE,"txPttOut = %i, chan %s\n",o->pmrChan->txPttOut,ast_channel_name(o->owner));
kickptt(o);
}
@@ -1960,13 +1960,13 @@ static struct ast_frame *usbradio_read(struct ast_channel *c)
if(cd!=o->rxcarrierdetect)
{
o->rxcarrierdetect=cd;
- if(o->debuglevel) ast_log(LOG_NOTICE,"rxcarrierdetect = %i, chan %s\n",cd,o->owner->name);
+ if(o->debuglevel) ast_log(LOG_NOTICE,"rxcarrierdetect = %i, chan %s\n",cd,ast_channel_name(o->owner));
// printf("rxcarrierdetect = %i, chan %s\n",res,o->owner->name);
}
if(o->pmrChan->b.ctcssRxEnable && o->pmrChan->rxCtcss->decode!=o->rxctcssdecode)
{
- if(o->debuglevel)ast_log(LOG_NOTICE,"rxctcssdecode = %i, chan %s\n",o->pmrChan->rxCtcss->decode,o->owner->name);
+ if(o->debuglevel)ast_log(LOG_NOTICE,"rxctcssdecode = %i, chan %s\n",o->pmrChan->rxCtcss->decode,ast_channel_name(o->owner));
// printf("rxctcssdecode = %i, chan %s\n",o->pmrChan->rxCtcss->decode,o->owner->name);
o->rxctcssdecode=o->pmrChan->rxCtcss->decode;
strcpy(o->rxctcssfreq, o->pmrChan->rxctcssfreq);
@@ -2004,7 +2004,7 @@ static struct ast_frame *usbradio_read(struct ast_channel *c)
if(o->pmrChan->decDcs->decode!=o->rxdcsdecode)
{
- if(o->debuglevel)ast_log(LOG_NOTICE,"rxdcsdecode = %s, chan %s\n",o->pmrChan->rxctcssfreq,o->owner->name);
+ if(o->debuglevel)ast_log(LOG_NOTICE,"rxdcsdecode = %s, chan %s\n",o->pmrChan->rxctcssfreq,ast_channel_name(o->owner));
// printf("rxctcssdecode = %i, chan %s\n",o->pmrChan->rxCtcss->decode,o->owner->name);
o->rxdcsdecode=o->pmrChan->decDcs->decode;
strcpy(o->rxctcssfreq, o->pmrChan->rxctcssfreq);
@@ -2012,7 +2012,7 @@ static struct ast_frame *usbradio_read(struct ast_channel *c)
if(o->pmrChan->rptnum && (o->pmrChan->pLsdCtl->cs[o->pmrChan->rptnum].b.rxkeyed != o->rxlsddecode))
{
- if(o->debuglevel)ast_log(LOG_NOTICE,"rxLSDecode = %s, chan %s\n",o->pmrChan->rxctcssfreq,o->owner->name);
+ if(o->debuglevel)ast_log(LOG_NOTICE,"rxLSDecode = %s, chan %s\n",o->pmrChan->rxctcssfreq,ast_channel_name(o->owner));
o->rxlsddecode=o->pmrChan->pLsdCtl->cs[o->pmrChan->rptnum].b.rxkeyed;
strcpy(o->rxctcssfreq, o->pmrChan->rxctcssfreq);
}
@@ -2027,13 +2027,13 @@ static struct ast_frame *usbradio_read(struct ast_channel *c)
if ( cd && sd )
{
//if(!o->rxkeyed)o->pmrChan->dd.b.doitnow=1;
- if(!o->rxkeyed && o->debuglevel)ast_log(LOG_NOTICE,"o->rxkeyed = 1, chan %s\n", o->owner->name);
+ if(!o->rxkeyed && o->debuglevel)ast_log(LOG_NOTICE,"o->rxkeyed = 1, chan %s\n", ast_channel_name(o->owner));
o->rxkeyed = 1;
}
else
{
//if(o->rxkeyed)o->pmrChan->dd.b.doitnow=1;
- if(o->rxkeyed && o->debuglevel)ast_log(LOG_NOTICE,"o->rxkeyed = 0, chan %s\n",o->owner->name);
+ if(o->rxkeyed && o->debuglevel)ast_log(LOG_NOTICE,"o->rxkeyed = 0, chan %s\n",ast_channel_name(o->owner));
o->rxkeyed = 0;
}
@@ -2159,7 +2159,7 @@ static int usbradio_indicate(struct ast_channel *c, int cond, const void *data,
if(o->debuglevel)ast_verbose(" << AST_CONTROL_RADIO_UNKEY Radio Transmit Off. >> \n");
break;
default:
- ast_log(LOG_WARNING, "Don't know how to display condition %d on %s\n", cond, c->name);
+ ast_log(LOG_WARNING, "Don't know how to display condition %d on %s\n", cond, ast_channel_name(c));
return -1;
}
@@ -2205,7 +2205,7 @@ static struct ast_channel *usbradio_new(struct chan_usbradio_pvt *o, char *ext,
ast_jb_configure(c, &global_jbconf);
if (state != AST_STATE_DOWN) {
if (ast_pbx_start(c)) {
- ast_log(LOG_WARNING, "Unable to start PBX on %s\n", c->name);
+ ast_log(LOG_WARNING, "Unable to start PBX on %s\n", ast_channel_name(c));
ast_hangup(c);
o->owner = c = NULL;
/* XXX what about the channel itself ? */
diff --git a/channels/chan_vpb.cc b/channels/chan_vpb.cc
index 894c6045f..71e7febee 100644
--- a/channels/chan_vpb.cc
+++ b/channels/chan_vpb.cc
@@ -467,7 +467,7 @@ static enum ast_bridge_result ast_vpb_bridge(struct ast_channel *c0, struct ast_
ast_mutex_unlock(&bridge_lock);
if (i == max_bridges) {
- ast_log(LOG_WARNING, "%s: vpb_bridge: Failed to bridge %s and %s!\n", p0->dev, c0->name, c1->name);
+ ast_log(LOG_WARNING, "%s: vpb_bridge: Failed to bridge %s and %s!\n", p0->dev, ast_channel_name(c0), ast_channel_name(c1));
ast_mutex_unlock(&p0->lock);
ast_mutex_unlock(&p1->lock);
return AST_BRIDGE_FAILED_NOWARN;
@@ -481,14 +481,14 @@ static enum ast_bridge_result ast_vpb_bridge(struct ast_channel *c0, struct ast_
p1->bridge = &bridges[i];
ast_mutex_unlock(&p1->lock);
- ast_verb(2, "%s: vpb_bridge: Bridging call entered with [%s, %s]\n", p0->dev, c0->name, c1->name);
+ ast_verb(2, "%s: vpb_bridge: Bridging call entered with [%s, %s]\n", p0->dev, ast_channel_name(c0), ast_channel_name(c1));
}
- ast_verb(3, "Native bridging %s and %s\n", c0->name, c1->name);
+ ast_verb(3, "Native bridging %s and %s\n", ast_channel_name(c0), ast_channel_name(c1));
#ifdef HALF_DUPLEX_BRIDGE
- ast_debug(2, "%s: vpb_bridge: Starting half-duplex bridge [%s, %s]\n", p0->dev, c0->name, c1->name);
+ ast_debug(2, "%s: vpb_bridge: Starting half-duplex bridge [%s, %s]\n", p0->dev, ast_channel_name(c0), ast_channel_name(c1));
int dir = 0;
@@ -520,7 +520,7 @@ static enum ast_bridge_result ast_vpb_bridge(struct ast_channel *c0, struct ast_
vpb_play_buf_finish(p0->handle);
vpb_play_buf_finish(p1->handle);
- ast_debug(2, "%s: vpb_bridge: Finished half-duplex bridge [%s, %s]\n", p0->dev, c0->name, c1->name);
+ ast_debug(2, "%s: vpb_bridge: Finished half-duplex bridge [%s, %s]\n", p0->dev, ast_channel_name(c0), ast_channel_name(c1));
res = VPB_OK;
@@ -602,7 +602,7 @@ static enum ast_bridge_result ast_vpb_bridge(struct ast_channel *c0, struct ast_
p1->bridge = NULL;
- ast_verb(2, "Bridging call done with [%s, %s] => %d\n", c0->name, c1->name, res);
+ ast_verb(2, "Bridging call done with [%s, %s] => %d\n", ast_channel_name(c0), ast_channel_name(c1), res);
/*
ast_mutex_unlock(&p0->lock);
@@ -901,11 +901,11 @@ static inline int monitor_handle_owned(struct vpb_pvt *p, VPB_EVENT *e)
if (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(3, "Redirecting %s to fax extension\n", p->owner->name);
+ ast_verb(3, "Redirecting %s to fax extension\n", ast_channel_name(p->owner));
/* Save the DID/DNIS when we transfer the fax call to a "fax" extension */
pbx_builtin_setvar_helper(p->owner, "FAXEXTEN", p->owner->exten);
if (ast_async_goto(p->owner, target_context, "fax", 1)) {
- ast_log(LOG_WARNING, "Failed to async goto '%s' into fax of '%s'\n", p->owner->name, target_context);
+ ast_log(LOG_WARNING, "Failed to async goto '%s' into fax of '%s'\n", ast_channel_name(p->owner), target_context);
}
} else {
ast_log(LOG_NOTICE, "Fax detected, but no fax extension\n");
@@ -1062,7 +1062,7 @@ static inline int monitor_handle_owned(struct vpb_pvt *p, VPB_EVENT *e)
}
ast_verb(4, "%s: handle_owned: Prepared frame type[%d]subclass[%d], bridge=%p owner=[%s]\n",
- p->dev, f.frametype, f.subclass.integer, (void *)p->bridge, p->owner->name);
+ p->dev, f.frametype, f.subclass.integer, (void *)p->bridge, ast_channel_name(p->owner));
/* Trylock used here to avoid deadlock that can occur if we
* happen to be in here handling an event when hangup is called
@@ -1072,7 +1072,7 @@ static inline int monitor_handle_owned(struct vpb_pvt *p, VPB_EVENT *e)
if (ast_channel_trylock(p->owner) == 0) {
ast_queue_frame(p->owner, &f);
ast_channel_unlock(p->owner);
- ast_verb(4, "%s: handled_owned: Queued Frame to [%s]\n", p->dev, p->owner->name);
+ ast_verb(4, "%s: handled_owned: Queued Frame to [%s]\n", p->dev, ast_channel_name(p->owner));
} else {
ast_verbose("%s: handled_owned: Missed event %d/%d \n",
p->dev, f.frametype, f.subclass.integer);
@@ -1731,7 +1731,7 @@ static int vpb_fixup(struct ast_channel *oldchan, struct ast_channel *newchan)
ast_verb(4, "%s: LOCKING count[%d] owner[%d] \n", p->dev, p->lock.__m_count,p->lock.__m_owner);
*/
ast_mutex_lock(&p->lock);
- ast_debug(1, "New owner for channel %s is %s\n", p->dev, newchan->name);
+ ast_debug(1, "New owner for channel %s is %s\n", p->dev, ast_channel_name(newchan));
if (p->owner == oldchan) {
p->owner = newchan;
@@ -1814,7 +1814,7 @@ static int vpb_call(struct ast_channel *ast, char *dest, int timeout)
}
if (ast->_state != AST_STATE_DOWN && ast->_state != AST_STATE_RESERVED) {
- ast_log(LOG_WARNING, "vpb_call on %s neither down nor reserved!\n", ast->name);
+ ast_log(LOG_WARNING, "vpb_call on %s neither down nor reserved!\n", ast_channel_name(ast));
ast_mutex_unlock(&p->lock);
return -1;
}
@@ -1840,15 +1840,15 @@ static int vpb_call(struct ast_channel *ast, char *dest, int timeout)
memcpy(&call.tone_map, DialToneMap, sizeof(DialToneMap));
vpb_set_call(p->handle, &call);
- ast_verb(2, "%s: Calling %s on %s \n",p->dev, dialstring, ast->name);
+ ast_verb(2, "%s: Calling %s on %s \n",p->dev, dialstring, ast_channel_name(ast));
ast_verb(2, "%s: Dial parms for %s %d/%dms/%dms/%dms/%dms\n", p->dev,
- ast->name, call.dialtones, call.dialtone_timeout,
+ ast_channel_name(ast), call.dialtones, call.dialtone_timeout,
call.ringback_timeout, call.inter_ringback_timeout,
call.answer_timeout);
for (j = 0; !call.tone_map[j].terminate; j++) {
ast_verb(2, "%s: Dial parms for %s tone %d->%d\n", p->dev,
- ast->name, call.tone_map[j].tone_id, call.tone_map[j].call_id);
+ ast_channel_name(ast), call.tone_map[j].tone_id, call.tone_map[j].call_id);
}
ast_verb(4, "%s: Disabling Loop Drop detection\n", p->dev);
@@ -1868,13 +1868,13 @@ static int vpb_call(struct ast_channel *ast, char *dest, int timeout)
#endif
if (res != VPB_OK) {
- ast_debug(1, "Call on %s to %s failed: %d\n", ast->name, s, res);
+ ast_debug(1, "Call on %s to %s failed: %d\n", ast_channel_name(ast), s, res);
res = -1;
} else
res = 0;
}
- ast_verb(3, "%s: VPB Calling %s [t=%d] on %s returned %d\n", p->dev , s, timeout, ast->name, res);
+ ast_verb(3, "%s: VPB Calling %s [t=%d] on %s returned %d\n", p->dev , s, timeout, ast_channel_name(ast), res);
if (res == 0) {
ast_setstate(ast, AST_STATE_RINGING);
ast_queue_control(ast, AST_CONTROL_RINGING);
@@ -1900,10 +1900,10 @@ static int vpb_hangup(struct ast_channel *ast)
ast_verb(4, "%s: LOCKING pthread_self(%d)\n", p->dev,pthread_self());
ast_mutex_lock(&p->lock);
*/
- ast_verb(2, "%s: Hangup requested\n", ast->name);
+ ast_verb(2, "%s: Hangup requested\n", ast_channel_name(ast));
if (!ast->tech || !ast->tech_pvt) {
- ast_log(LOG_WARNING, "%s: channel not connected?\n", ast->name);
+ ast_log(LOG_WARNING, "%s: channel not connected?\n", ast_channel_name(ast));
ast_mutex_unlock(&p->lock);
/* Free up ast dsp if we have one */
if (use_ast_dtmfdet && p->vad) {
@@ -1919,19 +1919,19 @@ static int vpb_hangup(struct ast_channel *ast)
p->stopreads = 1;
if (p->readthread) {
pthread_join(p->readthread, NULL);
- ast_verb(4, "%s: stopped record thread \n", ast->name);
+ ast_verb(4, "%s: stopped record thread \n", ast_channel_name(ast));
}
/* Stop play */
if (p->lastoutput != -1) {
- ast_verb(2, "%s: Ending play mode \n", ast->name);
+ ast_verb(2, "%s: Ending play mode \n", ast_channel_name(ast));
vpb_play_terminate(p->handle);
ast_mutex_lock(&p->play_lock);
vpb_play_buf_finish(p->handle);
ast_mutex_unlock(&p->play_lock);
}
- ast_verb(4, "%s: Setting state down\n", ast->name);
+ ast_verb(4, "%s: Setting state down\n", ast_channel_name(ast));
ast_setstate(ast, AST_STATE_DOWN);
@@ -1967,7 +1967,7 @@ static int vpb_hangup(struct ast_channel *ast)
}
while (VPB_OK == vpb_get_event_ch_async(p->handle, &je)) {
vpb_translate_event(&je, str);
- ast_verb(4, "%s: Flushing event [%d]=>%s\n", ast->name, je.type, str);
+ ast_verb(4, "%s: Flushing event [%d]=>%s\n", ast_channel_name(ast), je.type, str);
}
p->readthread = 0;
@@ -1986,7 +1986,7 @@ static int vpb_hangup(struct ast_channel *ast)
p->vad = NULL;
}
- ast_verb(2, "%s: Hangup complete\n", ast->name);
+ ast_verb(2, "%s: Hangup complete\n", ast_channel_name(ast));
restart_monitor();
ast_mutex_unlock(&p->lock);
@@ -2026,7 +2026,7 @@ static int vpb_answer(struct ast_channel *ast)
ast_setstate(ast, AST_STATE_UP);
ast_verb(2, "%s: Answered call on %s [%s]\n", p->dev,
- ast->name, (p->mode == MODE_FXO) ? "FXO" : "FXS");
+ ast_channel_name(ast), (p->mode == MODE_FXO) ? "FXO" : "FXS");
ast->rings = 0;
if (!p->readthread) {
@@ -2136,11 +2136,11 @@ static int vpb_write(struct ast_channel *ast, struct ast_frame *frame)
ast_verb(6, "%s: vpb_write: Writing to channel\n", p->dev);
if (frame->frametype != AST_FRAME_VOICE) {
- ast_verb(4, "%s: vpb_write: Don't know how to handle from type %d\n", ast->name, frame->frametype);
+ ast_verb(4, "%s: vpb_write: Don't know how to handle from type %d\n", ast_channel_name(ast), frame->frametype);
/* ast_mutex_unlock(&p->lock); */
return 0;
} else if (ast->_state != AST_STATE_UP) {
- ast_verb(4, "%s: vpb_write: Attempt to Write frame type[%d]subclass[%s] on not up chan(state[%d])\n", ast->name, frame->frametype, ast_getformatname(&frame->subclass.format), ast->_state);
+ ast_verb(4, "%s: vpb_write: Attempt to Write frame type[%d]subclass[%s] on not up chan(state[%d])\n", ast_channel_name(ast), frame->frametype, ast_getformatname(&frame->subclass.format), ast->_state);
p->lastoutput = -1;
/* ast_mutex_unlock(&p->lock); */
return 0;
@@ -2150,7 +2150,7 @@ static int vpb_write(struct ast_channel *ast, struct ast_frame *frame)
fmt = ast2vpbformat(&frame->subclass.format);
if (fmt < 0) {
- ast_log(LOG_WARNING, "%s: vpb_write: Cannot handle frames of %s format!\n", ast->name, ast_getformatname(&frame->subclass.format));
+ ast_log(LOG_WARNING, "%s: vpb_write: Cannot handle frames of %s format!\n", ast_channel_name(ast), ast_getformatname(&frame->subclass.format));
return -1;
}
@@ -2258,7 +2258,7 @@ static void *do_chanreads(void *pvt)
} else {
ast_verb(5, "%s: chanreads: No native bridge.\n", p->dev);
if (p->owner->_bridge) {
- ast_verb(5, "%s: chanreads: Got Asterisk bridge with [%s].\n", p->dev, p->owner->_bridge->name);
+ ast_verb(5, "%s: chanreads: Got Asterisk bridge with [%s].\n", p->dev, ast_channel_name(p->owner->_bridge));
bridgerec = 1;
} else {
bridgerec = 0;
@@ -2495,7 +2495,7 @@ static struct ast_channel *vpb_new(struct vpb_pvt *me, enum ast_channel_state st
vpb_answer(tmp);
}
if (ast_pbx_start(tmp)) {
- ast_log(LOG_WARNING, "Unable to start PBX on %s\n", tmp->name);
+ ast_log(LOG_WARNING, "Unable to start PBX on %s\n", ast_channel_name(tmp));
ast_hangup(tmp);
}
}
@@ -2552,7 +2552,7 @@ static struct ast_channel *vpb_request(const char *type, struct ast_format_cap *
ast_mutex_unlock(&iflock);
- ast_verb(2, " %s requested, got: [%s]\n", name, tmp ? tmp->name : "None");
+ ast_verb(2, " %s requested, got: [%s]\n", name, tmp ? ast_channel_name(tmp) : "None");
ast_free(name);
diff --git a/channels/console_video.c b/channels/console_video.c
index c26ac983f..25e095f68 100644
--- a/channels/console_video.c
+++ b/channels/console_video.c
@@ -991,7 +991,7 @@ static void *video_thread(void *arg)
for (p = f; p; p = AST_LIST_NEXT(p, frame_list)) {
if (write(fd, &blah, l) != l)
ast_log(LOG_WARNING, "Unable to write to alert pipe on %s, frametype/subclass %d/%d: %s!\n",
- chan->name, f->frametype, f->subclass, strerror(errno));
+ ast_channel_name(chan), f->frametype, f->subclass, strerror(errno));
}
}
ast_channel_unlock(chan);
diff --git a/channels/sig_analog.c b/channels/sig_analog.c
index edfd0da9e..7a7b34555 100644
--- a/channels/sig_analog.c
+++ b/channels/sig_analog.c
@@ -397,7 +397,7 @@ static int _analog_get_index(struct ast_channel *ast, struct analog_pvt *p, int
if (!nullok) {
ast_log(LOG_WARNING,
"Unable to get index for '%s' on channel %d (%s(), line %lu)\n",
- ast ? ast->name : "", p->channel, fname, line);
+ ast ? ast_channel_name(ast) : "", p->channel, fname, line);
}
}
return res;
@@ -700,7 +700,7 @@ static int analog_attempt_transfer(struct analog_pvt *p, int inthreeway)
* applications together. Why would we want to?
*/
if (bridge_3way) {
- ast_verb(3, "TRANSFERRING %s to %s\n", owner_3way->name, owner_real->name);
+ ast_verb(3, "TRANSFERRING %s to %s\n", ast_channel_name(owner_3way), ast_channel_name(owner_real));
ast_cel_report_event(owner_3way,
(owner_real->_state == AST_STATE_RINGING
|| owner_3way->_state == AST_STATE_RINGING)
@@ -714,7 +714,7 @@ static int analog_attempt_transfer(struct analog_pvt *p, int inthreeway)
if (ast_channel_transfer_masquerade(owner_real, &owner_real->connected, 0,
bridge_3way, &owner_3way->connected, !inthreeway)) {
ast_log(LOG_WARNING, "Unable to masquerade %s as %s\n",
- bridge_3way->name, owner_real->name);
+ ast_channel_name(bridge_3way), ast_channel_name(owner_real));
return -1;
}
@@ -726,7 +726,7 @@ static int analog_attempt_transfer(struct analog_pvt *p, int inthreeway)
return 1;
} else if (bridge_real) {
/* Try transferring the other way. */
- ast_verb(3, "TRANSFERRING %s to %s\n", owner_real->name, owner_3way->name);
+ ast_verb(3, "TRANSFERRING %s to %s\n", ast_channel_name(owner_real), ast_channel_name(owner_3way));
ast_cel_report_event(owner_3way,
(owner_real->_state == AST_STATE_RINGING
|| owner_3way->_state == AST_STATE_RINGING)
@@ -740,7 +740,7 @@ static int analog_attempt_transfer(struct analog_pvt *p, int inthreeway)
if (ast_channel_transfer_masquerade(owner_3way, &owner_3way->connected,
!inthreeway, bridge_real, &owner_real->connected, 0)) {
ast_log(LOG_WARNING, "Unable to masquerade %s as %s\n",
- bridge_real->name, owner_3way->name);
+ ast_channel_name(bridge_real), ast_channel_name(owner_3way));
return -1;
}
@@ -750,7 +750,7 @@ static int analog_attempt_transfer(struct analog_pvt *p, int inthreeway)
return 0;
} else {
ast_debug(1, "Neither %s nor %s are in a bridge, nothing to transfer\n",
- owner_real->name, owner_3way->name);
+ ast_channel_name(owner_real), ast_channel_name(owner_3way));
return -1;
}
}
@@ -1021,7 +1021,7 @@ int analog_call(struct analog_pvt *p, struct ast_channel *ast, char *rdest, int
}
if ((ast->_state != AST_STATE_DOWN) && (ast->_state != AST_STATE_RESERVED)) {
- ast_log(LOG_WARNING, "analog_call called on %s, neither down nor reserved\n", ast->name);
+ ast_log(LOG_WARNING, "analog_call called on %s, neither down nor reserved\n", ast_channel_name(ast));
return -1;
}
@@ -1085,7 +1085,7 @@ int analog_call(struct analog_pvt *p, struct ast_channel *ast, char *rdest, int
}
/* Make ring-back */
if (analog_play_tone(p, ANALOG_SUB_CALLWAIT, ANALOG_TONE_RINGTONE)) {
- ast_log(LOG_WARNING, "Unable to generate call-wait ring-back on channel %s\n", ast->name);
+ ast_log(LOG_WARNING, "Unable to generate call-wait ring-back on channel %s\n", ast_channel_name(ast));
}
}
@@ -1436,7 +1436,7 @@ int analog_hangup(struct analog_pvt *p, struct ast_channel *ast)
/* Perform low level hangup if no owner left */
res = analog_on_hook(p);
if (res < 0) {
- ast_log(LOG_WARNING, "Unable to hangup line %s\n", ast->name);
+ ast_log(LOG_WARNING, "Unable to hangup line %s\n", ast_channel_name(ast));
}
switch (p->sig) {
case ANALOG_SIG_FXOGS:
@@ -1480,7 +1480,7 @@ int analog_hangup(struct analog_pvt *p, struct ast_channel *ast)
analog_stop_callwait(p);
- ast_verb(3, "Hanging up on '%s'\n", ast->name);
+ ast_verb(3, "Hanging up on '%s'\n", ast_channel_name(ast));
return 0;
}
@@ -1522,7 +1522,7 @@ int analog_answer(struct analog_pvt *p, struct ast_channel *ast)
case ANALOG_SIG_FXOGS:
case ANALOG_SIG_FXOKS:
/* Pick up the line */
- ast_debug(1, "Took %s off hook\n", ast->name);
+ ast_debug(1, "Took %s off hook\n", ast_channel_name(ast));
if (p->hanguponpolarityswitch) {
gettimeofday(&p->polaritydelaytv, NULL);
}
@@ -1594,11 +1594,11 @@ void analog_handle_dtmf(struct analog_pvt *p, struct ast_channel *ast, enum anal
ast_debug(1, "%s DTMF digit: 0x%02X '%c' on %s\n",
f->frametype == AST_FRAME_DTMF_BEGIN ? "Begin" : "End",
- f->subclass.integer, f->subclass.integer, ast->name);
+ f->subclass.integer, f->subclass.integer, ast_channel_name(ast));
if (analog_check_confirmanswer(p)) {
if (f->frametype == AST_FRAME_DTMF_END) {
- ast_debug(1, "Confirm answer on %s!\n", ast->name);
+ ast_debug(1, "Confirm answer on %s!\n", ast_channel_name(ast));
/* Upon receiving a DTMF digit, consider this an answer confirmation instead
of a DTMF digit */
p->subs[idx].f.frametype = AST_FRAME_CONTROL;
@@ -1771,12 +1771,12 @@ static void *__analog_ss_thread(void *data)
even get started here, abort safely
*/
if (!chan->tech_pvt) {
- ast_log(LOG_WARNING, "Channel became a zombie before simple switch could be started (%s)\n", chan->name);
+ ast_log(LOG_WARNING, "Channel became a zombie before simple switch could be started (%s)\n", ast_channel_name(chan));
ast_hangup(chan);
goto quit;
}
- ast_verb(3, "Starting simple switch on '%s'\n", chan->name);
+ ast_verb(3, "Starting simple switch on '%s'\n", ast_channel_name(chan));
idx = analog_get_index(chan, p, 0);
if (idx < 0) {
ast_hangup(chan);
@@ -2174,13 +2174,13 @@ static void *__analog_ss_thread(void *data)
ast_hangup(chan);
goto quit;
} else if (p->callwaiting && !strcmp(exten, "*70")) {
- ast_verb(3, "Disabling call waiting on %s\n", chan->name);
+ ast_verb(3, "Disabling call waiting on %s\n", ast_channel_name(chan));
/* Disable call waiting if enabled */
analog_set_callwaiting(p, 0);
res = analog_play_tone(p, idx, ANALOG_TONE_DIALRECALL);
if (res) {
ast_log(LOG_WARNING, "Unable to do dial recall on channel %s: %s\n",
- chan->name, strerror(errno));
+ ast_channel_name(chan), strerror(errno));
}
len = 0;
memset(exten, 0, sizeof(exten));
@@ -2215,7 +2215,7 @@ static void *__analog_ss_thread(void *data)
}
} else if (!p->hidecallerid && !strcmp(exten, "*67")) {
- ast_verb(3, "Disabling Caller*ID on %s\n", chan->name);
+ ast_verb(3, "Disabling Caller*ID on %s\n", ast_channel_name(chan));
/* Disable Caller*ID if enabled */
p->hidecallerid = 1;
ast_party_number_free(&chan->caller.id.number);
@@ -2225,7 +2225,7 @@ static void *__analog_ss_thread(void *data)
res = analog_play_tone(p, idx, ANALOG_TONE_DIALRECALL);
if (res) {
ast_log(LOG_WARNING, "Unable to do dial recall on channel %s: %s\n",
- chan->name, strerror(errno));
+ ast_channel_name(chan), strerror(errno));
}
len = 0;
memset(exten, 0, sizeof(exten));
@@ -2273,7 +2273,7 @@ static void *__analog_ss_thread(void *data)
ast_masq_park_call_exten(
ast_bridged_channel(p->subs[ANALOG_SUB_THREEWAY].owner), chan, exten,
chan->context, 0, NULL);
- ast_verb(3, "Parking call to '%s'\n", chan->name);
+ ast_verb(3, "Parking call to '%s'\n", ast_channel_name(chan));
break;
} else if (!ast_strlen_zero(p->lastcid_num) && !strcmp(exten, "*60")) {
ast_verb(3, "Blacklisting number %s\n", p->lastcid_num);
@@ -2284,14 +2284,14 @@ static void *__analog_ss_thread(void *data)
len = 0;
}
} else if (p->hidecallerid && !strcmp(exten, "*82")) {
- ast_verb(3, "Enabling Caller*ID on %s\n", chan->name);
+ ast_verb(3, "Enabling Caller*ID on %s\n", ast_channel_name(chan));
/* Enable Caller*ID if enabled */
p->hidecallerid = 0;
ast_set_callerid(chan, p->cid_num, p->cid_name, NULL);
res = analog_play_tone(p, idx, ANALOG_TONE_DIALRECALL);
if (res) {
ast_log(LOG_WARNING, "Unable to do dial recall on channel %s: %s\n",
- chan->name, strerror(errno));
+ ast_channel_name(chan), strerror(errno));
}
len = 0;
memset(exten, 0, sizeof(exten));
@@ -2312,7 +2312,7 @@ static void *__analog_ss_thread(void *data)
/* flash hookswitch */
if ((analog_flash(p) == -1) && (errno != EINPROGRESS)) {
ast_log(LOG_WARNING, "Unable to flash external trunk on channel %s: %s\n",
- nbridge->name, strerror(errno));
+ ast_channel_name(nbridge), strerror(errno));
}
analog_swap_subs(p, ANALOG_SUB_REAL, ANALOG_SUB_THREEWAY);
analog_unalloc_sub(p, ANALOG_SUB_THREEWAY);
@@ -2363,7 +2363,7 @@ static void *__analog_ss_thread(void *data)
else if (smdi_msg->type == 'N')
pbx_builtin_setvar_helper(chan, "_SMDI_VM_TYPE", "u");
- ast_debug(1, "Received SMDI message on %s\n", chan->name);
+ ast_debug(1, "Received SMDI message on %s\n", ast_channel_name(chan));
} else {
ast_log(LOG_WARNING, "SMDI enabled but no SMDI message present\n");
}
@@ -2384,7 +2384,7 @@ static void *__analog_ss_thread(void *data)
int k = 0;
int oldlinearity;
cs = NULL;
- ast_debug(1, "Receiving DTMF cid on channel %s\n", chan->name);
+ ast_debug(1, "Receiving DTMF cid on channel %s\n", ast_channel_name(chan));
oldlinearity = analog_set_linear_mode(p, idx, 0);
@@ -2516,7 +2516,7 @@ static void *__analog_ss_thread(void *data)
}
if (res < 0) {
- ast_log(LOG_WARNING, "CallerID returned with error on channel '%s'\n", chan->name);
+ ast_log(LOG_WARNING, "CallerID returned with error on channel '%s'\n", ast_channel_name(chan));
}
} else {
ast_log(LOG_WARNING, "Unable to get caller ID space\n");
@@ -2526,7 +2526,7 @@ static void *__analog_ss_thread(void *data)
"state, but I have nothing to do. "
"Terminating simple switch, should be "
"restarted by the actual ring.\n",
- chan->name);
+ ast_channel_name(chan));
ast_hangup(chan);
goto quit;
}
@@ -2589,7 +2589,7 @@ static void *__analog_ss_thread(void *data)
}
if (res < 0) {
- ast_log(LOG_WARNING, "CallerID returned with error on channel '%s'\n", chan->name);
+ ast_log(LOG_WARNING, "CallerID returned with error on channel '%s'\n", ast_channel_name(chan));
}
} else {
ast_log(LOG_WARNING, "Unable to get caller ID space\n");
@@ -3137,7 +3137,7 @@ static struct ast_frame *__analog_handle_event(struct analog_pvt *p, struct ast_
analog_swap_subs(p, ANALOG_SUB_REAL, ANALOG_SUB_CALLWAIT);
analog_play_tone(p, ANALOG_SUB_REAL, -1);
analog_set_new_owner(p, p->subs[ANALOG_SUB_REAL].owner);
- ast_debug(1, "Making %s the new owner\n", p->owner->name);
+ ast_debug(1, "Making %s the new owner\n", ast_channel_name(p->owner));
if (p->subs[ANALOG_SUB_REAL].owner->_state == AST_STATE_RINGING) {
ast_setstate(p->subs[ANALOG_SUB_REAL].owner, AST_STATE_UP);
ast_queue_control(p->subs[ANALOG_SUB_REAL].owner, AST_CONTROL_ANSWER);
@@ -3267,7 +3267,7 @@ static struct ast_frame *__analog_handle_event(struct analog_pvt *p, struct ast_
analog_set_new_owner(p, p->subs[ANALOG_SUB_REAL].owner);
}
/* Drop the last call and stop the conference */
- ast_verb(3, "Dropping three-way call on %s\n", p->subs[ANALOG_SUB_THREEWAY].owner->name);
+ ast_verb(3, "Dropping three-way call on %s\n", ast_channel_name(p->subs[ANALOG_SUB_THREEWAY].owner));
ast_softhangup_nolock(p->subs[ANALOG_SUB_THREEWAY].owner, AST_SOFTHANGUP_DEV);
analog_set_inthreeway(p, ANALOG_SUB_REAL, 0);
analog_set_inthreeway(p, ANALOG_SUB_THREEWAY, 0);
@@ -3276,8 +3276,8 @@ static struct ast_frame *__analog_handle_event(struct analog_pvt *p, struct ast_
if (((ast->pbx) || (ast->_state == AST_STATE_UP)) &&
(p->transfertobusy || (ast->_state != AST_STATE_BUSY))) {
ast_verb(3, "Building conference call with %s and %s\n",
- p->subs[ANALOG_SUB_THREEWAY].owner->name,
- p->subs[ANALOG_SUB_REAL].owner->name);
+ ast_channel_name(p->subs[ANALOG_SUB_THREEWAY].owner),
+ ast_channel_name(p->subs[ANALOG_SUB_REAL].owner));
/* Put them in the threeway, and flip */
analog_set_inthreeway(p, ANALOG_SUB_THREEWAY, 1);
analog_set_inthreeway(p, ANALOG_SUB_REAL, 1);
@@ -3290,7 +3290,7 @@ static struct ast_frame *__analog_handle_event(struct analog_pvt *p, struct ast_
}
analog_set_new_owner(p, p->subs[ANALOG_SUB_REAL].owner);
} else {
- ast_verb(3, "Dumping incomplete call on %s\n", p->subs[ANALOG_SUB_THREEWAY].owner->name);
+ ast_verb(3, "Dumping incomplete call on %s\n", ast_channel_name(p->subs[ANALOG_SUB_THREEWAY].owner));
analog_swap_subs(p, ANALOG_SUB_THREEWAY, ANALOG_SUB_REAL);
orig_3way_sub = ANALOG_SUB_REAL;
ast_softhangup_nolock(p->subs[ANALOG_SUB_THREEWAY].owner, AST_SOFTHANGUP_DEV);
@@ -3537,7 +3537,7 @@ struct ast_frame *analog_exception(struct analog_pvt *p, struct ast_channel *ast
* Possible deadlock because we do not have the real-call lock.
*/
ast_log(LOG_WARNING, "Event %s on %s is not restored owner %s\n",
- analog_event2str(res), ast->name, p->owner->name);
+ analog_event2str(res), ast_channel_name(ast), ast_channel_name(p->owner));
}
if (p->owner && ast_bridged_channel(p->owner)) {
ast_queue_control(p->owner, AST_CONTROL_UNHOLD);
@@ -3547,7 +3547,7 @@ struct ast_frame *analog_exception(struct analog_pvt *p, struct ast_channel *ast
case ANALOG_EVENT_ONHOOK:
analog_set_echocanceller(p, 0);
if (p->owner) {
- ast_verb(3, "Channel %s still has call, ringing phone\n", p->owner->name);
+ ast_verb(3, "Channel %s still has call, ringing phone\n", ast_channel_name(p->owner));
analog_ring(p);
analog_stop_callwait(p);
} else {
@@ -3572,7 +3572,7 @@ struct ast_frame *analog_exception(struct analog_pvt *p, struct ast_channel *ast
case ANALOG_EVENT_WINKFLASH:
gettimeofday(&p->flashtime, NULL);
if (p->owner) {
- ast_verb(3, "Channel %d flashed to other channel %s\n", p->channel, p->owner->name);
+ ast_verb(3, "Channel %d flashed to other channel %s\n", p->channel, ast_channel_name(p->owner));
if (p->owner->_state != AST_STATE_UP) {
/* Answer if necessary */
ast_queue_control(p->owner, AST_CONTROL_ANSWER);
@@ -3598,7 +3598,7 @@ struct ast_frame *analog_exception(struct analog_pvt *p, struct ast_channel *ast
ast_debug(1, "Exception on %d, channel %d\n", ast->fds[0],p->channel);
/* If it's not us, return NULL immediately */
if (ast != p->owner) {
- ast_log(LOG_WARNING, "We're %s, not %s\n", ast->name, p->owner->name);
+ ast_log(LOG_WARNING, "We're %s, not %s\n", ast_channel_name(ast), ast_channel_name(p->owner));
f = &p->subs[idx].f;
return f;
}
@@ -3908,7 +3908,7 @@ int analog_fixup(struct ast_channel *oldchan, struct ast_channel *newchan, void
{
struct analog_pvt *new_pvt = newp;
int x;
- ast_debug(1, "New owner for channel %d is %s\n", new_pvt->channel, newchan->name);
+ ast_debug(1, "New owner for channel %d is %s\n", new_pvt->channel, ast_channel_name(newchan));
if (new_pvt->owner == oldchan) {
analog_set_new_owner(new_pvt, newchan);
}
diff --git a/channels/sig_pri.c b/channels/sig_pri.c
index e0e40725c..3c0f908ac 100644
--- a/channels/sig_pri.c
+++ b/channels/sig_pri.c
@@ -1395,12 +1395,12 @@ static int pri_fixup_principle(struct sig_pri_span *pri, int principle, q931_cal
sig_pri_lock_private(new_chan);
ast_verb(3, "Moving call (%s) from channel %d to %d.\n",
- old_chan->owner ? old_chan->owner->name : "",
+ old_chan->owner ? ast_channel_name(old_chan->owner) : "",
old_chan->channel, new_chan->channel);
if (!sig_pri_is_chan_available(new_chan)) {
ast_log(LOG_WARNING,
"Can't move call (%s) from channel %d to %d. It is already in use.\n",
- old_chan->owner ? old_chan->owner->name : "",
+ old_chan->owner ? ast_channel_name(old_chan->owner) : "",
old_chan->channel, new_chan->channel);
sig_pri_unlock_private(new_chan);
if (old_chan->owner) {
@@ -1802,10 +1802,10 @@ static void *do_idle_thread(void *v_pvt)
/* Wait up to 30 seconds for an answer */
int newms, ms = 30000;
- ast_verb(3, "Initiating idle call on channel %s\n", chan->name);
+ ast_verb(3, "Initiating idle call on channel %s\n", ast_channel_name(chan));
snprintf(ex, sizeof(ex), "%d/%s", pvt->channel, pvt->pri->idledial);
if (ast_call(chan, ex, 0)) {
- ast_log(LOG_WARNING, "Idle dial failed on '%s' to '%s'\n", chan->name, ex);
+ ast_log(LOG_WARNING, "Idle dial failed on '%s' to '%s'\n", ast_channel_name(chan), ex);
ast_hangup(chan);
return NULL;
}
@@ -1822,15 +1822,15 @@ static void *do_idle_thread(void *v_pvt)
ast_copy_string(chan->exten, pvt->pri->idleext, sizeof(chan->exten));
ast_copy_string(chan->context, pvt->pri->idlecontext, sizeof(chan->context));
chan->priority = 1;
- ast_verb(4, "Idle channel '%s' answered, sending to %s@%s\n", chan->name, chan->exten, chan->context);
+ ast_verb(4, "Idle channel '%s' answered, sending to %s@%s\n", ast_channel_name(chan), chan->exten, chan->context);
ast_pbx_run(chan);
/* It's already hungup, return immediately */
return NULL;
case AST_CONTROL_BUSY:
- ast_verb(4, "Idle channel '%s' busy, waiting...\n", chan->name);
+ ast_verb(4, "Idle channel '%s' busy, waiting...\n", ast_channel_name(chan));
break;
case AST_CONTROL_CONGESTION:
- ast_verb(4, "Idle channel '%s' congested, waiting...\n", chan->name);
+ ast_verb(4, "Idle channel '%s' congested, waiting...\n", ast_channel_name(chan));
break;
};
}
@@ -1861,12 +1861,12 @@ static void *pri_ss_thread(void *data)
* even get started here, abort safely.
*/
if (!chan->tech_pvt) {
- ast_log(LOG_WARNING, "Channel became a zombie before simple switch could be started (%s)\n", chan->name);
+ ast_log(LOG_WARNING, "Channel became a zombie before simple switch could be started (%s)\n", ast_channel_name(chan));
ast_hangup(chan);
return NULL;
}
- ast_verb(3, "Starting simple switch on '%s'\n", chan->name);
+ ast_verb(3, "Starting simple switch on '%s'\n", ast_channel_name(chan));
sig_pri_dsp_reset_and_flush_digits(p);
@@ -2216,7 +2216,7 @@ static void sig_pri_mcid_event(struct sig_pri_span *pri, const struct pri_subcmd
*/
ast_queue_control(owner, AST_CONTROL_MCID);
- ast_str_append(&msg, 0, "Channel: %s\r\n", owner->name);
+ ast_str_append(&msg, 0, "Channel: %s\r\n", ast_channel_name(owner));
ast_str_append(&msg, 0, "UniqueID: %s\r\n", owner->uniqueid);
sig_pri_event_party_id(&msg, "CallerID", &owner->connected.id);
@@ -2405,7 +2405,7 @@ static int sig_pri_attempt_transfer(struct sig_pri_span *pri, q931_call *call_1_
return -1;
}
- ast_verb(3, "TRANSFERRING %s to %s\n", call_1->ast->name, call_2->ast->name);
+ ast_verb(3, "TRANSFERRING %s to %s\n", ast_channel_name(call_1->ast), ast_channel_name(call_2->ast));
/*
* Setup transfer masquerade.
@@ -3769,7 +3769,7 @@ static void sig_pri_send_aoce_termination_request(struct sig_pri_span *pri, int
pvt->waiting_for_aoce = 1;
ast_channel_setwhentohangup_tv(pvt->owner, whentohangup);
- ast_debug(1, "Delaying hangup on %s for aoc-e msg\n", pvt->owner->name);
+ ast_debug(1, "Delaying hangup on %s for aoc-e msg\n", ast_channel_name(pvt->owner));
cleanup_termination_request:
ast_channel_unlock(pvt->owner);
@@ -4175,14 +4175,14 @@ static void sig_pri_handle_subcmds(struct sig_pri_span *pri, int chanpos, int ev
if (!call_rsp) {
ast_log(LOG_WARNING,
"Span %d: %s tried CallRerouting/CallDeflection to '%s' without call!\n",
- pri->span, owner->name, subcmd->u.rerouting.deflection.to.number.str);
+ pri->span, ast_channel_name(owner), subcmd->u.rerouting.deflection.to.number.str);
ast_channel_unlock(owner);
break;
}
if (ast_strlen_zero(subcmd->u.rerouting.deflection.to.number.str)) {
ast_log(LOG_WARNING,
"Span %d: %s tried CallRerouting/CallDeflection to empty number!\n",
- pri->span, owner->name);
+ pri->span, ast_channel_name(owner));
pri_rerouting_rsp(pri->pri, call_rsp, subcmd->u.rerouting.invoke_id,
PRI_REROUTING_RSP_INVALID_NUMBER);
ast_channel_unlock(owner);
@@ -4190,7 +4190,7 @@ static void sig_pri_handle_subcmds(struct sig_pri_span *pri, int chanpos, int ev
}
ast_verb(3, "Span %d: %s is CallRerouting/CallDeflection to '%s'.\n",
- pri->span, owner->name, subcmd->u.rerouting.deflection.to.number.str);
+ pri->span, ast_channel_name(owner), subcmd->u.rerouting.deflection.to.number.str);
/*
* Send back positive ACK to CallRerouting/CallDeflection.
@@ -5042,7 +5042,7 @@ static void sig_pri_moh_fsm_event(struct ast_channel *chan, struct sig_pri_chan
const char *chan_name;
if (chan) {
- chan_name = ast_strdupa(chan->name);
+ chan_name = ast_strdupa(ast_channel_name(chan));
} else {
chan_name = "Unknown";
}
@@ -5080,7 +5080,7 @@ static void sig_pri_ami_hold_event(struct ast_channel *chan, int is_held)
"Channel: %s\r\n"
"Uniqueid: %s\r\n",
is_held ? "On" : "Off",
- chan->name,
+ ast_channel_name(chan),
chan->uniqueid);
}
#endif /* defined(HAVE_PRI_CALL_HOLD) */
@@ -5515,7 +5515,7 @@ static void *pri_dchannel(void *vpri)
if (idle) {
pri->pvts[nextidle]->isidlecall = 1;
if (ast_pthread_create_background(&p, NULL, do_idle_thread, pri->pvts[nextidle])) {
- ast_log(LOG_WARNING, "Unable to start new thread for idle channel '%s'\n", idle->name);
+ ast_log(LOG_WARNING, "Unable to start new thread for idle channel '%s'\n", ast_channel_name(idle));
ast_mutex_unlock(&pri->lock);
ast_hangup(idle);
ast_mutex_lock(&pri->lock);
@@ -7405,7 +7405,7 @@ int sig_pri_call(struct sig_pri_chan *p, struct ast_channel *ast, char *rdest, i
}
if ((ast->_state != AST_STATE_DOWN) && (ast->_state != AST_STATE_RESERVED)) {
- ast_log(LOG_WARNING, "sig_pri_call called on %s, neither down nor reserved\n", ast->name);
+ ast_log(LOG_WARNING, "sig_pri_call called on %s, neither down nor reserved\n", ast_channel_name(ast));
return -1;
}
@@ -7846,7 +7846,7 @@ int sig_pri_indicate(struct sig_pri_chan *p, struct ast_channel *chan, int condi
}
break;
case AST_CONTROL_PROCEEDING:
- ast_debug(1, "Received AST_CONTROL_PROCEEDING on %s\n",chan->name);
+ ast_debug(1, "Received AST_CONTROL_PROCEEDING on %s\n",ast_channel_name(chan));
if (p->call_level < SIG_PRI_CALL_LEVEL_PROCEEDING && !p->outgoing) {
p->call_level = SIG_PRI_CALL_LEVEL_PROCEEDING;
if (p->pri && p->pri->pri) {
@@ -7863,7 +7863,7 @@ int sig_pri_indicate(struct sig_pri_chan *p, struct ast_channel *chan, int condi
res = 0;
break;
case AST_CONTROL_PROGRESS:
- ast_debug(1, "Received AST_CONTROL_PROGRESS on %s\n",chan->name);
+ ast_debug(1, "Received AST_CONTROL_PROGRESS on %s\n",ast_channel_name(chan));
sig_pri_set_digital(p, 0); /* Digital-only calls isn't allowing any inband progress messages */
if (!p->progress && p->call_level < SIG_PRI_CALL_LEVEL_ALERTING && !p->outgoing
&& !p->no_b_channel) {
@@ -7960,7 +7960,7 @@ int sig_pri_indicate(struct sig_pri_chan *p, struct ast_channel *chan, int condi
res = sig_pri_play_tone(p, -1);
break;
case AST_CONTROL_CONNECTED_LINE:
- ast_debug(1, "Received AST_CONTROL_CONNECTED_LINE on %s\n", chan->name);
+ ast_debug(1, "Received AST_CONTROL_CONNECTED_LINE on %s\n", ast_channel_name(chan));
if (p->pri) {
struct pri_party_connected_line connected;
int dialplan;
@@ -8009,7 +8009,7 @@ int sig_pri_indicate(struct sig_pri_chan *p, struct ast_channel *chan, int condi
}
break;
case AST_CONTROL_REDIRECTING:
- ast_debug(1, "Received AST_CONTROL_REDIRECTING on %s\n", chan->name);
+ ast_debug(1, "Received AST_CONTROL_REDIRECTING on %s\n", ast_channel_name(chan));
if (p->pri) {
pri_grab(p, p->pri);
sig_pri_redirecting_update(p, chan);
@@ -8021,7 +8021,7 @@ int sig_pri_indicate(struct sig_pri_chan *p, struct ast_channel *chan, int condi
{
struct ast_aoc_decoded *decoded
= ast_aoc_decode((struct ast_aoc_encoded *) data, datalen, chan);
- ast_debug(1, "Received AST_CONTROL_AOC on %s\n", chan->name);
+ ast_debug(1, "Received AST_CONTROL_AOC on %s\n", ast_channel_name(chan));
if (decoded && p->pri) {
pri_grab(p, p->pri);
switch (ast_aoc_get_msg_type(decoded)) {
@@ -8047,7 +8047,7 @@ int sig_pri_indicate(struct sig_pri_chan *p, struct ast_channel *chan, int condi
p->waiting_for_aoce = 0;
ast_debug(1,
"Received final AOC-E msg, continue with hangup on %s\n",
- chan->name);
+ ast_channel_name(chan));
ast_softhangup_nolock(chan, AST_SOFTHANGUP_DEV);
}
break;
@@ -8776,7 +8776,7 @@ void sig_pri_cli_show_channels(int fd, struct sig_pri_span *pri)
sig_pri_is_chan_available(pvt) ? "Yes" : "No",
sig_pri_call_level2str(pvt->call_level),
pvt->call ? "Yes" : "No",
- pvt->owner ? pvt->owner->name : "");
+ pvt->owner ? ast_channel_name(pvt->owner) : "");
if (pvt->owner) {
ast_channel_unlock(pvt->owner);
diff --git a/channels/sig_ss7.c b/channels/sig_ss7.c
index 616d6002a..a94188071 100644
--- a/channels/sig_ss7.c
+++ b/channels/sig_ss7.c
@@ -624,7 +624,7 @@ static void ss7_start_call(struct sig_ss7_chan *p, struct sig_ss7_linkset *links
ast_channel_unlock(c);
if (ast_pbx_start(c)) {
- ast_log(LOG_WARNING, "Unable to start PBX on %s (CIC %d)\n", c->name, p->cic);
+ ast_log(LOG_WARNING, "Unable to start PBX on %s (CIC %d)\n", ast_channel_name(c), p->cic);
ast_hangup(c);
} else {
ast_verb(3, "Accepting call to '%s' on CIC %d\n", p->exten, p->cic);
@@ -1679,7 +1679,7 @@ int sig_ss7_indicate(struct sig_ss7_chan *p, struct ast_channel *chan, int condi
}
break;
case AST_CONTROL_PROCEEDING:
- ast_debug(1,"Received AST_CONTROL_PROCEEDING on %s\n",chan->name);
+ ast_debug(1,"Received AST_CONTROL_PROCEEDING on %s\n",ast_channel_name(chan));
ss7_grab(p, p->ss7);
/* This IF sends the FAR for an answered ALEG call */
if (chan->_state == AST_STATE_UP && (p->rlt != 1)){
@@ -1697,7 +1697,7 @@ int sig_ss7_indicate(struct sig_ss7_chan *p, struct ast_channel *chan, int condi
res = 0;
break;
case AST_CONTROL_PROGRESS:
- ast_debug(1,"Received AST_CONTROL_PROGRESS on %s\n",chan->name);
+ ast_debug(1,"Received AST_CONTROL_PROGRESS on %s\n",ast_channel_name(chan));
ss7_grab(p, p->ss7);
if (!p->progress && p->call_level < SIG_SS7_CALL_LEVEL_ALERTING && !p->outgoing) {
p->progress = 1;/* No need to send inband-information progress again. */
@@ -1812,7 +1812,7 @@ void sig_ss7_cli_show_channels(int fd, struct sig_ss7_linkset *linkset)
pvt->remotelyblocked ? "Yes" : "No",
sig_ss7_call_level2str(pvt->call_level),
pvt->ss7call ? "Yes" : "No",
- pvt->owner ? pvt->owner->name : "");
+ pvt->owner ? ast_channel_name(pvt->owner) : "");
if (pvt->owner) {
ast_channel_unlock(pvt->owner);