diff options
Diffstat (limited to 'apps')
37 files changed, 271 insertions, 271 deletions
diff --git a/apps/app_adsiprog.c b/apps/app_adsiprog.c index 430d8258d..518a02113 100644 --- a/apps/app_adsiprog.c +++ b/apps/app_adsiprog.c @@ -1469,7 +1469,7 @@ static int adsi_prog(struct ast_channel *chan, const char *script) if (ast_adsi_begin_download(chan, scr->desc, scr->fdn, scr->sec, scr->ver)) { /* User rejected us for some reason */ ast_verb(3, "User rejected download attempt\n"); - ast_log(LOG_NOTICE, "User rejected download on channel %s\n", chan->name); + ast_log(LOG_NOTICE, "User rejected download on channel %s\n", ast_channel_name(chan)); ast_free(scr); return -1; } @@ -1554,7 +1554,7 @@ static int adsi_prog(struct ast_channel *chan, const char *script) 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; } diff --git a/apps/app_alarmreceiver.c b/apps/app_alarmreceiver.c index 1a4f9220f..20171e023 100644 --- a/apps/app_alarmreceiver.c +++ b/apps/app_alarmreceiver.c @@ -210,8 +210,8 @@ static int send_tone_burst(struct ast_channel *chan, float freq, int duration, i break; } if (ast_write(chan, &wf)) { - ast_verb(4, "AlarmReceiver: Failed to write frame on %s\n", chan->name); - ast_log(LOG_WARNING, "AlarmReceiver Failed to write frame on %s\n",chan->name); + ast_verb(4, "AlarmReceiver: Failed to write frame on %s\n", ast_channel_name(chan)); + ast_log(LOG_WARNING, "AlarmReceiver Failed to write frame on %s\n",ast_channel_name(chan)); res = -1; ast_frfree(f); break; @@ -245,8 +245,8 @@ static int receive_dtmf_digits(struct ast_channel *chan, char *digit_string, int for (;;) { /* if outa time, leave */ if (ast_tvdiff_ms(ast_tvnow(), lastdigittime) > ((i > 0) ? sdto : fdto)) { - ast_verb(4, "AlarmReceiver: DTMF Digit Timeout on %s\n", chan->name); - ast_debug(1,"AlarmReceiver: DTMF timeout on chan %s\n",chan->name); + ast_verb(4, "AlarmReceiver: DTMF Digit Timeout on %s\n", ast_channel_name(chan)); + ast_debug(1,"AlarmReceiver: DTMF timeout on chan %s\n",ast_channel_name(chan)); res = 1; break; } @@ -583,12 +583,12 @@ static int alarmreceiver_exec(struct ast_channel *chan, const char *data) 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; } diff --git a/apps/app_amd.c b/apps/app_amd.c index 35c5005f7..0e0301007 100644 --- a/apps/app_amd.c +++ b/apps/app_amd.c @@ -192,7 +192,7 @@ static void isAnsweringMachine(struct ast_channel *chan, const char *data) ); ast_format_clear(&readFormat); - ast_verb(3, "AMD: %s %s %s (Fmt: %s)\n", chan->name, + ast_verb(3, "AMD: %s %s %s (Fmt: %s)\n", ast_channel_name(chan), S_COR(chan->caller.ani.number.valid, chan->caller.ani.number.str, "(N/A)"), S_COR(chan->redirecting.from.number.valid, chan->redirecting.from.number.str, "(N/A)"), ast_getformatname(&chan->readformat)); @@ -246,7 +246,7 @@ static void isAnsweringMachine(struct ast_channel *chan, const char *data) /* Set read format to signed linear so we get signed linear frames in */ ast_format_copy(&readFormat, &chan->readformat); if (ast_set_read_format_by_id(chan, AST_FORMAT_SLINEAR) < 0 ) { - ast_log(LOG_WARNING, "AMD: Channel [%s]. Unable to set to linear mode, giving up\n", chan->name ); + ast_log(LOG_WARNING, "AMD: Channel [%s]. Unable to set to linear mode, giving up\n", ast_channel_name(chan)); pbx_builtin_setvar_helper(chan , "AMDSTATUS", ""); pbx_builtin_setvar_helper(chan , "AMDCAUSE", ""); return; @@ -254,7 +254,7 @@ static void isAnsweringMachine(struct ast_channel *chan, const char *data) /* Create a new DSP that will detect the silence */ if (!(silenceDetector = ast_dsp_new())) { - ast_log(LOG_WARNING, "AMD: Channel [%s]. Unable to create silence detector :(\n", chan->name ); + ast_log(LOG_WARNING, "AMD: Channel [%s]. Unable to create silence detector :(\n", ast_channel_name(chan)); pbx_builtin_setvar_helper(chan , "AMDSTATUS", ""); pbx_builtin_setvar_helper(chan , "AMDCAUSE", ""); return; @@ -268,7 +268,7 @@ static void isAnsweringMachine(struct ast_channel *chan, const char *data) /* If we fail to read in a frame, that means they hung up */ if (!(f = ast_read(chan))) { - ast_verb(3, "AMD: Channel [%s]. HANGUP\n", chan->name); + ast_verb(3, "AMD: Channel [%s]. HANGUP\n", ast_channel_name(chan)); ast_debug(1, "Got hangup\n"); strcpy(amdStatus, "HANGUP"); res = 1; @@ -285,7 +285,7 @@ static void isAnsweringMachine(struct ast_channel *chan, const char *data) iTotalTime += framelength; if (iTotalTime >= totalAnalysisTime) { - ast_verb(3, "AMD: Channel [%s]. Too long...\n", chan->name ); + ast_verb(3, "AMD: Channel [%s]. Too long...\n", ast_channel_name(chan)); ast_frfree(f); strcpy(amdStatus , "NOTSURE"); sprintf(amdCause , "TOOLONG-%d", iTotalTime); @@ -305,11 +305,11 @@ static void isAnsweringMachine(struct ast_channel *chan, const char *data) if (silenceDuration >= betweenWordsSilence) { if (currentState != STATE_IN_SILENCE ) { - ast_verb(3, "AMD: Channel [%s]. Changed state to STATE_IN_SILENCE\n", chan->name); + ast_verb(3, "AMD: Channel [%s]. Changed state to STATE_IN_SILENCE\n", ast_channel_name(chan)); } /* Find words less than word duration */ if (consecutiveVoiceDuration < minimumWordLength && consecutiveVoiceDuration > 0){ - ast_verb(3, "AMD: Channel [%s]. Short Word Duration: %d\n", chan->name, consecutiveVoiceDuration); + ast_verb(3, "AMD: Channel [%s]. Short Word Duration: %d\n", ast_channel_name(chan), consecutiveVoiceDuration); } currentState = STATE_IN_SILENCE; consecutiveVoiceDuration = 0; @@ -317,7 +317,7 @@ static void isAnsweringMachine(struct ast_channel *chan, const char *data) if (inInitialSilence == 1 && silenceDuration >= initialSilence) { ast_verb(3, "AMD: Channel [%s]. ANSWERING MACHINE: silenceDuration:%d initialSilence:%d\n", - chan->name, silenceDuration, initialSilence); + ast_channel_name(chan), silenceDuration, initialSilence); ast_frfree(f); strcpy(amdStatus , "MACHINE"); sprintf(amdCause , "INITIALSILENCE-%d-%d", silenceDuration, initialSilence); @@ -327,7 +327,7 @@ static void isAnsweringMachine(struct ast_channel *chan, const char *data) if (silenceDuration >= afterGreetingSilence && inGreeting == 1) { ast_verb(3, "AMD: Channel [%s]. HUMAN: silenceDuration:%d afterGreetingSilence:%d\n", - chan->name, silenceDuration, afterGreetingSilence); + ast_channel_name(chan), silenceDuration, afterGreetingSilence); ast_frfree(f); strcpy(amdStatus , "HUMAN"); sprintf(amdCause , "HUMAN-%d-%d", silenceDuration, afterGreetingSilence); @@ -343,18 +343,18 @@ static void isAnsweringMachine(struct ast_channel *chan, const char *data) number of words if my previous state was Silence, which means that I moved into a word. */ if (consecutiveVoiceDuration >= minimumWordLength && currentState == STATE_IN_SILENCE) { iWordsCount++; - ast_verb(3, "AMD: Channel [%s]. Word detected. iWordsCount:%d\n", chan->name, iWordsCount); + ast_verb(3, "AMD: Channel [%s]. Word detected. iWordsCount:%d\n", ast_channel_name(chan), iWordsCount); currentState = STATE_IN_WORD; } if (consecutiveVoiceDuration >= maximumWordLength){ - ast_verb(3, "AMD: Channel [%s]. Maximum Word Length detected. [%d]\n", chan->name, consecutiveVoiceDuration); + ast_verb(3, "AMD: Channel [%s]. Maximum Word Length detected. [%d]\n", ast_channel_name(chan), consecutiveVoiceDuration); ast_frfree(f); strcpy(amdStatus , "MACHINE"); sprintf(amdCause , "MAXWORDLENGTH-%d", consecutiveVoiceDuration); break; } if (iWordsCount >= maximumNumberOfWords) { - ast_verb(3, "AMD: Channel [%s]. ANSWERING MACHINE: iWordsCount:%d\n", chan->name, iWordsCount); + ast_verb(3, "AMD: Channel [%s]. ANSWERING MACHINE: iWordsCount:%d\n", ast_channel_name(chan), iWordsCount); ast_frfree(f); strcpy(amdStatus , "MACHINE"); sprintf(amdCause , "MAXWORDS-%d-%d", iWordsCount, maximumNumberOfWords); @@ -363,7 +363,7 @@ static void isAnsweringMachine(struct ast_channel *chan, const char *data) } if (inGreeting == 1 && voiceDuration >= greeting) { - ast_verb(3, "AMD: Channel [%s]. ANSWERING MACHINE: voiceDuration:%d greeting:%d\n", chan->name, voiceDuration, greeting); + ast_verb(3, "AMD: Channel [%s]. ANSWERING MACHINE: voiceDuration:%d greeting:%d\n", ast_channel_name(chan), voiceDuration, greeting); ast_frfree(f); strcpy(amdStatus , "MACHINE"); sprintf(amdCause , "LONGGREETING-%d-%d", voiceDuration, greeting); @@ -373,13 +373,13 @@ static void isAnsweringMachine(struct ast_channel *chan, const char *data) if (voiceDuration >= minimumWordLength ) { if (silenceDuration > 0) - ast_verb(3, "AMD: Channel [%s]. Detected Talk, previous silence duration: %d\n", chan->name, silenceDuration); + ast_verb(3, "AMD: Channel [%s]. Detected Talk, previous silence duration: %d\n", ast_channel_name(chan), silenceDuration); silenceDuration = 0; } if (consecutiveVoiceDuration >= minimumWordLength && inGreeting == 0) { /* Only go in here once to change the greeting flag when we detect the 1st word */ if (silenceDuration > 0) - ast_verb(3, "AMD: Channel [%s]. Before Greeting Time: silenceDuration: %d voiceDuration: %d\n", chan->name, silenceDuration, voiceDuration); + ast_verb(3, "AMD: Channel [%s]. Before Greeting Time: silenceDuration: %d voiceDuration: %d\n", ast_channel_name(chan), silenceDuration, voiceDuration); inInitialSilence = 0; inGreeting = 1; } @@ -391,7 +391,7 @@ static void isAnsweringMachine(struct ast_channel *chan, const char *data) if (!res) { /* It took too long to get a frame back. Giving up. */ - ast_verb(3, "AMD: Channel [%s]. Too long...\n", chan->name); + ast_verb(3, "AMD: Channel [%s]. Too long...\n", ast_channel_name(chan)); strcpy(amdStatus , "NOTSURE"); sprintf(amdCause , "TOOLONG-%d", iTotalTime); } @@ -402,7 +402,7 @@ static void isAnsweringMachine(struct ast_channel *chan, const char *data) /* 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); diff --git a/apps/app_chanisavail.c b/apps/app_chanisavail.c index 86ce34177..37ba214ca 100644 --- a/apps/app_chanisavail.c +++ b/apps/app_chanisavail.c @@ -170,7 +170,7 @@ static int chanavail_exec(struct ast_channel *chan, const char *data) 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); diff --git a/apps/app_chanspy.c b/apps/app_chanspy.c index 278098c10..af816f320 100644 --- a/apps/app_chanspy.c +++ b/apps/app_chanspy.c @@ -484,7 +484,7 @@ static int start_spying(struct ast_autochan *autochan, const char *spychan_name, int res = 0; struct ast_channel *peer = NULL; - ast_log(LOG_NOTICE, "Attaching %s to %s\n", spychan_name, autochan->chan->name); + ast_log(LOG_NOTICE, "Attaching %s to %s\n", spychan_name, ast_channel_name(autochan->chan)); ast_set_flag(audiohook, AST_AUDIOHOOK_TRIGGER_SYNC | AST_AUDIOHOOK_SMALL_QUEUE); res = ast_audiohook_attach(autochan->chan, audiohook); @@ -524,7 +524,7 @@ static int channel_spy(struct ast_channel *chan, struct ast_autochan *spyee_auto struct ast_channel *chans[] = { chan, spyee_autochan->chan }; ast_channel_lock(chan); - spyer_name = ast_strdupa(chan->name); + spyer_name = ast_strdupa(ast_channel_name(chan)); ast_channel_unlock(chan); /* We now hold the channel lock on spyee */ @@ -534,7 +534,7 @@ static int channel_spy(struct ast_channel *chan, struct ast_autochan *spyee_auto } ast_channel_lock(spyee_autochan->chan); - name = ast_strdupa(spyee_autochan->chan->name); + name = ast_strdupa(ast_channel_name(spyee_autochan->chan)); ast_channel_unlock(spyee_autochan->chan); ast_verb(2, "Spying on channel %s\n", name); @@ -685,7 +685,7 @@ static int channel_spy(struct ast_channel *chan, struct ast_autochan *spyee_auto (*volfactor)++; if (*volfactor > 4) *volfactor = -4; - ast_verb(3, "Setting spy volume on %s to %d\n", chan->name, *volfactor); + ast_verb(3, "Setting spy volume on %s to %d\n", ast_channel_name(chan), *volfactor); csth.volfactor = *volfactor; csth.spy_audiohook.options.read_volume = csth.volfactor; @@ -747,7 +747,7 @@ redo: return NULL; } - if (!strncmp(next->name, "DAHDI/pseudo", pseudo_len)) { + if (!strncmp(ast_channel_name(next), "DAHDI/pseudo", pseudo_len)) { goto redo; } else if (next == chan) { goto redo; @@ -925,7 +925,7 @@ static int common_exec(struct ast_channel *chan, struct ast_flags *flags, snprintf(buffer, sizeof(buffer) - 1, ":%s:", myenforced); - ast_copy_string(ext + 1, autochan->chan->name, sizeof(ext) - 1); + ast_copy_string(ext + 1, ast_channel_name(autochan->chan), sizeof(ext) - 1); if ((end = strchr(ext, '-'))) { *end++ = ':'; *end = '\0'; @@ -943,7 +943,7 @@ static int common_exec(struct ast_channel *chan, struct ast_flags *flags, } 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, "-"); diff --git a/apps/app_confbridge.c b/apps/app_confbridge.c index d5609b741..8683c95f8 100644 --- a/apps/app_confbridge.c +++ b/apps/app_confbridge.c @@ -545,7 +545,7 @@ static void send_join_event(struct ast_channel *chan, const char *conf_name) "Conference: %s\r\n" "CallerIDnum: %s\r\n" "CallerIDname: %s\r\n", - chan->name, + ast_channel_name(chan), chan->uniqueid, conf_name, S_COR(chan->caller.id.number.valid, chan->caller.id.number.str, "<unknown>"), @@ -561,7 +561,7 @@ static void send_leave_event(struct ast_channel *chan, const char *conf_name) "Conference: %s\r\n" "CallerIDnum: %s\r\n" "CallerIDname: %s\r\n", - chan->name, + ast_channel_name(chan), chan->uniqueid, conf_name, S_COR(chan->caller.id.number.valid, chan->caller.id.number.str, "<unknown>"), @@ -1165,7 +1165,7 @@ static int play_sound_helper(struct conference_bridge *conference_bridge, const ast_say_number(conference_bridge->playback_chan, say_number, "", conference_bridge->playback_chan->language, NULL); } - ast_debug(1, "Departing underlying channel '%s' from bridge '%p'\n", underlying_channel->name, conference_bridge->bridge); + ast_debug(1, "Departing underlying channel '%s' from bridge '%p'\n", ast_channel_name(underlying_channel), conference_bridge->bridge); ast_bridge_depart(conference_bridge->bridge, underlying_channel); ast_mutex_unlock(&conference_bridge->playback_lock); @@ -1228,7 +1228,7 @@ static void conf_handle_talker_cb(struct ast_bridge *bridge, struct ast_bridge_c "Uniqueid: %s\r\n" "Conference: %s\r\n" "TalkingStatus: %s\r\n", - bridge_channel->chan->name, bridge_channel->chan->uniqueid, conf_name, talking ? "on" : "off"); + ast_channel_name(bridge_channel->chan), bridge_channel->chan->uniqueid, conf_name, talking ? "on" : "off"); } static int conf_get_pin(struct ast_channel *chan, struct conference_bridge_user *conference_bridge_user) @@ -1548,7 +1548,7 @@ static int action_toggle_mute(struct conference_bridge *conference_bridge, /* Mute or unmute yourself, note we only allow manipulation if they aren't waiting for a marked user or if marked users exist */ if (!ast_test_flag(&conference_bridge_user->u_profile, USER_OPT_WAITMARKED) || conference_bridge->markedusers) { conference_bridge_user->features.mute = (!conference_bridge_user->features.mute ? 1 : 0); - ast_test_suite_event_notify("CONF_MUTE", "Message: participant %s %s\r\nConference: %s\r\nChannel: %s", chan->name, conference_bridge_user->features.mute ? "muted" : "unmuted", conference_bridge_user->b_profile.name, chan->name); + ast_test_suite_event_notify("CONF_MUTE", "Message: participant %s %s\r\nConference: %s\r\nChannel: %s", ast_channel_name(chan), conference_bridge_user->features.mute ? "muted" : "unmuted", conference_bridge_user->b_profile.name, ast_channel_name(chan)); } return ast_stream_and_wait(chan, (conference_bridge_user->features.mute ? conf_get_sound(CONF_SOUND_MUTED, conference_bridge_user->b_profile.sounds) : @@ -1684,7 +1684,7 @@ static int action_kick_last(struct conference_bridge *conference_bridge, conf_get_sound(CONF_SOUND_ERROR_MENU, conference_bridge_user->b_profile.sounds), ""); ast_log(LOG_WARNING, "Only admin users can use the kick_last menu action. Channel %s of conf %s is not an admin.\n", - bridge_channel->chan->name, + ast_channel_name(bridge_channel->chan), conference_bridge->name); return -1; } @@ -1938,12 +1938,12 @@ static char *handle_cli_confbridge_kick(struct ast_cli_entry *e, int cmd, struct } ao2_lock(bridge); AST_LIST_TRAVERSE(&bridge->users_list, participant, list) { - if (!strncmp(a->argv[3], participant->chan->name, strlen(participant->chan->name))) { + if (!strncmp(a->argv[3], ast_channel_name(participant->chan), strlen(ast_channel_name(participant->chan)))) { break; } } if (participant) { - ast_cli(a->fd, "Kicking %s from confbridge %s\n", participant->chan->name, bridge->name); + ast_cli(a->fd, "Kicking %s from confbridge %s\n", ast_channel_name(participant->chan), bridge->name); participant->kicked = 1; ast_bridge_remove(bridge->bridge, participant->chan); } @@ -1996,7 +1996,7 @@ static char *handle_cli_confbridge_list(struct ast_cli_entry *e, int cmd, struct ast_cli(a->fd, "============================= ================ ================ ================ ================\n"); ao2_lock(bridge); AST_LIST_TRAVERSE(&bridge->users_list, participant, list) { - ast_cli(a->fd, "%-29s ", participant->chan->name); + ast_cli(a->fd, "%-29s ", ast_channel_name(participant->chan)); ast_cli(a->fd, "%-17s", participant->u_profile.name); ast_cli(a->fd, "%-17s", participant->b_profile.name); ast_cli(a->fd, "%-17s", participant->menu_name); @@ -2057,13 +2057,13 @@ static int generic_mute_unmute_helper(int mute, const char *conference, const ch } ao2_lock(bridge); AST_LIST_TRAVERSE(&bridge->users_list, participant, list) { - if (!strncmp(user, participant->chan->name, strlen(user))) { + if (!strncmp(user, ast_channel_name(participant->chan), strlen(user))) { break; } } if (participant) { participant->features.mute = mute; - ast_test_suite_event_notify("CONF_MUTE", "Message: participant %s %s\r\nConference: %s\r\nChannel: %s", participant->chan->name, participant->features.mute ? "muted" : "unmuted", bridge->b_profile.name, participant->chan->name); + ast_test_suite_event_notify("CONF_MUTE", "Message: participant %s %s\r\nConference: %s\r\nChannel: %s", ast_channel_name(participant->chan), participant->features.mute ? "muted" : "unmuted", bridge->b_profile.name, ast_channel_name(participant->chan)); } else { res = -2;; } @@ -2340,7 +2340,7 @@ static int action_confbridgelist(struct mansession *s, const struct message *m) bridge->name, S_COR(participant->chan->caller.id.number.valid, participant->chan->caller.id.number.str, "<unknown>"), S_COR(participant->chan->caller.id.name.valid, participant->chan->caller.id.name.str, "<no name>"), - participant->chan->name, + ast_channel_name(participant->chan), ast_test_flag(&participant->u_profile, USER_OPT_ADMIN) ? "Yes" : "No", ast_test_flag(&participant->u_profile, USER_OPT_MARKEDUSER) ? "Yes" : "No"); } @@ -2508,7 +2508,7 @@ static int action_confbridgekick(struct mansession *s, const struct message *m) ao2_lock(bridge); AST_LIST_TRAVERSE(&bridge->users_list, participant, list) { - if (!strcasecmp(participant->chan->name, channel)) { + if (!strcasecmp(ast_channel_name(participant->chan), channel)) { participant->kicked = 1; ast_bridge_remove(bridge->bridge, participant->chan); found = 1; @@ -2635,7 +2635,7 @@ static int action_confbridgesetsinglevideosrc(struct mansession *s, const struct /* 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; } diff --git a/apps/app_dahdibarge.c b/apps/app_dahdibarge.c index bb0120cbc..5384c6814 100644 --- a/apps/app_dahdibarge.c +++ b/apps/app_dahdibarge.c @@ -117,13 +117,13 @@ static int conf_run(struct ast_channel *chan, int confno, int confflags) /* Set it into U-law mode (write) */ if (ast_set_write_format_by_id(chan, AST_FORMAT_ULAW) < 0) { - ast_log(LOG_WARNING, "Unable to set '%s' to write ulaw mode\n", chan->name); + ast_log(LOG_WARNING, "Unable to set '%s' to write ulaw mode\n", ast_channel_name(chan)); goto outrun; } /* Set it into U-law mode (read) */ if (ast_set_read_format_by_id(chan, AST_FORMAT_ULAW) < 0) { - ast_log(LOG_WARNING, "Unable to set '%s' to read ulaw mode\n", chan->name); + ast_log(LOG_WARNING, "Unable to set '%s' to read ulaw mode\n", ast_channel_name(chan)); goto outrun; } ast_indicate(chan, -1); @@ -192,7 +192,7 @@ dahdiretry: 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; diff --git a/apps/app_dahdiras.c b/apps/app_dahdiras.c index fbaf98450..dcf0cafb3 100644 --- a/apps/app_dahdiras.c +++ b/apps/app_dahdiras.c @@ -141,7 +141,7 @@ static void run_ras(struct ast_channel *chan, char *args) res = ioctl(chan->fds[0], DAHDI_GET_BUFINFO, &savebi); if(res) { - ast_log(LOG_WARNING, "Unable to check buffer policy on channel %s\n", chan->name); + ast_log(LOG_WARNING, "Unable to check buffer policy on channel %s\n", ast_channel_name(chan)); return; } @@ -154,7 +154,7 @@ static void run_ras(struct ast_channel *chan, char *args) if (!res) { /* Check for hangup */ if (ast_check_hangup(chan) && !signalled) { - ast_debug(1, "Channel '%s' hungup. Signalling RAS at %d to die...\n", chan->name, pid); + ast_debug(1, "Channel '%s' hungup. Signalling RAS at %d to die...\n", ast_channel_name(chan), pid); kill(pid, SIGTERM); signalled=1; } @@ -166,12 +166,12 @@ static void run_ras(struct ast_channel *chan, char *args) ast_log(LOG_WARNING, "wait4 returned %d: %s\n", res, strerror(errno)); } if (WIFEXITED(status)) { - ast_verb(3, "RAS on %s terminated with status %d\n", chan->name, WEXITSTATUS(status)); + ast_verb(3, "RAS on %s terminated with status %d\n", ast_channel_name(chan), WEXITSTATUS(status)); } else if (WIFSIGNALED(status)) { ast_verb(3, "RAS on %s terminated with signal %d\n", - chan->name, WTERMSIG(status)); + ast_channel_name(chan), WTERMSIG(status)); } else { - ast_verb(3, "RAS on %s terminated weirdly.\n", chan->name); + ast_verb(3, "RAS on %s terminated weirdly.\n", ast_channel_name(chan)); } /* Throw back into audio mode */ x = 1; @@ -180,7 +180,7 @@ static void run_ras(struct ast_channel *chan, char *args) /* Restore saved values */ res = ioctl(chan->fds[0], DAHDI_SET_BUFINFO, &savebi); if (res < 0) { - ast_log(LOG_WARNING, "Unable to set buffer policy on channel %s\n", chan->name); + ast_log(LOG_WARNING, "Unable to set buffer policy on channel %s\n", ast_channel_name(chan)); } break; } @@ -205,17 +205,17 @@ static int dahdiras_exec(struct ast_channel *chan, const char *data) 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); } diff --git a/apps/app_dial.c b/apps/app_dial.c index 24bff278a..2c7f50a9e 100644 --- a/apps/app_dial.c +++ b/apps/app_dial.c @@ -801,7 +801,7 @@ static void senddialevent(struct ast_channel *src, struct ast_channel *dst, cons "UniqueID: %s\r\n" "DestUniqueID: %s\r\n" "Dialstring: %s\r\n", - src->name, dst->name, + ast_channel_name(src), ast_channel_name(dst), S_COR(src->caller.id.number.valid, src->caller.id.number.str, "<unknown>"), S_COR(src->caller.id.name.valid, src->caller.id.name.str, "<unknown>"), S_COR(src->connected.id.number.valid, src->connected.id.number.str, "<unknown>"), @@ -817,7 +817,7 @@ static void senddialendevent(struct ast_channel *src, const char *dialstatus) "Channel: %s\r\n" "UniqueID: %s\r\n" "DialStatus: %s\r\n", - src->name, src->uniqueid, dialstatus); + ast_channel_name(src), src->uniqueid, dialstatus); } /*! @@ -861,10 +861,10 @@ static void do_forward(struct chanlist *o, ast_cel_report_event(in, AST_CEL_FORWARD, NULL, c->call_forward, NULL); /* Before processing channel, go ahead and check for forwarding */ - ast_verb(3, "Now forwarding %s to '%s/%s' (thanks to %s)\n", in->name, tech, stuff, c->name); + ast_verb(3, "Now forwarding %s to '%s/%s' (thanks to %s)\n", ast_channel_name(in), tech, stuff, ast_channel_name(c)); /* If we have been told to ignore forwards, just set this channel to null and continue processing extensions normally */ if (ast_test_flag64(peerflags, OPT_IGNORE_FORWARDING)) { - ast_verb(3, "Forwarding %s to '%s/%s' prevented.\n", in->name, tech, stuff); + ast_verb(3, "Forwarding %s to '%s/%s' prevented.\n", ast_channel_name(in), tech, stuff); c = o->chan = NULL; cause = AST_CAUSE_BUSY; } else { @@ -880,7 +880,7 @@ static void do_forward(struct chanlist *o, * any Dial operations that happen later won't record CC interfaces. */ ast_ignore_cc(o->chan); - ast_log(LOG_NOTICE, "Not accepting call completion offers from call-forward recipient %s\n", o->chan->name); + ast_log(LOG_NOTICE, "Not accepting call completion offers from call-forward recipient %s\n", ast_channel_name(o->chan)); } else ast_log(LOG_NOTICE, "Forwarding failed to create channel to dial '%s/%s' (cause = %d)\n", @@ -1102,7 +1102,7 @@ static struct ast_channel *wait_for_answer(struct ast_channel *in, continue; if (ast_test_flag64(o, DIAL_STILLGOING) && c->_state == AST_STATE_UP) { if (!peer) { - ast_verb(3, "%s answered %s\n", c->name, in->name); + ast_verb(3, "%s answered %s\n", ast_channel_name(c), ast_channel_name(in)); if (!single && !ast_test_flag64(peerflags, OPT_IGNORE_CONNECTEDLINE)) { if (o->pending_connected_update) { if (ast_channel_connected_line_macro(c, in, &o->connected, 1, 0)) { @@ -1172,7 +1172,7 @@ static struct ast_channel *wait_for_answer(struct ast_channel *in, case AST_CONTROL_ANSWER: /* This is our guy if someone answered. */ if (!peer) { - ast_verb(3, "%s answered %s\n", c->name, in->name); + ast_verb(3, "%s answered %s\n", ast_channel_name(c), ast_channel_name(in)); if (!single && !ast_test_flag64(peerflags, OPT_IGNORE_CONNECTEDLINE)) { if (o->pending_connected_update) { if (ast_channel_connected_line_macro(c, in, &o->connected, 1, 0)) { @@ -1218,7 +1218,7 @@ static struct ast_channel *wait_for_answer(struct ast_channel *in, c->hangupcause = AST_CAUSE_NORMAL_CLEARING; break; case AST_CONTROL_BUSY: - ast_verb(3, "%s is busy\n", c->name); + ast_verb(3, "%s is busy\n", ast_channel_name(c)); in->hangupcause = c->hangupcause; ast_hangup(c); c = o->chan = NULL; @@ -1226,7 +1226,7 @@ static struct ast_channel *wait_for_answer(struct ast_channel *in, 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; @@ -1261,7 +1261,7 @@ static struct ast_channel *wait_for_answer(struct ast_channel *in, */ ++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); @@ -1272,7 +1272,7 @@ static struct ast_channel *wait_for_answer(struct ast_channel *in, } 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); @@ -1289,19 +1289,19 @@ static struct ast_channel *wait_for_answer(struct ast_channel *in, } 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); @@ -1326,9 +1326,9 @@ static struct ast_channel *wait_for_answer(struct ast_channel *in, 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); } @@ -1336,18 +1336,18 @@ static struct ast_channel *wait_for_answer(struct ast_channel *in, } 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: @@ -1362,7 +1362,7 @@ static struct ast_channel *wait_for_answer(struct ast_channel *in, 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; } @@ -1484,7 +1484,7 @@ static struct ast_channel *wait_for_answer(struct ast_channel *in, 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: @@ -1722,7 +1722,7 @@ static int setup_privacy_args(struct privacy_args *pa, } 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? */ @@ -2342,7 +2342,7 @@ static int dial_exec_full(struct ast_channel *chan, const char *data, struct ast /* 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) { @@ -2460,11 +2460,11 @@ static int dial_exec_full(struct ast_channel *chan, const char *data, struct ast 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"); @@ -2813,7 +2813,7 @@ static int dial_exec_full(struct ast_channel *chan, const char *data, struct ast /* 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; @@ -2852,8 +2852,8 @@ static int dial_exec_full(struct ast_channel *chan, const char *data, struct ast 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 */ } diff --git a/apps/app_directed_pickup.c b/apps/app_directed_pickup.c index b01ec4c69..4fda8320e 100644 --- a/apps/app_directed_pickup.c +++ b/apps/app_directed_pickup.c @@ -113,7 +113,7 @@ static int pickup_by_name_cb(void *obj, void *arg, void *data, int flags) 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; } @@ -183,7 +183,7 @@ static int pickup_by_exten(struct ast_channel *chan, const char *exten, const ch 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); @@ -259,7 +259,7 @@ static int pickup_by_group(struct ast_channel *chan) /* 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); @@ -308,7 +308,7 @@ static int find_by_part(void *obj, void *arg, void *data, int flags) 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; @@ -359,7 +359,7 @@ static int pickupchan_exec(struct ast_channel *chan, const char *data) /* 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) { diff --git a/apps/app_disa.c b/apps/app_disa.c index 3ca080009..ce175bc20 100644 --- a/apps/app_disa.c +++ b/apps/app_disa.c @@ -210,7 +210,7 @@ static int disa_exec(struct ast_channel *chan, const char *data) /* 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; } @@ -256,7 +256,7 @@ static int disa_exec(struct ast_channel *chan, const char *data) 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; } @@ -294,12 +294,12 @@ static int disa_exec(struct ast_channel *chan, const char *data) } /* 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 */ @@ -307,7 +307,7 @@ static int disa_exec(struct ast_channel *chan, const char *data) 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 { diff --git a/apps/app_dumpchan.c b/apps/app_dumpchan.c index 0a9fa6888..9b0096f0a 100644 --- a/apps/app_dumpchan.c +++ b/apps/app_dumpchan.c @@ -127,7 +127,7 @@ static int serialize_showchan(struct ast_channel *c, char *buf, size_t size) "Application= %s\n" "Data= %s\n" "Blocking_in= %s\n", - c->name, + ast_channel_name(c), c->tech->type, c->uniqueid, c->linkedid, @@ -158,8 +158,8 @@ static int serialize_showchan(struct ast_channel *c, char *buf, size_t size) 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, @@ -191,7 +191,7 @@ static int dumpchan_exec(struct ast_channel *chan, const char *data) "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; diff --git a/apps/app_externalivr.c b/apps/app_externalivr.c index 4eb99c1bb..d8ff60ab0 100644 --- a/apps/app_externalivr.c +++ b/apps/app_externalivr.c @@ -97,7 +97,7 @@ ASTERISK_FILE_VERSION(__FILE__, "$Revision$") 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 */ diff --git a/apps/app_fax.c b/apps/app_fax.c index 5285ba833..e4cf44f62 100644 --- a/apps/app_fax.c +++ b/apps/app_fax.c @@ -265,7 +265,7 @@ static void phase_e_handler(t30_state_t *f, void *user_data, int result) "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, ""), @@ -350,7 +350,7 @@ static int fax_generator_generate(struct ast_channel *chan, void *data, int len, 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; } } @@ -408,11 +408,11 @@ static int transmit_audio(fax_session *s) 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) { @@ -421,7 +421,7 @@ static int transmit_audio(fax_session *s) 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; } } @@ -435,14 +435,14 @@ static int transmit_audio(fax_session *s) 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); @@ -594,12 +594,12 @@ static int transmit_audio(fax_session *s) 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; @@ -735,11 +735,11 @@ disable_t38: 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) { @@ -748,7 +748,7 @@ disable_t38: 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; } } @@ -762,13 +762,13 @@ disable_t38: 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); @@ -802,7 +802,7 @@ static int transmit(fax_session *s) * 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; } } diff --git a/apps/app_flash.c b/apps/app_flash.c index 3273b5b0a..283953b39 100644 --- a/apps/app_flash.c +++ b/apps/app_flash.c @@ -80,7 +80,7 @@ static int flash_exec(struct ast_channel *chan, const char *data) 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; } @@ -96,13 +96,13 @@ static int flash_exec(struct ast_channel *chan, const char *data) 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; } diff --git a/apps/app_followme.c b/apps/app_followme.c index 6d46a1fd5..d3e8f4778 100644 --- a/apps/app_followme.c +++ b/apps/app_followme.c @@ -681,7 +681,7 @@ static struct ast_channel *wait_for_winner(struct findme_user_listptr *findme_us 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; } @@ -692,7 +692,7 @@ static struct ast_channel *wait_for_winner(struct findme_user_listptr *findme_us } 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; @@ -720,38 +720,38 @@ static struct ast_channel *wait_for_winner(struct findme_user_listptr *findme_us } 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); @@ -1206,7 +1206,7 @@ static int app_exec(struct ast_channel *chan, const char *data) /* 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; } diff --git a/apps/app_getcpeid.c b/apps/app_getcpeid.c index 7f59976eb..30b5d78a4 100644 --- a/apps/app_getcpeid.c +++ b/apps/app_getcpeid.c @@ -87,7 +87,7 @@ static int cpeid_exec(struct ast_channel *chan, const char *idata) 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..."); @@ -95,7 +95,7 @@ static int cpeid_exec(struct ast_channel *chan, const char *idata) 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; } } diff --git a/apps/app_jack.c b/apps/app_jack.c index 893a5dec0..46024ff39 100644 --- a/apps/app_jack.c +++ b/apps/app_jack.c @@ -396,7 +396,7 @@ static int init_jack_data(struct ast_channel *chan, struct jack_data *jack_data) 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); } @@ -833,7 +833,7 @@ static int jack_hook_callback(struct ast_audiohook *audiohook, struct ast_channe 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; } @@ -863,7 +863,7 @@ static int enable_jack_hook(struct ast_channel *chan, char *data) 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; } diff --git a/apps/app_macro.c b/apps/app_macro.c index 8a31dc221..86017e6ed 100644 --- a/apps/app_macro.c +++ b/apps/app_macro.c @@ -426,8 +426,8 @@ static int _macro_exec(struct ast_channel *chan, const char *data, int exclusive 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; } } @@ -494,7 +494,7 @@ static int _macro_exec(struct ast_channel *chan, const char *data, int exclusive } 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; } diff --git a/apps/app_meetme.c b/apps/app_meetme.c index 956f95c52..2b3f5c43f 100644 --- a/apps/app_meetme.c +++ b/apps/app_meetme.c @@ -1511,7 +1511,7 @@ static char *meetme_show_cmd(struct ast_cli_entry *e, int cmd, struct ast_cli_ar 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)" : "", @@ -1522,7 +1522,7 @@ static char *meetme_show_cmd(struct ast_cli_entry *e, int cmd, struct ast_cli_ar 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" : "", @@ -1922,7 +1922,7 @@ static void conf_queue_dtmf(const struct ast_conference *conf, 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); @@ -2185,7 +2185,7 @@ static void send_talking_event(struct ast_channel *chan, struct ast_conference * "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) @@ -2663,12 +2663,12 @@ static int conf_run(struct ast_channel *chan, struct ast_conference *conf, struc } 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; } @@ -2775,7 +2775,7 @@ static int conf_run(struct ast_channel *chan, struct ast_conference *conf, struc 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", @@ -2787,7 +2787,7 @@ static int conf_run(struct ast_channel *chan, struct ast_conference *conf, struc "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>"), @@ -3150,7 +3150,7 @@ static int conf_run(struct ast_channel *chan, struct ast_conference *conf, struc "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 */ @@ -3168,7 +3168,7 @@ static int conf_run(struct ast_channel *chan, struct ast_conference *conf, struc "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)) && @@ -3181,7 +3181,7 @@ static int conf_run(struct ast_channel *chan, struct ast_conference *conf, struc "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); } @@ -3194,7 +3194,7 @@ static int conf_run(struct ast_channel *chan, struct ast_conference *conf, struc "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 */ @@ -3505,7 +3505,7 @@ static int conf_run(struct ast_channel *chan, struct ast_conference *conf, struc 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, ""); } @@ -3693,12 +3693,12 @@ static int conf_run(struct ast_channel *chan, struct ast_conference *conf, struc 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) { @@ -3756,7 +3756,7 @@ static int conf_run(struct ast_channel *chan, struct ast_conference *conf, struc */ 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; } } @@ -3780,7 +3780,7 @@ bailoutandtrynormal: 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; @@ -3861,7 +3861,7 @@ bailoutandtrynormal: "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>"), @@ -4629,7 +4629,7 @@ static int user_chan_cb(void *obj, void *args, int flags) 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); } @@ -4894,7 +4894,7 @@ static int meetmemute(struct mansession *s, const struct message *m, int mute) 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"); @@ -4965,7 +4965,7 @@ static int action_meetmelist(struct mansession *s, const struct message *m) 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", diff --git a/apps/app_milliwatt.c b/apps/app_milliwatt.c index dc37e7e89..412ac1ef4 100644 --- a/apps/app_milliwatt.c +++ b/apps/app_milliwatt.c @@ -109,7 +109,7 @@ static int milliwatt_generate(struct ast_channel *chan, void *data, int len, int } 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; } @@ -132,7 +132,7 @@ static int old_milliwatt_exec(struct ast_channel *chan) } 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; } diff --git a/apps/app_minivm.c b/apps/app_minivm.c index edffd4d3f..9348b3a84 100644 --- a/apps/app_minivm.c +++ b/apps/app_minivm.c @@ -1946,7 +1946,7 @@ static int leave_voicemail(struct ast_channel *chan, char *username, struct leav chan->macrocontext, chan->exten, chan->priority, - chan->name, + ast_channel_name(chan), callerid, date, timebuf, diff --git a/apps/app_mixmonitor.c b/apps/app_mixmonitor.c index 82ee8c7ad..b7d40f3f7 100644 --- a/apps/app_mixmonitor.c +++ b/apps/app_mixmonitor.c @@ -610,7 +610,7 @@ static void launch_monitor_thread(struct ast_channel *chan, const char *filename 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); @@ -637,7 +637,7 @@ static void launch_monitor_thread(struct ast_channel *chan, const char *filename 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; diff --git a/apps/app_page.c b/apps/app_page.c index cf2101446..1389c792c 100644 --- a/apps/app_page.c +++ b/apps/app_page.c @@ -171,7 +171,7 @@ static int page_exec(struct ast_channel *chan, const char *data) 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'; } diff --git a/apps/app_parkandannounce.c b/apps/app_parkandannounce.c index c899bd220..f245d5929 100644 --- a/apps/app_parkandannounce.c +++ b/apps/app_parkandannounce.c @@ -182,10 +182,10 @@ static int parkandannounce_exec(struct ast_channel *chan, const char *data) 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; @@ -218,7 +218,7 @@ static int parkandannounce_exec(struct ast_channel *chan, const char *data) 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)); } } } diff --git a/apps/app_playback.c b/apps/app_playback.c index ea4d90b19..6db5377ea 100644 --- a/apps/app_playback.c +++ b/apps/app_playback.c @@ -477,7 +477,7 @@ static int playback_exec(struct ast_channel *chan, const char *data) 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; } diff --git a/apps/app_queue.c b/apps/app_queue.c index de88dcaba..ec9ad3966 100644 --- a/apps/app_queue.c +++ b/apps/app_queue.c @@ -2595,13 +2595,13 @@ static int join_queue(char *queuename, struct queue_ent *qe, enum queue_result * "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"); @@ -2790,7 +2790,7 @@ static int say_position(struct queue_ent *qe, int ringing) 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); @@ -2856,8 +2856,8 @@ static void leave_queue(struct queue_ent *qe) /* 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; @@ -3219,7 +3219,7 @@ static int ring_entry(struct queue_ent *qe, struct callattempt *tmp, int *busies 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); @@ -3264,7 +3264,7 @@ static int ring_entry(struct queue_ent *qe, struct callattempt *tmp, int *busies "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"), @@ -3489,7 +3489,7 @@ static void rna(int rnatime, struct queue_ent *qe, char *interface, char *member "%s", qe->parent->name, qe->chan->uniqueid, - qe->chan->name, + ast_channel_name(qe->chan), interface, membername, rnatime, @@ -3574,7 +3574,7 @@ static struct callattempt *wait_for_answer(struct queue_ent *qe, struct callatte 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); @@ -3638,7 +3638,7 @@ static struct callattempt *wait_for_answer(struct queue_ent *qe, struct callatte 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)) { @@ -3990,10 +3990,10 @@ static int is_our_turn(struct queue_ent *qe) * 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; } @@ -4024,7 +4024,7 @@ static void update_qe_rule(struct queue_ent *qe) 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); } @@ -4269,7 +4269,7 @@ static void send_agent_complete(const struct queue_ent *qe, const char *queuenam "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) : ""); } @@ -4547,7 +4547,7 @@ static int try_calling(struct queue_ent *qe, const char *options, char *announce 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; @@ -4708,7 +4708,7 @@ static int try_calling(struct queue_ent *qe, const char *options, char *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 */ @@ -4775,7 +4775,7 @@ static int try_calling(struct queue_ent *qe, const char *options, char *announce 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", @@ -4785,14 +4785,14 @@ static int try_calling(struct queue_ent *qe, const char *options, char *announce "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); @@ -4807,13 +4807,13 @@ static int try_calling(struct queue_ent *qe, const char *options, char *announce 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); @@ -5140,7 +5140,7 @@ static int try_calling(struct queue_ent *qe, const char *options, char *announce "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)); @@ -5799,7 +5799,7 @@ static int rqm_exec(struct ast_channel *chan, const char *data) 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'; @@ -5871,7 +5871,7 @@ static int aqm_exec(struct ast_channel *chan, const char *data) 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'; @@ -6042,10 +6042,10 @@ static int queue_exec(struct ast_channel *chan, const char *data) 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 { @@ -6057,10 +6057,10 @@ static int queue_exec(struct ast_channel *chan, const char *data) 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 { @@ -6069,10 +6069,10 @@ static int queue_exec(struct ast_channel *chan, const char *data) 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 { @@ -6228,7 +6228,7 @@ check_turns: * 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; } } @@ -7322,7 +7322,7 @@ static char *__queues_show(struct mansession *s, int fd, int argc, const char * 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)); } @@ -7593,7 +7593,7 @@ static int manager_queues_status(struct mansession *s, const struct message *m) "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"), diff --git a/apps/app_readexten.c b/apps/app_readexten.c index 479211911..6e8531d16 100644 --- a/apps/app_readexten.c +++ b/apps/app_readexten.c @@ -246,7 +246,7 @@ static int readexten_exec(struct ast_channel *chan, const char *data) 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"; diff --git a/apps/app_record.c b/apps/app_record.c index 6098ca729..18101e460 100644 --- a/apps/app_record.c +++ b/apps/app_record.c @@ -272,7 +272,7 @@ static int record_exec(struct ast_channel *chan, const char *data) } 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; } @@ -283,7 +283,7 @@ static int record_exec(struct ast_channel *chan, const char *data) 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); } @@ -416,7 +416,7 @@ out: 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); } diff --git a/apps/app_rpt.c b/apps/app_rpt.c index 6722040e5..3a8ef4ad8 100644 --- a/apps/app_rpt.c +++ b/apps/app_rpt.c @@ -1647,7 +1647,7 @@ static const char* dtmf_tones[] = { 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); } @@ -3708,7 +3708,7 @@ int 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; } @@ -3721,7 +3721,7 @@ int 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; } @@ -3733,7 +3733,7 @@ static int saynum(struct ast_channel *mychannel, int num) 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; } @@ -4229,7 +4229,7 @@ struct ast_format_cap *cap = NULL; 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 */ @@ -4238,7 +4238,7 @@ struct ast_format_cap *cap = NULL; 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); } } @@ -4252,7 +4252,7 @@ struct ast_format_cap *cap = NULL; 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])) { @@ -4287,7 +4287,7 @@ struct ast_format_cap *cap = NULL; 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) @@ -4383,7 +4383,7 @@ struct ast_format_cap *cap = NULL; 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; @@ -4446,13 +4446,13 @@ struct ast_format_cap *cap = NULL; 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; @@ -4826,7 +4826,7 @@ struct ast_format_cap *cap = NULL; 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); @@ -4851,7 +4851,7 @@ struct ast_format_cap *cap = NULL; 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; @@ -4868,7 +4868,7 @@ struct ast_format_cap *cap = NULL; 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; } @@ -4878,7 +4878,7 @@ struct ast_format_cap *cap = NULL; 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 */ @@ -4912,7 +4912,7 @@ struct ast_format_cap *cap = NULL; 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 */ @@ -4936,7 +4936,7 @@ struct ast_format_cap *cap = NULL; 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) @@ -4945,7 +4945,7 @@ struct ast_format_cap *cap = NULL; 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; @@ -4980,7 +4980,7 @@ struct ast_format_cap *cap = NULL; 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; @@ -5000,7 +5000,7 @@ struct ast_format_cap *cap = NULL; 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"); @@ -5023,7 +5023,7 @@ struct ast_format_cap *cap = NULL; 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 - @@ -5043,7 +5043,7 @@ struct ast_format_cap *cap = NULL; 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 - @@ -5115,7 +5115,7 @@ struct ast_format_cap *cap = NULL; 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: @@ -5154,7 +5154,7 @@ struct ast_format_cap *cap = NULL; 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; } } @@ -5186,7 +5186,7 @@ struct ast_format_cap *cap = NULL; 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; } } @@ -5829,7 +5829,7 @@ static int connect_link(struct rpt *myrpt, char* node, int mode, int perma) 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); @@ -5838,7 +5838,7 @@ static int connect_link(struct rpt *myrpt, char* node, int mode, int perma) 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]; @@ -7427,7 +7427,7 @@ struct dahdi_radio_param r; 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; } } @@ -10411,7 +10411,7 @@ static int attempt_reconnect(struct rpt *myrpt, struct rpt_link *l) 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); @@ -10421,7 +10421,7 @@ static int attempt_reconnect(struct rpt *myrpt, struct rpt_link *l) 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); @@ -13335,12 +13335,12 @@ static int rpt_exec(struct ast_channel *chan, const char *data) { #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; @@ -13485,7 +13485,7 @@ static int rpt_exec(struct ast_channel *chan, const char *data) 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); @@ -13827,7 +13827,7 @@ static int rpt_exec(struct ast_channel *chan, const char *data) 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); @@ -13869,7 +13869,7 @@ static int rpt_exec(struct ast_channel *chan, const char *data) 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); @@ -14058,7 +14058,7 @@ static int rpt_exec(struct ast_channel *chan, const char *data) 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) { @@ -14596,7 +14596,7 @@ static int rpt_exec(struct ast_channel *chan, const char *data) } /* 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); diff --git a/apps/app_sms.c b/apps/app_sms.c index e3f8c5260..68770da30 100644 --- a/apps/app_sms.c +++ b/apps/app_sms.c @@ -1658,7 +1658,7 @@ static int sms_generate(struct ast_channel *chan, void *data, int len, int sampl } } 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; @@ -2015,7 +2015,7 @@ static int sms_exec(struct ast_channel *chan, const char *data) } 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; } diff --git a/apps/app_softhangup.c b/apps/app_softhangup.c index cdfd7c147..2a4befa9e 100644 --- a/apps/app_softhangup.c +++ b/apps/app_softhangup.c @@ -104,7 +104,7 @@ static int softhangup_exec(struct ast_channel *chan, const char *data) 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")) { @@ -119,7 +119,7 @@ static int softhangup_exec(struct ast_channel *chan, const char *data) *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); diff --git a/apps/app_stack.c b/apps/app_stack.c index c5f0b6aff..83de48187 100644 --- a/apps/app_stack.c +++ b/apps/app_stack.c @@ -231,7 +231,7 @@ static int frame_set_var(struct ast_channel *chan, struct gosub_stack_frame *fra "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; } @@ -358,7 +358,7 @@ static int gosub_exec(struct ast_channel *chan, const char *data) } 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"); diff --git a/apps/app_talkdetect.c b/apps/app_talkdetect.c index 9eb800287..a177227be 100644 --- a/apps/app_talkdetect.c +++ b/apps/app_talkdetect.c @@ -145,7 +145,7 @@ static int background_detect_exec(struct ast_channel *chan, const char *data) } 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(); @@ -160,7 +160,7 @@ static int background_detect_exec(struct ast_channel *chan, const char *data) } 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); @@ -169,7 +169,7 @@ static int background_detect_exec(struct ast_channel *chan, const char *data) * 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)); } } @@ -235,7 +235,7 @@ static int background_detect_exec(struct ast_channel *chan, const char *data) 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) { diff --git a/apps/app_test.c b/apps/app_test.c index 32b6fc02b..9e118669e 100644 --- a/apps/app_test.c +++ b/apps/app_test.c @@ -199,7 +199,7 @@ static int testclient_exec(struct ast_channel *chan, const char *data) 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; @@ -317,7 +317,7 @@ static int testclient_exec(struct ast_channel *chan, const char *data) } 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; @@ -361,7 +361,7 @@ static int testserver_exec(struct ast_channel *chan, const char *data) 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); @@ -467,7 +467,7 @@ static int testserver_exec(struct ast_channel *chan, const char *data) } 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; diff --git a/apps/app_voicemail.c b/apps/app_voicemail.c index 8be69e5a6..062e103d0 100644 --- a/apps/app_voicemail.c +++ b/apps/app_voicemail.c @@ -4757,7 +4757,7 @@ static void make_email_file(FILE *p, char *srcemail, struct ast_vm_user *vmu, in /* 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); @@ -6024,7 +6024,7 @@ static int leave_voicemail(struct ast_channel *chan, char *ext, struct leave_vm_ "macrocontext", chan->macrocontext, "exten", chan->exten, "priority", priority, - "callerchan", chan->name, + "callerchan", ast_channel_name(chan), "callerid", callerid, "origdate", date, "origtime", origtime, @@ -6064,7 +6064,7 @@ static int leave_voicemail(struct ast_channel *chan, char *ext, struct leave_vm_ 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 : ""); diff --git a/apps/app_waitforsilence.c b/apps/app_waitforsilence.c index a920e11a8..3d3aa75df 100644 --- a/apps/app_waitforsilence.c +++ b/apps/app_waitforsilence.c @@ -200,7 +200,7 @@ static int do_waiting(struct ast_channel *chan, int timereqd, time_t waitstart, 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; |