}
if ((ast->_state != AST_STATE_DOWN) && (ast->_state != AST_STATE_RESERVED)) {
- ast_log(LOG_WARNING, "mbl_call called on %s, neither down nor reserved\n", ast->name);
+ ast_log(LOG_WARNING, "mbl_call called on %s, neither down nor reserved\n", ast_channel_name(ast));
return -1;
}
- ast_debug(1, "Calling %s on %s\n", dest, ast->name);
+ ast_debug(1, "Calling %s on %s\n", dest, ast_channel_name(ast));
ast_mutex_lock(&pvt->lock);
if (pvt->type == MBL_TYPE_PHONE) {
ast_setstate(ch, state);
if (state != AST_STATE_DOWN) {
if (ast_pbx_start(ch)) {
- ast_log(LOG_WARNING, "Unable to start PBX on %s\n", ch->name);
+ ast_log(LOG_WARNING, "Unable to start PBX on %s\n", ast_channel_name(ch));
ast_channel_unlock(ch);
ast_hangup(ch);
ch = NULL;
}
manager_event(EVENT_FLAG_SYSTEM, "ChannelUpdate", "Channel: %s\r\nChanneltype: %s\r\n"
- "CallRef: %d\r\n", ch->name, "OOH323", i->call_reference);
+ "CallRef: %d\r\n", ast_channel_name(ch), "OOH323", i->call_reference);
} else
ast_log(LOG_WARNING, "Unable to allocate channel structure\n");
if ((ast->_state != AST_STATE_DOWN) && (ast->_state != AST_STATE_RESERVED)) {
ast_log(LOG_WARNING, "ooh323_call called on %s, neither down nor "
- "reserved\n", ast->name);
+ "reserved\n", ast_channel_name(ast));
return -1;
}
ast_mutex_lock(&p->lock);
}
ast_setstate(ast, AST_STATE_UP);
if (option_debug)
- ast_debug(1, "ooh323_answer(%s)\n", ast->name);
+ ast_debug(1, "ooh323_answer(%s)\n", ast_channel_name(ast));
ast_channel_unlock(ast);
ooAnswerCall(p->callToken);
}
if (f->frametype == AST_FRAME_MODEM) {
ast_debug(1, "Send UDPTL %d/%d len %d for %s\n",
- f->frametype, f->subclass.integer, f->datalen, ast->name);
+ f->frametype, f->subclass.integer, f->datalen, ast_channel_name(ast));
if (p->udptl)
res = ast_udptl_write(p->udptl, f);
ast_mutex_unlock(&p->lock);
ast_mutex_lock(&p->lock);
if (gH323Debug)
- ast_verb(0, "----- ooh323_queryoption %d on channel %s\n", option, ast->name);
+ ast_verb(0, "----- ooh323_queryoption %d on channel %s\n", option, ast_channel_name(ast));
switch (option) {
cp = (char *) data;
*cp = p->vad ? 1 : 0;
ast_debug(1, "Reporting digit detection %sabled on %s\n",
- *cp ? "en" : "dis", ast->name);
+ *cp ? "en" : "dis", ast_channel_name(ast));
res = 0;
break;
}
if (gH323Debug)
- ast_verb(0, "+++++ ooh323_queryoption %d on channel %s\n", option, ast->name);
+ ast_verb(0, "+++++ ooh323_queryoption %d on channel %s\n", option, ast_channel_name(ast));
ast_mutex_unlock(&p->lock);
ast_queue_control(c, AST_CONTROL_ANSWER);
ast_channel_unlock(p->owner);
manager_event(EVENT_FLAG_SYSTEM,"ChannelUpdate","Channel: %s\r\nChanneltype: %s\r\n"
- "CallRef: %d\r\n", c->name, "OOH323", p->call_reference);
+ "CallRef: %d\r\n", ast_channel_name(c), "OOH323", p->call_reference);
}
ast_mutex_unlock(&p->lock);
ast_debug(1, "Failed to grab lock, trying again\n");
DEADLOCK_AVOIDANCE(&cur->lock);
}
- ast_debug(1, "Detaching from %s\n", cur->owner->name);
+ ast_debug(1, "Detaching from %s\n", ast_channel_name(cur->owner));
cur->owner->tech_pvt = NULL;
ast_channel_unlock(cur->owner);
cur->owner = NULL;
int mode;
if (gH323Debug)
- ast_verb(0, "--- ooh323_set_peer - %s\n", chan->name);
+ ast_verb(0, "--- ooh323_set_peer - %s\n", ast_channel_name(chan));
if (!rtp) {
return 0;
ast_sockaddr_set_port(&them, remotePort);
ast_udptl_set_peer(p->udptl, &them);
- ast_udptl_set_tag(p->udptl, "%s", p->owner->name);
+ ast_udptl_set_tag(p->udptl, "%s", ast_channel_name(p->owner));
p->t38_tx_enable = 1;
p->lastTxT38 = time(NULL);
if (p->t38support == T38_ENABLED) {
f = ast_udptl_read(p->udptl); /* UDPTL t.38 data */
if (gH323Debug) {
ast_debug(1, "Got UDPTL %d/%d len %d for %s\n",
- f->frametype, f->subclass.integer, f->datalen, ast->name);
+ f->frametype, f->subclass.integer, f->datalen, ast_channel_name(ast));
}
break;
if ((strcmp(p->owner->exten, "fax")) &&
(ast_exists_extension(p->owner, target_context, "fax", 1,
S_COR(p->owner->caller.id.number.valid, p->owner->caller.id.number.str, NULL)))) {
- ast_verb(2, "Redirecting '%s' to fax extension due to CNG detection\n", p->owner->name);
+ ast_verb(2, "Redirecting '%s' to fax extension due to CNG detection\n", ast_channel_name(p->owner));
pbx_builtin_setvar_helper(p->owner, "FAXEXTEN", p->owner->exten);
if (ast_async_goto(p->owner, target_context, "fax", 1)) {
- ast_log(LOG_NOTICE, "Failed to async goto '%s' into fax of '%s'\n", p->owner->name,target_context);
+ ast_log(LOG_NOTICE, "Failed to async goto '%s' into fax of '%s'\n", ast_channel_name(p->owner),target_context);
}
p->faxdetected = 1;
if (dfr) {
if ((strcmp(p->owner->exten, "fax")) &&
(ast_exists_extension(p->owner, target_context, "fax", 1,
S_COR(p->owner->caller.id.number.valid, p->owner->caller.id.number.str, NULL)))) {
- ast_verb(2, "Redirecting '%s' to fax extension due to CNG detection\n", p->owner->name);
+ ast_verb(2, "Redirecting '%s' to fax extension due to CNG detection\n", ast_channel_name(p->owner));
pbx_builtin_setvar_helper(p->owner, "FAXEXTEN", p->owner->exten);
if (ast_async_goto(p->owner, target_context, "fax", 1)) {
- ast_log(LOG_NOTICE, "Failed to async goto '%s' into fax of '%s'\n", p->owner->name,target_context);
+ ast_log(LOG_NOTICE, "Failed to async goto '%s' into fax of '%s'\n", ast_channel_name(p->owner),target_context);
}
}
p->faxdetected = 1;
if (ast_adsi_begin_download(chan, scr->desc, scr->fdn, scr->sec, scr->ver)) {
/* User rejected us for some reason */
ast_verb(3, "User rejected download attempt\n");
- ast_log(LOG_NOTICE, "User rejected download on channel %s\n", chan->name);
+ ast_log(LOG_NOTICE, "User rejected download on channel %s\n", ast_channel_name(chan));
ast_free(scr);
return -1;
}
if (ast_adsi_end_download(chan)) {
/* Download failed for some reason */
ast_verb(3, "Download attempt failed\n");
- ast_log(LOG_NOTICE, "Download failed on %s\n", chan->name);
+ ast_log(LOG_NOTICE, "Download failed on %s\n", ast_channel_name(chan));
ast_free(scr);
return -1;
}
break;
}
if (ast_write(chan, &wf)) {
- ast_verb(4, "AlarmReceiver: Failed to write frame on %s\n", chan->name);
- ast_log(LOG_WARNING, "AlarmReceiver Failed to write frame on %s\n",chan->name);
+ ast_verb(4, "AlarmReceiver: Failed to write frame on %s\n", ast_channel_name(chan));
+ ast_log(LOG_WARNING, "AlarmReceiver Failed to write frame on %s\n",ast_channel_name(chan));
res = -1;
ast_frfree(f);
break;
for (;;) {
/* if outa time, leave */
if (ast_tvdiff_ms(ast_tvnow(), lastdigittime) > ((i > 0) ? sdto : fdto)) {
- ast_verb(4, "AlarmReceiver: DTMF Digit Timeout on %s\n", chan->name);
- ast_debug(1,"AlarmReceiver: DTMF timeout on chan %s\n",chan->name);
+ ast_verb(4, "AlarmReceiver: DTMF Digit Timeout on %s\n", ast_channel_name(chan));
+ ast_debug(1,"AlarmReceiver: DTMF timeout on chan %s\n",ast_channel_name(chan));
res = 1;
break;
}
ast_verb(4, "AlarmReceiver: Setting read and write formats to ULAW\n");
if (ast_set_write_format_by_id(chan,AST_FORMAT_ULAW)) {
- ast_log(LOG_WARNING, "AlarmReceiver: Unable to set write format to Mu-law on %s\n",chan->name);
+ ast_log(LOG_WARNING, "AlarmReceiver: Unable to set write format to Mu-law on %s\n",ast_channel_name(chan));
return -1;
}
if (ast_set_read_format_by_id(chan,AST_FORMAT_ULAW)) {
- ast_log(LOG_WARNING, "AlarmReceiver: Unable to set read format to Mu-law on %s\n",chan->name);
+ ast_log(LOG_WARNING, "AlarmReceiver: Unable to set read format to Mu-law on %s\n",ast_channel_name(chan));
return -1;
}
);
ast_format_clear(&readFormat);
- ast_verb(3, "AMD: %s %s %s (Fmt: %s)\n", chan->name,
+ ast_verb(3, "AMD: %s %s %s (Fmt: %s)\n", ast_channel_name(chan),
S_COR(chan->caller.ani.number.valid, chan->caller.ani.number.str, "(N/A)"),
S_COR(chan->redirecting.from.number.valid, chan->redirecting.from.number.str, "(N/A)"),
ast_getformatname(&chan->readformat));
/* Set read format to signed linear so we get signed linear frames in */
ast_format_copy(&readFormat, &chan->readformat);
if (ast_set_read_format_by_id(chan, AST_FORMAT_SLINEAR) < 0 ) {
- ast_log(LOG_WARNING, "AMD: Channel [%s]. Unable to set to linear mode, giving up\n", chan->name );
+ ast_log(LOG_WARNING, "AMD: Channel [%s]. Unable to set to linear mode, giving up\n", ast_channel_name(chan));
pbx_builtin_setvar_helper(chan , "AMDSTATUS", "");
pbx_builtin_setvar_helper(chan , "AMDCAUSE", "");
return;
/* Create a new DSP that will detect the silence */
if (!(silenceDetector = ast_dsp_new())) {
- ast_log(LOG_WARNING, "AMD: Channel [%s]. Unable to create silence detector :(\n", chan->name );
+ ast_log(LOG_WARNING, "AMD: Channel [%s]. Unable to create silence detector :(\n", ast_channel_name(chan));
pbx_builtin_setvar_helper(chan , "AMDSTATUS", "");
pbx_builtin_setvar_helper(chan , "AMDCAUSE", "");
return;
/* If we fail to read in a frame, that means they hung up */
if (!(f = ast_read(chan))) {
- ast_verb(3, "AMD: Channel [%s]. HANGUP\n", chan->name);
+ ast_verb(3, "AMD: Channel [%s]. HANGUP\n", ast_channel_name(chan));
ast_debug(1, "Got hangup\n");
strcpy(amdStatus, "HANGUP");
res = 1;
iTotalTime += framelength;
if (iTotalTime >= totalAnalysisTime) {
- ast_verb(3, "AMD: Channel [%s]. Too long...\n", chan->name );
+ ast_verb(3, "AMD: Channel [%s]. Too long...\n", ast_channel_name(chan));
ast_frfree(f);
strcpy(amdStatus , "NOTSURE");
sprintf(amdCause , "TOOLONG-%d", iTotalTime);
if (silenceDuration >= betweenWordsSilence) {
if (currentState != STATE_IN_SILENCE ) {
- ast_verb(3, "AMD: Channel [%s]. Changed state to STATE_IN_SILENCE\n", chan->name);
+ ast_verb(3, "AMD: Channel [%s]. Changed state to STATE_IN_SILENCE\n", ast_channel_name(chan));
}
/* Find words less than word duration */
if (consecutiveVoiceDuration < minimumWordLength && consecutiveVoiceDuration > 0){
- ast_verb(3, "AMD: Channel [%s]. Short Word Duration: %d\n", chan->name, consecutiveVoiceDuration);
+ ast_verb(3, "AMD: Channel [%s]. Short Word Duration: %d\n", ast_channel_name(chan), consecutiveVoiceDuration);
}
currentState = STATE_IN_SILENCE;
consecutiveVoiceDuration = 0;
if (inInitialSilence == 1 && silenceDuration >= initialSilence) {
ast_verb(3, "AMD: Channel [%s]. ANSWERING MACHINE: silenceDuration:%d initialSilence:%d\n",
- chan->name, silenceDuration, initialSilence);
+ ast_channel_name(chan), silenceDuration, initialSilence);
ast_frfree(f);
strcpy(amdStatus , "MACHINE");
sprintf(amdCause , "INITIALSILENCE-%d-%d", silenceDuration, initialSilence);
if (silenceDuration >= afterGreetingSilence && inGreeting == 1) {
ast_verb(3, "AMD: Channel [%s]. HUMAN: silenceDuration:%d afterGreetingSilence:%d\n",
- chan->name, silenceDuration, afterGreetingSilence);
+ ast_channel_name(chan), silenceDuration, afterGreetingSilence);
ast_frfree(f);
strcpy(amdStatus , "HUMAN");
sprintf(amdCause , "HUMAN-%d-%d", silenceDuration, afterGreetingSilence);
number of words if my previous state was Silence, which means that I moved into a word. */
if (consecutiveVoiceDuration >= minimumWordLength && currentState == STATE_IN_SILENCE) {
iWordsCount++;
- ast_verb(3, "AMD: Channel [%s]. Word detected. iWordsCount:%d\n", chan->name, iWordsCount);
+ ast_verb(3, "AMD: Channel [%s]. Word detected. iWordsCount:%d\n", ast_channel_name(chan), iWordsCount);
currentState = STATE_IN_WORD;
}
if (consecutiveVoiceDuration >= maximumWordLength){
- ast_verb(3, "AMD: Channel [%s]. Maximum Word Length detected. [%d]\n", chan->name, consecutiveVoiceDuration);
+ ast_verb(3, "AMD: Channel [%s]. Maximum Word Length detected. [%d]\n", ast_channel_name(chan), consecutiveVoiceDuration);
ast_frfree(f);
strcpy(amdStatus , "MACHINE");
sprintf(amdCause , "MAXWORDLENGTH-%d", consecutiveVoiceDuration);
break;
}
if (iWordsCount >= maximumNumberOfWords) {
- ast_verb(3, "AMD: Channel [%s]. ANSWERING MACHINE: iWordsCount:%d\n", chan->name, iWordsCount);
+ ast_verb(3, "AMD: Channel [%s]. ANSWERING MACHINE: iWordsCount:%d\n", ast_channel_name(chan), iWordsCount);
ast_frfree(f);
strcpy(amdStatus , "MACHINE");
sprintf(amdCause , "MAXWORDS-%d-%d", iWordsCount, maximumNumberOfWords);
}
if (inGreeting == 1 && voiceDuration >= greeting) {
- ast_verb(3, "AMD: Channel [%s]. ANSWERING MACHINE: voiceDuration:%d greeting:%d\n", chan->name, voiceDuration, greeting);
+ ast_verb(3, "AMD: Channel [%s]. ANSWERING MACHINE: voiceDuration:%d greeting:%d\n", ast_channel_name(chan), voiceDuration, greeting);
ast_frfree(f);
strcpy(amdStatus , "MACHINE");
sprintf(amdCause , "LONGGREETING-%d-%d", voiceDuration, greeting);
if (voiceDuration >= minimumWordLength ) {
if (silenceDuration > 0)
- ast_verb(3, "AMD: Channel [%s]. Detected Talk, previous silence duration: %d\n", chan->name, silenceDuration);
+ ast_verb(3, "AMD: Channel [%s]. Detected Talk, previous silence duration: %d\n", ast_channel_name(chan), silenceDuration);
silenceDuration = 0;
}
if (consecutiveVoiceDuration >= minimumWordLength && inGreeting == 0) {
/* Only go in here once to change the greeting flag when we detect the 1st word */
if (silenceDuration > 0)
- ast_verb(3, "AMD: Channel [%s]. Before Greeting Time: silenceDuration: %d voiceDuration: %d\n", chan->name, silenceDuration, voiceDuration);
+ ast_verb(3, "AMD: Channel [%s]. Before Greeting Time: silenceDuration: %d voiceDuration: %d\n", ast_channel_name(chan), silenceDuration, voiceDuration);
inInitialSilence = 0;
inGreeting = 1;
}
if (!res) {
/* It took too long to get a frame back. Giving up. */
- ast_verb(3, "AMD: Channel [%s]. Too long...\n", chan->name);
+ ast_verb(3, "AMD: Channel [%s]. Too long...\n", ast_channel_name(chan));
strcpy(amdStatus , "NOTSURE");
sprintf(amdCause , "TOOLONG-%d", iTotalTime);
}
/* Restore channel read format */
if (readFormat.id && ast_set_read_format(chan, &readFormat))
- ast_log(LOG_WARNING, "AMD: Unable to restore read format on '%s'\n", chan->name);
+ ast_log(LOG_WARNING, "AMD: Unable to restore read format on '%s'\n", ast_channel_name(chan));
/* Free the DSP used to detect silence */
ast_dsp_free(silenceDetector);
snprintf(tmp, sizeof(tmp), "%d", status);
ast_str_append(&tmp_availstat, 0, "%s%s", ast_str_strlen(tmp_availstat) ? "&" : "", tmp);
if ((inuse <= 1) && (tempchan = ast_request(tech, chan->nativeformats, chan, number, &status))) {
- ast_str_append(&tmp_availchan, 0, "%s%s", ast_str_strlen(tmp_availchan) ? "&" : "", tempchan->name);
+ ast_str_append(&tmp_availchan, 0, "%s%s", ast_str_strlen(tmp_availchan) ? "&" : "", ast_channel_name(tempchan));
snprintf(tmp, sizeof(tmp), "%s/%s", tech, number);
ast_str_append(&tmp_availorig, 0, "%s%s", ast_str_strlen(tmp_availorig) ? "&" : "", tmp);
int res = 0;
struct ast_channel *peer = NULL;
- ast_log(LOG_NOTICE, "Attaching %s to %s\n", spychan_name, autochan->chan->name);
+ ast_log(LOG_NOTICE, "Attaching %s to %s\n", spychan_name, ast_channel_name(autochan->chan));
ast_set_flag(audiohook, AST_AUDIOHOOK_TRIGGER_SYNC | AST_AUDIOHOOK_SMALL_QUEUE);
res = ast_audiohook_attach(autochan->chan, audiohook);
struct ast_channel *chans[] = { chan, spyee_autochan->chan };
ast_channel_lock(chan);
- spyer_name = ast_strdupa(chan->name);
+ spyer_name = ast_strdupa(ast_channel_name(chan));
ast_channel_unlock(chan);
/* We now hold the channel lock on spyee */
}
ast_channel_lock(spyee_autochan->chan);
- name = ast_strdupa(spyee_autochan->chan->name);
+ name = ast_strdupa(ast_channel_name(spyee_autochan->chan));
ast_channel_unlock(spyee_autochan->chan);
ast_verb(2, "Spying on channel %s\n", name);
(*volfactor)++;
if (*volfactor > 4)
*volfactor = -4;
- ast_verb(3, "Setting spy volume on %s to %d\n", chan->name, *volfactor);
+ ast_verb(3, "Setting spy volume on %s to %d\n", ast_channel_name(chan), *volfactor);
csth.volfactor = *volfactor;
csth.spy_audiohook.options.read_volume = csth.volfactor;
return NULL;
}
- if (!strncmp(next->name, "DAHDI/pseudo", pseudo_len)) {
+ if (!strncmp(ast_channel_name(next), "DAHDI/pseudo", pseudo_len)) {
goto redo;
} else if (next == chan) {
goto redo;
snprintf(buffer, sizeof(buffer) - 1, ":%s:", myenforced);
- ast_copy_string(ext + 1, autochan->chan->name, sizeof(ext) - 1);
+ ast_copy_string(ext + 1, ast_channel_name(autochan->chan), sizeof(ext) - 1);
if ((end = strchr(ext, '-'))) {
*end++ = ':';
*end = '\0';
}
strcpy(peer_name, "spy-");
- strncat(peer_name, autochan->chan->name, AST_NAME_STRLEN - 4 - 1);
+ strncat(peer_name, ast_channel_name(autochan->chan), AST_NAME_STRLEN - 4 - 1);
ptr = strchr(peer_name, '/');
*ptr++ = '\0';
ptr = strsep(&ptr, "-");
"Conference: %s\r\n"
"CallerIDnum: %s\r\n"
"CallerIDname: %s\r\n",
- chan->name,
+ ast_channel_name(chan),
chan->uniqueid,
conf_name,
S_COR(chan->caller.id.number.valid, chan->caller.id.number.str, "<unknown>"),
"Conference: %s\r\n"
"CallerIDnum: %s\r\n"
"CallerIDname: %s\r\n",
- chan->name,
+ ast_channel_name(chan),
chan->uniqueid,
conf_name,
S_COR(chan->caller.id.number.valid, chan->caller.id.number.str, "<unknown>"),
ast_say_number(conference_bridge->playback_chan, say_number, "", conference_bridge->playback_chan->language, NULL);
}
- ast_debug(1, "Departing underlying channel '%s' from bridge '%p'\n", underlying_channel->name, conference_bridge->bridge);
+ ast_debug(1, "Departing underlying channel '%s' from bridge '%p'\n", ast_channel_name(underlying_channel), conference_bridge->bridge);
ast_bridge_depart(conference_bridge->bridge, underlying_channel);
ast_mutex_unlock(&conference_bridge->playback_lock);
"Uniqueid: %s\r\n"
"Conference: %s\r\n"
"TalkingStatus: %s\r\n",
- bridge_channel->chan->name, bridge_channel->chan->uniqueid, conf_name, talking ? "on" : "off");
+ ast_channel_name(bridge_channel->chan), bridge_channel->chan->uniqueid, conf_name, talking ? "on" : "off");
}
static int conf_get_pin(struct ast_channel *chan, struct conference_bridge_user *conference_bridge_user)
/* Mute or unmute yourself, note we only allow manipulation if they aren't waiting for a marked user or if marked users exist */
if (!ast_test_flag(&conference_bridge_user->u_profile, USER_OPT_WAITMARKED) || conference_bridge->markedusers) {
conference_bridge_user->features.mute = (!conference_bridge_user->features.mute ? 1 : 0);
- ast_test_suite_event_notify("CONF_MUTE", "Message: participant %s %s\r\nConference: %s\r\nChannel: %s", chan->name, conference_bridge_user->features.mute ? "muted" : "unmuted", conference_bridge_user->b_profile.name, chan->name);
+ ast_test_suite_event_notify("CONF_MUTE", "Message: participant %s %s\r\nConference: %s\r\nChannel: %s", ast_channel_name(chan), conference_bridge_user->features.mute ? "muted" : "unmuted", conference_bridge_user->b_profile.name, ast_channel_name(chan));
}
return ast_stream_and_wait(chan, (conference_bridge_user->features.mute ?
conf_get_sound(CONF_SOUND_MUTED, conference_bridge_user->b_profile.sounds) :
conf_get_sound(CONF_SOUND_ERROR_MENU, conference_bridge_user->b_profile.sounds),
"");
ast_log(LOG_WARNING, "Only admin users can use the kick_last menu action. Channel %s of conf %s is not an admin.\n",
- bridge_channel->chan->name,
+ ast_channel_name(bridge_channel->chan),
conference_bridge->name);
return -1;
}
}
ao2_lock(bridge);
AST_LIST_TRAVERSE(&bridge->users_list, participant, list) {
- if (!strncmp(a->argv[3], participant->chan->name, strlen(participant->chan->name))) {
+ if (!strncmp(a->argv[3], ast_channel_name(participant->chan), strlen(ast_channel_name(participant->chan)))) {
break;
}
}
if (participant) {
- ast_cli(a->fd, "Kicking %s from confbridge %s\n", participant->chan->name, bridge->name);
+ ast_cli(a->fd, "Kicking %s from confbridge %s\n", ast_channel_name(participant->chan), bridge->name);
participant->kicked = 1;
ast_bridge_remove(bridge->bridge, participant->chan);
}
ast_cli(a->fd, "============================= ================ ================ ================ ================\n");
ao2_lock(bridge);
AST_LIST_TRAVERSE(&bridge->users_list, participant, list) {
- ast_cli(a->fd, "%-29s ", participant->chan->name);
+ ast_cli(a->fd, "%-29s ", ast_channel_name(participant->chan));
ast_cli(a->fd, "%-17s", participant->u_profile.name);
ast_cli(a->fd, "%-17s", participant->b_profile.name);
ast_cli(a->fd, "%-17s", participant->menu_name);
}
ao2_lock(bridge);
AST_LIST_TRAVERSE(&bridge->users_list, participant, list) {
- if (!strncmp(user, participant->chan->name, strlen(user))) {
+ if (!strncmp(user, ast_channel_name(participant->chan), strlen(user))) {
break;
}
}
if (participant) {
participant->features.mute = mute;
- ast_test_suite_event_notify("CONF_MUTE", "Message: participant %s %s\r\nConference: %s\r\nChannel: %s", participant->chan->name, participant->features.mute ? "muted" : "unmuted", bridge->b_profile.name, participant->chan->name);
+ ast_test_suite_event_notify("CONF_MUTE", "Message: participant %s %s\r\nConference: %s\r\nChannel: %s", ast_channel_name(participant->chan), participant->features.mute ? "muted" : "unmuted", bridge->b_profile.name, ast_channel_name(participant->chan));
} else {
res = -2;;
}
bridge->name,
S_COR(participant->chan->caller.id.number.valid, participant->chan->caller.id.number.str, "<unknown>"),
S_COR(participant->chan->caller.id.name.valid, participant->chan->caller.id.name.str, "<no name>"),
- participant->chan->name,
+ ast_channel_name(participant->chan),
ast_test_flag(&participant->u_profile, USER_OPT_ADMIN) ? "Yes" : "No",
ast_test_flag(&participant->u_profile, USER_OPT_MARKEDUSER) ? "Yes" : "No");
}
ao2_lock(bridge);
AST_LIST_TRAVERSE(&bridge->users_list, participant, list) {
- if (!strcasecmp(participant->chan->name, channel)) {
+ if (!strcasecmp(ast_channel_name(participant->chan), channel)) {
participant->kicked = 1;
ast_bridge_remove(bridge->bridge, participant->chan);
found = 1;
/* find channel and set as video src. */
ao2_lock(bridge);
AST_LIST_TRAVERSE(&bridge->users_list, participant, list) {
- if (!strncmp(channel, participant->chan->name, strlen(channel))) {
+ if (!strncmp(channel, ast_channel_name(participant->chan), strlen(channel))) {
ast_bridge_set_single_src_video_mode(bridge->bridge, participant->chan);
break;
}
/* Set it into U-law mode (write) */
if (ast_set_write_format_by_id(chan, AST_FORMAT_ULAW) < 0) {
- ast_log(LOG_WARNING, "Unable to set '%s' to write ulaw mode\n", chan->name);
+ ast_log(LOG_WARNING, "Unable to set '%s' to write ulaw mode\n", ast_channel_name(chan));
goto outrun;
}
/* Set it into U-law mode (read) */
if (ast_set_read_format_by_id(chan, AST_FORMAT_ULAW) < 0) {
- ast_log(LOG_WARNING, "Unable to set '%s' to read ulaw mode\n", chan->name);
+ ast_log(LOG_WARNING, "Unable to set '%s' to read ulaw mode\n", ast_channel_name(chan));
goto outrun;
}
ast_indicate(chan, -1);
close(fd);
goto outrun;
}
- ast_debug(1, "Placed channel %s in DAHDI channel %d monitor\n", chan->name, confno);
+ ast_debug(1, "Placed channel %s in DAHDI channel %d monitor\n", ast_channel_name(chan), confno);
for(;;) {
outfd = -1;
res = ioctl(chan->fds[0], DAHDI_GET_BUFINFO, &savebi);
if(res) {
- ast_log(LOG_WARNING, "Unable to check buffer policy on channel %s\n", chan->name);
+ ast_log(LOG_WARNING, "Unable to check buffer policy on channel %s\n", ast_channel_name(chan));
return;
}
if (!res) {
/* Check for hangup */
if (ast_check_hangup(chan) && !signalled) {
- ast_debug(1, "Channel '%s' hungup. Signalling RAS at %d to die...\n", chan->name, pid);
+ ast_debug(1, "Channel '%s' hungup. Signalling RAS at %d to die...\n", ast_channel_name(chan), pid);
kill(pid, SIGTERM);
signalled=1;
}
ast_log(LOG_WARNING, "wait4 returned %d: %s\n", res, strerror(errno));
}
if (WIFEXITED(status)) {
- ast_verb(3, "RAS on %s terminated with status %d\n", chan->name, WEXITSTATUS(status));
+ ast_verb(3, "RAS on %s terminated with status %d\n", ast_channel_name(chan), WEXITSTATUS(status));
} else if (WIFSIGNALED(status)) {
ast_verb(3, "RAS on %s terminated with signal %d\n",
- chan->name, WTERMSIG(status));
+ ast_channel_name(chan), WTERMSIG(status));
} else {
- ast_verb(3, "RAS on %s terminated weirdly.\n", chan->name);
+ ast_verb(3, "RAS on %s terminated weirdly.\n", ast_channel_name(chan));
}
/* Throw back into audio mode */
x = 1;
/* Restore saved values */
res = ioctl(chan->fds[0], DAHDI_SET_BUFINFO, &savebi);
if (res < 0) {
- ast_log(LOG_WARNING, "Unable to set buffer policy on channel %s\n", chan->name);
+ ast_log(LOG_WARNING, "Unable to set buffer policy on channel %s\n", ast_channel_name(chan));
}
break;
}
if (strcasecmp(chan->tech->type, "DAHDI")) {
/* If it's not a DAHDI channel, we're done. Wait a couple of
seconds and then hangup... */
- ast_verb(2, "Channel %s is not a DAHDI channel\n", chan->name);
+ ast_verb(2, "Channel %s is not a DAHDI channel\n", ast_channel_name(chan));
sleep(2);
} else {
memset(&dahdip, 0, sizeof(dahdip));
if (ioctl(chan->fds[0], DAHDI_GET_PARAMS, &dahdip)) {
ast_log(LOG_WARNING, "Unable to get DAHDI parameters\n");
} else if (dahdip.sigtype != DAHDI_SIG_CLEAR) {
- ast_verb(2, "Channel %s is not a clear channel\n", chan->name);
+ ast_verb(2, "Channel %s is not a clear channel\n", ast_channel_name(chan));
} else {
/* Everything should be okay. Run PPP. */
- ast_verb(3, "Starting RAS on %s\n", chan->name);
+ ast_verb(3, "Starting RAS on %s\n", ast_channel_name(chan));
/* Execute RAS */
run_ras(chan, args);
}
"UniqueID: %s\r\n"
"DestUniqueID: %s\r\n"
"Dialstring: %s\r\n",
- src->name, dst->name,
+ ast_channel_name(src), ast_channel_name(dst),
S_COR(src->caller.id.number.valid, src->caller.id.number.str, "<unknown>"),
S_COR(src->caller.id.name.valid, src->caller.id.name.str, "<unknown>"),
S_COR(src->connected.id.number.valid, src->connected.id.number.str, "<unknown>"),
"Channel: %s\r\n"
"UniqueID: %s\r\n"
"DialStatus: %s\r\n",
- src->name, src->uniqueid, dialstatus);
+ ast_channel_name(src), src->uniqueid, dialstatus);
}
/*!
ast_cel_report_event(in, AST_CEL_FORWARD, NULL, c->call_forward, NULL);
/* Before processing channel, go ahead and check for forwarding */
- ast_verb(3, "Now forwarding %s to '%s/%s' (thanks to %s)\n", in->name, tech, stuff, c->name);
+ ast_verb(3, "Now forwarding %s to '%s/%s' (thanks to %s)\n", ast_channel_name(in), tech, stuff, ast_channel_name(c));
/* If we have been told to ignore forwards, just set this channel to null and continue processing extensions normally */
if (ast_test_flag64(peerflags, OPT_IGNORE_FORWARDING)) {
- ast_verb(3, "Forwarding %s to '%s/%s' prevented.\n", in->name, tech, stuff);
+ ast_verb(3, "Forwarding %s to '%s/%s' prevented.\n", ast_channel_name(in), tech, stuff);
c = o->chan = NULL;
cause = AST_CAUSE_BUSY;
} else {
* any Dial operations that happen later won't record CC interfaces.
*/
ast_ignore_cc(o->chan);
- ast_log(LOG_NOTICE, "Not accepting call completion offers from call-forward recipient %s\n", o->chan->name);
+ ast_log(LOG_NOTICE, "Not accepting call completion offers from call-forward recipient %s\n", ast_channel_name(o->chan));
} else
ast_log(LOG_NOTICE,
"Forwarding failed to create channel to dial '%s/%s' (cause = %d)\n",
continue;
if (ast_test_flag64(o, DIAL_STILLGOING) && c->_state == AST_STATE_UP) {
if (!peer) {
- ast_verb(3, "%s answered %s\n", c->name, in->name);
+ ast_verb(3, "%s answered %s\n", ast_channel_name(c), ast_channel_name(in));
if (!single && !ast_test_flag64(peerflags, OPT_IGNORE_CONNECTEDLINE)) {
if (o->pending_connected_update) {
if (ast_channel_connected_line_macro(c, in, &o->connected, 1, 0)) {
case AST_CONTROL_ANSWER:
/* This is our guy if someone answered. */
if (!peer) {
- ast_verb(3, "%s answered %s\n", c->name, in->name);
+ ast_verb(3, "%s answered %s\n", ast_channel_name(c), ast_channel_name(in));
if (!single && !ast_test_flag64(peerflags, OPT_IGNORE_CONNECTEDLINE)) {
if (o->pending_connected_update) {
if (ast_channel_connected_line_macro(c, in, &o->connected, 1, 0)) {
c->hangupcause = AST_CAUSE_NORMAL_CLEARING;
break;
case AST_CONTROL_BUSY:
- ast_verb(3, "%s is busy\n", c->name);
+ ast_verb(3, "%s is busy\n", ast_channel_name(c));
in->hangupcause = c->hangupcause;
ast_hangup(c);
c = o->chan = NULL;
handle_cause(AST_CAUSE_BUSY, &num);
break;
case AST_CONTROL_CONGESTION:
- ast_verb(3, "%s is circuit-busy\n", c->name);
+ ast_verb(3, "%s is circuit-busy\n", ast_channel_name(c));
in->hangupcause = c->hangupcause;
ast_hangup(c);
c = o->chan = NULL;
*/
++num_ringing;
if (ignore_cc || cc_frame_received || num_ringing == numlines) {
- ast_verb(3, "%s is ringing\n", c->name);
+ ast_verb(3, "%s is ringing\n", ast_channel_name(c));
/* Setup early media if appropriate */
if (single && CAN_EARLY_BRIDGE(peerflags, in, c))
ast_channel_early_bridge(in, c);
}
break;
case AST_CONTROL_PROGRESS:
- ast_verb(3, "%s is making progress passing it to %s\n", c->name, in->name);
+ ast_verb(3, "%s is making progress passing it to %s\n", ast_channel_name(c), ast_channel_name(in));
/* Setup early media if appropriate */
if (single && CAN_EARLY_BRIDGE(peerflags, in, c))
ast_channel_early_bridge(in, c);
}
break;
case AST_CONTROL_VIDUPDATE:
- ast_verb(3, "%s requested a video update, passing it to %s\n", c->name, in->name);
+ ast_verb(3, "%s requested a video update, passing it to %s\n", ast_channel_name(c), ast_channel_name(in));
ast_indicate(in, AST_CONTROL_VIDUPDATE);
break;
case AST_CONTROL_SRCUPDATE:
- ast_verb(3, "%s requested a source update, passing it to %s\n", c->name, in->name);
+ ast_verb(3, "%s requested a source update, passing it to %s\n", ast_channel_name(c), ast_channel_name(in));
ast_indicate(in, AST_CONTROL_SRCUPDATE);
break;
case AST_CONTROL_CONNECTED_LINE:
if (ast_test_flag64(peerflags, OPT_IGNORE_CONNECTEDLINE)) {
- ast_verb(3, "Connected line update to %s prevented.\n", in->name);
+ ast_verb(3, "Connected line update to %s prevented.\n", ast_channel_name(in));
} else if (!single) {
struct ast_party_connected_line connected;
- ast_verb(3, "%s connected line has changed. Saving it until answer for %s\n", c->name, in->name);
+ ast_verb(3, "%s connected line has changed. Saving it until answer for %s\n", ast_channel_name(c), ast_channel_name(in));
ast_party_connected_line_set_init(&connected, &o->connected);
ast_connected_line_parse_data(f->data.ptr, f->datalen, &connected);
ast_party_connected_line_set(&o->connected, &connected, NULL);
break;
case AST_CONTROL_REDIRECTING:
if (ast_test_flag64(peerflags, OPT_IGNORE_CONNECTEDLINE)) {
- ast_verb(3, "Redirecting update to %s prevented.\n", in->name);
+ ast_verb(3, "Redirecting update to %s prevented.\n", ast_channel_name(in));
} else if (single) {
- ast_verb(3, "%s redirecting info has changed, passing it to %s\n", c->name, in->name);
+ ast_verb(3, "%s redirecting info has changed, passing it to %s\n", ast_channel_name(c), ast_channel_name(in));
if (ast_channel_redirecting_macro(c, in, f, 1, 1)) {
ast_indicate_data(in, AST_CONTROL_REDIRECTING, f->data.ptr, f->datalen);
}
}
break;
case AST_CONTROL_PROCEEDING:
- ast_verb(3, "%s is proceeding passing it to %s\n", c->name, in->name);
+ ast_verb(3, "%s is proceeding passing it to %s\n", ast_channel_name(c), ast_channel_name(in));
if (single && CAN_EARLY_BRIDGE(peerflags, in, c))
ast_channel_early_bridge(in, c);
if (!ast_test_flag64(outgoing, OPT_RINGBACK))
ast_indicate(in, AST_CONTROL_PROCEEDING);
break;
case AST_CONTROL_HOLD:
- ast_verb(3, "Call on %s placed on hold\n", c->name);
+ ast_verb(3, "Call on %s placed on hold\n", ast_channel_name(c));
ast_indicate(in, AST_CONTROL_HOLD);
break;
case AST_CONTROL_UNHOLD:
- ast_verb(3, "Call on %s left from hold\n", c->name);
+ ast_verb(3, "Call on %s left from hold\n", ast_channel_name(c));
ast_indicate(in, AST_CONTROL_UNHOLD);
break;
case AST_CONTROL_OFFHOOK:
break;
case -1:
if (!ast_test_flag64(outgoing, OPT_RINGBACK | OPT_MUSICBACK)) {
- ast_verb(3, "%s stopped sounds\n", c->name);
+ ast_verb(3, "%s stopped sounds\n", ast_channel_name(c));
ast_indicate(in, -1);
pa->sentringing = 0;
}
case AST_CONTROL_VIDUPDATE:
case AST_CONTROL_SRCUPDATE:
ast_verb(3, "%s requested special control %d, passing it to %s\n",
- in->name, f->subclass.integer, o->chan->name);
+ ast_channel_name(in), f->subclass.integer, ast_channel_name(o->chan));
ast_indicate_data(o->chan, f->subclass.integer, f->data.ptr, f->datalen);
break;
case AST_CONTROL_CONNECTED_LINE:
} else {
char *tnam, *tn2;
- tnam = ast_strdupa(chan->name);
+ tnam = ast_strdupa(ast_channel_name(chan));
/* clean the channel name so slashes don't try to end up in disk file name */
for (tn2 = tnam; *tn2; tn2++) {
if (*tn2 == '/') /* any other chars to be afraid of? */
/* Save the info in cdr's that we called them */
if (chan->cdr)
- ast_cdr_setdestchan(chan->cdr, tc->name);
+ ast_cdr_setdestchan(chan->cdr, ast_channel_name(tc));
/* check the results of ast_call */
if (res) {
outgoing = NULL;
/* If appropriate, log that we have a destination channel and set the answer time */
if (chan->cdr) {
- ast_cdr_setdestchan(chan->cdr, peer->name);
+ ast_cdr_setdestchan(chan->cdr, ast_channel_name(peer));
ast_cdr_setanswer(chan->cdr, peer->cdr->answer);
}
- if (peer->name)
- pbx_builtin_setvar_helper(chan, "DIALEDPEERNAME", peer->name);
+ if (ast_channel_name(peer))
+ pbx_builtin_setvar_helper(chan, "DIALEDPEERNAME", ast_channel_name(peer));
ast_channel_lock(peer);
number = pbx_builtin_getvar_helper(peer, "DIALEDPEERNUMBER");
/* Make sure channels are compatible */
res = ast_channel_make_compatible(chan, peer);
if (res < 0) {
- ast_log(LOG_WARNING, "Had to drop call because I couldn't make %s compatible with %s\n", chan->name, peer->name);
+ ast_log(LOG_WARNING, "Had to drop call because I couldn't make %s compatible with %s\n", ast_channel_name(chan), ast_channel_name(peer));
ast_hangup(peer);
res = -1;
goto done;
if (found && res9) {
/* Something bad happened, or a hangup has been requested. */
- ast_debug(1, "Spawn extension (%s,%s,%d) exited non-zero on '%s'\n", peer->context, peer->exten, peer->priority, peer->name);
- ast_verb(2, "Spawn extension (%s, %s, %d) exited non-zero on '%s'\n", peer->context, peer->exten, peer->priority, peer->name);
+ ast_debug(1, "Spawn extension (%s,%s,%d) exited non-zero on '%s'\n", peer->context, peer->exten, peer->priority, ast_channel_name(peer));
+ ast_verb(2, "Spawn extension (%s, %s, %d) exited non-zero on '%s'\n", peer->context, peer->exten, peer->priority, ast_channel_name(peer));
}
ast_set2_flag(peer, autoloopflag, AST_FLAG_IN_AUTOLOOP); /* set it back the way it was */
}
struct pickup_by_name_args *args = data;
ast_channel_lock(target);
- if (!strncasecmp(target->name, args->name, args->len) && ast_can_pickup(target)) {
+ if (!strncasecmp(ast_channel_name(target), args->name, args->len) && ast_can_pickup(target)) {
/* Return with the channel still locked on purpose */
return CMP_MATCH | CMP_STOP;
}
while ((target = ast_channel_iterator_next(iter))) {
ast_channel_lock(target);
if ((chan != target) && ast_can_pickup(target)) {
- ast_log(LOG_NOTICE, "%s pickup by %s\n", target->name, chan->name);
+ ast_log(LOG_NOTICE, "%s pickup by %s\n", ast_channel_name(target), ast_channel_name(chan));
break;
}
ast_channel_unlock(target);
/* The found channel is already locked. */
target = ast_channel_callback(find_channel_by_group, NULL, chan, 0);
if (target) {
- ast_log(LOG_NOTICE, "pickup %s attempt by %s\n", target->name, chan->name);
+ ast_log(LOG_NOTICE, "pickup %s attempt by %s\n", ast_channel_name(target), ast_channel_name(chan));
res = ast_do_pickup(chan, target);
ast_channel_unlock(target);
target = ast_channel_unref(target);
int len = strlen(part);
ast_channel_lock(target);
- if (len <= strlen(target->name) && !strncmp(target->name, part, len)
+ if (len <= strlen(ast_channel_name(target)) && !strncmp(ast_channel_name(target), part, len)
&& ast_can_pickup(target)) {
/* Return with the channel still locked on purpose */
return CMP_MATCH | CMP_STOP;
/* Parse channel */
while (!ast_strlen_zero(args.channel) && (pickup = strsep(&args.channel, "&"))) {
- if (!strncasecmp(chan->name, pickup, strlen(pickup))) {
+ if (!strncasecmp(ast_channel_name(chan), pickup, strlen(pickup))) {
ast_log(LOG_NOTICE, "Cannot pickup your own channel %s.\n", pickup);
} else {
if (partial_pickup) {
/* if outa time, give em reorder */
if (ast_tvdiff_ms(ast_tvnow(), lastdigittime) > ((k&2) ? digittimeout : firstdigittimeout)) {
ast_debug(1,"DISA %s entry timeout on chan %s\n",
- ((k&1) ? "extension" : "password"),chan->name);
+ ((k&1) ? "extension" : "password"),ast_channel_name(chan));
break;
}
if (sscanf(args.passcode,"%30d",&j) < 1) { /* nope, it must be a filename */
fp = fopen(args.passcode,"r");
if (!fp) {
- ast_log(LOG_WARNING,"DISA password file %s not found on chan %s\n",args.passcode,chan->name);
+ ast_log(LOG_WARNING,"DISA password file %s not found on chan %s\n",args.passcode,ast_channel_name(chan));
ast_clear_flag(chan, AST_FLAG_END_DTMF_ONLY);
return -1;
}
}
/* compare the two */
if (strcmp(exten,args.passcode)) {
- ast_log(LOG_WARNING,"DISA on chan %s got bad password %s\n",chan->name,exten);
+ ast_log(LOG_WARNING,"DISA on chan %s got bad password %s\n",ast_channel_name(chan),exten);
goto reorder;
}
/* password good, set to dial state */
- ast_debug(1,"DISA on chan %s password is good\n",chan->name);
+ ast_debug(1,"DISA on chan %s password is good\n",ast_channel_name(chan));
play_dialtone(chan, args.mailbox);
k|=1; /* In number mode */
exten[sizeof(acctcode)] = 0;
ast_copy_string(acctcode, exten, sizeof(acctcode));
exten[0] = 0;
- ast_debug(1,"Successful DISA log-in on chan %s\n", chan->name);
+ ast_debug(1,"Successful DISA log-in on chan %s\n", ast_channel_name(chan));
continue;
}
} else {
"Application= %s\n"
"Data= %s\n"
"Blocking_in= %s\n",
- c->name,
+ ast_channel_name(c),
c->tech->type,
c->uniqueid,
c->linkedid,
hour,
min,
sec,
- c->_bridge ? c->_bridge->name : "<none>",
- ast_bridged_channel(c) ? ast_bridged_channel(c)->name : "<none>",
+ c->_bridge ? ast_channel_name(c->_bridge) : "<none>",
+ ast_bridged_channel(c) ? ast_channel_name(ast_bridged_channel(c)) : "<none>",
c->context,
c->exten,
c->priority,
"Info:\n"
"%s\n"
"Variables:\n"
- "%s%s\n", chan->name, line, info, ast_str_buffer(vars), line);
+ "%s%s\n", ast_channel_name(chan), line, info, ast_str_buffer(vars), line);
}
return 0;
static const char app[] = "ExternalIVR";
/* XXX the parser in gcc 2.95 gets confused if you don't put a space between 'name' and the comma */
-#define ast_chan_log(level, channel, format, ...) ast_log(level, "%s: " format, channel->name , ## __VA_ARGS__)
+#define ast_chan_log(level, channel, format, ...) ast_log(level, "%s: " format, ast_channel_name(channel) , ## __VA_ARGS__)
/* Commands */
#define EIVR_CMD_APND 'A' /* append to prompt queue */
"Resolution: %d\r\n"
"TransferRate: %d\r\n"
"FileName: %s\r\n",
- s->chan->name,
+ ast_channel_name(s->chan),
s->chan->exten,
S_COR(s->chan->caller.id.number.valid, s->chan->caller.id.number.str, ""),
S_COR(s->chan->caller.id.name.valid, s->chan->caller.id.name.str, ""),
AST_FRAME_SET_BUFFER(&outf, buffer, AST_FRIENDLY_OFFSET, len * sizeof(int16_t));
if (ast_write(chan, &outf) < 0) {
- ast_log(LOG_WARNING, "Failed to write frame to '%s': %s\n", chan->name, strerror(errno));
+ ast_log(LOG_WARNING, "Failed to write frame to '%s': %s\n", ast_channel_name(chan), strerror(errno));
return -1;
}
}
unsigned int timeout = 5000;
int ms;
- ast_debug(1, "Negotiating T.38 for receive on %s\n", s->chan->name);
+ ast_debug(1, "Negotiating T.38 for receive on %s\n", ast_channel_name(s->chan));
while (timeout > 0) {
ms = ast_waitfor(s->chan, 1000);
if (ms < 0) {
- ast_log(LOG_WARNING, "something bad happened while channel '%s' was polling.\n", s->chan->name);
+ ast_log(LOG_WARNING, "something bad happened while channel '%s' was polling.\n", ast_channel_name(s->chan));
return -1;
}
if (!ms) {
timeout -= 1000;
continue;
} else {
- ast_log(LOG_WARNING, "channel '%s' timed-out during the T.38 negotiation.\n", s->chan->name);
+ ast_log(LOG_WARNING, "channel '%s' timed-out during the T.38 negotiation.\n", ast_channel_name(s->chan));
break;
}
}
switch (parameters->request_response) {
case AST_T38_NEGOTIATED:
- ast_debug(1, "Negotiated T.38 for receive on %s\n", s->chan->name);
+ ast_debug(1, "Negotiated T.38 for receive on %s\n", ast_channel_name(s->chan));
res = 1;
break;
case AST_T38_REFUSED:
- ast_log(LOG_WARNING, "channel '%s' refused to negotiate T.38\n", s->chan->name);
+ ast_log(LOG_WARNING, "channel '%s' refused to negotiate T.38\n", ast_channel_name(s->chan));
break;
default:
- ast_log(LOG_ERROR, "channel '%s' failed to negotiate T.38\n", s->chan->name);
+ ast_log(LOG_ERROR, "channel '%s' failed to negotiate T.38\n", ast_channel_name(s->chan));
break;
}
ast_frfree(inf);
done:
if (original_write_fmt.id != AST_FORMAT_SLINEAR) {
if (ast_set_write_format(s->chan, &original_write_fmt) < 0)
- ast_log(LOG_WARNING, "Unable to restore write format on '%s'\n", s->chan->name);
+ ast_log(LOG_WARNING, "Unable to restore write format on '%s'\n", ast_channel_name(s->chan));
}
if (original_read_fmt.id != AST_FORMAT_SLINEAR) {
if (ast_set_read_format(s->chan, &original_read_fmt) < 0)
- ast_log(LOG_WARNING, "Unable to restore read format on '%s'\n", s->chan->name);
+ ast_log(LOG_WARNING, "Unable to restore read format on '%s'\n", ast_channel_name(s->chan));
}
return res;
unsigned int timeout = 5000;
int ms;
- ast_debug(1, "Shutting down T.38 on %s\n", s->chan->name);
+ ast_debug(1, "Shutting down T.38 on %s\n", ast_channel_name(s->chan));
while (timeout > 0) {
ms = ast_waitfor(s->chan, 1000);
if (ms < 0) {
- ast_log(LOG_WARNING, "something bad happened while channel '%s' was polling.\n", s->chan->name);
+ ast_log(LOG_WARNING, "something bad happened while channel '%s' was polling.\n", ast_channel_name(s->chan));
return -1;
}
if (!ms) {
timeout -= 1000;
continue;
} else {
- ast_log(LOG_WARNING, "channel '%s' timed-out during the T.38 shutdown.\n", s->chan->name);
+ ast_log(LOG_WARNING, "channel '%s' timed-out during the T.38 shutdown.\n", ast_channel_name(s->chan));
break;
}
}
switch (parameters->request_response) {
case AST_T38_TERMINATED:
- ast_debug(1, "Shut down T.38 on %s\n", s->chan->name);
+ ast_debug(1, "Shut down T.38 on %s\n", ast_channel_name(s->chan));
break;
case AST_T38_REFUSED:
- ast_log(LOG_WARNING, "channel '%s' refused to disable T.38\n", s->chan->name);
+ ast_log(LOG_WARNING, "channel '%s' refused to disable T.38\n", ast_channel_name(s->chan));
break;
default:
- ast_log(LOG_ERROR, "channel '%s' failed to disable T.38\n", s->chan->name);
+ ast_log(LOG_ERROR, "channel '%s' failed to disable T.38\n", ast_channel_name(s->chan));
break;
}
ast_frfree(inf);
* Theoretically asterisk should already have answered before running the app */
res = ast_answer(s->chan);
if (res) {
- ast_log(LOG_WARNING, "Could not answer channel '%s'\n", s->chan->name);
+ ast_log(LOG_WARNING, "Could not answer channel '%s'\n", ast_channel_name(s->chan));
return res;
}
}
struct dahdi_params dahdip;
if (strcasecmp(chan->tech->type, "DAHDI")) {
- ast_log(LOG_WARNING, "%s is not a DAHDI channel\n", chan->name);
+ ast_log(LOG_WARNING, "%s is not a DAHDI channel\n", ast_channel_name(chan));
return -1;
}
dahdi_wait_event(chan->fds[0]);
}
res = ast_safe_sleep(chan, 1000);
- ast_verb(3, "Flashed channel %s\n", chan->name);
+ ast_verb(3, "Flashed channel %s\n", ast_channel_name(chan));
} else
- ast_log(LOG_WARNING, "Unable to flash channel %s: %s\n", chan->name, strerror(errno));
+ ast_log(LOG_WARNING, "Unable to flash channel %s: %s\n", ast_channel_name(chan), strerror(errno));
} else
- ast_log(LOG_WARNING, "%s is not an FXO Channel\n", chan->name);
+ ast_log(LOG_WARNING, "%s is not an FXO Channel\n", ast_channel_name(chan));
} else
- ast_log(LOG_WARNING, "Unable to get parameters of %s: %s\n", chan->name, strerror(errno));
+ ast_log(LOG_WARNING, "Unable to get parameters of %s: %s\n", ast_channel_name(chan), strerror(errno));
return res;
}
if (f->frametype == AST_FRAME_CONTROL) {
switch (f->subclass.integer) {
case AST_CONTROL_HANGUP:
- ast_verb(3, "%s received a hangup frame.\n", winner->name);
+ ast_verb(3, "%s received a hangup frame.\n", ast_channel_name(winner));
if (f->data.uint32) {
winner->hangupcause = f->data.uint32;
}
}
break;
case AST_CONTROL_ANSWER:
- ast_verb(3, "%s answered %s\n", winner->name, caller->name);
+ ast_verb(3, "%s answered %s\n", ast_channel_name(winner), ast_channel_name(caller));
/* If call has been answered, then the eventual hangup is likely to be normal hangup */
winner->hangupcause = AST_CAUSE_NORMAL_CLEARING;
caller->hangupcause = AST_CAUSE_NORMAL_CLEARING;
}
break;
case AST_CONTROL_BUSY:
- ast_verb(3, "%s is busy\n", winner->name);
+ ast_verb(3, "%s is busy\n", ast_channel_name(winner));
break;
case AST_CONTROL_CONGESTION:
- ast_verb(3, "%s is circuit-busy\n", winner->name);
+ ast_verb(3, "%s is circuit-busy\n", ast_channel_name(winner));
break;
case AST_CONTROL_RINGING:
- ast_verb(3, "%s is ringing\n", winner->name);
+ ast_verb(3, "%s is ringing\n", ast_channel_name(winner));
break;
case AST_CONTROL_PROGRESS:
- ast_verb(3, "%s is making progress passing it to %s\n", winner->name, caller->name);
+ ast_verb(3, "%s is making progress passing it to %s\n", ast_channel_name(winner), ast_channel_name(caller));
break;
case AST_CONTROL_VIDUPDATE:
- ast_verb(3, "%s requested a video update, passing it to %s\n", winner->name, caller->name);
+ ast_verb(3, "%s requested a video update, passing it to %s\n", ast_channel_name(winner), ast_channel_name(caller));
break;
case AST_CONTROL_SRCUPDATE:
- ast_verb(3, "%s requested a source update, passing it to %s\n", winner->name, caller->name);
+ ast_verb(3, "%s requested a source update, passing it to %s\n", ast_channel_name(winner), ast_channel_name(caller));
break;
case AST_CONTROL_PROCEEDING:
- ast_verb(3, "%s is proceeding passing it to %s\n", winner->name,caller->name);
+ ast_verb(3, "%s is proceeding passing it to %s\n", ast_channel_name(winner),ast_channel_name(caller));
break;
case AST_CONTROL_HOLD:
- ast_verb(3, "Call on %s placed on hold\n", winner->name);
+ ast_verb(3, "Call on %s placed on hold\n", ast_channel_name(winner));
break;
case AST_CONTROL_UNHOLD:
- ast_verb(3, "Call on %s left from hold\n", winner->name);
+ ast_verb(3, "Call on %s left from hold\n", ast_channel_name(winner));
break;
case AST_CONTROL_OFFHOOK:
case AST_CONTROL_FLASH:
/* Ignore going off hook and flash */
break;
case -1:
- ast_verb(3, "%s stopped sounds\n", winner->name);
+ ast_verb(3, "%s stopped sounds\n", ast_channel_name(winner));
break;
default:
ast_debug(1, "Dunno what to do with control type %d\n", f->subclass.integer);
/* Make sure channels are compatible */
res = ast_channel_make_compatible(caller, outbound);
if (res < 0) {
- ast_log(LOG_WARNING, "Had to drop call because I couldn't make %s compatible with %s\n", caller->name, outbound->name);
+ ast_log(LOG_WARNING, "Had to drop call because I couldn't make %s compatible with %s\n", ast_channel_name(caller), ast_channel_name(outbound));
ast_hangup(outbound);
goto outrun;
}
res = ast_adsi_get_cpeid(chan, cpeid, 0);
if (res > 0) {
gotcpeid = 1;
- ast_verb(3, "Got CPEID of '%02x:%02x:%02x:%02x' on '%s'\n", cpeid[0], cpeid[1], cpeid[2], cpeid[3], chan->name);
+ ast_verb(3, "Got CPEID of '%02x:%02x:%02x:%02x' on '%s'\n", cpeid[0], cpeid[1], cpeid[2], cpeid[3], ast_channel_name(chan));
}
if (res > -1) {
strcpy(data[1], "Measuring CPE...");
cpeid_setstatus(chan, data, 0);
res = ast_adsi_get_cpeinfo(chan, &width, &height, &buttons, 0);
if (res > -1) {
- ast_verb(3, "CPE has %d lines, %d columns, and %d buttons on '%s'\n", height, width, buttons, chan->name);
+ ast_verb(3, "CPE has %d lines, %d columns, and %d buttons on '%s'\n", height, width, buttons, ast_channel_name(chan));
gotgeometry = 1;
}
}
client_name = jack_data->client_name;
} else {
ast_channel_lock(chan);
- client_name = ast_strdupa(chan->name);
+ client_name = ast_strdupa(ast_channel_name(chan));
ast_channel_unlock(chan);
}
ast_channel_lock(chan);
if (!(datastore = ast_channel_datastore_find(chan, &jack_hook_ds_info, NULL))) {
- ast_log(LOG_ERROR, "JACK_HOOK datastore not found for '%s'\n", chan->name);
+ ast_log(LOG_ERROR, "JACK_HOOK datastore not found for '%s'\n", ast_channel_name(chan));
ast_channel_unlock(chan);
return -1;
}
ast_channel_lock(chan);
if ((datastore = ast_channel_datastore_find(chan, &jack_hook_ds_info, NULL))) {
- ast_log(LOG_ERROR, "JACK_HOOK already enabled for '%s'\n", chan->name);
+ ast_log(LOG_ERROR, "JACK_HOOK already enabled for '%s'\n", ast_channel_name(chan));
goto return_error;
}
res = 0;
goto out;
default:
- ast_debug(2, "Spawn extension (%s,%s,%d) exited non-zero on '%s' in macro '%s'\n", chan->context, chan->exten, chan->priority, chan->name, macro);
- ast_verb(2, "Spawn extension (%s, %s, %d) exited non-zero on '%s' in macro '%s'\n", chan->context, chan->exten, chan->priority, chan->name, macro);
+ ast_debug(2, "Spawn extension (%s,%s,%d) exited non-zero on '%s' in macro '%s'\n", chan->context, chan->exten, chan->priority, ast_channel_name(chan), macro);
+ ast_verb(2, "Spawn extension (%s, %s, %d) exited non-zero on '%s' in macro '%s'\n", chan->context, chan->exten, chan->priority, ast_channel_name(chan), macro);
goto out;
}
}
}
if (gosub_level == 0 && strcasecmp(chan->context, fullmacro)) {
- ast_verb(2, "Channel '%s' jumping out of macro '%s'\n", chan->name, macro);
+ ast_verb(2, "Channel '%s' jumping out of macro '%s'\n", ast_channel_name(chan), macro);
break;
}
user->user_no,
S_COR(user->chan->caller.id.number.valid, user->chan->caller.id.number.str, "<unknown>"),
S_COR(user->chan->caller.id.name.valid, user->chan->caller.id.name.str, "<no name>"),
- user->chan->name,
+ ast_channel_name(user->chan),
ast_test_flag64(&user->userflags, CONFFLAG_ADMIN) ? "(Admin)" : "",
ast_test_flag64(&user->userflags, CONFFLAG_MONITOR) ? "(Listen only)" : "",
user->adminflags & ADMINFLAG_MUTED ? "(Admin Muted)" : user->adminflags & ADMINFLAG_SELFMUTED ? "(Muted)" : "",
user->user_no,
S_COR(user->chan->caller.id.number.valid, user->chan->caller.id.number.str, ""),
S_COR(user->chan->caller.id.name.valid, user->chan->caller.id.name.str, ""),
- user->chan->name,
+ ast_channel_name(user->chan),
ast_test_flag64(&user->userflags, CONFFLAG_ADMIN) ? "1" : "",
ast_test_flag64(&user->userflags, CONFFLAG_MONITOR) ? "1" : "",
user->adminflags & (ADMINFLAG_MUTED | ADMINFLAG_SELFMUTED) ? "1" : "",
continue;
}
if (ast_write(user->chan, f) < 0)
- ast_log(LOG_WARNING, "Error writing frame to channel %s\n", user->chan->name);
+ ast_log(LOG_WARNING, "Error writing frame to channel %s\n", ast_channel_name(user->chan));
ao2_ref(user, -1);
}
ao2_iterator_destroy(&user_iter);
"Meetme: %s\r\n"
"Usernum: %d\r\n"
"Status: %s\r\n",
- chan->name, chan->uniqueid, conf->confno, user->user_no, talking ? "on" : "off");
+ ast_channel_name(chan), chan->uniqueid, conf->confno, user->user_no, talking ? "on" : "off");
}
static void set_user_talking(struct ast_channel *chan, struct ast_conference *conf, struct ast_conf_user *user, int talking, int monitor)
}
if (ast_set_write_format_by_id(chan, AST_FORMAT_SLINEAR) < 0) {
- ast_log(LOG_WARNING, "Unable to set '%s' to write linear mode\n", chan->name);
+ ast_log(LOG_WARNING, "Unable to set '%s' to write linear mode\n", ast_channel_name(chan));
goto outrun;
}
if (ast_set_read_format_by_id(chan, AST_FORMAT_SLINEAR) < 0) {
- ast_log(LOG_WARNING, "Unable to set '%s' to read linear mode\n", chan->name);
+ ast_log(LOG_WARNING, "Unable to set '%s' to read linear mode\n", ast_channel_name(chan));
goto outrun;
}
close(fd);
goto outrun;
}
- ast_debug(1, "Placed channel %s in DAHDI conf %d\n", chan->name, conf->dahdiconf);
+ ast_debug(1, "Placed channel %s in DAHDI conf %d\n", ast_channel_name(chan), conf->dahdiconf);
if (!sent_event) {
ast_manager_event(chan, EVENT_FLAG_CALL, "MeetmeJoin",
"CallerIDname: %s\r\n"
"ConnectedLineNum: %s\r\n"
"ConnectedLineName: %s\r\n",
- chan->name, chan->uniqueid, conf->confno,
+ ast_channel_name(chan), chan->uniqueid, conf->confno,
user->user_no,
S_COR(user->chan->caller.id.number.valid, user->chan->caller.id.number.str, "<unknown>"),
S_COR(user->chan->caller.id.name.valid, user->chan->caller.id.name.str, "<unknown>"),
"Meetme: %s\r\n"
"Usernum: %i\r\n"
"Status: on\r\n",
- chan->name, chan->uniqueid, conf->confno, user->user_no);
+ ast_channel_name(chan), chan->uniqueid, conf->confno, user->user_no);
}
/* If I should be un-muted but am not talker, un-mute me */
"Meetme: %s\r\n"
"Usernum: %i\r\n"
"Status: off\r\n",
- chan->name, chan->uniqueid, conf->confno, user->user_no);
+ ast_channel_name(chan), chan->uniqueid, conf->confno, user->user_no);
}
if ((user->adminflags & (ADMINFLAG_MUTED | ADMINFLAG_SELFMUTED)) &&
"Meetme: %s\r\n"
"Usernum: %i\r\n"
"Status: on\r\n",
- chan->name, chan->uniqueid, conf->confno, user->user_no);
+ ast_channel_name(chan), chan->uniqueid, conf->confno, user->user_no);
}
"Meetme: %s\r\n"
"Usernum: %i\r\n"
"Status: off\r\n",
- chan->name, chan->uniqueid, conf->confno, user->user_no);
+ ast_channel_name(chan), chan->uniqueid, conf->confno, user->user_no);
}
/* If user have been hung up, exit the conference */
ao2_callback(conf->usercontainer, OBJ_NODATA, user_max_cmp, &max_no);
menu_active = 0;
usr = ao2_find(conf->usercontainer, &max_no, 0);
- if ((usr->chan->name == chan->name) || ast_test_flag64(&usr->userflags, CONFFLAG_ADMIN)) {
+ if ((ast_channel_name(usr->chan) == ast_channel_name(chan)) || ast_test_flag64(&usr->userflags, CONFFLAG_ADMIN)) {
if (!ast_streamfile(chan, "conf-errormenu", chan->language)) {
ast_waitstream(chan, "");
}
default:
ast_debug(1,
"Got ignored control frame on channel %s, f->frametype=%d,f->subclass=%d\n",
- chan->name, f->frametype, f->subclass.integer);
+ ast_channel_name(chan), f->frametype, f->subclass.integer);
}
} else {
ast_debug(1,
"Got unrecognized frame on channel %s, f->frametype=%d,f->subclass=%d\n",
- chan->name, f->frametype, f->subclass.integer);
+ ast_channel_name(chan), f->frametype, f->subclass.integer);
}
ast_frfree(f);
} else if (outfd > -1) {
*/
for (cur = conf->transframe[idx]; cur; cur = AST_LIST_NEXT(cur, frame_list)) {
if (ast_write(chan, cur)) {
- ast_log(LOG_WARNING, "Unable to write frame to channel %s\n", chan->name);
+ ast_log(LOG_WARNING, "Unable to write frame to channel %s\n", ast_channel_name(chan));
break;
}
}
ast_frame_adjust_volume(&fr, user->listen.actual);
}
if (can_write(chan, confflags) && ast_write(chan, &fr) < 0) {
- ast_log(LOG_WARNING, "Unable to write frame to channel %s\n", chan->name);
+ ast_log(LOG_WARNING, "Unable to write frame to channel %s\n", ast_channel_name(chan));
}
if (musiconhold && mohtempstopped && confsilence > MEETME_DELAYDETECTENDTALK) {
mohtempstopped = 0;
"ConnectedLineNum: %s\r\n"
"ConnectedLineName: %s\r\n"
"Duration: %ld\r\n",
- chan->name, chan->uniqueid, conf->confno,
+ ast_channel_name(chan), chan->uniqueid, conf->confno,
user->user_no,
S_COR(user->chan->caller.id.number.valid, user->chan->caller.id.number.str, "<unknown>"),
S_COR(user->chan->caller.id.name.valid, user->chan->caller.id.name.str, "<unknown>"),
struct ast_conf_user *user = obj;
const char *channel = args;
- if (!strcmp(user->chan->name, channel)) {
+ if (!strcmp(ast_channel_name(user->chan), channel)) {
return (CMP_MATCH | CMP_STOP);
}
AST_LIST_UNLOCK(&confs);
- ast_log(LOG_NOTICE, "Requested to %smute conf %s user %d userchan %s uniqueid %s\n", mute ? "" : "un", conf->confno, user->user_no, user->chan->name, user->chan->uniqueid);
+ ast_log(LOG_NOTICE, "Requested to %smute conf %s user %d userchan %s uniqueid %s\n", mute ? "" : "un", conf->confno, user->user_no, ast_channel_name(user->chan), user->chan->uniqueid);
ao2_ref(user, -1);
astman_send_ack(s, m, mute ? "User muted" : "User unmuted");
S_COR(user->chan->caller.id.name.valid, user->chan->caller.id.name.str, "<no name>"),
S_COR(user->chan->connected.id.number.valid, user->chan->connected.id.number.str, "<unknown>"),
S_COR(user->chan->connected.id.name.valid, user->chan->connected.id.name.str, "<no name>"),
- user->chan->name,
+ ast_channel_name(user->chan),
ast_test_flag64(&user->userflags, CONFFLAG_ADMIN) ? "Yes" : "No",
ast_test_flag64(&user->userflags, CONFFLAG_MONITOR) ? "Listen only" : ast_test_flag64(&user->userflags, CONFFLAG_TALKER) ? "Talk only" : "Talk and listen",
ast_test_flag64(&user->userflags, CONFFLAG_MARKEDUSER) ? "Yes" : "No",
}
if (ast_write(chan,&wf) < 0) {
- ast_log(LOG_WARNING,"Failed to write frame to '%s': %s\n",chan->name,strerror(errno));
+ ast_log(LOG_WARNING,"Failed to write frame to '%s': %s\n",ast_channel_name(chan),strerror(errno));
return -1;
}
}
if (ast_activate_generator(chan,&milliwattgen,"milliwatt") < 0) {
- ast_log(LOG_WARNING,"Failed to activate generator on '%s'\n",chan->name);
+ ast_log(LOG_WARNING,"Failed to activate generator on '%s'\n",ast_channel_name(chan));
return -1;
}
chan->macrocontext,
chan->exten,
chan->priority,
- chan->name,
+ ast_channel_name(chan),
callerid,
date,
timebuf,
return;
}
- mixmonitor->name = ast_strdup(chan->name);
+ mixmonitor->name = ast_strdup(ast_channel_name(chan));
if (!ast_strlen_zero(postprocess2)) {
mixmonitor->post_process = ast_strdup(postprocess2);
if (startmon(chan, &mixmonitor->audiohook)) {
ast_log(LOG_WARNING, "Unable to add '%s' spy to channel '%s'\n",
- mixmonitor_spy_type, chan->name);
+ mixmonitor_spy_type, ast_channel_name(chan));
ast_audiohook_destroy(&mixmonitor->audiohook);
mixmonitor_free(mixmonitor);
return;
AST_STANDARD_APP_ARGS(args, parse);
- ast_copy_string(originator, chan->name, sizeof(originator));
+ ast_copy_string(originator, ast_channel_name(chan), sizeof(originator));
if ((tmp = strchr(originator, '-'))) {
*tmp = '\0';
}
ast_party_id_free(&caller_id);
if (dchan) {
if (dchan->_state == AST_STATE_UP) {
- ast_verb(4, "Channel %s was answered.\n", dchan->name);
+ ast_verb(4, "Channel %s was answered.\n", ast_channel_name(dchan));
} else {
- ast_verb(4, "Channel %s was never answered.\n", dchan->name);
- ast_log(LOG_WARNING, "PARK: Channel %s was never answered for the announce.\n", dchan->name);
+ ast_verb(4, "Channel %s was never answered.\n", ast_channel_name(dchan));
+ ast_log(LOG_WARNING, "PARK: Channel %s was never answered for the announce.\n", ast_channel_name(dchan));
ast_hangup(dchan);
res = -1;
goto parkcleanup;
if (!dres) {
dres = ast_waitstream(dchan, "");
} else {
- ast_log(LOG_WARNING, "ast_streamfile of %s failed on %s\n", tmp[i], dchan->name);
+ ast_log(LOG_WARNING, "ast_streamfile of %s failed on %s\n", tmp[i], ast_channel_name(dchan));
}
}
}
res = ast_waitstream(chan, "");
ast_stopstream(chan);
} else {
- ast_log(LOG_WARNING, "ast_streamfile failed on %s for %s\n", chan->name, (char *)data);
+ ast_log(LOG_WARNING, "ast_streamfile failed on %s for %s\n", ast_channel_name(chan), (char *)data);
res = 0;
mres = 1;
}
"Position: %d\r\n"
"Count: %d\r\n"
"Uniqueid: %s\r\n",
- qe->chan->name,
+ ast_channel_name(qe->chan),
S_COR(qe->chan->caller.id.number.valid, qe->chan->caller.id.number.str, "unknown"),/* XXX somewhere else it is <unknown> */
S_COR(qe->chan->caller.id.name.valid, qe->chan->caller.id.name.str, "unknown"),
S_COR(qe->chan->connected.id.number.valid, qe->chan->connected.id.number.str, "unknown"),/* XXX somewhere else it is <unknown> */
S_COR(qe->chan->connected.id.name.valid, qe->chan->connected.id.name.str, "unknown"),
q->name, qe->pos, q->count, qe->chan->uniqueid );
- ast_debug(1, "Queue '%s' Join, Channel '%s', Position '%d'\n", q->name, qe->chan->name, qe->pos );
+ ast_debug(1, "Queue '%s' Join, Channel '%s', Position '%d'\n", q->name, ast_channel_name(qe->chan), qe->pos );
}
ao2_unlock(q);
queue_t_unref(q, "Done with realtime queue");
posout:
if (qe->parent->announceposition) {
ast_verb(3, "Told %s in %s their queue position (which was %d)\n",
- qe->chan->name, qe->parent->name, qe->pos);
+ ast_channel_name(qe->chan), qe->parent->name, qe->pos);
}
if (say_thanks) {
res = play_file(qe->chan, qe->parent->sound_thanks);
/* Take us out of the queue */
ast_manager_event(qe->chan, EVENT_FLAG_CALL, "Leave",
"Channel: %s\r\nQueue: %s\r\nCount: %d\r\nPosition: %d\r\nUniqueid: %s\r\n",
- qe->chan->name, q->name, q->count, qe->pos, qe->chan->uniqueid);
- ast_debug(1, "Queue '%s' Leave, Channel '%s'\n", q->name, qe->chan->name );
+ ast_channel_name(qe->chan), q->name, q->count, qe->pos, qe->chan->uniqueid);
+ ast_debug(1, "Queue '%s' Leave, Channel '%s'\n", q->name, ast_channel_name(qe->chan));
/* Take us out of the queue */
if (prev)
prev->next = current->next;
if (ast_cdr_isset_unanswered()) {
/* they want to see the unanswered dial attempts! */
/* set up the CDR fields on all the CDRs to give sensical information */
- ast_cdr_setdestchan(tmp->chan->cdr, tmp->chan->name);
+ ast_cdr_setdestchan(tmp->chan->cdr, ast_channel_name(tmp->chan));
strcpy(tmp->chan->cdr->clid, qe->chan->cdr->clid);
strcpy(tmp->chan->cdr->channel, qe->chan->cdr->channel);
strcpy(tmp->chan->cdr->src, qe->chan->cdr->src);
"Priority: %d\r\n"
"Uniqueid: %s\r\n"
"%s",
- qe->parent->name, tmp->interface, tmp->member->membername, qe->chan->name, tmp->chan->name,
+ qe->parent->name, tmp->interface, tmp->member->membername, ast_channel_name(qe->chan), ast_channel_name(tmp->chan),
S_COR(qe->chan->caller.id.number.valid, qe->chan->caller.id.number.str, "unknown"),
S_COR(qe->chan->caller.id.name.valid, qe->chan->caller.id.name.str, "unknown"),
S_COR(qe->chan->connected.id.number.valid, qe->chan->connected.id.number.str, "unknown"),
"%s",
qe->parent->name,
qe->chan->uniqueid,
- qe->chan->name,
+ ast_channel_name(qe->chan),
interface,
membername,
rnatime,
ast_party_connected_line_init(&connected_caller);
ast_channel_lock(qe->chan);
- inchan_name = ast_strdupa(qe->chan->name);
+ inchan_name = ast_strdupa(ast_channel_name(qe->chan));
ast_channel_unlock(qe->chan);
starttime = (long) time(NULL);
char ochan_name[AST_CHANNEL_NAME];
if (o->chan) {
ast_channel_lock(o->chan);
- ast_copy_string(ochan_name, o->chan->name, sizeof(ochan_name));
+ ast_copy_string(ochan_name, ast_channel_name(o->chan), sizeof(ochan_name));
ast_channel_unlock(o->chan);
}
if (o->stillgoing && (o->chan) && (o->chan->_state == AST_STATE_UP)) {
* from the front of the queue are valid when autofill is disabled)
*/
if (ch && idx < avl && (qe->parent->autofill || qe->pos == 1)) {
- ast_debug(1, "It's our turn (%s).\n", qe->chan->name);
+ ast_debug(1, "It's our turn (%s).\n", ast_channel_name(qe->chan));
res = 1;
} else {
- ast_debug(1, "It's not our turn (%s).\n", qe->chan->name);
+ ast_debug(1, "It's not our turn (%s).\n", ast_channel_name(qe->chan));
res = 0;
}
pbx_builtin_setvar_helper(qe->chan, "QUEUE_MIN_PENALTY", min_penalty_str);
qe->max_penalty = max_penalty;
qe->min_penalty = min_penalty;
- ast_debug(3, "Setting max penalty to %d and min penalty to %d for caller %s since %d seconds have elapsed\n", qe->max_penalty, qe->min_penalty, qe->chan->name, qe->pr->time);
+ ast_debug(3, "Setting max penalty to %d and min penalty to %d for caller %s since %d seconds have elapsed\n", qe->max_penalty, qe->min_penalty, ast_channel_name(qe->chan), qe->pr->time);
qe->pr = AST_LIST_NEXT(qe->pr, list);
}
"TalkTime: %ld\r\n"
"Reason: %s\r\n"
"%s",
- queuename, qe->chan->uniqueid, peer->name, member->interface, member->membername,
+ queuename, qe->chan->uniqueid, ast_channel_name(peer), member->interface, member->membername,
(long)(callstart - qe->start), (long)(time(NULL) - callstart), reason,
qe->parent->eventwhencalled == QUEUE_EVENT_VARIABLES ? vars2manager(qe->chan, vars, vars_len) : "");
}
ao2_lock(qe->parent);
ast_debug(1, "%s is trying to call a queue member.\n",
- qe->chan->name);
+ ast_channel_name(qe->chan));
ast_copy_string(queuename, qe->parent->name, sizeof(queuename));
if (!ast_strlen_zero(qe->announce))
announce = qe->announce;
res = digit;
}
if (res == -1)
- ast_debug(1, "%s: Nobody answered.\n", qe->chan->name);
+ ast_debug(1, "%s: Nobody answered.\n", ast_channel_name(qe->chan));
if (ast_cdr_isset_unanswered()) {
/* channel contains the name of one of the outgoing channels
in its CDR; zero out this CDR to avoid a dual-posting */
res2 |= ast_autoservice_stop(qe->chan);
if (ast_check_hangup(peer)) {
/* Agent must have hung up */
- ast_log(LOG_WARNING, "Agent on %s hungup on the customer.\n", peer->name);
+ ast_log(LOG_WARNING, "Agent on %s hungup on the customer.\n", ast_channel_name(peer));
ast_queue_log(queuename, qe->chan->uniqueid, member->membername, "AGENTDUMP", "%s", "");
if (qe->parent->eventwhencalled)
manager_event(EVENT_FLAG_AGENT, "AgentDump",
"Member: %s\r\n"
"MemberName: %s\r\n"
"%s",
- queuename, qe->chan->uniqueid, peer->name, member->interface, member->membername,
+ queuename, qe->chan->uniqueid, ast_channel_name(peer), member->interface, member->membername,
qe->parent->eventwhencalled == QUEUE_EVENT_VARIABLES ? vars2manager(qe->chan, vars, sizeof(vars)) : "");
ast_hangup(peer);
ao2_ref(member, -1);
goto out;
} else if (res2) {
/* Caller must have hung up just before being connected*/
- ast_log(LOG_NOTICE, "Caller was about to talk to agent on %s but the caller hungup.\n", peer->name);
+ ast_log(LOG_NOTICE, "Caller was about to talk to agent on %s but the caller hungup.\n", ast_channel_name(peer));
ast_queue_log(queuename, qe->chan->uniqueid, member->membername, "ABANDON", "%d|%d|%ld", qe->pos, qe->opos, (long) time(NULL) - qe->start);
record_abandoned(qe);
ast_hangup(peer);
ast_moh_stop(qe->chan);
/* If appropriate, log that we have a destination channel */
if (qe->chan->cdr) {
- ast_cdr_setdestchan(qe->chan->cdr, peer->name);
+ ast_cdr_setdestchan(qe->chan->cdr, ast_channel_name(peer));
}
/* Make sure channels are compatible */
res = ast_channel_make_compatible(qe->chan, peer);
if (res < 0) {
ast_queue_log(queuename, qe->chan->uniqueid, member->membername, "SYSCOMPAT", "%s", "");
- ast_log(LOG_WARNING, "Had to drop call because I couldn't make %s compatible with %s\n", qe->chan->name, peer->name);
+ ast_log(LOG_WARNING, "Had to drop call because I couldn't make %s compatible with %s\n", ast_channel_name(qe->chan), ast_channel_name(peer));
record_abandoned(qe);
ast_cdr_failed(qe->chan->cdr);
ast_hangup(peer);
"BridgedChannel: %s\r\n"
"Ringtime: %ld\r\n"
"%s",
- queuename, qe->chan->uniqueid, peer->name, member->interface, member->membername,
+ queuename, qe->chan->uniqueid, ast_channel_name(peer), member->interface, member->membername,
(long) time(NULL) - qe->start, peer->uniqueid, (long)(orig - to > 0 ? (orig - to) / 1000 : 0),
qe->parent->eventwhencalled == QUEUE_EVENT_VARIABLES ? vars2manager(qe->chan, vars, sizeof(vars)) : "");
ast_copy_string(oldcontext, qe->chan->context, sizeof(oldcontext));
AST_STANDARD_APP_ARGS(args, parse);
if (ast_strlen_zero(args.interface)) {
- args.interface = ast_strdupa(chan->name);
+ args.interface = ast_strdupa(ast_channel_name(chan));
temppos = strrchr(args.interface, '-');
if (temppos)
*temppos = '\0';
AST_STANDARD_APP_ARGS(args, parse);
if (ast_strlen_zero(args.interface)) {
- args.interface = ast_strdupa(chan->name);
+ args.interface = ast_strdupa(ast_channel_name(chan));
temppos = strrchr(args.interface, '-');
if (temppos)
*temppos = '\0';
user_priority = pbx_builtin_getvar_helper(chan, "QUEUE_PRIO");
if (user_priority) {
if (sscanf(user_priority, "%30d", &prio) == 1) {
- ast_debug(1, "%s: Got priority %d from ${QUEUE_PRIO}.\n", chan->name, prio);
+ ast_debug(1, "%s: Got priority %d from ${QUEUE_PRIO}.\n", ast_channel_name(chan), prio);
} else {
ast_log(LOG_WARNING, "${QUEUE_PRIO}: Invalid value (%s), channel %s.\n",
- user_priority, chan->name);
+ user_priority, ast_channel_name(chan));
prio = 0;
}
} else {
if ((max_penalty_str = pbx_builtin_getvar_helper(chan, "QUEUE_MAX_PENALTY"))) {
if (sscanf(max_penalty_str, "%30d", &max_penalty) == 1) {
- ast_debug(1, "%s: Got max penalty %d from ${QUEUE_MAX_PENALTY}.\n", chan->name, max_penalty);
+ ast_debug(1, "%s: Got max penalty %d from ${QUEUE_MAX_PENALTY}.\n", ast_channel_name(chan), max_penalty);
} else {
ast_log(LOG_WARNING, "${QUEUE_MAX_PENALTY}: Invalid value (%s), channel %s.\n",
- max_penalty_str, chan->name);
+ max_penalty_str, ast_channel_name(chan));
max_penalty = 0;
}
} else {
if ((min_penalty_str = pbx_builtin_getvar_helper(chan, "QUEUE_MIN_PENALTY"))) {
if (sscanf(min_penalty_str, "%30d", &min_penalty) == 1) {
- ast_debug(1, "%s: Got min penalty %d from ${QUEUE_MIN_PENALTY}.\n", chan->name, min_penalty);
+ ast_debug(1, "%s: Got min penalty %d from ${QUEUE_MIN_PENALTY}.\n", ast_channel_name(chan), min_penalty);
} else {
ast_log(LOG_WARNING, "${QUEUE_MIN_PENALTY}: Invalid value (%s), channel %s.\n",
- min_penalty_str, chan->name);
+ min_penalty_str, ast_channel_name(chan));
min_penalty = 0;
}
} else {
* of the queue, go and check for our turn again.
*/
if (!is_our_turn(&qe)) {
- ast_debug(1, "Darn priorities, going back in queue (%s)!\n", qe.chan->name);
+ ast_debug(1, "Darn priorities, going back in queue (%s)!\n", ast_channel_name(qe.chan));
goto check_turns;
}
}
do_print(s, fd, " Callers: ");
for (qe = q->head; qe; qe = qe->next) {
ast_str_set(&out, 0, " %d. %s (wait: %ld:%2.2ld, prio: %d)",
- pos++, qe->chan->name, (long) (now - qe->start) / 60,
+ pos++, ast_channel_name(qe->chan), (long) (now - qe->start) / 60,
(long) (now - qe->start) % 60, qe->prio);
do_print(s, fd, ast_str_buffer(out));
}
"Wait: %ld\r\n"
"%s"
"\r\n",
- q->name, pos++, qe->chan->name, qe->chan->uniqueid,
+ q->name, pos++, ast_channel_name(qe->chan), qe->chan->uniqueid,
S_COR(qe->chan->caller.id.number.valid, qe->chan->caller.id.number.str, "unknown"),
S_COR(qe->chan->caller.id.name.valid, qe->chan->caller.id.name.str, "unknown"),
S_COR(qe->chan->connected.id.number.valid, qe->chan->connected.id.number.str, "unknown"),
pbx_builtin_setvar_helper(chan, arglist.variable, exten);
status = "OK";
} else {
- ast_debug(3, "User dialed invalid extension '%s' in context '%s' on %s\n", exten, arglist.context, chan->name);
+ ast_debug(3, "User dialed invalid extension '%s' in context '%s' on %s\n", exten, arglist.context, ast_channel_name(chan));
pbx_builtin_setvar_helper(chan, arglist.variable, "i");
pbx_builtin_setvar_helper(chan, "INVALID_EXTEN", exten);
status = "INVALID";
}
if (res) {
- ast_log(LOG_WARNING, "Could not answer channel '%s'\n", chan->name);
+ ast_log(LOG_WARNING, "Could not answer channel '%s'\n", ast_channel_name(chan));
pbx_builtin_setvar_helper(chan, "RECORD_STATUS", "ERROR");
goto out;
}
if (!res) {
res = ast_waitstream(chan, "");
} else {
- ast_log(LOG_WARNING, "ast_streamfile failed on %s\n", chan->name);
+ ast_log(LOG_WARNING, "ast_streamfile failed on %s\n", ast_channel_name(chan));
}
ast_stopstream(chan);
}
if ((silence > 0) && rfmt.id) {
res = ast_set_read_format(chan, &rfmt);
if (res)
- ast_log(LOG_WARNING, "Unable to restore read format on '%s'\n", chan->name);
+ ast_log(LOG_WARNING, "Unable to restore read format on '%s'\n", ast_channel_name(chan));
if (sildet)
ast_dsp_free(sildet);
}
ast_playtones_start(myrpt->txchannel, 0, dtmf_tones[15], 0);
else {
/* not handled */
- ast_debug(1, "Unable to generate DTMF tone '%c' for '%s'\n", digit, myrpt->txchannel->name);
+ ast_debug(1, "Unable to generate DTMF tone '%c' for '%s'\n", digit, ast_channel_name(myrpt->txchannel));
}
rpt_mutex_lock(&myrpt->lock);
}
if (!res)
res = ast_waitstream(mychannel, "");
else
- ast_log(LOG_WARNING, "ast_streamfile failed on %s\n", mychannel->name);
+ ast_log(LOG_WARNING, "ast_streamfile failed on %s\n", ast_channel_name(mychannel));
ast_stopstream(mychannel);
return res;
}
if (!res)
res = ast_waitstream(mychannel, "");
else
- ast_log(LOG_WARNING, "ast_streamfile failed on %s\n", mychannel->name);
+ ast_log(LOG_WARNING, "ast_streamfile failed on %s\n", ast_channel_name(mychannel));
ast_stopstream(mychannel);
return res;
}
if(!res)
res = ast_waitstream(mychannel, "");
else
- ast_log(LOG_WARNING, "ast_streamfile failed on %s\n", mychannel->name);
+ ast_log(LOG_WARNING, "ast_streamfile failed on %s\n", ast_channel_name(mychannel));
ast_stopstream(mychannel);
return res;
}
res = telem_lookup(myrpt,mychannel, myrpt->name, (!hastx) ? "remotemon" : "remotetx");
if(res)
- ast_log(LOG_WARNING, "telem_lookup:remotexx failed on %s\n", mychannel->name);
+ ast_log(LOG_WARNING, "telem_lookup:remotexx failed on %s\n", ast_channel_name(mychannel));
/* if in remote cmd mode, indicate it */
ast_safe_sleep(mychannel,200);
res = telem_lookup(myrpt,mychannel, myrpt->name, "cmdmode");
if(res)
- ast_log(LOG_WARNING, "telem_lookup:cmdmode failed on %s\n", mychannel->name);
+ ast_log(LOG_WARNING, "telem_lookup:cmdmode failed on %s\n", ast_channel_name(mychannel));
ast_stopstream(mychannel);
}
}
else
res = -1;
if(res)
- ast_log(LOG_WARNING, "telem_lookup:ctx failed on %s\n", mychannel->name);
+ ast_log(LOG_WARNING, "telem_lookup:ctx failed on %s\n", ast_channel_name(mychannel));
}
if (hasremote && (!myrpt->cmdnode[0]))
{
res = -1;
if(res)
- ast_log(LOG_WARNING, "telem_lookup:ctx failed on %s\n", mychannel->name);
+ ast_log(LOG_WARNING, "telem_lookup:ctx failed on %s\n", ast_channel_name(mychannel));
}
}
#if defined(_MDC_DECODE_H_) && defined(MDC_SAY_WHEN_DOING_CT)
else
res = -1;
if(res)
- ast_log(LOG_WARNING, "telem_lookup:ctx failed on %s\n", mychannel->name);
+ ast_log(LOG_WARNING, "telem_lookup:ctx failed on %s\n", ast_channel_name(mychannel));
}
imdone = 1;
break;
if (!res)
res = ast_waitstream(mychannel, "");
else
- ast_log(LOG_WARNING, "ast_streamfile failed on %s\n", mychannel->name);
+ ast_log(LOG_WARNING, "ast_streamfile failed on %s\n", ast_channel_name(mychannel));
ast_stopstream(mychannel);
res = ast_streamfile(mychannel, "digits/2", mychannel->language);
if (!res)
res = ast_waitstream(mychannel, "");
else
- ast_log(LOG_WARNING, "ast_streamfile failed on %s\n", mychannel->name);
+ ast_log(LOG_WARNING, "ast_streamfile failed on %s\n", ast_channel_name(mychannel));
ast_stopstream(mychannel);
res = saynode(myrpt,mychannel,myrpt->name);
imdone = 1;
l1 = ast_malloc(sizeof(struct rpt_link));
if (!l1)
{
- ast_log(LOG_WARNING, "Cannot alloc memory on %s\n", mychannel->name);
+ ast_log(LOG_WARNING, "Cannot alloc memory on %s\n", ast_channel_name(mychannel));
remque((struct qelem *)mytele);
myrpt->active_telem = NULL;
rpt_mutex_unlock(&myrpt->lock);
if (!res)
res = ast_waitstream(mychannel, "");
else
- ast_log(LOG_WARNING, "ast_streamfile failed on %s\n", mychannel->name);
+ ast_log(LOG_WARNING, "ast_streamfile failed on %s\n", ast_channel_name(mychannel));
ast_stopstream(mychannel);
}
l = linkbase.next;
if (!res)
res = ast_waitstream(mychannel, "");
else
- ast_log(LOG_WARNING, "ast_streamfile failed on %s\n", mychannel->name);
+ ast_log(LOG_WARNING, "ast_streamfile failed on %s\n", ast_channel_name(mychannel));
ast_stopstream(mychannel);
l = l->next;
}
if (!res)
res = ast_waitstream(mychannel, "");
else
- ast_log(LOG_WARNING, "ast_streamfile failed on %s\n", mychannel->name);
+ ast_log(LOG_WARNING, "ast_streamfile failed on %s\n", ast_channel_name(mychannel));
ast_stopstream(mychannel);
}
/* destroy our local link queue */
if (!res)
res = ast_waitstream(mychannel, "");
else
- ast_log(LOG_WARNING, "ast_streamfile failed on %s\n", mychannel->name);
+ ast_log(LOG_WARNING, "ast_streamfile failed on %s\n", ast_channel_name(mychannel));
ast_stopstream(mychannel);
}
/* go thru all the nodes in list */
if (!res)
res = ast_waitstream(mychannel, "");
else
- ast_log(LOG_WARNING, "ast_streamfile failed on %s\n", mychannel->name);
+ ast_log(LOG_WARNING, "ast_streamfile failed on %s\n", ast_channel_name(mychannel));
ast_stopstream(mychannel);
}
if (!hastx)
if (!res)
res = ast_waitstream(mychannel, "");
else
- ast_log(LOG_WARNING, "ast_streamfile failed on %s\n", mychannel->name);
+ ast_log(LOG_WARNING, "ast_streamfile failed on %s\n", ast_channel_name(mychannel));
ast_stopstream(mychannel);
}
imdone = 1;
if (!res)
res = ast_waitstream(mychannel, "");
else
- ast_log(LOG_WARNING, "ast_streamfile failed on %s\n", mychannel->name);
+ ast_log(LOG_WARNING, "ast_streamfile failed on %s\n", ast_channel_name(mychannel));
ast_stopstream(mychannel);
imdone = 1;
break;
if (!res)
res = ast_waitstream(mychannel, "");
else
- ast_log(LOG_WARNING, "ast_streamfile failed on %s\n", mychannel->name);
+ ast_log(LOG_WARNING, "ast_streamfile failed on %s\n", ast_channel_name(mychannel));
ast_stopstream(mychannel);
sprintf(mystr,PARROTFILE,myrpt->name,(unsigned int)mytele->parrot);
strcat(mystr,".wav");
if (!res)
res = ast_waitstream(mychannel, "");
else
- ast_log(LOG_WARNING, "ast_streamfile failed on %s\n", mychannel->name);
+ ast_log(LOG_WARNING, "ast_streamfile failed on %s\n", ast_channel_name(mychannel));
ast_stopstream(mychannel);
if(!res) /* Say number of seconds */
ast_say_number(mychannel, myrpt->p.remotetimeout -
if (!res)
res = ast_waitstream(mychannel, "");
else
- ast_log(LOG_WARNING, "ast_streamfile failed on %s\n", mychannel->name);
+ ast_log(LOG_WARNING, "ast_streamfile failed on %s\n", ast_channel_name(mychannel));
ast_stopstream(mychannel);
if(!res) /* Say number of seconds */
ast_say_number(mychannel, myrpt->p.remoteinacttimeout -
ast_stopstream(mychannel);
}
else
- ast_log(LOG_WARNING, "ast_streamfile failed on %s\n", mychannel->name);
+ ast_log(LOG_WARNING, "ast_streamfile failed on %s\n", ast_channel_name(mychannel));
imdone = 1;
break;
case ARB_ALPHA:
if(!dres) {
dres = ast_waitstream(mychannel, "");
} else {
- ast_log(LOG_WARNING, "ast_streamfile of %s failed on %s\n", tmp[idx], mychannel->name);
+ ast_log(LOG_WARNING, "ast_streamfile of %s failed on %s\n", tmp[idx], ast_channel_name(mychannel));
dres = 0;
}
}
if (!res)
res = ast_waitstream(mychannel, "");
else {
- ast_log(LOG_WARNING, "ast_streamfile failed on %s\n", mychannel->name);
+ ast_log(LOG_WARNING, "ast_streamfile failed on %s\n", ast_channel_name(mychannel));
res = 0;
}
}
l->chan->data = "(Remote Rx)";
if (debug > 3)
ast_log(LOG_NOTICE, "rpt (remote) initiating call to %s/%s on %s\n",
- deststr, tele, l->chan->name);
+ deststr, tele, ast_channel_name(l->chan));
l->chan->caller.id.number.valid = 1;
ast_free(l->chan->caller.id.number.str);
l->chan->caller.id.number.str = ast_strdup(myrpt->name);
else {
if(debug > 3)
ast_log(LOG_NOTICE, "Unable to place call to %s/%s on %s\n",
- deststr,tele,l->chan->name);
+ deststr,tele,ast_channel_name(l->chan));
if (myrpt->p.archivedir)
{
char str[100];
memcpy(&r.data,data,5);
if (ioctl(myrpt->dahdirxchannel->fds[0],DAHDI_RADIO_SETPARAM,&r) == -1)
{
- ast_log(LOG_WARNING,"Cannot send RBI command for channel %s\n",myrpt->dahdirxchannel->name);
+ ast_log(LOG_WARNING,"Cannot send RBI command for channel %s\n",ast_channel_name(myrpt->dahdirxchannel));
return;
}
}
l->chan->appl = "Apprpt";
l->chan->data = "(Remote Rx)";
ast_verb(3, "rpt (attempt_reconnect) initiating call to %s/%s on %s\n",
- deststr, tele, l->chan->name);
+ deststr, tele, ast_channel_name(l->chan));
l->chan->caller.id.number.valid = 1;
ast_free(l->chan->caller.id.number.str);
l->chan->caller.id.number.str = ast_strdup(myrpt->name);
else
{
ast_verb(3, "Unable to place call to %s/%s on %s\n",
- deststr,tele,l->chan->name);
+ deststr,tele,ast_channel_name(l->chan));
return -1;
}
rpt_mutex_lock(&myrpt->lock);
{
#ifdef ALLOW_LOCAL_CHANNELS
/* Check to insure the connection is IAX2 or Local*/
- if ( (strncmp(chan->name,"IAX2",4)) && (strncmp(chan->name,"Local",5)) ) {
+ if ( (strncmp(ast_channel_name(chan),"IAX2",4)) && (strncmp(ast_channel_name(chan),"Local",5)) ) {
ast_log(LOG_WARNING, "We only accept links via IAX2 or Local!!\n");
return -1;
}
#else
- if (strncmp(chan->name,"IAX2",4))
+ if (strncmp(ast_channel_name(chan),"IAX2",4))
{
ast_log(LOG_WARNING, "We only accept links via IAX2!!\n");
return -1;
memset(hisip,0,sizeof(hisip));
#ifdef ALLOW_LOCAL_CHANNELS
/* set IP address if this is a local connection*/
- if (strncmp(chan->name,"Local",5)==0) {
+ if (strncmp(ast_channel_name(chan),"Local",5)==0) {
strcpy(hisip,"127.0.0.1");
} else {
pbx_substitute_variables_helper(chan,"${IAXPEER(CURRENTCHANNEL)}",hisip,sizeof(hisip) - 1);
myrpt->rxchannel->appl = "Apprpt";
myrpt->rxchannel->data = "(Link Rx)";
ast_verb(3, "rpt (Rx) initiating call to %s/%s on %s\n",
- myrpt->rxchanname,tele,myrpt->rxchannel->name);
+ myrpt->rxchanname,tele,ast_channel_name(myrpt->rxchannel));
rpt_mutex_unlock(&myrpt->lock);
ast_call(myrpt->rxchannel,tele,999);
rpt_mutex_lock(&myrpt->lock);
myrpt->txchannel->appl = "Apprpt";
myrpt->txchannel->data = "(Link Tx)";
ast_verb(3, "rpt (Tx) initiating call to %s/%s on %s\n",
- myrpt->txchanname,tele,myrpt->txchannel->name);
+ myrpt->txchanname,tele,ast_channel_name(myrpt->txchannel));
rpt_mutex_unlock(&myrpt->lock);
ast_call(myrpt->txchannel,tele,999);
rpt_mutex_lock(&myrpt->lock);
time(&myt);
strftime(mydate,sizeof(mydate) - 1,"%Y%m%d%H%M%S",
localtime(&myt));
- sprintf(mycmd,"mixmonitor start %s %s/%s/%s.wav49 a",chan->name,
+ sprintf(mycmd,"mixmonitor start %s %s/%s/%s.wav49 a",ast_channel_name(chan),
myrpt->p.archivedir,myrpt->name,mydate);
if (myrpt->p.monminblocks)
{
}
/* wait for telem to be done */
while(myrpt->tele.next != &myrpt->tele) usleep(100000);
- sprintf(tmp,"mixmonitor stop %s",chan->name);
+ sprintf(tmp,"mixmonitor stop %s",ast_channel_name(chan));
ast_cli_command(nullfd,tmp);
close(nullfd);
rpt_mutex_lock(&myrpt->lock);
}
}
if (ast_write(chan, &f) < 0) {
- ast_log(LOG_WARNING, "Failed to write frame to '%s': %s\n", chan->name, strerror(errno));
+ ast_log(LOG_WARNING, "Failed to write frame to '%s': %s\n", ast_channel_name(chan), strerror(errno));
return -1;
}
return 0;
}
if ( (res = ast_activate_generator(chan, &smsgen, &h)) < 0) {
- ast_log(LOG_ERROR, "Failed to activate generator on '%s'\n", chan->name);
+ ast_log(LOG_ERROR, "Failed to activate generator on '%s'\n", ast_channel_name(chan));
goto done;
}
while ((c = ast_channel_iterator_next(iter))) {
ast_channel_lock(c);
- ast_copy_string(name, c->name, sizeof(name));
+ ast_copy_string(name, ast_channel_name(c), sizeof(name));
if (ast_test_flag(&flags, OPTION_ALL)) {
/* CAPI is set up like CAPI[foo/bar]/clcnt */
if (!strcmp(c->tech->type, "CAPI")) {
*cut = 0;
}
if (!strcasecmp(name, args.channel)) {
- ast_log(LOG_WARNING, "Soft hanging %s up.\n", c->name);
+ ast_log(LOG_WARNING, "Soft hanging %s up.\n", ast_channel_name(c));
ast_softhangup(c, AST_SOFTHANGUP_EXPLICIT);
if (!ast_test_flag(&flags, OPTION_ALL)) {
ast_channel_unlock(c);
"Variable: LOCAL(%s)\r\n"
"Value: %s\r\n"
"Uniqueid: %s\r\n",
- chan->name, var, value, chan->uniqueid);
+ ast_channel_name(chan), var, value, chan->uniqueid);
return 0;
}
}
if (!stack_store) {
- ast_debug(1, "Channel %s has no datastore, so we're allocating one.\n", chan->name);
+ ast_debug(1, "Channel %s has no datastore, so we're allocating one.\n", ast_channel_name(chan));
stack_store = ast_datastore_alloc(&stack_info, NULL);
if (!stack_store) {
ast_log(LOG_ERROR, "Unable to allocate new datastore. Gosub will fail.\n");
}
ast_stopstream(chan);
if (ast_streamfile(chan, tmp, chan->language)) {
- ast_log(LOG_WARNING, "ast_streamfile failed on %s for %s\n", chan->name, (char *)data);
+ ast_log(LOG_WARNING, "ast_streamfile failed on %s for %s\n", ast_channel_name(chan), (char *)data);
break;
}
detection_start = ast_tvnow();
}
res = ast_waitfor(chan, res);
if (res < 0) {
- ast_log(LOG_WARNING, "Waitfor failed on %s\n", chan->name);
+ ast_log(LOG_WARNING, "Waitfor failed on %s\n", ast_channel_name(chan));
break;
} else if (res > 0) {
fr = ast_read(chan);
* frames and the time has not expired */
if (ast_tvdiff_ms(ast_tvnow(), detection_start) >= analysistime) {
continue_analysis = 0;
- ast_verb(3, "BackgroundDetect: Talk analysis time complete on %s.\n", chan->name);
+ ast_verb(3, "BackgroundDetect: Talk analysis time complete on %s.\n", ast_channel_name(chan));
}
}
if (res > -1) {
if (origrformat.id && ast_set_read_format(chan, &origrformat)) {
ast_log(LOG_WARNING, "Failed to restore read format for %s to %s\n",
- chan->name, ast_getformatname(&origrformat));
+ ast_channel_name(chan), ast_getformatname(&origrformat));
}
}
if (dsp) {
snprintf(fn, sizeof(fn), "%s/testresults/%s-client.txt", ast_config_AST_LOG_DIR, testid);
if ((f = fopen(fn, "w+"))) {
setlinebuf(f);
- fprintf(f, "CLIENTCHAN: %s\n", chan->name);
+ fprintf(f, "CLIENTCHAN: %s\n", ast_channel_name(chan));
fprintf(f, "CLIENTTEST ID: %s\n", testid);
fprintf(f, "ANSWER: PASS\n");
res = 0;
} else
res = -1;
} else {
- ast_log(LOG_NOTICE, "Did not read a test ID on '%s'\n", chan->name);
+ ast_log(LOG_NOTICE, "Did not read a test ID on '%s'\n", ast_channel_name(chan));
res = -1;
}
return res;
snprintf(fn, sizeof(fn), "%s/testresults/%s-server.txt", ast_config_AST_LOG_DIR, testid);
if ((f = fopen(fn, "w+"))) {
setlinebuf(f);
- fprintf(f, "SERVERCHAN: %s\n", chan->name);
+ fprintf(f, "SERVERCHAN: %s\n", ast_channel_name(chan));
fprintf(f, "SERVERTEST ID: %s\n", testid);
fprintf(f, "ANSWER: PASS\n");
ast_debug(1, "Processing Test ID '%s'\n", testid);
} else
res = -1;
} else {
- ast_log(LOG_NOTICE, "Did not read a test ID on '%s'\n", chan->name);
+ ast_log(LOG_NOTICE, "Did not read a test ID on '%s'\n", ast_channel_name(chan));
res = -1;
}
return res;
/* flag added for Urgent */
fprintf(p, "X-Asterisk-VM-Flag: %s" ENDL, flag);
fprintf(p, "X-Asterisk-VM-Priority: %d" ENDL, chan->priority);
- fprintf(p, "X-Asterisk-VM-Caller-channel: %s" ENDL, chan->name);
+ fprintf(p, "X-Asterisk-VM-Caller-channel: %s" ENDL, ast_channel_name(chan));
fprintf(p, "X-Asterisk-VM-Caller-ID-Num: %s" ENDL, enc_cidnum);
fprintf(p, "X-Asterisk-VM-Caller-ID-Name: %s" ENDL, enc_cidname);
fprintf(p, "X-Asterisk-VM-Duration: %d" ENDL, duration);
"macrocontext", chan->macrocontext,
"exten", chan->exten,
"priority", priority,
- "callerchan", chan->name,
+ "callerchan", ast_channel_name(chan),
"callerid", callerid,
"origdate", date,
"origtime", origtime,
S_COR(chan->redirecting.from.number.valid,
chan->redirecting.from.number.str, "unknown"),
chan->priority,
- chan->name,
+ ast_channel_name(chan),
callerid,
date, (long) time(NULL),
category ? category : "");
if (rfmt.id && ast_set_read_format(chan, &rfmt)) {
- ast_log(LOG_WARNING, "Unable to restore format %s to channel '%s'\n", ast_getformatname(&rfmt), chan->name);
+ ast_log(LOG_WARNING, "Unable to restore format %s to channel '%s'\n", ast_getformatname(&rfmt), ast_channel_name(chan));
}
ast_dsp_free(sildet);
return res;
struct ast_channel *c0 = AST_LIST_FIRST(&bridge->channels)->chan, *c1 = AST_LIST_LAST(&bridge->channels)->chan;
struct multiplexed_thread *multiplexed_thread = bridge->bridge_pvt;
- ast_debug(1, "Adding channel '%s' to multiplexed thread '%p' for monitoring\n", bridge_channel->chan->name, multiplexed_thread);
+ ast_debug(1, "Adding channel '%s' to multiplexed thread '%p' for monitoring\n", ast_channel_name(bridge_channel->chan), multiplexed_thread);
multiplexed_add_or_remove(multiplexed_thread, bridge_channel->chan, 1);
{
struct multiplexed_thread *multiplexed_thread = bridge->bridge_pvt;
- ast_debug(1, "Removing channel '%s' from multiplexed thread '%p'\n", bridge_channel->chan->name, multiplexed_thread);
+ ast_debug(1, "Removing channel '%s' from multiplexed thread '%p'\n", ast_channel_name(bridge_channel->chan), multiplexed_thread);
multiplexed_add_or_remove(multiplexed_thread, bridge_channel->chan, 0);
{
struct multiplexed_thread *multiplexed_thread = bridge->bridge_pvt;
- ast_debug(1, "Suspending channel '%s' from multiplexed thread '%p'\n", bridge_channel->chan->name, multiplexed_thread);
+ ast_debug(1, "Suspending channel '%s' from multiplexed thread '%p'\n", ast_channel_name(bridge_channel->chan), multiplexed_thread);
multiplexed_add_or_remove(multiplexed_thread, bridge_channel->chan, 0);
{
struct multiplexed_thread *multiplexed_thread = bridge->bridge_pvt;
- ast_debug(1, "Unsuspending channel '%s' from multiplexed thread '%p'\n", bridge_channel->chan->name, multiplexed_thread);
+ ast_debug(1, "Unsuspending channel '%s' from multiplexed thread '%p'\n", ast_channel_name(bridge_channel->chan), multiplexed_thread);
multiplexed_add_or_remove(multiplexed_thread, bridge_channel->chan, 1);
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;
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;
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);
} 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;
}
}
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;
}
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;
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;
}
}
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;
}
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;
}
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";
}
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++;
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;
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")))
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 */
"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 */
"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);
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)
} 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")) {
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;
}
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;
}
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;
}
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) {
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;
}
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);
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);
"Uniqueid: %s\r\n"
"DAHDISpan: %d\r\n"
"DAHDIChannel: %s\r\n",
- chan->name,
+ ast_channel_name(chan),
chan->uniqueid,
p->span,
ch_name);
/* 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;
}
}
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;
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;
}
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);
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;
}
break;
default:
ast_debug(1, "callrerouting attempted on non-ISDN channel %s\n",
- chan->name);
+ ast_channel_name(chan));
return -1;
}
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;
}
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;
}
}
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;
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;
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;
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:
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) {
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)
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;
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)
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;
}
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 */
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) */
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)
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 {
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 {
(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) &&
(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)) {
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);
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);
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;
}
}
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 */
}
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 */
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;
}
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;
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;
}
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);
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);
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 */
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;
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;
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;
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;
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;
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);
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;
}
/* 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;
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;
}
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;
}
/* 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;
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;
}
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 */
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:
}
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;
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
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;
}
}
}
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();
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';
}
#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;
}
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");
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);
}
} 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);
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));
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));
/* 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);
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");
}
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
*/
ast_log(LOG_WARNING,
"Failed to decode CallerID on channel '%s'\n",
- chan->name);
+ ast_channel_name(chan));
break;
} else if (res)
break;
"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;
}
*/
ast_log(LOG_WARNING,
"Failed to decode CallerID on channel '%s'\n",
- chan->name);
+ ast_channel_name(chan));
break;
} else if (res)
break;
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");
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++;
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);
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;
"%s"
"\r\n",
tmp->channel,
- tmp->owner->name,
+ ast_channel_name(tmp->owner),
tmp->owner->uniqueid,
tmp->owner->accountcode,
sig2str(tmp->sig),
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;
}
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;
}
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;
}
}
if (chan)
ast_cli(a->fd, FORMAT,
- chan->name,
+ ast_channel_name(chan),
jid,
resource,
ast_getformatname(&chan->readformat),
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);
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);
}
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);
/*|| ((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