Opaquify channel stringfields
authorTerry Wilson <twilson@digium.com>
Tue, 24 Jan 2012 20:12:09 +0000 (20:12 +0000)
committerTerry Wilson <twilson@digium.com>
Tue, 24 Jan 2012 20:12:09 +0000 (20:12 +0000)
Continue channel opaque-ification by wrapping all of the stringfields.
Eventually, we will restrict what can actually set these variables, but
the purpose for now is to hide the implementation and keep people from
adding code that directly accesses the channel structure. Semantic
changes will follow afterward.

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

git-svn-id: https://origsvn.digium.com/svn/asterisk/trunk@352348 65c4cc65-6c06-0410-ace0-fbb531ad65f3

74 files changed:
addons/app_saycountpl.c
addons/chan_mobile.c
addons/chan_ooh323.c
apps/app_authenticate.c
apps/app_chanspy.c
apps/app_confbridge.c
apps/app_dial.c
apps/app_dictate.c
apps/app_directory.c
apps/app_disa.c
apps/app_dumpchan.c
apps/app_externalivr.c
apps/app_followme.c
apps/app_meetme.c
apps/app_minivm.c
apps/app_page.c
apps/app_parkandannounce.c
apps/app_playback.c
apps/app_privacy.c
apps/app_queue.c
apps/app_readexten.c
apps/app_record.c
apps/app_rpt.c
apps/app_sayunixtime.c
apps/app_speech_utils.c
apps/app_stack.c
apps/app_talkdetect.c
apps/app_userevent.c
apps/app_voicemail.c
channels/chan_agent.c
channels/chan_alsa.c
channels/chan_bridge.c
channels/chan_console.c
channels/chan_dahdi.c
channels/chan_gtalk.c
channels/chan_h323.c
channels/chan_iax2.c
channels/chan_jingle.c
channels/chan_local.c
channels/chan_mgcp.c
channels/chan_misdn.c
channels/chan_multicast_rtp.c
channels/chan_nbs.c
channels/chan_oss.c
channels/chan_phone.c
channels/chan_sip.c
channels/chan_skinny.c
channels/chan_unistim.c
channels/chan_usbradio.c
channels/sig_analog.c
channels/sig_pri.c
funcs/func_channel.c
funcs/func_global.c
include/asterisk/channel.h
main/aoc.c
main/app.c
main/cdr.c
main/cel.c
main/channel.c
main/channel_internal_api.c
main/cli.c
main/dial.c
main/features.c
main/file.c
main/image.c
main/manager.c
main/pbx.c
main/say.c
pbx/pbx_realtime.c
res/res_agi.c
res/res_fax.c
res/res_monitor.c
res/res_musiconhold.c
res/snmp/agent.c

index b4441f2..dce519d 100644 (file)
@@ -67,13 +67,13 @@ static int saywords(struct ast_channel *chan, char *word1, char *word2, char *wo
 
        if (num > 0) {
                if (num % 1000 == 1) {
-                       ast_streamfile(chan, word1, chan->language);
+                       ast_streamfile(chan, word1, ast_channel_language(chan));
                        d = ast_waitstream(chan,"");
                } else if (((num % 10) >= 2) && ((num % 10) <= 4 ) && ((num % 100) < 10 || (num % 100) > 20)) {
-                       ast_streamfile(chan, word2, chan->language);
+                       ast_streamfile(chan, word2, ast_channel_language(chan));
                        d = ast_waitstream(chan, "");
                } else {
-                       ast_streamfile(chan, word5, chan->language);
+                       ast_streamfile(chan, word5, ast_channel_language(chan));
                        d = ast_waitstream(chan, "");
                }
        }
index b99b2d7..0588ef8 100644 (file)
@@ -837,7 +837,7 @@ static struct ast_channel *mbl_new(int state, struct mbl_pvt *pvt, char *cid_num
        ast_dsp_digitreset(pvt->dsp);
 
        chn = ast_channel_alloc(1, state, cid_num, pvt->id, 0, 0, pvt->context,
-                       requestor ? requestor->linkedid : "", 0,
+                       requestor ? ast_channel_linkedid(requestor) : "", 0,
                        "Mobile/%s-%04lx", pvt->id, ast_random() & 0xffff);
        if (!chn) {
                goto e_return;
@@ -854,7 +854,7 @@ static struct ast_channel *mbl_new(int state, struct mbl_pvt *pvt, char *cid_num
        if (state == AST_STATE_RING)
                chn->rings = 1;
 
-       ast_string_field_set(chn, language, "en");
+       ast_channel_language_set(chn, "en");
        pvt->owner = chn;
 
        if (pvt->sco_socket != -1) {
index c1a69bc..1ed389a 100644 (file)
@@ -461,7 +461,7 @@ static struct ast_channel *ooh323_new(struct ooh323_pvt *i, int state,
                }
 
                if (!ast_strlen_zero(i->accountcode))
-                       ast_string_field_set(ch, accountcode, i->accountcode);
+                       ast_channel_accountcode_set(ch, i->accountcode);
                
                if (i->amaflags)
                        ch->amaflags = i->amaflags;
@@ -701,7 +701,7 @@ static struct ast_channel *ooh323_request(const char *type, struct ast_format_ca
 
 
        chan = ooh323_new(p, AST_STATE_DOWN, p->username, cap,
-                                requestor ? requestor->linkedid : NULL);
+                                requestor ? ast_channel_linkedid(requestor) : NULL);
        
        ast_mutex_unlock(&p->lock);
 
index 3bdf483..45e6d96 100644 (file)
@@ -253,10 +253,10 @@ static int auth_exec(struct ast_channel *chan, const char *data)
                        ast_cdr_setaccount(chan, passwd);
                        ast_channel_unlock(chan);
                }
-               if (!(res = ast_streamfile(chan, "auth-thankyou", chan->language)))
+               if (!(res = ast_streamfile(chan, "auth-thankyou", ast_channel_language(chan))))
                        res = ast_waitstream(chan, "");
        } else {
-               if (!ast_streamfile(chan, "vm-goodbye", chan->language))
+               if (!ast_streamfile(chan, "vm-goodbye", ast_channel_language(chan)))
                        res = ast_waitstream(chan, "");
                res = -1;
        }
index af816f3..54e4736 100644 (file)
@@ -800,7 +800,7 @@ static int common_exec(struct ast_channel *chan, struct ast_flags *flags,
                struct ast_channel *prev = NULL;
 
                if (!ast_test_flag(flags, OPTION_QUIET) && num_spyed_upon) {
-                       res = ast_streamfile(chan, "beep", chan->language);
+                       res = ast_streamfile(chan, "beep", ast_channel_language(chan));
                        if (!res)
                                res = ast_waitstream(chan, "");
                        else if (res < 0) {
@@ -960,7 +960,7 @@ static int common_exec(struct ast_channel *chan, struct ast_flags *flags,
                                if (!ast_test_flag(flags, OPTION_NAME) || res < 0) {
                                        if (!ast_test_flag(flags, OPTION_NOTECH)) {
                                                if (ast_fileexists(peer_name, NULL, NULL) > 0) {
-                                                       res = ast_streamfile(chan, peer_name, chan->language);
+                                                       res = ast_streamfile(chan, peer_name, ast_channel_language(chan));
                                                        if (!res) {
                                                                res = ast_waitstream(chan, "");
                                                        }
@@ -969,11 +969,11 @@ static int common_exec(struct ast_channel *chan, struct ast_flags *flags,
                                                                break;
                                                        }
                                                } else {
-                                                       res = ast_say_character_str(chan, peer_name, "", chan->language);
+                                                       res = ast_say_character_str(chan, peer_name, "", ast_channel_language(chan));
                                                }
                                        }
                                        if ((num = atoi(ptr)))
-                                               ast_say_digits(chan, atoi(ptr), "", chan->language);
+                                               ast_say_digits(chan, atoi(ptr), "", ast_channel_language(chan));
                                }
                        }
 
index 1103b6e..46d448a 100644 (file)
@@ -546,7 +546,7 @@ static void send_join_event(struct ast_channel *chan, const char *conf_name)
                "CallerIDnum: %s\r\n"
                "CallerIDname: %s\r\n",
                ast_channel_name(chan),
-               chan->uniqueid,
+               ast_channel_uniqueid(chan),
                conf_name,
                S_COR(chan->caller.id.number.valid, chan->caller.id.number.str, "<unknown>"),
                S_COR(chan->caller.id.name.valid, chan->caller.id.name.str, "<unknown>")
@@ -562,7 +562,7 @@ static void send_leave_event(struct ast_channel *chan, const char *conf_name)
                "CallerIDnum: %s\r\n"
                "CallerIDname: %s\r\n",
                ast_channel_name(chan),
-               chan->uniqueid,
+               ast_channel_uniqueid(chan),
                conf_name,
                S_COR(chan->caller.id.number.valid, chan->caller.id.number.str, "<unknown>"),
                S_COR(chan->caller.id.name.valid, chan->caller.id.name.str, "<unknown>")
@@ -606,7 +606,7 @@ static int announce_user_count(struct conference_bridge *conference_bridge, stru
                                "")) {
                                return -1;
                        }
-                       if (ast_say_number(conference_bridge_user->chan, conference_bridge->users - 1, "", conference_bridge_user->chan->language, NULL)) {
+                       if (ast_say_number(conference_bridge_user->chan, conference_bridge->users - 1, "", ast_channel_language(conference_bridge_user->chan), NULL)) {
                                return -1;
                        }
                        if (ast_stream_and_wait(conference_bridge_user->chan,
@@ -1164,7 +1164,7 @@ static int play_sound_helper(struct conference_bridge *conference_bridge, const
        if (!ast_strlen_zero(filename)) {
                ast_stream_and_wait(conference_bridge->playback_chan, filename, "");
        } else {
-               ast_say_number(conference_bridge->playback_chan, say_number, "", conference_bridge->playback_chan->language, NULL);
+               ast_say_number(conference_bridge->playback_chan, say_number, "", ast_channel_language(conference_bridge->playback_chan), NULL);
        }
 
        ast_debug(1, "Departing underlying channel '%s' from bridge '%p'\n", ast_channel_name(underlying_channel), conference_bridge->bridge);
@@ -1230,7 +1230,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",
-             ast_channel_name(bridge_channel->chan), bridge_channel->chan->uniqueid, conf_name, talking ? "on" : "off");
+             ast_channel_name(bridge_channel->chan), ast_channel_uniqueid(bridge_channel->chan), conf_name, talking ? "on" : "off");
 }
 
 static int conf_get_pin(struct ast_channel *chan, struct conference_bridge_user *conference_bridge_user)
@@ -1252,7 +1252,7 @@ static int conf_get_pin(struct ast_channel *chan, struct conference_bridge_user
                }
                ast_streamfile(chan,
                        conf_get_sound(CONF_SOUND_INVALID_PIN, conference_bridge_user->b_profile.sounds),
-                       chan->language);
+                       ast_channel_language(chan));
                res = ast_waitstream(chan, AST_DIGIT_ANY);
                if (res > 0) {
                        /* Account for digit already read during ivalid pin playback
@@ -1284,7 +1284,7 @@ static int conf_rec_name(struct conference_bridge_user *user, const char *conf_n
        }
        snprintf(user->name_rec_location, sizeof(user->name_rec_location),
                 "%s/confbridge-name-%s-%s", destdir,
-                conf_name, user->chan->uniqueid);
+                conf_name, ast_channel_uniqueid(user->chan));
 
        res = ast_play_and_record(user->chan,
                "vm-rec-name",
@@ -1619,7 +1619,7 @@ static int action_playback_and_continue(struct conference_bridge *conference_bri
        char *file = NULL;
 
        while ((file = strsep(&file_copy, "&"))) {
-               if (ast_streamfile(bridge_channel->chan, file, bridge_channel->chan->language)) {
+               if (ast_streamfile(bridge_channel->chan, file, ast_channel_language(bridge_channel->chan))) {
                        ast_log(LOG_WARNING, "Failed to playback file %s to channel\n", file);
                        return -1;
                }
index 1e06b28..18cbe8d 100644 (file)
@@ -806,7 +806,7 @@ static void senddialevent(struct ast_channel *src, struct ast_channel *dst, cons
                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>"),
                S_COR(src->connected.id.name.valid, src->connected.id.name.str, "<unknown>"),
-               src->uniqueid, dst->uniqueid,
+               ast_channel_uniqueid(src), ast_channel_uniqueid(dst),
                dialstring ? dialstring : "");
 }
 
@@ -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",
-               ast_channel_name(src), src->uniqueid, dialstatus);
+               ast_channel_name(src), ast_channel_uniqueid(src), dialstatus);
 }
 
 /*!
@@ -841,7 +841,7 @@ static void do_forward(struct chanlist *o,
        int cause;
        struct ast_party_caller caller;
 
-       ast_copy_string(tmpchan, c->call_forward, sizeof(tmpchan));
+       ast_copy_string(tmpchan, ast_channel_call_forward(c), sizeof(tmpchan));
        if ((stuff = strchr(tmpchan, '/'))) {
                *stuff++ = '\0';
                tech = tmpchan;
@@ -852,13 +852,13 @@ static void do_forward(struct chanlist *o,
                if (ast_strlen_zero(forward_context)) {
                        forward_context = NULL;
                }
-               snprintf(tmpchan, sizeof(tmpchan), "%s@%s", c->call_forward, forward_context ? forward_context : c->context);
+               snprintf(tmpchan, sizeof(tmpchan), "%s@%s", ast_channel_call_forward(c), forward_context ? forward_context : c->context);
                ast_channel_unlock(c);
                stuff = tmpchan;
                tech = "Local";
        }
 
-       ast_cel_report_event(in, AST_CEL_FORWARD, NULL, c->call_forward, NULL);
+       ast_cel_report_event(in, AST_CEL_FORWARD, NULL, ast_channel_call_forward(c), NULL);
 
        /* Before processing channel, go ahead and check for forwarding */
        ast_verb(3, "Now forwarding %s to '%s/%s' (thanks to %s)\n", ast_channel_name(in), tech, stuff, ast_channel_name(c));
@@ -943,7 +943,7 @@ static void do_forward(struct chanlist *o,
                        ast_connected_line_copy_from_caller(&c->connected, &in->caller);
                }
 
-               ast_string_field_set(c, accountcode, in->accountcode);
+               ast_channel_accountcode_set(c, ast_channel_accountcode(in));
 
                c->appl = "AppDial";
                c->data = "(Outgoing Line)";
@@ -1133,7 +1133,7 @@ static struct ast_channel *wait_for_answer(struct ast_channel *in,
                                                OPT_CALLEE_PARK | OPT_CALLER_PARK |
                                                OPT_CALLEE_MIXMONITOR | OPT_CALLER_MIXMONITOR |
                                                DIAL_NOFORWARDHTML);
-                                       ast_string_field_set(c, dialcontext, "");
+                                       ast_channel_dialcontext_set(c, "");
                                        ast_copy_string(c->exten, "", sizeof(c->exten));
                                }
                                continue;
@@ -1141,7 +1141,7 @@ static struct ast_channel *wait_for_answer(struct ast_channel *in,
                        if (c != winner)
                                continue;
                        /* here, o->chan == c == winner */
-                       if (!ast_strlen_zero(c->call_forward)) {
+                       if (!ast_strlen_zero(ast_channel_call_forward(c))) {
                                pa->sentringing = 0;
                                if (!ignore_cc && (f = ast_read(c))) {
                                        if (f->frametype == AST_FRAME_CONTROL && f->subclass.integer == AST_CONTROL_CC) {
@@ -1207,7 +1207,7 @@ static struct ast_channel *wait_for_answer(struct ast_channel *in,
                                                        OPT_CALLEE_PARK | OPT_CALLER_PARK |
                                                        OPT_CALLEE_MIXMONITOR | OPT_CALLER_MIXMONITOR |
                                                        DIAL_NOFORWARDHTML);
-                                               ast_string_field_set(c, dialcontext, "");
+                                               ast_channel_dialcontext_set(c, "");
                                                ast_copy_string(c->exten, "", sizeof(c->exten));
                                                if (CAN_EARLY_BRIDGE(peerflags, in, peer))
                                                        /* Setup early bridge if appropriate */
@@ -1581,11 +1581,11 @@ static int do_privacy(struct ast_channel *chan, struct ast_channel *peer,
           time and make the caller believe the peer hasn't picked up yet */
 
        if (ast_test_flag64(opts, OPT_MUSICBACK) && !ast_strlen_zero(opt_args[OPT_ARG_MUSICBACK])) {
-               char *original_moh = ast_strdupa(chan->musicclass);
+               char *original_moh = ast_strdupa(ast_channel_musicclass(chan));
                ast_indicate(chan, -1);
-               ast_string_field_set(chan, musicclass, opt_args[OPT_ARG_MUSICBACK]);
+               ast_channel_musicclass_set(chan, opt_args[OPT_ARG_MUSICBACK]);
                ast_moh_start(chan, opt_args[OPT_ARG_MUSICBACK], NULL);
-               ast_string_field_set(chan, musicclass, original_moh);
+               ast_channel_musicclass_set(chan, original_moh);
        } else if (ast_test_flag64(opts, OPT_RINGBACK)) {
                ast_indicate(chan, AST_CONTROL_RINGING);
                pa->sentringing++;
@@ -1795,7 +1795,7 @@ static int setup_privacy_args(struct privacy_args *pa,
                                        ast_verb(3, "Successfully deleted %s intro file\n", pa->privintro);
                                return -1;
                        }
-                       if (!ast_streamfile(chan, "vm-dialout", chan->language) )
+                       if (!ast_streamfile(chan, "vm-dialout", ast_channel_language(chan)) )
                                ast_waitstream(chan, "");
                }
        }
@@ -2306,11 +2306,11 @@ static int dial_exec_full(struct ast_channel *chan, const char *data, struct ast
 
                tc->dialed.transit_network_select = chan->dialed.transit_network_select;
 
-               if (!ast_strlen_zero(chan->accountcode)) {
-                       ast_string_field_set(tc, peeraccount, chan->accountcode);
+               if (!ast_strlen_zero(ast_channel_accountcode(chan))) {
+                       ast_channel_peeraccount_set(tc, ast_channel_accountcode(chan));
                }
-               if (ast_strlen_zero(tc->musicclass))
-                       ast_string_field_set(tc, musicclass, chan->musicclass);
+               if (ast_strlen_zero(ast_channel_musicclass(tc)))
+                       ast_channel_musicclass_set(tc, ast_channel_musicclass(chan));
 
                /* Pass ADSI CPE and transfer capability */
                tc->adsicpe = chan->adsicpe;
@@ -2329,7 +2329,7 @@ static int dial_exec_full(struct ast_channel *chan, const char *data, struct ast
 
 
                /* Inherit context and extension */
-               ast_string_field_set(tc, dialcontext, ast_strlen_zero(chan->macrocontext) ? chan->context : chan->macrocontext);
+               ast_channel_dialcontext_set(tc, ast_strlen_zero(chan->macrocontext) ? chan->context : chan->macrocontext);
                if (!ast_strlen_zero(chan->macroexten))
                        ast_copy_string(tc->exten, chan->macroexten, sizeof(tc->exten));
                else
@@ -2399,10 +2399,10 @@ static int dial_exec_full(struct ast_channel *chan, const char *data, struct ast
                if (ast_test_flag64(outgoing, OPT_MUSICBACK)) {
                        moh = 1;
                        if (!ast_strlen_zero(opt_args[OPT_ARG_MUSICBACK])) {
-                               char *original_moh = ast_strdupa(chan->musicclass);
-                               ast_string_field_set(chan, musicclass, opt_args[OPT_ARG_MUSICBACK]);
+                               char *original_moh = ast_strdupa(ast_channel_musicclass(chan));
+                               ast_channel_musicclass_set(chan, opt_args[OPT_ARG_MUSICBACK]);
                                ast_moh_start(chan, opt_args[OPT_ARG_MUSICBACK], NULL);
-                               ast_string_field_set(chan, musicclass, original_moh);
+                               ast_channel_musicclass_set(chan, original_moh);
                        } else {
                                ast_moh_start(chan, NULL, NULL);
                        }
@@ -2496,7 +2496,7 @@ static int dial_exec_full(struct ast_channel *chan, const char *data, struct ast
                        /* we need to stream the announcment while monitoring the caller for a hangup */
 
                        /* stream the file */
-                       res = ast_streamfile(peer, opt_args[OPT_ARG_ANNOUNCE], peer->language);
+                       res = ast_streamfile(peer, opt_args[OPT_ARG_ANNOUNCE], ast_channel_language(peer));
                        if (res) {
                                res = 0;
                                ast_log(LOG_ERROR, "error streaming file '%s' to callee\n", opt_args[OPT_ARG_ANNOUNCE]);
@@ -2988,8 +2988,8 @@ static int retrydial_exec(struct ast_channel *chan, const char *data)
                if (res == 0) {
                        if (ast_test_flag64(&peerflags, OPT_DTMF_EXIT)) {
                                if (!ast_strlen_zero(args.announce)) {
-                                       if (ast_fileexists(args.announce, NULL, chan->language) > 0) {
-                                               if (!(res = ast_streamfile(chan, args.announce, chan->language)))
+                                       if (ast_fileexists(args.announce, NULL, ast_channel_language(chan)) > 0) {
+                                               if (!(res = ast_streamfile(chan, args.announce, ast_channel_language(chan))))
                                                        ast_waitstream(chan, AST_DIGIT_ANY);
                                        } else
                                                ast_log(LOG_WARNING, "Announce file \"%s\" specified in Retrydial does not exist\n", args.announce);
@@ -3001,8 +3001,8 @@ static int retrydial_exec(struct ast_channel *chan, const char *data)
                                }
                        } else {
                                if (!ast_strlen_zero(args.announce)) {
-                                       if (ast_fileexists(args.announce, NULL, chan->language) > 0) {
-                                               if (!(res = ast_streamfile(chan, args.announce, chan->language)))
+                                       if (ast_fileexists(args.announce, NULL, ast_channel_language(chan)) > 0) {
+                                               if (!(res = ast_streamfile(chan, args.announce, ast_channel_language(chan))))
                                                        res = ast_waitstream(chan, "");
                                        } else
                                                ast_log(LOG_WARNING, "Announce file \"%s\" specified in Retrydial does not exist\n", args.announce);
index b50fbb0..6b20017 100644 (file)
@@ -79,7 +79,7 @@ typedef enum {
 static int play_and_wait(struct ast_channel *chan, char *file, char *digits)
 {
        int res = -1;
-       if (!ast_streamfile(chan, file, chan->language)) {
+       if (!ast_streamfile(chan, file, ast_channel_language(chan))) {
                res = ast_waitstream(chan, digits);
        }
        return res;
@@ -188,7 +188,7 @@ static int dictate_exec(struct ast_channel *chan, const char *data)
                                                if (speed > 4) {
                                                        speed = 1;
                                                }
-                                               res = ast_say_number(chan, speed, AST_DIGIT_ANY, chan->language, NULL);
+                                               res = ast_say_number(chan, speed, AST_DIGIT_ANY, ast_channel_language(chan), NULL);
                                                break;
                                        case '7':
                                                samples -= ffactor;
@@ -275,7 +275,7 @@ static int dictate_exec(struct ast_channel *chan, const char *data)
                                                if (lastop != DFLAG_PLAY) {
                                                        lastop = DFLAG_PLAY;
                                                        ast_closestream(fs);
-                                                       if (!(fs = ast_openstream(chan, path, chan->language)))
+                                                       if (!(fs = ast_openstream(chan, path, ast_channel_language(chan))))
                                                                break;
                                                        ast_seekstream(fs, samples, SEEK_SET);
                                                        chan->stream = NULL;
index dccae94..a4ec93e 100644 (file)
@@ -273,13 +273,13 @@ static int play_mailbox_owner(struct ast_channel *chan, const char *context,
                /* If Option 'e' was specified, also read the extension number with the name */
                if (ast_test_flag(flags, OPT_SAYEXTENSION)) {
                        ast_stream_and_wait(chan, "vm-extension", AST_DIGIT_ANY);
-                       res = ast_say_character_str(chan, ext, AST_DIGIT_ANY, chan->language);
+                       res = ast_say_character_str(chan, ext, AST_DIGIT_ANY, ast_channel_language(chan));
                }
        } else {
-               res = ast_say_character_str(chan, S_OR(name, ext), AST_DIGIT_ANY, chan->language);
+               res = ast_say_character_str(chan, S_OR(name, ext), AST_DIGIT_ANY, ast_channel_language(chan));
                if (!ast_strlen_zero(name) && ast_test_flag(flags, OPT_SAYEXTENSION)) {
                        ast_stream_and_wait(chan, "vm-extension", AST_DIGIT_ANY);
-                       res = ast_say_character_str(chan, ext, AST_DIGIT_ANY, chan->language);
+                       res = ast_say_character_str(chan, ext, AST_DIGIT_ANY, ast_channel_language(chan));
                }
        }
 
@@ -383,15 +383,15 @@ static int select_item_menu(struct ast_channel *chan, struct directory_item **it
 
                        snprintf(buf, sizeof(buf), "digits/%d", i + 1);
                        /* Press <num> for <name>, [ extension <ext> ] */
-                       res = ast_streamfile(chan, "dir-multi1", chan->language);
+                       res = ast_streamfile(chan, "dir-multi1", ast_channel_language(chan));
                        if (!res)
                                res = ast_waitstream(chan, AST_DIGIT_ANY);
                        if (!res)
-                               res = ast_streamfile(chan, buf, chan->language);
+                               res = ast_streamfile(chan, buf, ast_channel_language(chan));
                        if (!res)
                                res = ast_waitstream(chan, AST_DIGIT_ANY);
                        if (!res)
-                               res = ast_streamfile(chan, "dir-multi2", chan->language);
+                               res = ast_streamfile(chan, "dir-multi2", ast_channel_language(chan));
                        if (!res)
                                res = ast_waitstream(chan, AST_DIGIT_ANY);
                        if (!res)
@@ -404,7 +404,7 @@ static int select_item_menu(struct ast_channel *chan, struct directory_item **it
 
                /* Press "9" for more names. */
                if (!res && count > limit) {
-                       res = ast_streamfile(chan, "dir-multi9", chan->language);
+                       res = ast_streamfile(chan, "dir-multi9", ast_channel_language(chan));
                        if (!res)
                                res = ast_waitstream(chan, AST_DIGIT_ANY);
                }
@@ -710,7 +710,7 @@ static int do_directory(struct ast_channel *chan, struct ast_config *vmcfg, stru
        }
 
        if (count < 1) {
-               res = ast_streamfile(chan, "dir-nomatch", chan->language);
+               res = ast_streamfile(chan, "dir-nomatch", ast_channel_language(chan));
                goto exit;
        }
 
@@ -742,7 +742,7 @@ static int do_directory(struct ast_channel *chan, struct ast_config *vmcfg, stru
        }
 
        if (!res) {
-               res = ast_streamfile(chan, "dir-nomore", chan->language);
+               res = ast_streamfile(chan, "dir-nomore", ast_channel_language(chan));
        }
 
 exit:
index ce175bc..78830f1 100644 (file)
@@ -377,7 +377,7 @@ static int disa_exec(struct ast_channel *chan, const char *data)
                        }
 
                        if (!ast_strlen_zero(acctcode))
-                               ast_string_field_set(chan, accountcode, acctcode);
+                               ast_channel_accountcode_set(chan, acctcode);
 
                        if (special_noanswer) cdr_flags.flags = 0;
                        ast_cdr_reset(chan->cdr, &cdr_flags);
index 9b0096f..c59d32e 100644 (file)
@@ -129,16 +129,16 @@ static int serialize_showchan(struct ast_channel *c, char *buf, size_t size)
                "Blocking_in=        %s\n",
                ast_channel_name(c),
                c->tech->type,
-               c->uniqueid,
-               c->linkedid,
+               ast_channel_uniqueid(c),
+               ast_channel_linkedid(c),
                S_COR(c->caller.id.number.valid, c->caller.id.number.str, "(N/A)"),
                S_COR(c->caller.id.name.valid, c->caller.id.name.str, "(N/A)"),
                S_COR(c->connected.id.number.valid, c->connected.id.number.str, "(N/A)"),
                S_COR(c->connected.id.name.valid, c->connected.id.name.str, "(N/A)"),
                S_OR(c->dialed.number.str, "(N/A)"),
                S_COR(c->redirecting.from.number.valid, c->redirecting.from.number.str, "(N/A)"),
-               c->parkinglot,
-               c->language,    
+               ast_channel_parkinglot(c),
+               ast_channel_language(c),        
                ast_state2str(c->_state),
                c->_state,
                c->rings, 
index d8ff60a..9377d23 100644 (file)
@@ -219,7 +219,7 @@ static int gen_nextfile(struct gen_state *state)
                        u->playing_silence = 1;
                }
 
-               if (!(state->stream = ast_openstream_full(u->chan, file_to_stream, u->chan->language, 1))) {
+               if (!(state->stream = ast_openstream_full(u->chan, file_to_stream, ast_channel_language(u->chan), 1))) {
                        ast_chan_log(LOG_WARNING, u->chan, "File '%s' could not be opened: %s\n", file_to_stream, strerror(errno));
                        AST_LIST_LOCK(&u->playlist);
                        AST_LIST_REMOVE_HEAD(&u->playlist, list);
@@ -761,7 +761,7 @@ static int eivr_comm(struct ast_channel *chan, struct ivr_localuser *u,
                                        send_eivr_event(eivr_events, 'Z', NULL, chan);
                                        continue;
                                }
-                               if (!ast_fileexists(&input[2], NULL, u->chan->language)) {
+                               if (!ast_fileexists(&input[2], NULL, ast_channel_language(u->chan))) {
                                        ast_chan_log(LOG_WARNING, chan, "Unknown file requested '%s'\n", &input[2]);
                                        send_eivr_event(eivr_events, 'Z', &input[2], chan);
                                } else {
@@ -791,7 +791,7 @@ static int eivr_comm(struct ast_channel *chan, struct ivr_localuser *u,
                                        send_eivr_event(eivr_events, 'Z', NULL, chan);
                                        continue;
                                }
-                               if (!ast_fileexists(&input[2], NULL, u->chan->language)) {
+                               if (!ast_fileexists(&input[2], NULL, ast_channel_language(u->chan))) {
                                        ast_chan_log(LOG_WARNING, chan, "Unknown file requested '%s'\n", &input[2]);
                                        send_eivr_event(eivr_events, 'Z', &input[2], chan);
                                } else {
index 65787f9..878e2ee 100644 (file)
@@ -623,7 +623,7 @@ static struct ast_channel *wait_for_winner(struct findme_user_listptr *findme_us
                                        if (!ast_strlen_zero(namerecloc)) {
                                                tmpuser->state = 1;
                                                tmpuser->digts = 0;
-                                               if (!ast_streamfile(tmpuser->ochan, callfromname, tmpuser->ochan->language)) {
+                                               if (!ast_streamfile(tmpuser->ochan, callfromname, ast_channel_language(tmpuser->ochan))) {
                                                        ast_sched_runq(tmpuser->ochan->sched);
                                                } else {
                                                        ast_log(LOG_WARNING, "Unable to playback %s.\n", callfromname);
@@ -632,7 +632,7 @@ static struct ast_channel *wait_for_winner(struct findme_user_listptr *findme_us
                                        } else {
                                                tmpuser->state = 2;
                                                tmpuser->digts = 0;
-                                               if (!ast_streamfile(tmpuser->ochan, tpargs->norecordingprompt, tmpuser->ochan->language))
+                                               if (!ast_streamfile(tmpuser->ochan, tpargs->norecordingprompt, ast_channel_language(tmpuser->ochan)))
                                                        ast_sched_runq(tmpuser->ochan->sched);
                                                else {
                                                        ast_log(LOG_WARNING, "Unable to playback %s.\n", tpargs->norecordingprompt);
@@ -649,13 +649,13 @@ static struct ast_channel *wait_for_winner(struct findme_user_listptr *findme_us
                                                ast_stopstream(tmpuser->ochan);
                                                if (tmpuser->state == 1) {
                                                        ast_verb(3, "Playback of the call-from file appears to be done.\n");
-                                                       if (!ast_streamfile(tmpuser->ochan, namerecloc, tmpuser->ochan->language)) {
+                                                       if (!ast_streamfile(tmpuser->ochan, namerecloc, ast_channel_language(tmpuser->ochan))) {
                                                                tmpuser->state = 2;
                                                        } else {
                                                                ast_log(LOG_NOTICE, "Unable to playback %s. Maybe the caller didn't record their name?\n", namerecloc);
                                                                memset(tmpuser->yn, 0, sizeof(tmpuser->yn));
                                                                tmpuser->ynidx = 0;
-                                                               if (!ast_streamfile(tmpuser->ochan, pressbuttonname, tmpuser->ochan->language))
+                                                               if (!ast_streamfile(tmpuser->ochan, pressbuttonname, ast_channel_language(tmpuser->ochan)))
                                                                        tmpuser->state = 3;
                                                                else {
                                                                        ast_log(LOG_WARNING, "Unable to playback %s.\n", pressbuttonname);
@@ -666,7 +666,7 @@ static struct ast_channel *wait_for_winner(struct findme_user_listptr *findme_us
                                                        ast_verb(3, "Playback of name file appears to be done.\n");
                                                        memset(tmpuser->yn, 0, sizeof(tmpuser->yn));
                                                        tmpuser->ynidx = 0;
-                                                       if (!ast_streamfile(tmpuser->ochan, pressbuttonname, tmpuser->ochan->language)) {
+                                                       if (!ast_streamfile(tmpuser->ochan, pressbuttonname, ast_channel_language(tmpuser->ochan))) {
                                                                tmpuser->state = 3;
                                                        } else {
                                                                return NULL;
@@ -737,7 +737,7 @@ static struct ast_channel *wait_for_winner(struct findme_user_listptr *findme_us
                                                ast_verb(3, "Starting playback of %s\n", callfromname);
                                                if (dg > 0) {
                                                        if (!ast_strlen_zero(namerecloc)) {
-                                                               if (!ast_streamfile(winner, callfromname, winner->language)) {
+                                                               if (!ast_streamfile(winner, callfromname, ast_channel_language(winner))) {
                                                                        ast_sched_runq(winner->sched);
                                                                        tmpuser->state = 1;
                                                                } else {
@@ -747,7 +747,7 @@ static struct ast_channel *wait_for_winner(struct findme_user_listptr *findme_us
                                                                }
                                                        } else {
                                                                tmpuser->state = 2;
-                                                               if (!ast_streamfile(tmpuser->ochan, tpargs->norecordingprompt, tmpuser->ochan->language))
+                                                               if (!ast_streamfile(tmpuser->ochan, tpargs->norecordingprompt, ast_channel_language(tmpuser->ochan)))
                                                                        ast_sched_runq(tmpuser->ochan->sched);
                                                                else {
                                                                        ast_log(LOG_WARNING, "Unable to playback %s.\n", tpargs->norecordingprompt);
@@ -959,9 +959,9 @@ static void findmeexec(struct fm_args *tpargs)
                                ast_connected_line_copy_from_caller(&outbound->connected, &caller->caller);
                                ast_channel_inherit_variables(caller, outbound);
                                ast_channel_datastore_inherit(caller, outbound);
-                               ast_string_field_set(outbound, language, caller->language);
-                               ast_string_field_set(outbound, accountcode, caller->accountcode);
-                               ast_string_field_set(outbound, musicclass, caller->musicclass);
+                               ast_channel_language_set(outbound, ast_channel_language(caller));
+                               ast_channel_accountcode_set(outbound, ast_channel_accountcode(caller));
+                               ast_channel_musicclass_set(outbound, ast_channel_musicclass(caller));
                                ast_channel_unlock(outbound);
                                ast_channel_unlock(caller);
                                ast_verb(3, "calling Local/%s\n", dialarg);
@@ -1243,18 +1243,18 @@ static int app_exec(struct ast_channel *chan, const char *data)
                        int duration = 5;
 
                        snprintf(namerecloc, sizeof(namerecloc), "%s/followme.%s",
-                               ast_config_AST_SPOOL_DIR, chan->uniqueid);
+                               ast_config_AST_SPOOL_DIR, ast_channel_uniqueid(chan));
                        if (ast_play_and_record(chan, "vm-rec-name", namerecloc, 5, "sln", &duration,
                                NULL, ast_dsp_get_threshold_from_settings(THRESHOLD_SILENCE), 0, NULL) < 0) {
                                goto outrun;
                        }
-                       if (!ast_fileexists(namerecloc, NULL, chan->language)) {
+                       if (!ast_fileexists(namerecloc, NULL, ast_channel_language(chan))) {
                                namerecloc[0] = '\0';
                        }
                }
 
                if (!ast_test_flag(&targs.followmeflags, FOLLOWMEFLAG_DISABLEHOLDPROMPT)) {
-                       if (ast_streamfile(chan, targs.plsholdprompt, chan->language))
+                       if (ast_streamfile(chan, targs.plsholdprompt, ast_channel_language(chan)))
                                goto outrun;
                        if (ast_waitstream(chan, "") < 0)
                                goto outrun;
index 2b3f5c4..52f53d2 100644 (file)
@@ -1249,7 +1249,7 @@ static struct ast_conference *build_conf(const char *confno, const char *pin,
        ast_copy_string(cnf->confno, confno, sizeof(cnf->confno));
        ast_copy_string(cnf->pin, pin, sizeof(cnf->pin));
        ast_copy_string(cnf->pinadmin, pinadmin, sizeof(cnf->pinadmin));
-       ast_copy_string(cnf->uniqueid, chan->uniqueid, sizeof(cnf->uniqueid));
+       ast_copy_string(cnf->uniqueid, ast_channel_uniqueid(chan), sizeof(cnf->uniqueid));
 
        /* Setup a new dahdi conference */
        dahdic.confno = -1;
@@ -2086,14 +2086,14 @@ static void conf_start_moh(struct ast_channel *chan, const char *musicclass)
        char *original_moh;
 
        ast_channel_lock(chan);
-       original_moh = ast_strdupa(chan->musicclass);
-       ast_string_field_set(chan, musicclass, musicclass);
+       original_moh = ast_strdupa(ast_channel_musicclass(chan));
+       ast_channel_musicclass_set(chan, musicclass);
        ast_channel_unlock(chan);
 
        ast_moh_start(chan, original_moh, NULL);
 
        ast_channel_lock(chan);
-       ast_string_field_set(chan, musicclass, original_moh);
+       ast_channel_musicclass_set(chan, original_moh);
        ast_channel_unlock(chan);
 }
 
@@ -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",
-             ast_channel_name(chan), chan->uniqueid, conf->confno, user->user_no, talking ? "on" : "off");
+             ast_channel_name(chan), ast_channel_uniqueid(chan), 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)
@@ -2420,7 +2420,7 @@ static int conf_run(struct ast_channel *chan, struct ast_conference *conf, struc
                        }
                        ast_channel_unlock(chan);
                        if (!conf->recordingfilename) {
-                               snprintf(recordingtmp, sizeof(recordingtmp), "meetme-conf-rec-%s-%s", conf->confno, chan->uniqueid);
+                               snprintf(recordingtmp, sizeof(recordingtmp), "meetme-conf-rec-%s-%s", conf->confno, ast_channel_uniqueid(chan));
                                conf->recordingfilename = ast_strdup(recordingtmp);
                        }
                        if (!conf->recordingformat) {
@@ -2482,7 +2482,7 @@ static int conf_run(struct ast_channel *chan, struct ast_conference *conf, struc
 
        if (conf->locked && (!ast_test_flag64(confflags, CONFFLAG_ADMIN))) {
                /* Sorry, but this conference is locked! */     
-               if (!ast_streamfile(chan, "conf-locked", chan->language))
+               if (!ast_streamfile(chan, "conf-locked", ast_channel_language(chan)))
                        ast_waitstream(chan, "");
                goto outrun;
        }
@@ -2492,7 +2492,7 @@ static int conf_run(struct ast_channel *chan, struct ast_conference *conf, struc
        if (rt_schedule && conf->maxusers) {
                if (conf->users >= conf->maxusers) {
                        /* Sorry, but this confernce has reached the participant limit! */      
-                       if (!ast_streamfile(chan, "conf-full", chan->language))
+                       if (!ast_streamfile(chan, "conf-full", ast_channel_language(chan)))
                                ast_waitstream(chan, "");
                        ast_mutex_unlock(&conf->playlock);
                        goto outrun;
@@ -2603,17 +2603,17 @@ static int conf_run(struct ast_channel *chan, struct ast_conference *conf, struc
        /* Play an arbitrary intro message */
        if (ast_test_flag64(confflags, CONFFLAG_INTROMSG) &&
                        !ast_strlen_zero(optargs[OPT_ARG_INTROMSG])) {
-               if (!ast_streamfile(chan, optargs[OPT_ARG_INTROMSG], chan->language)) {
+               if (!ast_streamfile(chan, optargs[OPT_ARG_INTROMSG], ast_channel_language(chan))) {
                        ast_waitstream(chan, "");
                }
        }
 
        if (!ast_test_flag64(confflags, (CONFFLAG_QUIET | CONFFLAG_NOONLYPERSON))) {
                if (conf->users == 1 && !ast_test_flag64(confflags, CONFFLAG_WAITMARKED))
-                       if (!ast_streamfile(chan, "conf-onlyperson", chan->language))
+                       if (!ast_streamfile(chan, "conf-onlyperson", ast_channel_language(chan)))
                                ast_waitstream(chan, "");
                if (ast_test_flag64(confflags, CONFFLAG_WAITMARKED) && conf->markedusers == 0)
-                       if (!ast_streamfile(chan, "conf-waitforleader", chan->language))
+                       if (!ast_streamfile(chan, "conf-waitforleader", ast_channel_language(chan)))
                                ast_waitstream(chan, "");
        }
 
@@ -2622,7 +2622,7 @@ static int conf_run(struct ast_channel *chan, struct ast_conference *conf, struc
                int keepplaying = 1;
 
                if (conf->users == 2) { 
-                       if (!ast_streamfile(chan, "conf-onlyone", chan->language)) {
+                       if (!ast_streamfile(chan, "conf-onlyone", ast_channel_language(chan))) {
                                res = ast_waitstream(chan, AST_DIGIT_ANY);
                                ast_stopstream(chan);
                                if (res > 0)
@@ -2631,7 +2631,7 @@ static int conf_run(struct ast_channel *chan, struct ast_conference *conf, struc
                                        goto outrun;
                        }
                } else { 
-                       if (!ast_streamfile(chan, "conf-thereare", chan->language)) {
+                       if (!ast_streamfile(chan, "conf-thereare", ast_channel_language(chan))) {
                                res = ast_waitstream(chan, AST_DIGIT_ANY);
                                ast_stopstream(chan);
                                if (res > 0)
@@ -2640,13 +2640,13 @@ static int conf_run(struct ast_channel *chan, struct ast_conference *conf, struc
                                        goto outrun;
                        }
                        if (keepplaying) {
-                               res = ast_say_number(chan, conf->users - 1, AST_DIGIT_ANY, chan->language, (char *) NULL);
+                               res = ast_say_number(chan, conf->users - 1, AST_DIGIT_ANY, ast_channel_language(chan), (char *) NULL);
                                if (res > 0)
                                        keepplaying = 0;
                                else if (res == -1)
                                        goto outrun;
                        }
-                       if (keepplaying && !ast_streamfile(chan, "conf-otherinparty", chan->language)) {
+                       if (keepplaying && !ast_streamfile(chan, "conf-otherinparty", ast_channel_language(chan))) {
                                res = ast_waitstream(chan, AST_DIGIT_ANY);
                                ast_stopstream(chan);
                                if (res > 0)
@@ -2742,7 +2742,7 @@ static int conf_run(struct ast_channel *chan, struct ast_conference *conf, struc
                if (!(item = ao2_alloc(sizeof(*item), NULL)))
                        goto outrun;
                ast_copy_string(item->namerecloc, user->namerecloc, sizeof(item->namerecloc));
-               ast_copy_string(item->language, chan->language, sizeof(item->language));
+               ast_copy_string(item->language, ast_channel_language(chan), sizeof(item->language));
                item->confchan = conf->chan;
                item->confusers = conf->users;
                if (ast_test_flag64(confflags, CONFFLAG_INTROUSER_VMREC)){
@@ -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",
-                       ast_channel_name(chan), chan->uniqueid, conf->confno,
+                       ast_channel_name(chan), ast_channel_uniqueid(chan), 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>"),
@@ -2900,10 +2900,10 @@ static int conf_run(struct ast_channel *chan, struct ast_conference *conf, struc
 
                                                if (!announcement_played && conf->endalert) {
                                                        if (now.tv_sec + conf->endalert >= conf->endtime) {
-                                                               if (!ast_streamfile(chan, "conf-will-end-in", chan->language))
+                                                               if (!ast_streamfile(chan, "conf-will-end-in", ast_channel_language(chan)))
                                                                        ast_waitstream(chan, "");
-                                                               ast_say_digits(chan, (conf->endtime - now.tv_sec) / 60, "", chan->language);
-                                                               if (!ast_streamfile(chan, "minutes", chan->language))
+                                                               ast_say_digits(chan, (conf->endtime - now.tv_sec) / 60, "", ast_channel_language(chan));
+                                                               if (!ast_streamfile(chan, "minutes", ast_channel_language(chan)))
                                                                        ast_waitstream(chan, "");
                                                                if (musiconhold) {
                                                                        conf_start_moh(chan, optargs[OPT_ARG_MOH_CLASS]);
@@ -2947,7 +2947,7 @@ static int conf_run(struct ast_channel *chan, struct ast_conference *conf, struc
        
                                if (time_left_ms <= 0) {
                                        if (user->end_sound) {                                          
-                                               res = ast_streamfile(chan, user->end_sound, chan->language);
+                                               res = ast_streamfile(chan, user->end_sound, ast_channel_language(chan));
                                                res = ast_waitstream(chan, "");
                                        }
                                        if (ast_test_flag64(confflags, CONFFLAG_KICK_CONTINUE)) {
@@ -2973,20 +2973,20 @@ static int conf_run(struct ast_channel *chan, struct ast_conference *conf, struc
                                                if (user->warning_sound && user->play_warning) {
                                                        if (!strcmp(user->warning_sound, "timeleft")) {
                                                                
-                                                               res = ast_streamfile(chan, "vm-youhave", chan->language);
+                                                               res = ast_streamfile(chan, "vm-youhave", ast_channel_language(chan));
                                                                res = ast_waitstream(chan, "");
                                                                if (minutes) {
-                                                                       res = ast_say_number(chan, minutes, AST_DIGIT_ANY, chan->language, (char *) NULL);
-                                                                       res = ast_streamfile(chan, "queue-minutes", chan->language);
+                                                                       res = ast_say_number(chan, minutes, AST_DIGIT_ANY, ast_channel_language(chan), (char *) NULL);
+                                                                       res = ast_streamfile(chan, "queue-minutes", ast_channel_language(chan));
                                                                        res = ast_waitstream(chan, "");
                                                                }
                                                                if (seconds) {
-                                                                       res = ast_say_number(chan, seconds, AST_DIGIT_ANY, chan->language, (char *) NULL);
-                                                                       res = ast_streamfile(chan, "queue-seconds", chan->language);
+                                                                       res = ast_say_number(chan, seconds, AST_DIGIT_ANY, ast_channel_language(chan), (char *) NULL);
+                                                                       res = ast_streamfile(chan, "queue-seconds", ast_channel_language(chan));
                                                                        res = ast_waitstream(chan, "");
                                                                }
                                                        } else {
-                                                               res = ast_streamfile(chan, user->warning_sound, chan->language);
+                                                               res = ast_streamfile(chan, user->warning_sound, ast_channel_language(chan));
                                                                res = ast_waitstream(chan, "");
                                                        }
                                                        if (musiconhold) {
@@ -3027,19 +3027,19 @@ static int conf_run(struct ast_channel *chan, struct ast_conference *conf, struc
                            ast_test_flag64(confflags, CONFFLAG_WAITMARKED) &&
                            lastmarked == 0) {
                                if (currentmarked == 1 && conf->users > 1) {
-                                       ast_say_number(chan, conf->users - 1, AST_DIGIT_ANY, chan->language, (char *) NULL);
+                                       ast_say_number(chan, conf->users - 1, AST_DIGIT_ANY, ast_channel_language(chan), (char *) NULL);
                                        if (conf->users - 1 == 1) {
-                                               if (!ast_streamfile(chan, "conf-userwilljoin", chan->language)) {
+                                               if (!ast_streamfile(chan, "conf-userwilljoin", ast_channel_language(chan))) {
                                                        ast_waitstream(chan, "");
                                                }
                                        } else {
-                                               if (!ast_streamfile(chan, "conf-userswilljoin", chan->language)) {
+                                               if (!ast_streamfile(chan, "conf-userswilljoin", ast_channel_language(chan))) {
                                                        ast_waitstream(chan, "");
                                                }
                                        }
                                }
                                if (conf->users == 1 && !ast_test_flag64(confflags, CONFFLAG_MARKEDUSER)) {
-                                       if (!ast_streamfile(chan, "conf-onlyperson", chan->language)) {
+                                       if (!ast_streamfile(chan, "conf-onlyperson", ast_channel_language(chan))) {
                                                ast_waitstream(chan, "");
                                        }
                                }
@@ -3052,7 +3052,7 @@ static int conf_run(struct ast_channel *chan, struct ast_conference *conf, struc
                                if (currentmarked == 0) {
                                        if (lastmarked != 0) {
                                                if (!ast_test_flag64(confflags, CONFFLAG_QUIET)) {
-                                                       if (!ast_streamfile(chan, "conf-leaderhasleft", chan->language)) {
+                                                       if (!ast_streamfile(chan, "conf-leaderhasleft", ast_channel_language(chan))) {
                                                                ast_waitstream(chan, "");
                                                        }
                                                }
@@ -3095,7 +3095,7 @@ static int conf_run(struct ast_channel *chan, struct ast_conference *conf, struc
                                        }
                                        if (!ast_test_flag64(confflags, CONFFLAG_QUIET) && 
                                                !ast_test_flag64(confflags, CONFFLAG_MARKEDUSER)) {
-                                               if (!ast_streamfile(chan, "conf-placeintoconf", chan->language)) {
+                                               if (!ast_streamfile(chan, "conf-placeintoconf", ast_channel_language(chan))) {
                                                        ast_waitstream(chan, "");
                                                }
                                                conf_play(chan, conf, ENTER);
@@ -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",
-                                               ast_channel_name(chan), chan->uniqueid, conf->confno, user->user_no);
+                                               ast_channel_name(chan), ast_channel_uniqueid(chan), 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",
-                                               ast_channel_name(chan), chan->uniqueid, conf->confno, user->user_no);
+                                               ast_channel_name(chan), ast_channel_uniqueid(chan), 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",
-                                                             ast_channel_name(chan), chan->uniqueid, conf->confno, user->user_no);
+                                                             ast_channel_name(chan), ast_channel_uniqueid(chan), 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",
-                                                            ast_channel_name(chan), chan->uniqueid, conf->confno, user->user_no);
+                                                            ast_channel_name(chan), ast_channel_uniqueid(chan), conf->confno, user->user_no);
                        }
 
                        /* If user have been hung up, exit the conference */
@@ -3207,7 +3207,7 @@ static int conf_run(struct ast_channel *chan, struct ast_conference *conf, struc
                        if (user->adminflags & ADMINFLAG_KICKME) {
                                /* You have been kicked. */
                                if (!ast_test_flag64(confflags, CONFFLAG_QUIET) && 
-                                       !ast_streamfile(chan, "conf-kicked", chan->language)) {
+                                       !ast_streamfile(chan, "conf-kicked", ast_channel_language(chan))) {
                                        ast_waitstream(chan, "");
                                }
                                ret = 0;
@@ -3313,32 +3313,32 @@ static int conf_run(struct ast_channel *chan, struct ast_conference *conf, struc
                                                                keepplaying = 1;
                                                                playednamerec = 0;
                                                                if (conf->users == 1) {
-                                                                       if (keepplaying && !ast_streamfile(chan, "conf-onlyperson", chan->language)) {
+                                                                       if (keepplaying && !ast_streamfile(chan, "conf-onlyperson", ast_channel_language(chan))) {
                                                                                res = ast_waitstream(chan, AST_DIGIT_ANY);
                                                                                ast_stopstream(chan);
                                                                                if (res > 0)
                                                                                        keepplaying = 0;
                                                                        }
                                                                } else if (conf->users == 2) {
-                                                                       if (keepplaying && !ast_streamfile(chan, "conf-onlyone", chan->language)) {
+                                                                       if (keepplaying && !ast_streamfile(chan, "conf-onlyone", ast_channel_language(chan))) {
                                                                                res = ast_waitstream(chan, AST_DIGIT_ANY);
                                                                                ast_stopstream(chan);
                                                                                if (res > 0)
                                                                                        keepplaying = 0;
                                                                        }
                                                                } else {
-                                                                       if (keepplaying && !ast_streamfile(chan, "conf-thereare", chan->language)) {
+                                                                       if (keepplaying && !ast_streamfile(chan, "conf-thereare", ast_channel_language(chan))) {
                                                                                res = ast_waitstream(chan, AST_DIGIT_ANY);
                                                                                ast_stopstream(chan);
                                                                                if (res > 0)
                                                                                        keepplaying = 0;
                                                                        }
                                                                        if (keepplaying) {
-                                                                               res = ast_say_number(chan, conf->users - 1, AST_DIGIT_ANY, chan->language, (char *) NULL);
+                                                                               res = ast_say_number(chan, conf->users - 1, AST_DIGIT_ANY, ast_channel_language(chan), (char *) NULL);
                                                                                if (res > 0)
                                                                                        keepplaying = 0;
                                                                        }
-                                                                       if (keepplaying && !ast_streamfile(chan, "conf-otherinparty", chan->language)) {
+                                                                       if (keepplaying && !ast_streamfile(chan, "conf-otherinparty", ast_channel_language(chan))) {
                                                                                res = ast_waitstream(chan, AST_DIGIT_ANY);
                                                                                ast_stopstream(chan);
                                                                                if (res > 0)
@@ -3348,7 +3348,7 @@ static int conf_run(struct ast_channel *chan, struct ast_conference *conf, struc
                                                                user_iter = ao2_iterator_init(conf->usercontainer, 0);
                                                                while((usr = ao2_iterator_next(&user_iter))) {
                                                                        if (ast_fileexists(usr->namerecloc, NULL, NULL)) {
-                                                                               if (keepplaying && !ast_streamfile(chan, usr->namerecloc, chan->language)) {
+                                                                               if (keepplaying && !ast_streamfile(chan, usr->namerecloc, ast_channel_language(chan))) {
                                                                                        res = ast_waitstream(chan, AST_DIGIT_ANY);
                                                                                        ast_stopstream(chan);
                                                                                        if (res > 0)
@@ -3359,7 +3359,7 @@ static int conf_run(struct ast_channel *chan, struct ast_conference *conf, struc
                                                                        ao2_ref(usr, -1);
                                                                }
                                                                ao2_iterator_destroy(&user_iter);
-                                                               if (keepplaying && playednamerec && !ast_streamfile(chan, "conf-roll-callcomplete", chan->language)) {
+                                                               if (keepplaying && playednamerec && !ast_streamfile(chan, "conf-roll-callcomplete", ast_channel_language(chan))) {
                                                                        res = ast_waitstream(chan, AST_DIGIT_ANY);
                                                                        ast_stopstream(chan);
                                                                        if (res > 0)
@@ -3368,7 +3368,7 @@ static int conf_run(struct ast_channel *chan, struct ast_conference *conf, struc
                                                                break;
                                                        case '2': /* *82 Eject all non-admins */
                                                                if (conf->users == 1) {
-                                                                       if(!ast_streamfile(chan, "conf-errormenu", chan->language))
+                                                                       if(!ast_streamfile(chan, "conf-errormenu", ast_channel_language(chan)))
                                                                                ast_waitstream(chan, "");
                                                                } else {
                                                                        ao2_callback(conf->usercontainer, OBJ_NODATA, user_set_kickme_cb, &conf);
@@ -3379,12 +3379,12 @@ static int conf_run(struct ast_channel *chan, struct ast_conference *conf, struc
                                                                if(conf->gmuted) {
                                                                        conf->gmuted = 0;
                                                                        ao2_callback(conf->usercontainer, OBJ_NODATA, user_set_unmuted_cb, &conf);
-                                                                       if (!ast_streamfile(chan, "conf-now-unmuted", chan->language))
+                                                                       if (!ast_streamfile(chan, "conf-now-unmuted", ast_channel_language(chan)))
                                                                                ast_waitstream(chan, "");
                                                                } else {
                                                                        conf->gmuted = 1;
                                                                        ao2_callback(conf->usercontainer, OBJ_NODATA, user_set_muted_cb, &conf);
-                                                                       if (!ast_streamfile(chan, "conf-now-muted", chan->language))
+                                                                       if (!ast_streamfile(chan, "conf-now-muted", ast_channel_language(chan)))
                                                                                ast_waitstream(chan, "");
                                                                }
                                                                ast_stopstream(chan);
@@ -3404,7 +3404,7 @@ static int conf_run(struct ast_channel *chan, struct ast_conference *conf, struc
                                                                                }
                                                                                ast_channel_unlock(chan);
                                                                                if (!conf->recordingfilename) {
-                                                                                       snprintf(recordingtmp, sizeof(recordingtmp), "meetme-conf-rec-%s-%s", conf->confno, chan->uniqueid);
+                                                                                       snprintf(recordingtmp, sizeof(recordingtmp), "meetme-conf-rec-%s-%s", conf->confno, ast_channel_uniqueid(chan));
                                                                                        conf->recordingfilename = ast_strdup(recordingtmp);
                                                                                }
                                                                                if (!conf->recordingformat) {
@@ -3431,7 +3431,7 @@ static int conf_run(struct ast_channel *chan, struct ast_conference *conf, struc
                                                                        }
                                                                        ast_mutex_unlock(&conf->recordthreadlock);
 
-                                                                       if (!ast_streamfile(chan, "conf-now-recording", chan->language))
+                                                                       if (!ast_streamfile(chan, "conf-now-recording", ast_channel_language(chan)))
                                                                                ast_waitstream(chan, "");
 
                                                                }
@@ -3439,7 +3439,7 @@ static int conf_run(struct ast_channel *chan, struct ast_conference *conf, struc
                                                                ast_stopstream(chan);
                                                                break;
                                                        default:
-                                                               if (!ast_streamfile(chan, "conf-errormenu", chan->language))
+                                                               if (!ast_streamfile(chan, "conf-errormenu", ast_channel_language(chan)))
                                                                        ast_waitstream(chan, "");
                                                                ast_stopstream(chan);
                                                                break;
@@ -3453,7 +3453,7 @@ static int conf_run(struct ast_channel *chan, struct ast_conference *conf, struc
                                                if (!menu_active) {
                                                        menu_active = 1;
                                                        /* Record this sound! */
-                                                       if (!ast_streamfile(chan, "conf-adminmenu-162", chan->language)) {
+                                                       if (!ast_streamfile(chan, "conf-adminmenu-162", ast_channel_language(chan))) {
                                                                dtmf = ast_waitstream(chan, AST_DIGIT_ANY);
                                                                ast_stopstream(chan);
                                                        } else {
@@ -3475,11 +3475,11 @@ static int conf_run(struct ast_channel *chan, struct ast_conference *conf, struc
                                                                }
 
                                                                if (ast_test_flag64(confflags, CONFFLAG_MONITOR) || (user->adminflags & (ADMINFLAG_MUTED | ADMINFLAG_SELFMUTED))) {
-                                                                       if (!ast_streamfile(chan, "conf-muted", chan->language)) {
+                                                                       if (!ast_streamfile(chan, "conf-muted", ast_channel_language(chan))) {
                                                                                ast_waitstream(chan, "");
                                                                        }
                                                                } else {
-                                                                       if (!ast_streamfile(chan, "conf-unmuted", chan->language)) {
+                                                                       if (!ast_streamfile(chan, "conf-unmuted", ast_channel_language(chan))) {
                                                                                ast_waitstream(chan, "");
                                                                        }
                                                                }
@@ -3488,12 +3488,12 @@ static int conf_run(struct ast_channel *chan, struct ast_conference *conf, struc
                                                                menu_active = 0;
                                                                if (conf->locked) {
                                                                        conf->locked = 0;
-                                                                       if (!ast_streamfile(chan, "conf-unlockednow", chan->language)) {
+                                                                       if (!ast_streamfile(chan, "conf-unlockednow", ast_channel_language(chan))) {
                                                                                ast_waitstream(chan, "");
                                                                        }
                                                                } else {
                                                                        conf->locked = 1;
-                                                                       if (!ast_streamfile(chan, "conf-lockednow", chan->language)) {
+                                                                       if (!ast_streamfile(chan, "conf-lockednow", ast_channel_language(chan))) {
                                                                                ast_waitstream(chan, "");
                                                                        }
                                                                }
@@ -3506,7 +3506,7 @@ static int conf_run(struct ast_channel *chan, struct ast_conference *conf, struc
                                                                menu_active = 0;
                                                                usr = ao2_find(conf->usercontainer, &max_no, 0);
                                                                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)) {
+                                                                       if (!ast_streamfile(chan, "conf-errormenu", ast_channel_language(chan))) {
                                                                                ast_waitstream(chan, "");
                                                                        }
                                                                } else {
@@ -3523,11 +3523,11 @@ static int conf_run(struct ast_channel *chan, struct ast_conference *conf, struc
                                                                /* Extend RT conference */
                                                                if (rt_schedule) {
                                                                        if (!rt_extend_conf(conf->confno)) {
-                                                                               if (!ast_streamfile(chan, "conf-extended", chan->language)) {
+                                                                               if (!ast_streamfile(chan, "conf-extended", ast_channel_language(chan))) {
                                                                                        ast_waitstream(chan, "");
                                                                                }
                                                                        } else {
-                                                                               if (!ast_streamfile(chan, "conf-nonextended", chan->language)) {
+                                                                               if (!ast_streamfile(chan, "conf-nonextended", ast_channel_language(chan))) {
                                                                                        ast_waitstream(chan, "");
                                                                                }
                                                                        }
@@ -3550,7 +3550,7 @@ static int conf_run(struct ast_channel *chan, struct ast_conference *conf, struc
                                                        default:
                                                                menu_active = 0;
                                                                /* Play an error message! */
-                                                               if (!ast_streamfile(chan, "conf-errormenu", chan->language)) {
+                                                               if (!ast_streamfile(chan, "conf-errormenu", ast_channel_language(chan))) {
                                                                        ast_waitstream(chan, "");
                                                                }
                                                                break;
@@ -3560,7 +3560,7 @@ static int conf_run(struct ast_channel *chan, struct ast_conference *conf, struc
                                                /* User menu */
                                                if (!menu_active) {
                                                        menu_active = 1;
-                                                       if (!ast_streamfile(chan, "conf-usermenu-162", chan->language)) {
+                                                       if (!ast_streamfile(chan, "conf-usermenu-162", ast_channel_language(chan))) {
                                                                dtmf = ast_waitstream(chan, AST_DIGIT_ANY);
                                                                ast_stopstream(chan);
                                                        } else {
@@ -3579,11 +3579,11 @@ static int conf_run(struct ast_channel *chan, struct ast_conference *conf, struc
 
                                                                /* they can't override the admin mute state */
                                                                if (ast_test_flag64(confflags, CONFFLAG_MONITOR) || (user->adminflags & (ADMINFLAG_MUTED | ADMINFLAG_SELFMUTED))) {
-                                                                       if (!ast_streamfile(chan, "conf-muted", chan->language)) {
+                                                                       if (!ast_streamfile(chan, "conf-muted", ast_channel_language(chan))) {
                                                                                ast_waitstream(chan, "");
                                                                        }
                                                                } else {
-                                                                       if (!ast_streamfile(chan, "conf-unmuted", chan->language)) {
+                                                                       if (!ast_streamfile(chan, "conf-unmuted", ast_channel_language(chan))) {
                                                                                ast_waitstream(chan, "");
                                                                        }
                                                                }
@@ -3595,7 +3595,7 @@ static int conf_run(struct ast_channel *chan, struct ast_conference *conf, struc
                                                                }
                                                                        
                                                                if (user->adminflags & ADMINFLAG_T_REQUEST) {
-                                                                       if (!ast_streamfile(chan, "beep", chan->language)) {
+                                                                       if (!ast_streamfile(chan, "beep", ast_channel_language(chan))) {
                                                                                ast_waitstream(chan, "");
                                                                        }
                                                                }
@@ -3624,7 +3624,7 @@ static int conf_run(struct ast_channel *chan, struct ast_conference *conf, struc
                                                                break;
                                                        default:
                                                                menu_active = 0;
-                                                               if (!ast_streamfile(chan, "conf-errormenu", chan->language)) {
+                                                               if (!ast_streamfile(chan, "conf-errormenu", ast_channel_language(chan))) {
                                                                        ast_waitstream(chan, "");
                                                                }
                                                                break;
@@ -3823,7 +3823,7 @@ bailoutandtrynormal:
                if (!(item = ao2_alloc(sizeof(*item), NULL)))
                        goto outrun;
                ast_copy_string(item->namerecloc, user->namerecloc, sizeof(item->namerecloc));
-               ast_copy_string(item->language, chan->language, sizeof(item->language));
+               ast_copy_string(item->language, ast_channel_language(chan), sizeof(item->language));
                item->confchan = conf->chan;
                item->confusers = conf->users;
                item->announcetype = CONF_HASLEFT;
@@ -3861,7 +3861,7 @@ bailoutandtrynormal:
                                "ConnectedLineNum: %s\r\n"
                                "ConnectedLineName: %s\r\n"
                                "Duration: %ld\r\n",
-                               ast_channel_name(chan), chan->uniqueid, conf->confno,
+                               ast_channel_name(chan), ast_channel_uniqueid(chan), 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>"),
@@ -3999,7 +3999,7 @@ static struct ast_conference *find_conf_realtime(struct ast_channel *chan, char
 
                if (rt_schedule && *too_early) {
                        /* Announce that the caller is early and exit */
-                       if (!ast_streamfile(chan, "conf-has-not-started", chan->language)) {
+                       if (!ast_streamfile(chan, "conf-has-not-started", ast_channel_language(chan))) {
                                ast_waitstream(chan, "");
                        }
                        ast_variables_destroy(var);
@@ -4064,7 +4064,7 @@ static struct ast_conference *find_conf_realtime(struct ast_channel *chan, char
                                        }
                                        ast_channel_unlock(chan);
                                        if (ast_strlen_zero(cnf->recordingfilename)) {
-                                               snprintf(recordingtmp, sizeof(recordingtmp), "meetme-conf-rec-%s-%s", cnf->confno, chan->uniqueid);
+                                               snprintf(recordingtmp, sizeof(recordingtmp), "meetme-conf-rec-%s-%s", cnf->confno, ast_channel_uniqueid(chan));
                                                ast_free(cnf->recordingfilename);
                                                cnf->recordingfilename = ast_strdup(recordingtmp);
                                        }
@@ -4248,7 +4248,7 @@ static int count_exec(struct ast_channel *chan, const char *data)
                if (chan->_state != AST_STATE_UP) {
                        ast_answer(chan);
                }
-               res = ast_say_number(chan, count, "", chan->language, (char *) NULL); /* Needs gender */
+               res = ast_say_number(chan, count, "", ast_channel_language(chan), (char *) NULL); /* Needs gender */
        }
 
        return res;
@@ -4412,16 +4412,16 @@ static int conf_exec(struct ast_channel *chan, const char *data)
 
                        /* Not found? */
                        if (ast_strlen_zero(confno)) {
-                               res = ast_streamfile(chan, "conf-noempty", chan->language);
+                               res = ast_streamfile(chan, "conf-noempty", ast_channel_language(chan));
                                if (!res)
                                        ast_waitstream(chan, "");
                        } else {
                                if (sscanf(confno, "%30d", &confno_int) == 1) {
                                        if (!ast_test_flag64(&confflags, CONFFLAG_QUIET)) {
-                                               res = ast_streamfile(chan, "conf-enteringno", chan->language);
+                                               res = ast_streamfile(chan, "conf-enteringno", ast_channel_language(chan));
                                                if (!res) {
                                                        ast_waitstream(chan, "");
-                                                       res = ast_say_digits(chan, confno_int, "", chan->language);
+                                                       res = ast_say_digits(chan, confno_int, "", ast_channel_language(chan));
                                                }
                                        }
                                } else {
@@ -4456,7 +4456,7 @@ static int conf_exec(struct ast_channel *chan, const char *data)
                        if (!cnf) {
                                if (allowretry) {
                                        confno[0] = '\0';
-                                       res = ast_streamfile(chan, "conf-invalid", chan->language);
+                                       res = ast_streamfile(chan, "conf-invalid", ast_channel_language(chan));
                                        if (!res)
                                                ast_waitstream(chan, "");
                                        res = -1;
@@ -4520,7 +4520,7 @@ static int conf_exec(struct ast_channel *chan, const char *data)
                                                                break;
                                                        } else {
                                                                /* Pin invalid */
-                                                               if (!ast_streamfile(chan, "conf-invalidpin", chan->language)) {
+                                                               if (!ast_streamfile(chan, "conf-invalidpin", ast_channel_language(chan))) {
                                                                        res = ast_waitstream(chan, AST_DIGIT_ANY);
                                                                        ast_stopstream(chan);
                                                                } else {
@@ -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, ast_channel_name(user->chan), 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), ast_channel_uniqueid(user->chan));
 
        ao2_ref(user, -1);
        astman_send_ack(s, m, mute ? "User muted" : "User unmuted");
index 9348b3a..da9f689 100644 (file)
@@ -1543,7 +1543,7 @@ static int invent_message(struct ast_channel *chan, char *domain, char *username
        snprintf(fn, sizeof(fn), "%s%s/%s/greet", MVM_SPOOL_DIR, domain, username);
 
        if (ast_fileexists(fn, NULL, NULL) > 0) {
-               res = ast_streamfile(chan, fn, chan->language);
+               res = ast_streamfile(chan, fn, ast_channel_language(chan));
                if (res) 
                        return -1;
                res = ast_waitstream(chan, ecodes);
@@ -1565,23 +1565,23 @@ static int invent_message(struct ast_channel *chan, char *domain, char *username
                }
 
                if (numericusername) {
-                       if (ast_streamfile(chan, "vm-theperson", chan->language))
+                       if (ast_streamfile(chan, "vm-theperson", ast_channel_language(chan)))
                                return -1;
                        if ((res = ast_waitstream(chan, ecodes)))
                                return res;
 
-                       res = ast_say_digit_str(chan, username, ecodes, chan->language);
+                       res = ast_say_digit_str(chan, username, ecodes, ast_channel_language(chan));
                        if (res)
                                return res;
                } else {
-                       if (ast_streamfile(chan, "vm-theextensionis", chan->language))
+                       if (ast_streamfile(chan, "vm-theextensionis", ast_channel_language(chan)))
                                return -1;
                        if ((res = ast_waitstream(chan, ecodes)))
                                return res;
                }
        }
 
-       res = ast_streamfile(chan, busy ? "vm-isonphone" : "vm-isunavail", chan->language);
+       res = ast_streamfile(chan, busy ? "vm-isonphone" : "vm-isunavail", ast_channel_language(chan));
        if (res)
                return -1;
        res = ast_waitstream(chan, ecodes);
@@ -1637,7 +1637,7 @@ static int play_record_review(struct ast_channel *chan, char *playfile, char *re
                case '2':
                        /* Review */
                        ast_verb(3, "Reviewing the message\n");
-                       ast_streamfile(chan, recordfile, chan->language);
+                       ast_streamfile(chan, recordfile, ast_channel_language(chan));
                        cmd = ast_waitstream(chan, AST_DIGIT_ANY);
                        break;
                case '3':
@@ -1902,7 +1902,7 @@ static int leave_voicemail(struct ast_channel *chan, char *username, struct leav
        txtdes = mkstemp(tmptxtfile);
        if (txtdes < 0) {
                ast_log(LOG_ERROR, "Unable to create message file %s: %s\n", tmptxtfile, strerror(errno));
-               res = ast_streamfile(chan, "vm-mailboxfull", chan->language);
+               res = ast_streamfile(chan, "vm-mailboxfull", ast_channel_language(chan));
                if (!res)
                        res = ast_waitstream(chan, "");
                pbx_builtin_setvar_helper(chan, "MVM_RECORD_STATUS", "FAILED");
@@ -1911,7 +1911,7 @@ static int leave_voicemail(struct ast_channel *chan, char *username, struct leav
 
        if (res >= 0) {
                /* Unless we're *really* silent, try to send the beep */
-               res = ast_streamfile(chan, "beep", chan->language);
+               res = ast_streamfile(chan, "beep", ast_channel_language(chan));
                if (!res)
                        res = ast_waitstream(chan, "");
        }
@@ -2339,7 +2339,7 @@ static int minivm_greet_exec(struct ast_channel *chan, const char *data)
        res = 0;        /* Reset */
        /* Play the beginning intro if desired */
        if (!ast_strlen_zero(prefile)) {
-               if (ast_streamfile(chan, prefile, chan->language) > -1) 
+               if (ast_streamfile(chan, prefile, ast_channel_language(chan)) > -1) 
                        res = ast_waitstream(chan, ecodes);
        } else {
                ast_debug(2, "%s doesn't exist, doing what we can\n", prefile);
@@ -2358,7 +2358,7 @@ static int minivm_greet_exec(struct ast_channel *chan, const char *data)
                res = 0;
        }
        if (!res && !ast_test_flag(&leave_options, OPT_SILENT)) {
-               res = ast_streamfile(chan, SOUND_INTRO, chan->language);
+               res = ast_streamfile(chan, SOUND_INTRO, ast_channel_language(chan));
                if (!res)
                        res = ast_waitstream(chan, ecodes);
                if (res == '#') {
index 1389c79..f05b5d8 100644 (file)
@@ -266,7 +266,7 @@ static int page_exec(struct ast_channel *chan, const char *data)
        }
 
        if (!ast_test_flag(&flags, PAGE_QUIET)) {
-               res = ast_streamfile(chan, "beep", chan->language);
+               res = ast_streamfile(chan, "beep", ast_channel_language(chan));
                if (!res)
                        res = ast_waitstream(chan, "");
        }
index f245d59..2d94db7 100644 (file)
@@ -212,9 +212,9 @@ static int parkandannounce_exec(struct ast_channel *chan, const char *data)
        for (i = 0; i < looptemp; i++) {
                ast_verb(4, "Announce:%s\n", tmp[i]);
                if (!strcmp(tmp[i], "PARKED")) {
-                       ast_say_digits(dchan, lot, "", dchan->language);
+                       ast_say_digits(dchan, lot, "", ast_channel_language(dchan));
                } else {
-                       dres = ast_streamfile(dchan, tmp[i], dchan->language);
+                       dres = ast_streamfile(dchan, tmp[i], ast_channel_language(dchan));
                        if (!dres) {
                                dres = ast_waitstream(dchan, "");
                        } else {
index 6db5377..e9d4d87 100644 (file)
@@ -470,9 +470,9 @@ static int playback_exec(struct ast_channel *chan, const char *data)
                ast_stopstream(chan);
                while (!res && (front = strsep(&back, "&"))) {
                        if (option_say)
-                               res = say_full(chan, front, "", chan->language, NULL, -1, -1);
+                               res = say_full(chan, front, "", ast_channel_language(chan), NULL, -1, -1);
                        else
-                               res = ast_streamfile(chan, front, chan->language);
+                               res = ast_streamfile(chan, front, ast_channel_language(chan));
                        if (!res) { 
                                res = ast_waitstream(chan, ""); 
                                ast_stopstream(chan);
index 6b19177..6c2c958 100644 (file)
@@ -136,7 +136,7 @@ static int privacy_exec(struct ast_channel *chan, const char *data)
                /* Play unidentified call */
                res = ast_safe_sleep(chan, 1000);
                if (!res) {
-                       res = ast_streamfile(chan, "privacy-unident", chan->language);
+                       res = ast_streamfile(chan, "privacy-unident", ast_channel_language(chan));
                }
                if (!res) {
                        res = ast_waitstream(chan, "");
@@ -145,7 +145,7 @@ static int privacy_exec(struct ast_channel *chan, const char *data)
                /* Ask for 10 digit number, give 3 attempts */
                for (retries = 0; retries < maxretries; retries++) {
                        if (!res) {
-                               res = ast_streamfile(chan, "privacy-prompt", chan->language);
+                               res = ast_streamfile(chan, "privacy-prompt", ast_channel_language(chan));
                        }
                        if (!res) {
                                res = ast_waitstream(chan, "");
@@ -164,7 +164,7 @@ static int privacy_exec(struct ast_channel *chan, const char *data)
                                /* if we have a checkcontext argument, do pattern matching */
                                if (!ast_strlen_zero(args.checkcontext)) {
                                        if (!ast_exists_extension(NULL, args.checkcontext, phone, 1, NULL)) {
-                                               res = ast_streamfile(chan, "privacy-incorrect", chan->language);
+                                               res = ast_streamfile(chan, "privacy-incorrect", ast_channel_language(chan));
                                                if (!res) {
                                                        res = ast_waitstream(chan, "");
                                                }
@@ -175,7 +175,7 @@ static int privacy_exec(struct ast_channel *chan, const char *data)
                                        break;
                                }
                        } else {
-                               res = ast_streamfile(chan, "privacy-incorrect", chan->language);
+                               res = ast_streamfile(chan, "privacy-incorrect", ast_channel_language(chan));
                                if (!res) {
                                        res = ast_waitstream(chan, "");
                                }
@@ -184,7 +184,7 @@ static int privacy_exec(struct ast_channel *chan, const char *data)
 
                /* Got a number, play sounds and send them on their way */
                if ((retries < maxretries) && res >= 0) {
-                       res = ast_streamfile(chan, "privacy-thankyou", chan->language);
+                       res = ast_streamfile(chan, "privacy-thankyou", ast_channel_language(chan));
                        if (!res) {
                                res = ast_waitstream(chan, "");
                        }
index c7dc141..0f192ac 100644 (file)
@@ -2599,7 +2599,7 @@ static int join_queue(char *queuename, struct queue_ent *qe, enum queue_result *
                        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 );
+                       q->name, qe->pos, q->count, ast_channel_uniqueid(qe->chan));
                ast_debug(1, "Queue '%s' Join, Channel '%s', Position '%d'\n", q->name, ast_channel_name(qe->chan), qe->pos );
        }
        ao2_unlock(q);
@@ -2616,13 +2616,13 @@ static int play_file(struct ast_channel *chan, const char *filename)
                return 0;
        }
 
-       if (!ast_fileexists(filename, NULL, chan->language)) {
+       if (!ast_fileexists(filename, NULL, ast_channel_language(chan))) {
                return 0;
        }
 
        ast_stopstream(chan);
 
-       res = ast_streamfile(chan, filename, chan->language);
+       res = ast_streamfile(chan, filename, ast_channel_language(chan));
        if (!res)
                res = ast_waitstream(chan, AST_DIGIT_ANY);
 
@@ -2712,7 +2712,7 @@ static int say_position(struct queue_ent *qe, int ringing)
                                res = play_file(qe->chan, qe->parent->queue_quantity1);
                                if (res)
                                        goto playout;
-                               res = ast_say_number(qe->chan, qe->parent->announcepositionlimit, AST_DIGIT_ANY, qe->chan->language, NULL); /* Needs gender */
+                               res = ast_say_number(qe->chan, qe->parent->announcepositionlimit, AST_DIGIT_ANY, ast_channel_language(qe->chan), NULL); /* Needs gender */
                                if (res)
                                        goto playout;
                        } else {
@@ -2720,7 +2720,7 @@ static int say_position(struct queue_ent *qe, int ringing)
                                res = play_file(qe->chan, qe->parent->sound_thereare);
                                if (res)
                                        goto playout;
-                               res = ast_say_number(qe->chan, qe->pos, AST_DIGIT_ANY, qe->chan->language, NULL); /* Needs gender */
+                               res = ast_say_number(qe->chan, qe->pos, AST_DIGIT_ANY, ast_channel_language(qe->chan), NULL); /* Needs gender */
                                if (res)
                                        goto playout;
                        }
@@ -2759,7 +2759,7 @@ static int say_position(struct queue_ent *qe, int ringing)
                        goto playout;
 
                if (avgholdmins >= 1) {
-                       res = ast_say_number(qe->chan, avgholdmins, AST_DIGIT_ANY, qe->chan->language, NULL);
+                       res = ast_say_number(qe->chan, avgholdmins, AST_DIGIT_ANY, ast_channel_language(qe->chan), NULL);
                        if (res)
                                goto playout;
 
@@ -2774,7 +2774,7 @@ static int say_position(struct queue_ent *qe, int ringing)
                        }
                }
                if (avgholdsecs >= 1) {
-                       res = ast_say_number(qe->chan, avgholdsecs, AST_DIGIT_ANY, qe->chan->language, NULL);
+                       res = ast_say_number(qe->chan, avgholdsecs, AST_DIGIT_ANY, ast_channel_language(qe->chan), NULL);
                        if (res)
                                goto playout;
 
@@ -2855,7 +2855,7 @@ 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",
-                               ast_channel_name(qe->chan), q->name,  q->count, qe->pos, qe->chan->uniqueid);
+                               ast_channel_name(qe->chan), q->name,  q->count, qe->pos, ast_channel_uniqueid(qe->chan));
                        ast_debug(1, "Queue '%s' Leave, Channel '%s'\n", q->name, ast_channel_name(qe->chan));
                        /* Take us out of the queue */
                        if (prev)
@@ -3209,7 +3209,7 @@ static int ring_entry(struct queue_ent *qe, struct callattempt *tmp, int *busies
 
        /* Inherit context and extension */
        macrocontext = pbx_builtin_getvar_helper(qe->chan, "MACRO_CONTEXT");
-       ast_string_field_set(tmp->chan, dialcontext, ast_strlen_zero(macrocontext) ? qe->chan->context : macrocontext);
+       ast_channel_dialcontext_set(tmp->chan, ast_strlen_zero(macrocontext) ? qe->chan->context : macrocontext);
        macroexten = pbx_builtin_getvar_helper(qe->chan, "MACRO_EXTEN");
        if (!ast_strlen_zero(macroexten))
                ast_copy_string(tmp->chan->exten, macroexten, sizeof(tmp->chan->exten));
@@ -3268,7 +3268,7 @@ static int ring_entry(struct queue_ent *qe, struct callattempt *tmp, int *busies
                        S_COR(qe->chan->caller.id.name.valid, qe->chan->caller.id.name.str, "unknown"),
                        S_COR(qe->chan->connected.id.number.valid, qe->chan->connected.id.number.str, "unknown"),
                        S_COR(qe->chan->connected.id.name.valid, qe->chan->connected.id.name.str, "unknown"),
-                       qe->chan->context, qe->chan->exten, qe->chan->priority, qe->chan->uniqueid,
+                       qe->chan->context, qe->chan->exten, qe->chan->priority, ast_channel_uniqueid(qe->chan),
                        qe->parent->eventwhencalled == QUEUE_EVENT_VARIABLES ? vars2manager(qe->chan, vars, sizeof(vars)) : "");
 
                ast_channel_unlock(tmp->chan);
@@ -3458,7 +3458,7 @@ static void record_abandoned(struct queue_ent *qe)
                "Position: %d\r\n"
                "OriginalPosition: %d\r\n"
                "HoldTime: %d\r\n",
-               qe->parent->name, qe->chan->uniqueid, qe->pos, qe->opos, (int)(time(NULL) - qe->start));
+               qe->parent->name, ast_channel_uniqueid(qe->chan), qe->pos, qe->opos, (int)(time(NULL) - qe->start));
 
        qe->parent->callsabandoned++;
        ao2_unlock(qe->parent);
@@ -3487,14 +3487,14 @@ static void rna(int rnatime, struct queue_ent *qe, char *interface, char *member
                                                "Ringtime: %d\r\n"
                                                "%s",
                                                qe->parent->name,
-                                               qe->chan->uniqueid,
+                                               ast_channel_uniqueid(qe->chan),
                                                ast_channel_name(qe->chan),
                                                interface,
                                                membername,
                                                rnatime,
                                                qe->parent->eventwhencalled == QUEUE_EVENT_VARIABLES ? vars2manager(qe->chan, vars, sizeof(vars)) : "");
        }
-       ast_queue_log(qe->parent->name, qe->chan->uniqueid, membername, "RINGNOANSWER", "%d", rnatime);
+       ast_queue_log(qe->parent->name, ast_channel_uniqueid(qe->chan), membername, "RINGNOANSWER", "%d", rnatime);
        if (qe->parent->autopause != QUEUE_AUTOPAUSE_OFF && pause) {
                if (qe->parent->autopausedelay > 0) {
                        struct member *mem;
@@ -3672,29 +3672,29 @@ static struct callattempt *wait_for_answer(struct queue_ent *qe, struct callatte
                                ast_copy_string(on, o->member->interface, sizeof(on));
                                ast_copy_string(membername, o->member->membername, sizeof(membername));
 
-                               if (!ast_strlen_zero(o->chan->call_forward) && !forwardsallowed) {
-                                       ast_verb(3, "Forwarding %s to '%s' prevented.\n", inchan_name, o->chan->call_forward);
+                               if (!ast_strlen_zero(ast_channel_call_forward(o->chan)) && !forwardsallowed) {
+                                       ast_verb(3, "Forwarding %s to '%s' prevented.\n", inchan_name, ast_channel_call_forward(o->chan));
                                        numnochan++;
                                        do_hang(o);
                                        winner = NULL;
                                        continue;
-                               } else if (!ast_strlen_zero(o->chan->call_forward)) {
+                               } else if (!ast_strlen_zero(ast_channel_call_forward(o->chan))) {
                                        struct ast_channel *original = o->chan;
                                        char tmpchan[256];
                                        char *stuff;
                                        char *tech;
 
-                                       ast_copy_string(tmpchan, o->chan->call_forward, sizeof(tmpchan));
+                                       ast_copy_string(tmpchan, ast_channel_call_forward(o->chan), sizeof(tmpchan));
                                        if ((stuff = strchr(tmpchan, '/'))) {
                                                *stuff++ = '\0';
                                                tech = tmpchan;
                                        } else {
-                                               snprintf(tmpchan, sizeof(tmpchan), "%s@%s", o->chan->call_forward, o->chan->context);
+                                               snprintf(tmpchan, sizeof(tmpchan), "%s@%s", ast_channel_call_forward(o->chan), o->chan->context);
                                                stuff = tmpchan;
                                                tech = "Local";
                                        }
 
-                                       ast_cel_report_event(in, AST_CEL_FORWARD, NULL, o->chan->call_forward, NULL);
+                                       ast_cel_report_event(in, AST_CEL_FORWARD, NULL, ast_channel_call_forward(o->chan), NULL);
 
                                        /* Before processing channel, go ahead and check for forwarding */
                                        ast_verb(3, "Now forwarding %s to '%s/%s' (thanks to %s)\n", inchan_name, tech, stuff, ochan_name);
@@ -3713,7 +3713,7 @@ static struct callattempt *wait_for_answer(struct queue_ent *qe, struct callatte
                                                ast_channel_inherit_variables(in, o->chan);
                                                ast_channel_datastore_inherit(in, o->chan);
 
-                                               ast_string_field_set(o->chan, accountcode, in->accountcode);
+                                               ast_channel_accountcode_set(o->chan, ast_channel_accountcode(in));
 
                                                ast_channel_set_redirecting(o->chan, &original->redirecting, NULL);
                                                if (!o->chan->redirecting.from.number.valid
@@ -4058,7 +4058,7 @@ static int wait_our_turn(struct queue_ent *qe, int ringing, enum queue_result *r
 
                        if ((status = get_member_status(qe->parent, qe->max_penalty, qe->min_penalty, qe->parent->leavewhenempty))) {
                                *reason = QUEUE_LEAVEEMPTY;
-                               ast_queue_log(qe->parent->name, qe->chan->uniqueid, "NONE", "EXITEMPTY", "%d|%d|%ld", qe->pos, qe->opos, (long) time(NULL) - qe->start);
+                               ast_queue_log(qe->parent->name, ast_channel_uniqueid(qe->chan), "NONE", "EXITEMPTY", "%d|%d|%ld", qe->pos, qe->opos, (long) time(NULL) - qe->start);
                                leave_queue(qe);
                                break;
                        }
@@ -4268,7 +4268,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, ast_channel_name(peer), member->interface, member->membername,
+               queuename, ast_channel_uniqueid(qe->chan), 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) : "");
 }
@@ -4312,7 +4312,7 @@ static void queue_transfer_fixup(void *data, struct ast_channel *old_chan, struc
        int callcompletedinsl = qtds->callcompletedinsl;
        struct ast_datastore *datastore;
 
-       ast_queue_log(qe->parent->name, qe->chan->uniqueid, member->membername, "TRANSFER", "%s|%s|%ld|%ld|%d",
+       ast_queue_log(qe->parent->name, ast_channel_uniqueid(qe->chan), member->membername, "TRANSFER", "%s|%s|%ld|%ld|%d",
                                new_chan->exten, new_chan->context, (long) (callstart - qe->start),
                                (long) (time(NULL) - callstart), qe->opos);
 
@@ -4761,11 +4761,11 @@ static int try_calling(struct queue_ent *qe, const char *options, char *announce
                                                holdtime = abs((now - qe->start) / 60);
                                                holdtimesecs = abs((now - qe->start) % 60);
                                                if (holdtime > 0) {
-                                                       ast_say_number(peer, holdtime, AST_DIGIT_ANY, peer->language, NULL);
+                                                       ast_say_number(peer, holdtime, AST_DIGIT_ANY, ast_channel_language(peer), NULL);
                                                        play_file(peer, qe->parent->sound_minutes);
                                                }
                                                if (holdtimesecs > 1) {
-                                                       ast_say_number(peer, holdtimesecs, AST_DIGIT_ANY, peer->language, NULL);
+                                                       ast_say_number(peer, holdtimesecs, AST_DIGIT_ANY, ast_channel_language(peer), NULL);
                                                        play_file(peer, qe->parent->sound_seconds);
                                                }
                                        }
@@ -4775,7 +4775,7 @@ static int try_calling(struct queue_ent *qe, const char *options, char *announce
                        if (ast_check_hangup(peer)) {
                                /* Agent must have hung up */
                                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", "");
+                               ast_queue_log(queuename, ast_channel_uniqueid(qe->chan), member->membername, "AGENTDUMP", "%s", "");
                                if (qe->parent->eventwhencalled)
                                        manager_event(EVENT_FLAG_AGENT, "AgentDump",
                                                        "Queue: %s\r\n"
@@ -4784,7 +4784,7 @@ 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, ast_channel_name(peer), member->interface, member->membername,
+                                                       queuename, ast_channel_uniqueid(qe->chan), 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);
@@ -4792,7 +4792,7 @@ static int try_calling(struct queue_ent *qe, const char *options, char *announce
                        } 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", 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);
+                               ast_queue_log(queuename, ast_channel_uniqueid(qe->chan), member->membername, "ABANDON", "%d|%d|%ld", qe->pos, qe->opos, (long) time(NULL) - qe->start);
                                record_abandoned(qe);
                                ast_hangup(peer);
                                ao2_ref(member, -1);
@@ -4811,7 +4811,7 @@ static int try_calling(struct queue_ent *qe, const char *options, char *announce
                /* 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_queue_log(queuename, ast_channel_uniqueid(qe->chan), member->membername, "SYSCOMPAT", "%s", "");
                        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);
@@ -5098,7 +5098,7 @@ static int try_calling(struct queue_ent *qe, const char *options, char *announce
                                ast_log(LOG_WARNING, "Asked to execute an AGI on this channel, but could not find application (agi)!\n");
                }
                qe->handled++;
-               ast_queue_log(queuename, qe->chan->uniqueid, member->membername, "CONNECT", "%ld|%s|%ld", (long) time(NULL) - qe->start, peer->uniqueid,
+               ast_queue_log(queuename, ast_channel_uniqueid(qe->chan), member->membername, "CONNECT", "%ld|%s|%ld", (long) time(NULL) - qe->start, ast_channel_uniqueid(peer),
                                                                                                        (long)(orig - to > 0 ? (orig - to) / 1000 : 0));
 
                if (qe->chan->cdr) {
@@ -5112,8 +5112,8 @@ static int try_calling(struct queue_ent *qe, const char *options, char *announce
                        }
 
                        /* If this CDR is not related to us add new one*/
-                       if ((strcasecmp(cdr->uniqueid, qe->chan->uniqueid)) &&
-                           (strcasecmp(cdr->linkedid, qe->chan->uniqueid)) &&
+                       if ((strcasecmp(cdr->uniqueid, ast_channel_uniqueid(qe->chan))) &&
+                           (strcasecmp(cdr->linkedid, ast_channel_uniqueid(qe->chan))) &&
                            (newcdr = ast_cdr_dup(cdr))) {
                                ast_channel_lock(qe->chan);
                                ast_cdr_init(newcdr, qe->chan);
@@ -5139,8 +5139,8 @@ 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, ast_channel_name(peer), member->interface, member->membername,
-                                       (long) time(NULL) - qe->start, peer->uniqueid, (long)(orig - to > 0 ? (orig - to) / 1000 : 0),
+                                       queuename, ast_channel_uniqueid(qe->chan), ast_channel_name(peer), member->interface, member->membername,
+                                       (long) time(NULL) - qe->start, ast_channel_uniqueid(peer), (long)(orig - to > 0 ? (orig - to) / 1000 : 0),
                                        qe->parent->eventwhencalled == QUEUE_EVENT_VARIABLES ? vars2manager(qe->chan, vars, sizeof(vars)) : "");
                ast_copy_string(oldcontext, qe->chan->context, sizeof(oldcontext));
                ast_copy_string(oldexten, qe->chan->exten, sizeof(oldexten));
@@ -5172,16 +5172,16 @@ static int try_calling(struct queue_ent *qe, const char *options, char *announce
 
                        /* detect a blind transfer */
                        if (!(qe->chan->_softhangup | peer->_softhangup) && (strcasecmp(oldcontext, qe->chan->context) || strcasecmp(oldexten, qe->chan->exten))) {
-                               ast_queue_log(queuename, qe->chan->uniqueid, member->membername, "TRANSFER", "%s|%s|%ld|%ld|%d",
+                               ast_queue_log(queuename, ast_channel_uniqueid(qe->chan), member->membername, "TRANSFER", "%s|%s|%ld|%ld|%d",
                                        qe->chan->exten, qe->chan->context, (long) (callstart - qe->start),
                                        (long) (time(NULL) - callstart), qe->opos);
                                send_agent_complete(qe, queuename, peer, member, callstart, vars, sizeof(vars), TRANSFER);
                        } else if (ast_check_hangup(qe->chan)) {
-                               ast_queue_log(queuename, qe->chan->uniqueid, member->membername, "COMPLETECALLER", "%ld|%ld|%d",
+                               ast_queue_log(queuename, ast_channel_uniqueid(qe->chan), member->membername, "COMPLETECALLER", "%ld|%ld|%d",
                                        (long) (callstart - qe->start), (long) (time(NULL) - callstart), qe->opos);
                                send_agent_complete(qe, queuename, peer, member, callstart, vars, sizeof(vars), CALLER);
                        } else {
-                               ast_queue_log(queuename, qe->chan->uniqueid, member->membername, "COMPLETEAGENT", "%ld|%ld|%d",
+                               ast_queue_log(queuename, ast_channel_uniqueid(qe->chan), member->membername, "COMPLETEAGENT", "%ld|%ld|%d",
                                        (long) (callstart - qe->start), (long) (time(NULL) - callstart), qe->opos);
                                send_agent_complete(qe, queuename, peer, member, callstart, vars, sizeof(vars), AGENT);
                        }
@@ -5813,9 +5813,9 @@ static int rqm_exec(struct ast_channel *chan, const char *data)
        switch (remove_from_queue(args.queuename, args.interface)) {
        case RES_OKAY:
                if (!mem || ast_strlen_zero(mem->membername)) {
-                       ast_queue_log(args.queuename, chan->uniqueid, args.interface, "REMOVEMEMBER", "%s", "");
+                       ast_queue_log(args.queuename, ast_channel_uniqueid(chan), args.interface, "REMOVEMEMBER", "%s", "");
                } else {
-                       ast_queue_log(args.queuename, chan->uniqueid, mem->membername, "REMOVEMEMBER", "%s", "");
+                       ast_queue_log(args.queuename, ast_channel_uniqueid(chan), mem->membername, "REMOVEMEMBER", "%s", "");
                }
                ast_log(LOG_NOTICE, "Removed interface '%s' from queue '%s'\n", args.interface, args.queuename);
                pbx_builtin_setvar_helper(chan, "RQMSTATUS", "REMOVED");
@@ -5886,9 +5886,9 @@ static int aqm_exec(struct ast_channel *chan, const char *data)
        switch (add_to_queue(args.queuename, args.interface, args.membername, penalty, 0, queue_persistent_members, args.state_interface)) {
        case RES_OKAY:
                if (ast_strlen_zero(args.membername) || !log_membername_as_agent) {
-                       ast_queue_log(args.queuename, chan->uniqueid, args.interface, "ADDMEMBER", "%s", "");
+                       ast_queue_log(args.queuename, ast_channel_uniqueid(chan), args.interface, "ADDMEMBER", "%s", "");
                } else {
-                       ast_queue_log(args.queuename, chan->uniqueid, args.membername, "ADDMEMBER", "%s", "");
+                       ast_queue_log(args.queuename, ast_channel_uniqueid(chan), args.membername, "ADDMEMBER", "%s", "");
                }
                ast_log(LOG_NOTICE, "Added interface '%s' to queue '%s'\n", args.interface, args.queuename);
                pbx_builtin_setvar_helper(chan, "AQMSTATUS", "ADDED");
@@ -6114,7 +6114,7 @@ static int queue_exec(struct ast_channel *chan, const char *data)
                set_queue_result(chan, reason);
                return 0;
        }
-       ast_queue_log(args.queuename, chan->uniqueid, "NONE", "ENTERQUEUE", "%s|%s|%d",
+       ast_queue_log(args.queuename, ast_channel_uniqueid(chan), "NONE", "ENTERQUEUE", "%s|%s|%d",
                S_OR(args.url, ""),
                S_COR(chan->caller.id.number.valid, chan->caller.id.number.str, ""),
                qe.opos);
@@ -6146,7 +6146,7 @@ check_turns:
                        record_abandoned(&qe);
                        reason = QUEUE_TIMEOUT;
                        res = 0;
-                       ast_queue_log(args.queuename, chan->uniqueid,"NONE", "EXITWITHTIMEOUT", "%d|%d|%ld", 
+                       ast_queue_log(args.queuename, ast_channel_uniqueid(chan),"NONE", "EXITWITHTIMEOUT", "%d|%d|%ld", 
                                qe.pos, qe.opos, (long) time(NULL) - qe.start);
                        break;
                }
@@ -6169,7 +6169,7 @@ check_turns:
                        record_abandoned(&qe);
                        reason = QUEUE_TIMEOUT;
                        res = 0;
-                       ast_queue_log(args.queuename, chan->uniqueid, "NONE", "EXITWITHTIMEOUT", "%d", qe.pos);
+                       ast_queue_log(args.queuename, ast_channel_uniqueid(chan), "NONE", "EXITWITHTIMEOUT", "%d", qe.pos);
                        break;
                }
 
@@ -6189,7 +6189,7 @@ check_turns:
                        if ((status = get_member_status(qe.parent, qe.max_penalty, qe.min_penalty, qe.parent->leavewhenempty))) {
                                record_abandoned(&qe);
                                reason = QUEUE_LEAVEEMPTY;
-                               ast_queue_log(args.queuename, chan->uniqueid, "NONE", "EXITEMPTY", "%d|%d|%ld", qe.pos, qe.opos, (long)(time(NULL) - qe.start));
+                               ast_queue_log(args.queuename, ast_channel_uniqueid(chan), "NONE", "EXITEMPTY", "%d|%d|%ld", qe.pos, qe.opos, (long)(time(NULL) - qe.start));
                                res = 0;
                                break;
                        }
@@ -6198,7 +6198,7 @@ check_turns:
                /* exit after 'timeout' cycle if 'n' option enabled */
                if (noption && tries >= ao2_container_count(qe.parent->members)) {
                        ast_verb(3, "Exiting on time-out cycle\n");
-                       ast_queue_log(args.queuename, chan->uniqueid, "NONE", "EXITWITHTIMEOUT", "%d", qe.pos);
+                       ast_queue_log(args.queuename, ast_channel_uniqueid(chan), "NONE", "EXITWITHTIMEOUT", "%d", qe.pos);
                        record_abandoned(&qe);
                        reason = QUEUE_TIMEOUT;
                        res = 0;
@@ -6211,7 +6211,7 @@ check_turns:
                        record_abandoned(&qe);
                        reason = QUEUE_TIMEOUT;
                        res = 0;
-                       ast_queue_log(qe.parent->name, qe.chan->uniqueid,"NONE", "EXITWITHTIMEOUT", "%d|%d|%ld", qe.pos, qe.opos, (long) time(NULL) - qe.start);
+                       ast_queue_log(qe.parent->name, ast_channel_uniqueid(qe.chan),"NONE", "EXITWITHTIMEOUT", "%d|%d|%ld", qe.pos, qe.opos, (long) time(NULL) - qe.start);
                        break;
                }
 
@@ -6237,7 +6237,7 @@ stop:
                if (res < 0) {
                        if (!qe.handled) {
                                record_abandoned(&qe);
-                               ast_queue_log(args.queuename, chan->uniqueid, "NONE", "ABANDON",
+                               ast_queue_log(args.queuename, ast_channel_uniqueid(chan), "NONE", "ABANDON",
                                        "%d|%d|%ld", qe.pos, qe.opos,
                                        (long) time(NULL) - qe.start);
                                res = -1;
@@ -6246,7 +6246,7 @@ stop:
                                res = 0;
                        }
                } else if (qe.valid_digits) {
-                       ast_queue_log(args.queuename, chan->uniqueid, "NONE", "EXITWITHKEY",
+                       ast_queue_log(args.queuename, ast_channel_uniqueid(chan), "NONE", "EXITWITHKEY",
                                "%s|%d", qe.digits, qe.pos);
                }
        }
@@ -7592,7 +7592,7 @@ static int manager_queues_status(struct mansession *s, const struct message *m)
                                        "Wait: %ld\r\n"
                                        "%s"
                                        "\r\n",
-                                       q->name, pos++, ast_channel_name(qe->chan), qe->chan->uniqueid,
+                                       q->name, pos++, ast_channel_name(qe->chan), ast_channel_uniqueid(qe->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"),
index 6e8531d..dc2e482 100644 (file)
@@ -194,7 +194,7 @@ static int readexten_exec(struct ast_channel *chan, const char *data)
                if (ts && ts->data[0]) {
                        res = ast_playtones_start(chan, 0, ts->data, 0);
                } else if (arglist.filename) {
-                       if (ast_test_flag(&flags, OPT_INDICATION) && ast_fileexists(arglist.filename, NULL, chan->language) <= 0) {
+                       if (ast_test_flag(&flags, OPT_INDICATION) && ast_fileexists(arglist.filename, NULL, ast_channel_language(chan)) <= 0) {
                                /*
                                 * We were asked to play an indication that did not exist in the config.
                                 * If no such file exists, play it as a tonelist.  With any luck they won't
@@ -203,7 +203,7 @@ static int readexten_exec(struct ast_channel *chan, const char *data)
                                 */
                                res = ast_playtones_start(chan, 0, arglist.filename, 0);
                        } else {
-                               res = ast_streamfile(chan, arglist.filename, chan->language);
+                               res = ast_streamfile(chan, arglist.filename, ast_channel_language(chan));
                        }
                }
 
index 18101e4..420ed0e 100644 (file)
@@ -254,7 +254,7 @@ static int record_exec(struct ast_channel *chan, const char *data)
                                ast_copy_string(tmp + tmplen, &(fname.piece[idx][1]), sizeof(tmp) - tmplen);
                        }
                        count++;
-               } while (ast_fileexists(tmp, ext, chan->language) > 0);
+               } while (ast_fileexists(tmp, ext, ast_channel_language(chan)) > 0);
                pbx_builtin_setvar_helper(chan, "RECORDED_FILE", tmp);
        } else
                ast_copy_string(tmp, args.filename, sizeof(tmp));
@@ -279,7 +279,7 @@ static int record_exec(struct ast_channel *chan, const char *data)
 
        if (!ast_test_flag(&flags, OPTION_QUIET)) {
                /* Some code to play a nice little beep to signify the start of the record operation */
-               res = ast_streamfile(chan, "beep", chan->language);
+               res = ast_streamfile(chan, "beep", ast_channel_language(chan));
                if (!res) {
                        res = ast_waitstream(chan, "");
                } else {
index 3a8ef4a..4dc196e 100644 (file)
@@ -3704,7 +3704,7 @@ static int sayfile(struct ast_channel *mychannel,char *fname)
 {
 int    res;
 
-       res = ast_streamfile(mychannel, fname, mychannel->language);
+       res = ast_streamfile(mychannel, fname, ast_channel_language(mychannel));
        if (!res) 
                res = ast_waitstream(mychannel, "");
        else
@@ -3717,7 +3717,7 @@ static int saycharstr(struct ast_channel *mychannel,char *str)
 {
 int    res;
 
-       res = ast_say_character_str(mychannel,str,NULL,mychannel->language);
+       res = ast_say_character_str(mychannel,str,NULL,ast_channel_language(mychannel));
        if (!res) 
                res = ast_waitstream(mychannel, "");
        else
@@ -3729,7 +3729,7 @@ int       res;
 static int saynum(struct ast_channel *mychannel, int num)
 {
        int res;
-       res = ast_say_number(mychannel, num, NULL, mychannel->language, NULL);
+       res = ast_say_number(mychannel, num, NULL, ast_channel_language(mychannel), NULL);
        if(!res)
                res = ast_waitstream(mychannel, "");
        else
@@ -3749,11 +3749,11 @@ char    *val,fname[300];
        val = (char *) ast_variable_retrieve(myrpt->cfg, myrpt->name, "nodenames");
        if (!val) val = NODENAMES;
        snprintf(fname,sizeof(fname) - 1,"%s/%s",val,name);
-       if (ast_fileexists(fname,NULL,mychannel->language) > 0)
+       if (ast_fileexists(fname,NULL,ast_channel_language(mychannel)) > 0)
                return(sayfile(mychannel,fname));
        res = sayfile(mychannel,"rpt/node");
        if (!res) 
-               res = ast_say_character_str(mychannel,name,NULL,mychannel->language);
+               res = ast_say_character_str(mychannel,name,NULL,ast_channel_language(mychannel));
        return res;
 }
 
@@ -4093,7 +4093,7 @@ struct ast_format_cap *cap = NULL;
                break;
                
            case TAILMSG:
-               res = ast_streamfile(mychannel, myrpt->p.tailmessages[myrpt->tailmessagen], mychannel->language); 
+               res = ast_streamfile(mychannel, myrpt->p.tailmessages[myrpt->tailmessagen], ast_channel_language(mychannel)); 
                break;
                
            case IDTALKOVER:
@@ -4108,7 +4108,7 @@ struct ast_format_cap *cap = NULL;
                wait_interval(myrpt, DLY_TELEM, mychannel);
                res = telem_lookup(myrpt, mychannel, myrpt->name, "patchup");
                if(res < 0){ /* Then default message */
-                       res = ast_streamfile(mychannel, "rpt/callproceeding", mychannel->language);
+                       res = ast_streamfile(mychannel, "rpt/callproceeding", ast_channel_language(mychannel));
                }
                break;
            case TERM:
@@ -4116,7 +4116,7 @@ struct ast_format_cap *cap = NULL;
                wait_interval(myrpt, DLY_CALLTERM, mychannel);
                res = telem_lookup(myrpt, mychannel, myrpt->name, "patchdown");
                if(res < 0){ /* Then default message */
-                       res = ast_streamfile(mychannel, "rpt/callterminated", mychannel->language);
+                       res = ast_streamfile(mychannel, "rpt/callterminated", ast_channel_language(mychannel));
                }
                break;
            case COMPLETE:
@@ -4127,12 +4127,12 @@ struct ast_format_cap *cap = NULL;
            case MACRO_NOTFOUND:
                /* wait a little bit */
                wait_interval(myrpt, DLY_TELEM, mychannel);
-               res = ast_streamfile(mychannel, "rpt/macro_notfound", mychannel->language);
+               res = ast_streamfile(mychannel, "rpt/macro_notfound", ast_channel_language(mychannel));
                break;
            case MACRO_BUSY:
                /* wait a little bit */
                wait_interval(myrpt, DLY_TELEM, mychannel);
-               res = ast_streamfile(mychannel, "rpt/macro_busy", mychannel->language);
+               res = ast_streamfile(mychannel, "rpt/macro_busy", ast_channel_language(mychannel));
                break;
            case UNKEY:
                if(myrpt->patchnoct && myrpt->callmode){ /* If no CT during patch configured, then don't send one */
@@ -4317,7 +4317,7 @@ struct ast_format_cap *cap = NULL;
                        }
                        sprintf(mystr,"%04x",myrpt->lastunit);
                        myrpt->lastunit = 0;
-                       ast_say_character_str(mychannel,mystr,NULL,mychannel->language);
+                       ast_say_character_str(mychannel,mystr,NULL,ast_channel_language(mychannel));
                        break;
                }
 #endif
@@ -4420,35 +4420,35 @@ struct ast_format_cap *cap = NULL;
                res = saynode(myrpt,mychannel,mytele->mylink.name);
                if (!res) 
                    res = ast_streamfile(mychannel, ((mytele->mylink.hasconnected) ? 
-                       "rpt/remote_disc" : "rpt/remote_busy"), mychannel->language);
+                       "rpt/remote_disc" : "rpt/remote_busy"), ast_channel_language(mychannel));
                break;
            case REMALREADY:
                /* wait a little bit */
                wait_interval(myrpt, DLY_TELEM, mychannel);
-               res = ast_streamfile(mychannel, "rpt/remote_already", mychannel->language);
+               res = ast_streamfile(mychannel, "rpt/remote_already", ast_channel_language(mychannel));
                break;
            case REMNOTFOUND:
                /* wait a little bit */
                wait_interval(myrpt, DLY_TELEM, mychannel);
-               res = ast_streamfile(mychannel, "rpt/remote_notfound", mychannel->language);
+               res = ast_streamfile(mychannel, "rpt/remote_notfound", ast_channel_language(mychannel));
                break;
            case REMGO:
                /* wait a little bit */
                wait_interval(myrpt, DLY_TELEM, mychannel);
-               res = ast_streamfile(mychannel, "rpt/remote_go", mychannel->language);
+               res = ast_streamfile(mychannel, "rpt/remote_go", ast_channel_language(mychannel));
                break;
            case CONNECTED:
                /* wait a little bit */
                wait_interval(myrpt, DLY_TELEM,  mychannel);
                res = saynode(myrpt,mychannel,mytele->mylink.name);
                if (!res)
-                   res = ast_streamfile(mychannel, "rpt/connected", mychannel->language);
+                   res = ast_streamfile(mychannel, "rpt/connected", ast_channel_language(mychannel));
                if (!res) 
                        res = ast_waitstream(mychannel, "");
                else
                         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);
+               res = ast_streamfile(mychannel, "digits/2", ast_channel_language(mychannel));
                if (!res) 
                        res = ast_waitstream(mychannel, "");
                else
@@ -4460,17 +4460,17 @@ struct ast_format_cap *cap = NULL;
            case CONNFAIL:
                res = saynode(myrpt,mychannel,mytele->mylink.name);
                if (!res) 
-                   res = ast_streamfile(mychannel, "rpt/connection_failed", mychannel->language);
+                   res = ast_streamfile(mychannel, "rpt/connection_failed", ast_channel_language(mychannel));
                break;
            case MEMNOTFOUND:
                /* wait a little bit */
                wait_interval(myrpt, DLY_TELEM, mychannel);
-               res = ast_streamfile(mychannel, "rpt/memory_notfound", mychannel->language);
+               res = ast_streamfile(mychannel, "rpt/memory_notfound", ast_channel_language(mychannel));
                break;
            case PLAYBACK:
                /* wait a little bit */
                wait_interval(myrpt, DLY_TELEM, mychannel);
-               res = ast_streamfile(mychannel, mytele->param, mychannel->language);
+               res = ast_streamfile(mychannel, mytele->param, ast_channel_language(mychannel));
                break;
            case TOPKEY:
                /* wait a little bit */
@@ -4559,7 +4559,7 @@ struct ast_format_cap *cap = NULL;
            case INVFREQ:
                /* wait a little bit */
                wait_interval(myrpt, DLY_TELEM, mychannel);
-               res = ast_streamfile(mychannel, "rpt/invalid-freq", mychannel->language);
+               res = ast_streamfile(mychannel, "rpt/invalid-freq", ast_channel_language(mychannel));
                break;
            case REMMODE:
                cp = 0;
@@ -4847,7 +4847,7 @@ struct ast_format_cap *cap = NULL;
                if (myrpt->callmode)
                {
                        hastx = 1;
-                       res = ast_streamfile(mychannel, "rpt/autopatch_on", mychannel->language);
+                       res = ast_streamfile(mychannel, "rpt/autopatch_on", ast_channel_language(mychannel));
                        if (!res) 
                                res = ast_waitstream(mychannel, "");
                        else
@@ -4864,7 +4864,7 @@ struct ast_format_cap *cap = NULL;
                        s = "rpt/tranceive";
                        if (!l->mode) s = "rpt/monitor";
                        if (!l->thisconnected) s = "rpt/connecting";
-                       res = ast_streamfile(mychannel, s, mychannel->language);
+                       res = ast_streamfile(mychannel, s, ast_channel_language(mychannel));
                        if (!res) 
                                res = ast_waitstream(mychannel, "");
                        else
@@ -4874,7 +4874,7 @@ struct ast_format_cap *cap = NULL;
                }                       
                if (!hastx)
                {
-                       res = ast_streamfile(mychannel, "rpt/repeat_only", mychannel->language);
+                       res = ast_streamfile(mychannel, "rpt/repeat_only", ast_channel_language(mychannel));
                        if (!res) 
                                res = ast_waitstream(mychannel, "");
                        else
@@ -4908,7 +4908,7 @@ struct ast_format_cap *cap = NULL;
                if (myrpt->callmode)
                {
                        hastx = 1;
-                       res = ast_streamfile(mychannel, "rpt/autopatch_on", mychannel->language);
+                       res = ast_streamfile(mychannel, "rpt/autopatch_on", ast_channel_language(mychannel));
                        if (!res) 
                                res = ast_waitstream(mychannel, "");
                        else
@@ -4932,7 +4932,7 @@ struct ast_format_cap *cap = NULL;
                        s = "rpt/tranceive";
                        if (mode == 'R') s = "rpt/monitor";
                        if (mode == 'C') s = "rpt/connecting";
-                       res = ast_streamfile(mychannel, s, mychannel->language);
+                       res = ast_streamfile(mychannel, s, ast_channel_language(mychannel));
                        if (!res) 
                                res = ast_waitstream(mychannel, "");
                        else
@@ -4941,7 +4941,7 @@ struct ast_format_cap *cap = NULL;
                }                       
                if (!hastx)
                {
-                       res = ast_streamfile(mychannel, "rpt/repeat_only", mychannel->language);
+                       res = ast_streamfile(mychannel, "rpt/repeat_only", ast_channel_language(mychannel));
                        if (!res) 
                                res = ast_waitstream(mychannel, "");
                        else
@@ -4976,7 +4976,7 @@ struct ast_format_cap *cap = NULL;
 
            case UNAUTHTX: /* Say unauthorized transmit frequency */
                wait_interval(myrpt, DLY_TELEM, mychannel);
-               res = ast_streamfile(mychannel, "rpt/unauthtx", mychannel->language);
+               res = ast_streamfile(mychannel, "rpt/unauthtx", ast_channel_language(mychannel));
                if (!res) 
                        res = ast_waitstream(mychannel, "");
                else
@@ -4988,7 +4988,7 @@ struct ast_format_cap *cap = NULL;
            case PARROT: /* Repeat stuff */
 
                sprintf(mystr,PARROTFILE,myrpt->name,(unsigned int)mytele->parrot);
-               if (ast_fileexists(mystr,NULL,mychannel->language) <= 0)
+               if (ast_fileexists(mystr,NULL,ast_channel_language(mychannel)) <= 0)
                {
                        imdone = 1;
                        myrpt->parrotstate = 0;
@@ -4996,7 +4996,7 @@ struct ast_format_cap *cap = NULL;
                }
                wait_interval(myrpt, DLY_PARROT, mychannel);
                sprintf(mystr,PARROTFILE,myrpt->name,(unsigned int)mytele->parrot);
-               res = ast_streamfile(mychannel, mystr, mychannel->language);
+               res = ast_streamfile(mychannel, mystr, ast_channel_language(mychannel));
                if (!res) 
                        res = ast_waitstream(mychannel, "");
                else
@@ -5012,14 +5012,14 @@ struct ast_format_cap *cap = NULL;
            case TIMEOUT:
                res = saynode(myrpt,mychannel,myrpt->name);
                if (!res)
-                  res = ast_streamfile(mychannel, "rpt/timeout", mychannel->language);
+                  res = ast_streamfile(mychannel, "rpt/timeout", ast_channel_language(mychannel));
                break;
                
            case TIMEOUT_WARNING:
                time(&t);
                res = saynode(myrpt,mychannel,myrpt->name);
                if (!res)
-                  res = ast_streamfile(mychannel, "rpt/timeout-warning", mychannel->language);
+                  res = ast_streamfile(mychannel, "rpt/timeout-warning", ast_channel_language(mychannel));
                if (!res) 
                        res = ast_waitstream(mychannel, "");
                else
@@ -5028,18 +5028,18 @@ struct ast_format_cap *cap = NULL;
                if(!res) /* Say number of seconds */
                        ast_say_number(mychannel, myrpt->p.remotetimeout - 
                            (t - myrpt->last_activity_time), 
-                               "", mychannel->language, (char *) NULL);
+                               "", ast_channel_language(mychannel), (char *) NULL);
                if (!res) 
                        res = ast_waitstream(mychannel, "");
                ast_stopstream(mychannel);      
-               res = ast_streamfile(mychannel, "queue-seconds", mychannel->language);
+               res = ast_streamfile(mychannel, "queue-seconds", ast_channel_language(mychannel));
                break;
 
            case ACT_TIMEOUT_WARNING:
                time(&t);
                res = saynode(myrpt,mychannel,myrpt->name);
                if (!res)
-                   res = ast_streamfile(mychannel, "rpt/act-timeout-warning", mychannel->language);
+                   res = ast_streamfile(mychannel, "rpt/act-timeout-warning", ast_channel_language(mychannel));
                if (!res) 
                        res = ast_waitstream(mychannel, "");
                else
@@ -5048,11 +5048,11 @@ struct ast_format_cap *cap = NULL;
                if(!res) /* Say number of seconds */
                        ast_say_number(mychannel, myrpt->p.remoteinacttimeout - 
                            (t - myrpt->last_activity_time), 
-                               "", mychannel->language, (char *) NULL);
+                               "", ast_channel_language(mychannel), (char *) NULL);
                if (!res) 
                        res = ast_waitstream(mychannel, "");
                ast_stopstream(mychannel);      
-               res = ast_streamfile(mychannel, "queue-seconds", mychannel->language);
+               res = ast_streamfile(mychannel, "queue-seconds", ast_channel_language(mychannel));
                break;
                
            case STATS_TIME:
@@ -5079,7 +5079,7 @@ struct ast_format_cap *cap = NULL;
                        break;
                }
                /* Say the time */                              
-               res = ast_say_time(mychannel, t, "", mychannel->language);
+               res = ast_say_time(mychannel, t, "", ast_channel_language(mychannel));
                if (!res) 
                        res = ast_waitstream(mychannel, "");
                ast_stopstream(mychannel);              
@@ -5099,7 +5099,7 @@ struct ast_format_cap *cap = NULL;
                        break;
                }
                if(!res) /* Say "X" */
-                       ast_say_number(mychannel, vmajor, "", mychannel->language, (char *) NULL);
+                       ast_say_number(mychannel, vmajor, "", ast_channel_language(mychannel), (char *) NULL);
                if (!res) 
                        res = ast_waitstream(mychannel, "");
                ast_stopstream(mychannel);      
@@ -5109,7 +5109,7 @@ struct ast_format_cap *cap = NULL;
                        break;
                }
                if(!res) /* Say "Y" */
-                       ast_say_number(mychannel, vminor, "", mychannel->language, (char *) NULL);
+                       ast_say_number(mychannel, vminor, "", ast_channel_language(mychannel), (char *) NULL);
                if (!res){
                        res = ast_waitstream(mychannel, "");
                        ast_stopstream(mychannel);
@@ -5146,11 +5146,11 @@ struct ast_format_cap *cap = NULL;
 
                        for(idx=0; idx<looptemp; idx++) {
                                if(!strcmp(tmp[idx], "PARKED")) {
-                                       ast_say_digits(mychannel, atoi(myparm), "", mychannel->language);
+                                       ast_say_digits(mychannel, atoi(myparm), "", ast_channel_language(mychannel));
                                } else if(!strcmp(tmp[idx], "NODE")) {
-                                       ast_say_digits(mychannel, atoi(myrpt->name), "", mychannel->language);
+                                       ast_say_digits(mychannel, atoi(myrpt->name), "", ast_channel_language(mychannel));
                                } else {
-                                       dres = ast_streamfile(mychannel, tmp[idx], mychannel->language);
+                                       dres = ast_streamfile(mychannel, tmp[idx], ast_channel_language(mychannel));
                                        if(!dres) {
                                                dres = ast_waitstream(mychannel, "");
                                        } else {
@@ -6382,7 +6382,7 @@ static int function_playback(struct rpt *myrpt, char *param, char *digitbuf, int
        if(debug) 
                printf("@@@@ playback param = %s, digitbuf = %s\n", (param)? param : "(null)", digitbuf);
        
-       if (ast_fileexists(param,NULL,myrpt->rxchannel->language) <= 0)
+       if (ast_fileexists(param,NULL,ast_channel_language(myrpt->rxchannel)) <= 0)
                return DC_ERROR;
 
        rpt_telemetry(myrpt,PLAYBACK,param);
index 8a37562..32119ac 100644 (file)
@@ -154,7 +154,7 @@ static int sayunixtime_exec(struct ast_channel *chan, const char *data)
 
        if (!res) {
                res = ast_say_date_with_format(chan, unixtime, haltondigits,
-                                              chan->language, ast_strlen_zero(args.format) ? NULL : args.format, ast_strlen_zero(args.timezone) ? NULL : args.timezone);
+                                              ast_channel_language(chan), ast_strlen_zero(args.format) ? NULL : args.format, ast_strlen_zero(args.timezone) ? NULL : args.timezone);
        }
 
        return res;
index 637aac6..078fcf2 100644 (file)
@@ -725,7 +725,7 @@ static int speech_background(struct ast_channel *chan, const char *data)
                        /* Discard old stream information */
                        ast_stopstream(chan);
                        /* Start new stream */
-                       speech_streamfile(chan, filename, chan->language);
+                       speech_streamfile(chan, filename, ast_channel_language(chan));
                }
 
                /* Run scheduled stuff */
@@ -792,14 +792,14 @@ static int speech_background(struct ast_channel *chan, const char *data)
                                if (chan->stream == NULL) {
                                        if (speech->processing_sound != NULL) {
                                                if (strlen(speech->processing_sound) > 0 && strcasecmp(speech->processing_sound, "none")) {
-                                                       speech_streamfile(chan, speech->processing_sound, chan->language);
+                                                       speech_streamfile(chan, speech->processing_sound, ast_channel_language(chan));
                                                }
                                        }
                                } else if (chan->streamid == -1 && chan->timingfunc == NULL) {
                                        ast_stopstream(chan);
                                        if (speech->processing_sound != NULL) {
                                                if (strlen(speech->processing_sound) > 0 && strcasecmp(speech->processing_sound, "none")) {
-                                                       speech_streamfile(chan, speech->processing_sound, chan->language);
+                                                       speech_streamfile(chan, speech->processing_sound, ast_channel_language(chan));
                                                }
                                        }
                                }
index 83de481..720ca55 100644 (file)
@@ -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",
-               ast_channel_name(chan), var, value, chan->uniqueid);
+               ast_channel_name(chan), var, value, ast_channel_uniqueid(chan));
        return 0;
 }
 
index a177227..5259d6f 100644 (file)
@@ -144,7 +144,7 @@ static int background_detect_exec(struct ast_channel *chan, const char *data)
                        break;
                }
                ast_stopstream(chan);
-               if (ast_streamfile(chan, tmp, chan->language)) {
+               if (ast_streamfile(chan, tmp, ast_channel_language(chan))) {
                        ast_log(LOG_WARNING, "ast_streamfile failed on %s for %s\n", ast_channel_name(chan), (char *)data);
                        break;
                }
index 59bea65..3ebf332 100644 (file)
@@ -93,7 +93,7 @@ static int userevent_exec(struct ast_channel *chan, const char *data)
                        "UserEvent: %s\r\n"
                        "Uniqueid: %s\r\n"
                        "%s",
-                       args.eventname, chan->uniqueid, ast_str_buffer(body));
+                       args.eventname, ast_channel_uniqueid(chan), ast_str_buffer(body));
 
        ast_free(body);
 
index 062e103..37c3e94 100644 (file)
@@ -5161,7 +5161,7 @@ static int invent_message(struct ast_channel *chan, char *context, char *ext, in
                res = ast_stream_and_wait(chan, "vm-theperson", ecodes);
                if (res)
                        return res;
-               res = ast_say_digit_str(chan, ext, ecodes, chan->language);
+               res = ast_say_digit_str(chan, ext, ecodes, ast_channel_language(chan));
                if (res)
                        return res;
        }
@@ -5438,7 +5438,7 @@ static int copy_message(struct ast_channel *chan, struct ast_vm_user *vmu, int i
        if (recipmsgnum < recip->maxmsg - (imbox ? 0 : inprocess_count(vmu->mailbox, vmu->context, 0))) {
                make_file(topath, sizeof(topath), todir, recipmsgnum);
 #ifndef ODBC_STORAGE
-               if (EXISTS(fromdir, msgnum, frompath, chan->language)) {        
+               if (EXISTS(fromdir, msgnum, frompath, ast_channel_language(chan))) {    
                        COPY(fromdir, msgnum, todir, recipmsgnum, recip->mailbox, recip->context, frompath, topath);
                } else {
 #endif
@@ -5846,7 +5846,7 @@ static int leave_voicemail(struct ast_channel *chan, char *ext, struct leave_vm_
 #endif
                        RETRIEVE(prefile, -1, ext, context);
                if (ast_fileexists(prefile, NULL, NULL) > 0) {
-                       if (ast_streamfile(chan, prefile, chan->language) > -1) 
+                       if (ast_streamfile(chan, prefile, ast_channel_language(chan)) > -1) 
                                res = ast_waitstream(chan, ecodes);
 #ifdef ODBC_STORAGE
                        if (success == -1) {
@@ -5980,7 +5980,7 @@ static int leave_voicemail(struct ast_channel *chan, char *ext, struct leave_vm_
                }
 #else
                if (count_messages(vmu, dir) >= vmu->maxmsg - inprocess_count(vmu->mailbox, vmu->context, +1)) {
-                       res = ast_streamfile(chan, "vm-mailboxfull", chan->language);
+                       res = ast_streamfile(chan, "vm-mailboxfull", ast_channel_language(chan));
                        if (!res)
                                res = ast_waitstream(chan, "");
                        ast_log(AST_LOG_WARNING, "No more messages possible\n");
@@ -5994,7 +5994,7 @@ static int leave_voicemail(struct ast_channel *chan, char *ext, struct leave_vm_
                txtdes = mkstemp(tmptxtfile);
                chmod(tmptxtfile, VOICEMAIL_FILE_MODE & ~my_umask);
                if (txtdes < 0) {
-                       res = ast_streamfile(chan, "vm-mailboxfull", chan->language);
+                       res = ast_streamfile(chan, "vm-mailboxfull", ast_channel_language(chan));
                        if (!res)
                                res = ast_waitstream(chan, "");
                        ast_log(AST_LOG_ERROR, "Unable to create message file: %s\n", strerror(errno));
@@ -6074,7 +6074,7 @@ static int leave_voicemail(struct ast_channel *chan, char *ext, struct leave_vm_
                        if (ast_check_realtime("voicemail_data")) {
                                ast_destroy_realtime("voicemail_data", "filename", tmptxtfile, SENTINEL);
                        }
-                       res = ast_streamfile(chan, "vm-mailboxfull", chan->language);
+                       res = ast_streamfile(chan, "vm-mailboxfull", ast_channel_language(chan));
                        goto leave_vm_out;
                }
                res = play_record_review(chan, NULL, tmptxtfile, vmu->maxsecs, fmt, 1, vmu, &duration, &sound_duration, NULL, options->record_gain, vms, flag);
@@ -6854,7 +6854,7 @@ static int get_folder(struct ast_channel *chan, int start)
        if (d)
                return d;
        for (x = start; x < 5; x++) {   /* For all folders */
-               if ((d = ast_say_number(chan, x, AST_DIGIT_ANY, chan->language, NULL)))
+               if ((d = ast_say_number(chan, x, AST_DIGIT_ANY, ast_channel_language(chan), NULL)))
                        return d;
                d = ast_play_and_wait(chan, "vm-for");  /* "for" */
                if (d)
@@ -7343,7 +7343,7 @@ static int forward_message(struct ast_channel *chan, char *context, struct vm_st
                } else {
                        /* Ask for an extension */
                        ast_test_suite_event_notify("PLAYBACK", "Message: vm-extension");
-                       res = ast_streamfile(chan, "vm-extension", chan->language);     /* "extension" */
+                       res = ast_streamfile(chan, "vm-extension", ast_channel_language(chan)); /* "extension" */
                        prompt_played++;
                        if (res || prompt_played > 4)
                                break;
@@ -7409,7 +7409,7 @@ static int forward_message(struct ast_channel *chan, char *context, struct vm_st
                                        return res;
                                }
                        } else {
-                               res = ast_say_digit_str(chan, s, ecodes, chan->language);
+                               res = ast_say_digit_str(chan, s, ecodes, ast_channel_language(chan));
                        }
                        DISPOSE(fn, -1);
 
@@ -7610,29 +7610,29 @@ static int play_message_datetime(struct ast_channel *chan, struct ast_vm_user *v
        /* Can't think of how other diffs might be helpful, but I'm sure somebody will think of something. */
 #endif
        if (the_zone) {
-               res = ast_say_date_with_format(chan, t, AST_DIGIT_ANY, chan->language, the_zone->msg_format, the_zone->timezone);
-       } else if (!strncasecmp(chan->language, "de", 2)) {     /* GERMAN syntax */
-               res = ast_say_date_with_format(chan, t, AST_DIGIT_ANY, chan->language, "'vm-received' Q 'digits/at' HM", NULL);
-       } else if (!strncasecmp(chan->language, "gr", 2)) {     /* GREEK syntax */
-               res = ast_say_date_with_format(chan, t, AST_DIGIT_ANY, chan->language, "'vm-received' q  H 'digits/kai' M ", NULL);
-       } else if (!strncasecmp(chan->language, "it", 2)) {     /* ITALIAN syntax */
-               res = ast_say_date_with_format(chan, t, AST_DIGIT_ANY, chan->language, "'vm-received' q 'digits/at' 'digits/hours' k 'digits/e' M 'digits/minutes'", NULL);
-       } else if (!strncasecmp(chan->language, "nl", 2)) {     /* DUTCH syntax */
-               res = ast_say_date_with_format(chan, t, AST_DIGIT_ANY, chan->language, "'vm-received' q 'digits/nl-om' HM", NULL);
-       } else if (!strncasecmp(chan->language, "no", 2)) {     /* NORWEGIAN syntax */
-               res = ast_say_date_with_format(chan, t, AST_DIGIT_ANY, chan->language, "'vm-received' Q 'digits/at' HM", NULL);
-       } else if (!strncasecmp(chan->language, "pl", 2)) {     /* POLISH syntax */
-               res = ast_say_date_with_format(chan, t, AST_DIGIT_ANY, chan->language, "'vm-received' Q HM", NULL);
-       } else if (!strncasecmp(chan->language, "pt_BR", 5)) {  /* Brazillian PORTUGUESE syntax */
-               res = ast_say_date_with_format(chan, t, AST_DIGIT_ANY, chan->language, "'vm-received' Ad 'digits/pt-de' B 'digits/pt-de' Y 'digits/pt-as' HM ", NULL);
-       } else if (!strncasecmp(chan->language, "se", 2)) {     /* SWEDISH syntax */
-               res = ast_say_date_with_format(chan, t, AST_DIGIT_ANY, chan->language, "'vm-received' dB 'digits/at' k 'and' M", NULL);
-       } else if (!strncasecmp(chan->language, "zh", 2)) {     /* CHINESE (Taiwan) syntax */
-               res = ast_say_date_with_format(chan, t, AST_DIGIT_ANY, chan->language, "qR 'vm-received'", NULL);
-       } else if (!strncasecmp(chan->language, "vi", 2)) {     /* VIETNAMESE syntax */
-               res = ast_say_date_with_format(chan, t, AST_DIGIT_ANY, chan->language, "'vm-received' A 'digits/day' dB 'digits/year' Y 'digits/at' k 'hours' M 'minutes'", NULL);
+               res = ast_say_date_with_format(chan, t, AST_DIGIT_ANY, ast_channel_language(chan), the_zone->msg_format, the_zone->timezone);
+       } else if (!strncasecmp(ast_channel_language(chan), "de", 2)) {     /* GERMAN syntax */
+               res = ast_say_date_with_format(chan, t, AST_DIGIT_ANY, ast_channel_language(chan), "'vm-received' Q 'digits/at' HM", NULL);
+       } else if (!strncasecmp(ast_channel_language(chan), "gr", 2)) {     /* GREEK syntax */
+               res = ast_say_date_with_format(chan, t, AST_DIGIT_ANY, ast_channel_language(chan), "'vm-received' q  H 'digits/kai' M ", NULL);
+       } else if (!strncasecmp(ast_channel_language(chan), "it", 2)) {     /* ITALIAN syntax */
+               res = ast_say_date_with_format(chan, t, AST_DIGIT_ANY, ast_channel_language(chan), "'vm-received' q 'digits/at' 'digits/hours' k 'digits/e' M 'digits/minutes'", NULL);
+       } else if (!strncasecmp(ast_channel_language(chan), "nl", 2)) {     /* DUTCH syntax */
+               res = ast_say_date_with_format(chan, t, AST_DIGIT_ANY, ast_channel_language(chan), "'vm-received' q 'digits/nl-om' HM", NULL);
+       } else if (!strncasecmp(ast_channel_language(chan), "no", 2)) {     /* NORWEGIAN syntax */
+               res = ast_say_date_with_format(chan, t, AST_DIGIT_ANY, ast_channel_language(chan), "'vm-received' Q 'digits/at' HM", NULL);
+       } else if (!strncasecmp(ast_channel_language(chan), "pl", 2)) {     /* POLISH syntax */
+               res = ast_say_date_with_format(chan, t, AST_DIGIT_ANY, ast_channel_language(chan), "'vm-received' Q HM", NULL);
+       } else if (!strncasecmp(ast_channel_language(chan), "pt_BR", 5)) {  /* Brazillian PORTUGUESE syntax */
+               res = ast_say_date_with_format(chan, t, AST_DIGIT_ANY, ast_channel_language(chan), "'vm-received' Ad 'digits/pt-de' B 'digits/pt-de' Y 'digits/pt-as' HM ", NULL);
+       } else if (!strncasecmp(ast_channel_language(chan), "se", 2)) {     /* SWEDISH syntax */
+               res = ast_say_date_with_format(chan, t, AST_DIGIT_ANY, ast_channel_language(chan), "'vm-received' dB 'digits/at' k 'and' M", NULL);
+       } else if (!strncasecmp(ast_channel_language(chan), "zh", 2)) {     /* CHINESE (Taiwan) syntax */
+               res = ast_say_date_with_format(chan, t, AST_DIGIT_ANY, ast_channel_language(chan), "qR 'vm-received'", NULL);
+       } else if (!strncasecmp(ast_channel_language(chan), "vi", 2)) {     /* VIETNAMESE syntax */
+               res = ast_say_date_with_format(chan, t, AST_DIGIT_ANY, ast_channel_language(chan), "'vm-received' A 'digits/day' dB 'digits/year' Y 'digits/at' k 'hours' M 'minutes'", NULL);
        } else {
-               res = ast_say_date_with_format(chan, t, AST_DIGIT_ANY, chan->language, "'vm-received' q 'digits/at' IMp", NULL);
+               res = ast_say_date_with_format(chan, t, AST_DIGIT_ANY, ast_channel_language(chan), "'vm-received' q 'digits/at' IMp", NULL);
        }
 #if 0
        pbx_builtin_setvar_helper(chan, "DIFF_DAY", NULL);
@@ -7686,7 +7686,7 @@ static int play_message_callerid(struct ast_channel *chan, struct vm_state *vms,
                                                /* Say "from extension" as one saying to sound smoother */
                                                if (!callback)
                                                        res = wait_file2(chan, vms, "vm-from-extension");
-                                               res = ast_say_digit_str(chan, callerid, "", chan->language);
+                                               res = ast_say_digit_str(chan, callerid, "", ast_channel_language(chan));
                                        }
                                }
                        }
@@ -7704,10 +7704,10 @@ static int play_message_callerid(struct ast_channel *chan, struct vm_state *vms,
                                } else {
                                        /* Since this is all nicely figured out, why not say "from phone number" in this case" */
                                        wait_file2(chan, vms, "vm-from-phonenumber");
-                                       res = ast_say_digit_str(chan, callerid, AST_DIGIT_ANY, chan->language);
+                                       res = ast_say_digit_str(chan, callerid, AST_DIGIT_ANY, ast_channel_language(chan));
                                }
                        } else {
-                               res = ast_say_digit_str(chan, callerid, AST_DIGIT_ANY, chan->language);
+                               res = ast_say_digit_str(chan, callerid, AST_DIGIT_ANY, ast_channel_language(chan));
                        }
                }
        } else {
@@ -7738,7 +7738,7 @@ static int play_message_duration(struct ast_channel *chan, struct vm_state *vms,
                res = wait_file2(chan, vms, "vm-duration");
 
                /* POLISH syntax */
-               if (!strncasecmp(chan->language, "pl", 2)) {
+               if (!strncasecmp(ast_channel_language(chan), "pl", 2)) {
                        div_t num = div(durationm, 10);
 
                        if (durationm == 1) {
@@ -7749,20 +7749,20 @@ static int play_message_duration(struct ast_channel *chan, struct vm_state *vms,
                                        if (!num.quot) {
                                                res = ast_play_and_wait(chan, "digits/2-ie");
                                        } else {
-                                               res = say_and_wait(chan, durationm - 2 , chan->language);
+                                               res = say_and_wait(chan, durationm - 2 , ast_channel_language(chan));
                                                res = res ? res : ast_play_and_wait(chan, "digits/2-ie");
                                        }
                                } else {
-                                       res = say_and_wait(chan, durationm, chan->language);
+                                       res = say_and_wait(chan, durationm, ast_channel_language(chan));
                                }
                                res = res ? res : ast_play_and_wait(chan, "vm-minute-ty");
                        } else {
-                               res = say_and_wait(chan, durationm, chan->language);
+                               res = say_and_wait(chan, durationm, ast_channel_language(chan));
                                res = res ? res : ast_play_and_wait(chan, "vm-minute-t");
                        }
                /* DEFAULT syntax */
                } else {
-                       res = ast_say_number(chan, durationm, AST_DIGIT_ANY, chan->language, NULL);
+                       res = ast_say_number(chan, durationm, AST_DIGIT_ANY, ast_channel_language(chan), NULL);
                        res = wait_file2(chan, vms, "vm-minutes");
                }
        }
@@ -7803,7 +7803,7 @@ static int play_message(struct ast_channel *chan, struct ast_vm_user *vmu, struc
        if (!res) {
                /* XXX Why are we playing messages above, and then playing the same language-specific stuff here? */
                /* POLISH syntax */
-               if (!strncasecmp(chan->language, "pl", 2)) {
+               if (!strncasecmp(ast_channel_language(chan), "pl", 2)) {
                        if (vms->curmsg && (vms->curmsg != vms->lastmsg)) {
                                int ten, one;
                                char nextmsg[256];
@@ -7827,7 +7827,7 @@ static int play_message(struct ast_channel *chan, struct ast_vm_user *vmu, struc
                        if (!res)
                                res = wait_file2(chan, vms, "vm-message");
                /* HEBREW syntax */
-               } else if (!strncasecmp(chan->language, "he", 2)) {
+               } else if (!strncasecmp(ast_channel_language(chan), "he", 2)) {
                        if (!vms->curmsg) {
                                res = wait_file2(chan, vms, "vm-message");
                                res = wait_file2(chan, vms, "vm-first");
@@ -7837,10 +7837,10 @@ static int play_message(struct ast_channel *chan, struct ast_vm_user *vmu, struc
                        } else {
                                res = wait_file2(chan, vms, "vm-message");
                                res = wait_file2(chan, vms, "vm-number");
-                               res = ast_say_number(chan, vms->curmsg + 1, AST_DIGIT_ANY, chan->language, "f");
+                               res = ast_say_number(chan, vms->curmsg + 1, AST_DIGIT_ANY, ast_channel_language(chan), "f");
                        }
                /* VIETNAMESE syntax */
-               } else if (!strncasecmp(chan->language, "vi", 2)) {
+               } else if (!strncasecmp(ast_channel_language(chan), "vi", 2)) {
                        if (!vms->curmsg) {
                                res = wait_file2(chan, vms, "vm-message");
                                res = wait_file2(chan, vms, "vm-first");
@@ -7850,10 +7850,10 @@ static int play_message(struct ast_channel *chan, struct ast_vm_user *vmu, struc
                        } else {
                                res = wait_file2(chan, vms, "vm-message");
                                res = wait_file2(chan, vms, "vm-number");
-                               res = ast_say_number(chan, vms->curmsg + 1, AST_DIGIT_ANY, chan->language, "f");
+                               res = ast_say_number(chan, vms->curmsg + 1, AST_DIGIT_ANY, ast_channel_language(chan), "f");
                        }
                } else {
-                       if (!strncasecmp(chan->language, "se", 2)) { /* SWEDISH syntax */
+                       if (!strncasecmp(ast_channel_language(chan), "se", 2)) { /* SWEDISH syntax */
                                res = wait_file2(chan, vms, "vm-meddelandet");  /* "message" */
                        } else { /* DEFAULT syntax */
                                res = wait_file2(chan, vms, "vm-message");
@@ -7861,7 +7861,7 @@ static int play_message(struct ast_channel *chan, struct ast_vm_user *vmu, struc
                        if (vms->curmsg && (vms->curmsg != vms->lastmsg)) {
                                if (!res) {
                                        ast_test_suite_event_notify("PLAYBACK", "Message: message number");
-                                       res = ast_say_number(chan, vms->curmsg + 1, AST_DIGIT_ANY, chan->language, NULL);
+                                       res = ast_say_number(chan, vms->curmsg + 1, AST_DIGIT_ANY, ast_channel_language(chan), NULL);
                                }
                        }
                }
@@ -8203,20 +8203,20 @@ static int vm_play_folder_name(struct ast_channel *chan, char *box)
 {
        int cmd;
 
-       if (  !strncasecmp(chan->language, "it", 2) ||
-                 !strncasecmp(chan->language, "es", 2) ||
-                 !strncasecmp(chan->language, "pt", 2)) { /* Italian, Spanish, or Portuguese syntax */
+       if (  !strncasecmp(ast_channel_language(chan), "it", 2) ||
+                 !strncasecmp(ast_channel_language(chan), "es", 2) ||
+                 !strncasecmp(ast_channel_language(chan), "pt", 2)) { /* Italian, Spanish, or Portuguese syntax */
                cmd = ast_play_and_wait(chan, "vm-messages"); /* "messages */
                return cmd ? cmd : ast_play_and_wait(chan, box);
-       } else if (!strncasecmp(chan->language, "gr", 2)) {
+       } else if (!strncasecmp(ast_channel_language(chan), "gr", 2)) {
                return vm_play_folder_name_gr(chan, box);
-       } else if (!strncasecmp(chan->language, "he", 2)) {  /* Hebrew syntax */
+       } else if (!strncasecmp(ast_channel_language(chan), "he", 2)) {  /* Hebrew syntax */
                return ast_play_and_wait(chan, box);
-       } else if (!strncasecmp(chan->language, "pl", 2)) {
+       } else if (!strncasecmp(ast_channel_language(chan), "pl", 2)) {
                return vm_play_folder_name_pl(chan, box);
-       } else if (!strncasecmp(chan->language, "ua", 2)) {  /* Ukrainian syntax */
+       } else if (!strncasecmp(ast_channel_language(chan), "ua", 2)) {  /* Ukrainian syntax */
                return vm_play_folder_name_ua(chan, box);
-       } else if (!strncasecmp(chan->language, "vi", 2)) {
+       } else if (!strncasecmp(ast_channel_language(chan), "vi", 2)) {
                return ast_play_and_wait(chan, box);
        } else {  /* Default English */
                cmd = ast_play_and_wait(chan, box);
@@ -8243,7 +8243,7 @@ static int vm_intro_gr(struct ast_channel *chan, struct vm_state *vms)
        if (vms->newmessages) {
                res = ast_play_and_wait(chan, "vm-youhave");
                if (!res) 
-                       res = ast_say_number(chan, vms->newmessages, AST_DIGIT_ANY, chan->language, NULL);
+                       res = ast_say_number(chan, vms->newmessages, AST_DIGIT_ANY, ast_channel_language(chan), NULL);
                if (!res) {
                        if ((vms->newmessages == 1)) {
                                res = ast_play_and_wait(chan, "vm-INBOX");
@@ -8258,7 +8258,7 @@ static int vm_intro_gr(struct ast_channel *chan, struct vm_state *vms)
        } else if (vms->oldmessages){
                res = ast_play_and_wait(chan, "vm-youhave");
                if (!res)
-                       res = ast_say_number(chan, vms->oldmessages, AST_DIGIT_ANY, chan->language, NULL);
+                       res = ast_say_number(chan, vms->oldmessages, AST_DIGIT_ANY, ast_channel_language(chan), NULL);
                if ((vms->oldmessages == 1)){
                        res = ast_play_and_wait(chan, "vm-Old");
                        if (!res)
@@ -8340,7 +8340,7 @@ static int vm_intro_multilang(struct ast_channel *chan, struct vm_state *vms, co
        if (!res && vms->newmessages) {
                lastnum = vms->newmessages;
 
-               if (!(res = ast_say_number(chan, lastnum, AST_DIGIT_ANY, chan->language, message_gender))) {
+               if (!(res = ast_say_number(chan, lastnum, AST_DIGIT_ANY, ast_channel_language(chan), message_gender))) {
                        res = ast_say_counted_adjective(chan, lastnum, "vm-new", message_gender);
                }
 
@@ -8352,7 +8352,7 @@ static int vm_intro_multilang(struct ast_channel *chan, struct vm_state *vms, co
        if (!res && vms->oldmessages) {
                lastnum = vms->oldmessages;
 
-               if (!(res = ast_say_number(chan, lastnum, AST_DIGIT_ANY, chan->language, message_gender))) {
+               if (!(res = ast_say_number(chan, lastnum, AST_DIGIT_ANY, ast_channel_language(chan), message_gender))) {
                        res = ast_say_counted_adjective(chan, lastnum, "vm-old", message_gender);
                }
        }
@@ -8392,7 +8392,7 @@ static int vm_intro_he(struct ast_channel *chan, struct vm_state *vms)
                                        if (vms->newmessages == 2) {
                                                res = ast_play_and_wait(chan, "vm-shtei");
                                        } else {
-                                               res = ast_say_number(chan, vms->newmessages, AST_DIGIT_ANY, chan->language, "f");
+                                               res = ast_say_number(chan, vms->newmessages, AST_DIGIT_ANY, ast_channel_language(chan), "f");
                                        }
                                        res = ast_play_and_wait(chan, "vm-INBOX");
                                }
@@ -8405,7 +8405,7 @@ static int vm_intro_he(struct ast_channel *chan, struct vm_state *vms)
                                        if (vms->oldmessages == 2) {
                                                res = ast_play_and_wait(chan, "vm-shtei");
                                        } else {
-                                               res = ast_say_number(chan, vms->oldmessages, AST_DIGIT_ANY, chan->language, "f");
+                                               res = ast_say_number(chan, vms->oldmessages, AST_DIGIT_ANY, ast_channel_language(chan), "f");
                                        }
                                        res = ast_play_and_wait(chan, "vm-Old");
                                }
@@ -8419,7 +8419,7 @@ static int vm_intro_he(struct ast_channel *chan, struct vm_state *vms)
                                        if (vms->oldmessages == 2) {
                                                res = ast_play_and_wait(chan, "vm-shtei");
                                        } else {
-                                               res = ast_say_number(chan, vms->oldmessages, AST_DIGIT_ANY, chan->language, "f");            
+                                               res = ast_say_number(chan, vms->oldmessages, AST_DIGIT_ANY, ast_channel_language(chan), "f");            
                                        }
                                        res = ast_play_and_wait(chan, "vm-Old");
                                }
@@ -8445,7 +8445,7 @@ static int vm_intro_en(struct ast_channel *chan, struct vm_state *vms)
        res = ast_play_and_wait(chan, "vm-youhave");
        if (!res) {
                if (vms->urgentmessages) {
-                       res = say_and_wait(chan, vms->urgentmessages, chan->language);
+                       res = say_and_wait(chan, vms->urgentmessages, ast_channel_language(chan));
                        if (!res)
                                res = ast_play_and_wait(chan, "vm-Urgent");
                        if ((vms->oldmessages || vms->newmessages) && !res) {
@@ -8458,7 +8458,7 @@ static int vm_intro_en(struct ast_channel *chan, struct vm_state *vms)
                        }
                }
                if (vms->newmessages) {
-                       res = say_and_wait(chan, vms->newmessages, chan->language);
+                       res = say_and_wait(chan, vms->newmessages, ast_channel_language(chan));
                        if (!res)
                                res = ast_play_and_wait(chan, "vm-INBOX");
                        if (vms->oldmessages && !res)
@@ -8472,7 +8472,7 @@ static int vm_intro_en(struct ast_channel *chan, struct vm_state *vms)
                                
                }
                if (!res && vms->oldmessages) {
-                       res = say_and_wait(chan, vms->oldmessages, chan->language);
+                       res = say_and_wait(chan, vms->oldmessages, ast_channel_language(chan));
                        if (!res)
                                res = ast_play_and_wait(chan, "vm-Old");
                        if (!res) {
@@ -8509,7 +8509,7 @@ static int vm_intro_it(struct ast_channel *chan, struct vm_state *vms)
                        ast_play_and_wait(chan, "vm-nuovo") ||
                        ast_play_and_wait(chan, "vm-message") :
                        /* 2 or more new messages */
-                       say_and_wait(chan, vms->newmessages, chan->language) ||
+                       say_and_wait(chan, vms->newmessages, ast_channel_language(chan)) ||
                        ast_play_and_wait(chan, "vm-nuovi") ||
                        ast_play_and_wait(chan, "vm-messages");
                if (!res && vms->oldmessages)
@@ -8521,7 +8521,7 @@ static int vm_intro_it(struct ast_channel *chan, struct vm_state *vms)
                        ast_play_and_wait(chan, "vm-vecchio") ||
                        ast_play_and_wait(chan, "vm-message") :
                        /* 2 or more old messages */
-                       say_and_wait(chan, vms->oldmessages, chan->language) ||
+                       say_and_wait(chan, vms->oldmessages, ast_channel_language(chan)) ||
                        ast_play_and_wait(chan, "vm-vecchi") ||
                        ast_play_and_wait(chan, "vm-messages");
        }
@@ -8554,16 +8554,16 @@ static int vm_intro_pl(struct ast_channel *chan, struct vm_state *vms)
                                if (!num.quot) {
                                        res = ast_play_and_wait(chan, "digits/2-ie");
                                } else {
-                                       res = say_and_wait(chan, vms->newmessages - 2 , chan->language);
+                                       res = say_and_wait(chan, vms->newmessages - 2 , ast_channel_language(chan));
                                        res = res ? res : ast_play_and_wait(chan, "digits/2-ie");
                                }
                        } else {
-                               res = say_and_wait(chan, vms->newmessages, chan->language);
+                               res = say_and_wait(chan, vms->newmessages, ast_channel_language(chan));
                        }
                        res = res ? res : ast_play_and_wait(chan, "vm-new-e");
                        res = res ? res : ast_play_and_wait(chan, "vm-messages");
                } else {
-                       res = say_and_wait(chan, vms->newmessages, chan->language);
+                       res = say_and_wait(chan, vms->newmessages, ast_channel_language(chan));
                        res = res ? res : ast_play_and_wait(chan, "vm-new-ych");
                        res = res ? res : ast_play_and_wait(chan, "vm-messages");
                }
@@ -8581,16 +8581,16 @@ static int vm_intro_pl(struct ast_channel *chan, struct vm_state *vms)
                                if (!num.quot) {
                                        res = ast_play_and_wait(chan, "digits/2-ie");
                                } else {
-                                       res = say_and_wait(chan, vms->oldmessages - 2 , chan->language);
+                                       res = say_and_wait(chan, vms->oldmessages - 2 , ast_channel_language(chan));
                                        res = res ? res : ast_play_and_wait(chan, "digits/2-ie");
                                }
                        } else {
-                               res = say_and_wait(chan, vms->oldmessages, chan->language);
+                               res = say_and_wait(chan, vms->oldmessages, ast_channel_language(chan));
                        }
                        res = res ? res : ast_play_and_wait(chan, "vm-old-e");
                        res = res ? res : ast_play_and_wait(chan, "vm-messages");
                } else {
-                       res = say_and_wait(chan, vms->oldmessages, chan->language);
+                       res = say_and_wait(chan, vms->oldmessages, ast_channel_language(chan));
                        res = res ? res : ast_play_and_wait(chan, "vm-old-ych");
                        res = res ? res : ast_play_and_wait(chan, "vm-messages");
                }
@@ -8621,7 +8621,7 @@ static int vm_intro_se(struct ast_channel *chan, struct vm_state *vms)
                        res = res ? res : ast_play_and_wait(chan, "vm-nytt");
                        res = res ? res : ast_play_and_wait(chan, "vm-message");
                } else {
-                       res = say_and_wait(chan, vms->newmessages, chan->language);
+                       res = say_and_wait(chan, vms->newmessages, ast_channel_language(chan));
                        res = res ? res : ast_play_and_wait(chan, "vm-nya");
                        res = res ? res : ast_play_and_wait(chan, "vm-messages");
                }
@@ -8634,7 +8634,7 @@ static int vm_intro_se(struct ast_channel *chan, struct vm_state *vms)
                        res = res ? res : ast_play_and_wait(chan, "vm-gammalt");
                        res = res ? res : ast_play_and_wait(chan, "vm-message");
                } else {
-                       res = say_and_wait(chan, vms->oldmessages, chan->language);
+                       res = say_and_wait(chan, vms->oldmessages, ast_channel_language(chan));
                        res = res ? res : ast_play_and_wait(chan, "vm-gamla");
                        res = res ? res : ast_play_and_wait(chan, "vm-messages");
                }
@@ -8665,7 +8665,7 @@ static int vm_intro_no(struct ast_channel *chan, struct vm_state *vms)
                        res = res ? res : ast_play_and_wait(chan, "vm-ny");
                        res = res ? res : ast_play_and_wait(chan, "vm-message");
                } else {
-                       res = say_and_wait(chan, vms->newmessages, chan->language);
+                       res = say_and_wait(chan, vms->newmessages, ast_channel_language(chan));
                        res = res ? res : ast_play_and_wait(chan, "vm-nye");
                        res = res ? res : ast_play_and_wait(chan, "vm-messages");
                }
@@ -8678,7 +8678,7 @@ static int vm_intro_no(struct ast_channel *chan, struct vm_state *vms)
                        res = res ? res : ast_play_and_wait(chan, "vm-gamel");
                        res = res ? res : ast_play_and_wait(chan, "vm-message");
                } else {
-                       res = say_and_wait(chan, vms->oldmessages, chan->language);
+                       res = say_and_wait(chan, vms->oldmessages, ast_channel_language(chan));
                        res = res ? res : ast_play_and_wait(chan, "vm-gamle");
                        res = res ? res : ast_play_and_wait(chan, "vm-messages");
                }
@@ -8698,7 +8698,7 @@ static int vm_intro_de(struct ast_channel *chan, struct vm_state *vms)
                        if ((vms->newmessages == 1))
                                res = ast_play_and_wait(chan, "digits/1F");
                        else
-                               res = say_and_wait(chan, vms->newmessages, chan->language);
+                               res = say_and_wait(chan, vms->newmessages, ast_channel_language(chan));
                        if (!res)
                                res = ast_play_and_wait(chan, "vm-INBOX");
                        if (vms->oldmessages && !res)
@@ -8715,7 +8715,7 @@ static int vm_intro_de(struct ast_channel *chan, struct vm_state *vms)
                        if (vms->oldmessages == 1)
                                res = ast_play_and_wait(chan, "digits/1F");
                        else
-                               res = say_and_wait(chan, vms->oldmessages, chan->language);
+                               res = say_and_wait(chan, vms->oldmessages, ast_channel_language(chan));
                        if (!res)
                                res = ast_play_and_wait(chan, "vm-Old");
                        if (!res) {
@@ -8758,7 +8758,7 @@ static int vm_intro_es(struct ast_channel *chan, struct vm_state *vms)
                                        if (!res)
                                                res = ast_play_and_wait(chan, "vm-INBOXs");
                                } else {
-                                       res = say_and_wait(chan, vms->newmessages, chan->language);
+                                       res = say_and_wait(chan, vms->newmessages, ast_channel_language(chan));
                                        if (!res)
                                                res = ast_play_and_wait(chan, "vm-messages");
                                        if (!res)
@@ -8777,7 +8777,7 @@ static int vm_intro_es(struct ast_channel *chan, struct vm_state *vms)
                                        if (!res)
                                                res = ast_play_and_wait(chan, "vm-Olds");
                                } else {
-                                       res = say_and_wait(chan, vms->oldmessages, chan->language);
+                                       res = say_and_wait(chan, vms->oldmessages, ast_channel_language(chan));
                                        if (!res)
                                                res = ast_play_and_wait(chan, "vm-messages");
                                        if (!res)
@@ -8801,7 +8801,7 @@ static int vm_intro_pt_BR(struct ast_channel *chan, struct vm_state *vms) {
        }
        if (vms->newmessages) {
                if (!res)
-                       res = ast_say_number(chan, vms->newmessages, AST_DIGIT_ANY, chan->language, "f");
+                       res = ast_say_number(chan, vms->newmessages, AST_DIGIT_ANY, ast_channel_language(chan), "f");
                if ((vms->newmessages == 1)) {
                        if (!res)
                                res = ast_play_and_wait(chan, "vm-message");
@@ -8818,7 +8818,7 @@ static int vm_intro_pt_BR(struct ast_channel *chan, struct vm_state *vms) {
        }
        if (vms->oldmessages) {
                if (!res)
-                       res = ast_say_number(chan, vms->oldmessages, AST_DIGIT_ANY, chan->language, "f");
+                       res = ast_say_number(chan, vms->oldmessages, AST_DIGIT_ANY, ast_channel_language(chan), "f");
                if (vms->oldmessages == 1) {
                        if (!res)
                                res = ast_play_and_wait(chan, "vm-message");
@@ -8842,7 +8842,7 @@ static int vm_intro_fr(struct ast_channel *chan, struct vm_state *vms)
        res = ast_play_and_wait(chan, "vm-youhave");
        if (!res) {
                if (vms->newmessages) {
-                       res = say_and_wait(chan, vms->newmessages, chan->language);
+                       res = say_and_wait(chan, vms->newmessages, ast_channel_language(chan));
                        if (!res)
                                res = ast_play_and_wait(chan, "vm-INBOX");
                        if (vms->oldmessages && !res)
@@ -8856,7 +8856,7 @@ static int vm_intro_fr(struct ast_channel *chan, struct vm_state *vms)
                                
                }
                if (!res && vms->oldmessages) {
-                       res = say_and_wait(chan, vms->oldmessages, chan->language);
+                       res = say_and_wait(chan, vms->oldmessages, ast_channel_language(chan));
                        if (!res)
                                res = ast_play_and_wait(chan, "vm-Old");
                        if (!res) {
@@ -8885,7 +8885,7 @@ static int vm_intro_nl(struct ast_channel *chan, struct vm_state *vms)
        res = ast_play_and_wait(chan, "vm-youhave");
        if (!res) {
                if (vms->newmessages) {
-                       res = say_and_wait(chan, vms->newmessages, chan->language);
+                       res = say_and_wait(chan, vms->newmessages, ast_channel_language(chan));
                        if (!res) {
                                if (vms->newmessages == 1)
                                        res = ast_play_and_wait(chan, "vm-INBOXs");
@@ -8903,7 +8903,7 @@ static int vm_intro_nl(struct ast_channel *chan, struct vm_state *vms)
                                
                }
                if (!res && vms->oldmessages) {
-                       res = say_and_wait(chan, vms->oldmessages, chan->language);
+                       res = say_and_wait(chan, vms->oldmessages, ast_channel_language(chan));
                        if (!res) {
                                if (vms->oldmessages == 1)
                                        res = ast_play_and_wait(chan, "vm-Olds");
@@ -8936,7 +8936,7 @@ static int vm_intro_pt(struct ast_channel *chan, struct vm_state *vms)
        res = ast_play_and_wait(chan, "vm-youhave");
        if (!res) {
                if (vms->newmessages) {
-                       res = ast_say_number(chan, vms->newmessages, AST_DIGIT_ANY, chan->language, "f");
+                       res = ast_say_number(chan, vms->newmessages, AST_DIGIT_ANY, ast_channel_language(chan), "f");
                        if (!res) {
                                if ((vms->newmessages == 1)) {
                                        res = ast_play_and_wait(chan, "vm-message");
@@ -8952,7 +8952,7 @@ static int vm_intro_pt(struct ast_channel *chan, struct vm_state *vms)
                                res = ast_play_and_wait(chan, "vm-and");
                }
                if (!res && vms->oldmessages) {
-                       res = ast_say_number(chan, vms->oldmessages, AST_DIGIT_ANY, chan->language, "f");
+                       res = ast_say_number(chan, vms->oldmessages, AST_DIGIT_ANY, ast_channel_language(chan), "f");
                        if (!res) {
                                if (vms->oldmessages == 1) {
                                        res = ast_play_and_wait(chan, "vm-message");
@@ -9001,7 +9001,7 @@ static int vm_intro_cs(struct ast_channel *chan, struct vm_state *vms)
                        if (vms->newmessages == 1) {
                                res = ast_play_and_wait(chan, "digits/jednu");
                        } else {
-                               res = say_and_wait(chan, vms->newmessages, chan->language);
+                               res = say_and_wait(chan, vms->newmessages, ast_channel_language(chan));
                        }
                        if (!res) {
                                if ((vms->newmessages == 1))
@@ -9023,7 +9023,7 @@ static int vm_intro_cs(struct ast_channel *chan, struct vm_state *vms)
                        }
                }
                if (!res && vms->oldmessages) {
-                       res = say_and_wait(chan, vms->oldmessages, chan->language);
+                       res = say_and_wait(chan, vms->oldmessages, ast_channel_language(chan));
                        if (!res) {
                                if ((vms->oldmessages == 1))
                                        res = ast_play_and_wait(chan, "vm-starou");
@@ -9062,7 +9062,7 @@ static int vm_intro_zh(struct ast_channel *chan, struct vm_state *vms)
        if (!res && vms->newmessages) {
                res = ast_play_and_wait(chan, "vm-have");
                if (!res)
-                       res = say_and_wait(chan, vms->newmessages, chan->language);
+                       res = say_and_wait(chan, vms->newmessages, ast_channel_language(chan));
                if (!res)
                        res = ast_play_and_wait(chan, "vm-tong");
                if (!res)
@@ -9075,7 +9075,7 @@ static int vm_intro_zh(struct ast_channel *chan, struct vm_state *vms)
        if (!res && vms->oldmessages) {
                res = ast_play_and_wait(chan, "vm-have");
                if (!res)
-                       res = say_and_wait(chan, vms->oldmessages, chan->language);
+                       res = say_and_wait(chan, vms->oldmessages, ast_channel_language(chan));
                if (!res)
                        res = ast_play_and_wait(chan, "vm-tong");
                if (!res)
@@ -9100,14 +9100,14 @@ static int vm_intro_vi(struct ast_channel *chan, struct vm_state *vms)
        res = ast_play_and_wait(chan, "vm-youhave");
        if (!res) {
                if (vms->newmessages) {
-                       res = say_and_wait(chan, vms->newmessages, chan->language);
+                       res = say_and_wait(chan, vms->newmessages, ast_channel_language(chan));
                        if (!res)
                                res = ast_play_and_wait(chan, "vm-INBOX");
                        if (vms->oldmessages && !res)
                                res = ast_play_and_wait(chan, "vm-and");
                }
                if (!res && vms->oldmessages) {
-                       res = say_and_wait(chan, vms->oldmessages, chan->language);
+                       res = say_and_wait(chan, vms->oldmessages, ast_channel_language(chan));
                        if (!res)
                                res = ast_play_and_wait(chan, "vm-Old");                        
                }
@@ -9139,45 +9139,45 @@ static int vm_intro(struct ast_channel *chan, struct ast_vm_user *vmu, struct vm
        /* Play voicemail intro - syntax is different for different languages */
        if (0) {
                return 0;
-       } else if (!strncasecmp(chan->language, "cs", 2)) {  /* CZECH syntax */
+       } else if (!strncasecmp(ast_channel_language(chan), "cs", 2)) {  /* CZECH syntax */
                return vm_intro_cs(chan, vms);
-       } else if (!strncasecmp(chan->language, "cz", 2)) {  /* deprecated CZECH syntax */
+       } else if (!strncasecmp(ast_channel_language(chan), "cz", 2)) {  /* deprecated CZECH syntax */
                static int deprecation_warning = 0;
                if (deprecation_warning++ % 10 == 0) {
                        ast_log(LOG_WARNING, "cz is not a standard language code.  Please switch to using cs instead.\n");
                }
                return vm_intro_cs(chan, vms);
-       } else if (!strncasecmp(chan->language, "de", 2)) {  /* GERMAN syntax */
+       } else if (!strncasecmp(ast_channel_language(chan), "de", 2)) {  /* GERMAN syntax */
                return vm_intro_de(chan, vms);
-       } else if (!strncasecmp(chan->language, "es", 2)) {  /* SPANISH syntax */
+       } else if (!strncasecmp(ast_channel_language(chan), "es", 2)) {  /* SPANISH syntax */
                return vm_intro_es(chan, vms);
-       } else if (!strncasecmp(chan->language, "fr", 2)) {  /* FRENCH syntax */
+       } else if (!strncasecmp(ast_channel_language(chan), "fr", 2)) {  /* FRENCH syntax */
                return vm_intro_fr(chan, vms);
-       } else if (!strncasecmp(chan->language, "gr", 2)) {  /* GREEK syntax */
+       } else if (!strncasecmp(ast_channel_language(chan), "gr", 2)) {  /* GREEK syntax */
                return vm_intro_gr(chan, vms);
-       } else if (!strncasecmp(chan->language, "he", 2)) {  /* HEBREW syntax */
+       } else if (!strncasecmp(ast_channel_language(chan), "he", 2)) {  /* HEBREW syntax */
                return vm_intro_he(chan, vms);
-       } else if (!strncasecmp(chan->language, "it", 2)) {  /* ITALIAN syntax */
+       } else if (!strncasecmp(ast_channel_language(chan), "it", 2)) {  /* ITALIAN syntax */
                return vm_intro_it(chan, vms);
-       } else if (!strncasecmp(chan->language, "nl", 2)) {  /* DUTCH syntax */
+       } else if (!strncasecmp(ast_channel_language(chan), "nl", 2)) {  /* DUTCH syntax */
                return vm_intro_nl(chan, vms);
-       } else if (!strncasecmp(chan->language, "no", 2)) {  /* NORWEGIAN syntax */
+       } else if (!strncasecmp(ast_channel_language(chan), "no", 2)) {  /* NORWEGIAN syntax */
                return vm_intro_no(chan, vms);
-       } else if (!strncasecmp(chan->language, "pl", 2)) {  /* POLISH syntax */
+       } else if (!strncasecmp(ast_channel_language(chan), "pl", 2)) {  /* POLISH syntax */
                return vm_intro_pl(chan, vms);
-       } else if (!strncasecmp(chan->language, "pt_BR", 5)) {  /* BRAZILIAN PORTUGUESE syntax */
+       } else if (!strncasecmp(ast_channel_language(chan), "pt_BR", 5)) {  /* BRAZILIAN PORTUGUESE syntax */
                return vm_intro_pt_BR(chan, vms);
-       } else if (!strncasecmp(chan->language, "pt", 2)) {  /* PORTUGUESE syntax */
+       } else if (!strncasecmp(ast_channel_language(chan), "pt", 2)) {  /* PORTUGUESE syntax */
                return vm_intro_pt(chan, vms);
-       } else if (!strncasecmp(chan->language, "ru", 2)) {  /* RUSSIAN syntax */
+       } else if (!strncasecmp(ast_channel_language(chan), "ru", 2)) {  /* RUSSIAN syntax */
                return vm_intro_multilang(chan, vms, "n");
-       } else if (!strncasecmp(chan->language, "se", 2)) {  /* SWEDISH syntax */
+       } else if (!strncasecmp(ast_channel_language(chan), "se", 2)) {  /* SWEDISH syntax */
                return vm_intro_se(chan, vms);
-       } else if (!strncasecmp(chan->language, "ua", 2)) {  /* UKRAINIAN syntax */
+       } else if (!strncasecmp(ast_channel_language(chan), "ua", 2)) {  /* UKRAINIAN syntax */
                return vm_intro_multilang(chan, vms, "n");
-       } else if (!strncasecmp(chan->language, "vi", 2)) { /* VIETNAMESE syntax */
+       } else if (!strncasecmp(ast_channel_language(chan), "vi", 2)) { /* VIETNAMESE syntax */
                return vm_intro_vi(chan, vms);
-       } else if (!strncasecmp(chan->language, "zh", 2)) { /* CHINESE (Taiwan) syntax */
+       } else if (!strncasecmp(ast_channel_language(chan), "zh", 2)) { /* CHINESE (Taiwan) syntax */
                return vm_intro_zh(chan, vms);
        } else {                                             /* Default to ENGLISH */
                return vm_intro_en(chan, vms);
@@ -9287,7 +9287,7 @@ static int vm_instructions_zh(struct ast_channel *chan, struct ast_vm_user *vmu,
 
 static int vm_instructions(struct ast_channel *chan, struct ast_vm_user *vmu, struct vm_state *vms, int skipadvanced, int in_urgent)
 {
-       if (vms->starting && !strncasecmp(chan->language, "zh", 2)) { /* CHINESE (Taiwan) syntax */
+       if (vms->starting && !strncasecmp(ast_channel_language(chan), "zh", 2)) { /* CHINESE (Taiwan) syntax */
                return vm_instructions_zh(chan, vmu, vms, skipadvanced, in_urgent);
        } else {                                        /* Default to ENGLISH */
                return vm_instructions_en(chan, vmu, vms, skipadvanced, in_urgent);
@@ -9822,19 +9822,19 @@ static int vm_browse_messages_vi(struct ast_channel *chan, struct vm_state *vms,
  */
 static int vm_browse_messages(struct ast_channel *chan, struct vm_state *vms, struct ast_vm_user *vmu)
 {
-       if (!strncasecmp(chan->language, "es", 2)) {         /* SPANISH */
+       if (!strncasecmp(ast_channel_language(chan), "es", 2)) {         /* SPANISH */
                return vm_browse_messages_es(chan, vms, vmu);
-       } else if (!strncasecmp(chan->language, "gr", 2)) {  /* GREEK */
+       } else if (!strncasecmp(ast_channel_language(chan), "gr", 2)) {  /* GREEK */
                return vm_browse_messages_gr(chan, vms, vmu);
-       } else if (!strncasecmp(chan->language, "he", 2)) {  /* HEBREW */
+       } else if (!strncasecmp(ast_channel_language(chan), "he", 2)) {  /* HEBREW */
                return vm_browse_messages_he(chan, vms, vmu);
-       } else if (!strncasecmp(chan->language, "it", 2)) {  /* ITALIAN */
+       } else if (!strncasecmp(ast_channel_language(chan), "it", 2)) {  /* ITALIAN */
                return vm_browse_messages_it(chan, vms, vmu);
-       } else if (!strncasecmp(chan->language, "pt", 2)) {  /* PORTUGUESE */
+       } else if (!strncasecmp(ast_channel_language(chan), "pt", 2)) {  /* PORTUGUESE */
                return vm_browse_messages_pt(chan, vms, vmu);
-       } else if (!strncasecmp(chan->language, "vi", 2)) {  /* VIETNAMESE */
+       } else if (!strncasecmp(ast_channel_language(chan), "vi", 2)) {  /* VIETNAMESE */
                return vm_browse_messages_vi(chan, vms, vmu);
-       } else if (!strncasecmp(chan->language, "zh", 2)) {  /* CHINESE (Taiwan) */
+       } else if (!strncasecmp(ast_channel_language(chan), "zh", 2)) {  /* CHINESE (Taiwan) */
                return vm_browse_messages_zh(chan, vms, vmu);
        } else {                                             /* Default to English syntax */
                return vm_browse_messages_en(chan, vms, vmu);
@@ -9854,7 +9854,7 @@ static int vm_authenticate(struct ast_channel *chan, char *mailbox, int mailbox_
        if (!skipuser && useadsi)
                adsi_login(chan);
        ast_test_suite_event_notify("PLAYBACK", "Message: vm-login");
-       if (!silent && !skipuser && ast_streamfile(chan, "vm-login", chan->language)) {
+       if (!silent && !skipuser && ast_streamfile(chan, "vm-login", ast_channel_language(chan))) {
                ast_log(AST_LOG_WARNING, "Couldn't stream login file\n");
                return -1;
        }
@@ -9902,7 +9902,7 @@ static int vm_authenticate(struct ast_channel *chan, char *mailbox, int mailbox_
                        password[0] = '\0';
                } else {
                        ast_test_suite_event_notify("PLAYBACK", "Message: %s", vm_password);
-                       if (ast_streamfile(chan, vm_password, chan->language)) {
+                       if (ast_streamfile(chan, vm_password, ast_channel_language(chan))) {
                                ast_log(AST_LOG_WARNING, "Unable to stream password file\n");
                                return -1;
                        }
@@ -9939,7 +9939,7 @@ static int vm_authenticate(struct ast_channel *chan, char *mailbox, int mailbox_
                if (!valid) {
                        if (skipuser || logretries >= max_logins) {
                                ast_test_suite_event_notify("PLAYBACK", "Message: vm-incorrect");
-                               if (ast_streamfile(chan, "vm-incorrect", chan->language)) {
+                               if (ast_streamfile(chan, "vm-incorrect", ast_channel_language(chan))) {
                                        ast_log(AST_LOG_WARNING, "Unable to stream incorrect message\n");
                                        return -1;
                                }
@@ -9947,7 +9947,7 @@ static int vm_authenticate(struct ast_channel *chan, char *mailbox, int mailbox_
                                ast_test_suite_event_notify("PLAYBACK", "Message: vm-incorrect-mailbox");
                                if (useadsi)
                                        adsi_login(chan);
-                               if (ast_streamfile(chan, "vm-incorrect-mailbox", chan->language)) {
+                               if (ast_streamfile(chan, "vm-incorrect-mailbox", ast_channel_language(chan))) {
                                        ast_log(AST_LOG_WARNING, "Unable to stream incorrect mailbox message\n");
                                        return -1;
                                }
@@ -10143,7 +10143,7 @@ static int vm_execmain(struct ast_channel *chan, const char *data)
 
        /* Set language from config to override channel language */
        if (!ast_strlen_zero(vmu->language))
-               ast_string_field_set(chan, language, vmu->language);
+               ast_channel_language_set(chan, vmu->language);
 
        /* Retrieve urgent, old and new message counts */
        ast_debug(1, "Before open_mailbox\n");
@@ -10600,7 +10600,7 @@ static int vm_execmain(struct ast_channel *chan, const char *data)
                        if (!cmd) {
                                cmd = ast_play_and_wait(chan, "vm-message");
                                if (!cmd) 
-                                       cmd = say_and_wait(chan, vms.curmsg + 1, chan->language);
+                                       cmd = say_and_wait(chan, vms.curmsg + 1, ast_channel_language(chan));
                                if (!cmd)
                                        cmd = ast_play_and_wait(chan, "vm-savedto");
                                if (!cmd)
@@ -10643,7 +10643,7 @@ static int vm_execmain(struct ast_channel *chan, const char *data)
                case '*': /* Help */
                        if (!vms.starting) {
                                cmd = ast_play_and_wait(chan, "vm-onefor");
-                               if (!strncasecmp(chan->language, "he", 2)) {
+                               if (!strncasecmp(ast_channel_language(chan), "he", 2)) {
                                        cmd = ast_play_and_wait(chan, "vm-for");
                                }
                                if (!cmd)
@@ -11203,7 +11203,7 @@ static int acf_vm_info(struct ast_channel *chan, const char *cmd, char *args, ch
                } else if (!strncasecmp(arg.attribute, "pager", 5)) {
                        ast_copy_string(buf, vmu->pager, len);
                } else if (!strncasecmp(arg.attribute, "language", 8)) {
-                       ast_copy_string(buf, S_OR(vmu->language, chan->language), len);
+                       ast_copy_string(buf, S_OR(vmu->language, ast_channel_language(chan)), len);
                } else if (!strncasecmp(arg.attribute, "locale", 6)) {
                        ast_copy_string(buf, vmu->locale, len);
                } else if (!strncasecmp(arg.attribute, "tz", 2)) {
@@ -12782,7 +12782,7 @@ static int vmsayname_exec(struct ast_channel *chan, const char *data)
                ast_debug(3, "Greeting not found for '%s@%s', falling back to mailbox number.\n", args_copy, context);
                res = ast_stream_and_wait(chan, "vm-extension", AST_DIGIT_ANY);
                if (!res) {
-                       res = ast_say_character_str(chan, args_copy, AST_DIGIT_ANY, chan->language);
+                       res = ast_say_character_str(chan, args_copy, AST_DIGIT_ANY, ast_channel_language(chan));
                }
        }
 
index 75aceac..3a96895 100644 (file)
@@ -522,7 +522,7 @@ static int __agent_start_monitoring(struct ast_channel *ast, struct agent_pvt *p
        if (!p)
                return -1;
        if (!ast->monitor) {
-               snprintf(filename, sizeof(filename), "agent-%s-%s",p->agent, ast->uniqueid);
+               snprintf(filename, sizeof(filename), "agent-%s-%s",p->agent, ast_channel_uniqueid(ast));
                /* substitute . for - */
                if ((pointer = strchr(filename, '.')))
                        *pointer = '-';
@@ -795,12 +795,12 @@ static int agent_call(struct ast_channel *ast, char *dest, int timeout)
                return res;
        }
        ast_verb(3, "agent_call, call to agent '%s' call on '%s'\n", p->agent, ast_channel_name(p->chan));
-       ast_debug(3, "Playing beep, lang '%s'\n", p->chan->language);
+       ast_debug(3, "Playing beep, lang '%s'\n", ast_channel_language(p->chan));
        
        chan = p->chan;
        ast_mutex_unlock(&p->lock);
 
-       res = ast_streamfile(chan, beep, chan->language);
+       res = ast_streamfile(chan, beep, ast_channel_language(chan));
        ast_debug(3, "Played beep, result '%d'\n", res);
        if (!res) {
                res = ast_waitstream(chan, "");
@@ -1065,7 +1065,7 @@ static struct ast_channel *agent_new(struct agent_pvt *p, int state, const char
                ast_format_copy(&tmp->rawwriteformat, &p->chan->writeformat);
                ast_format_copy(&tmp->readformat, &p->chan->readformat);
                ast_format_copy(&tmp->rawreadformat, &p->chan->readformat);
-               ast_string_field_set(tmp, language, p->chan->language);
+               ast_channel_language_set(tmp, ast_channel_language(p->chan));
                ast_copy_string(tmp->context, p->chan->context, sizeof(tmp->context));
                ast_copy_string(tmp->exten, p->chan->exten, sizeof(tmp->exten));
                /* XXX Is this really all we copy form the originating channel?? */
@@ -1270,7 +1270,7 @@ static int check_availability(struct agent_pvt *newlyavailable, int needlock)
                if (!p->abouttograb && p->pending && ((p->group && (newlyavailable->group & p->group)) || !strcmp(p->agent, newlyavailable->agent))) {
                        ast_debug(1, "Call '%s' looks like a winner for agent '%s'\n", ast_channel_name(p->owner), newlyavailable->agent);
                        /* We found a pending call, time to merge */
-                       chan = agent_new(newlyavailable, AST_STATE_DOWN, p->owner ? p->owner->linkedid : NULL);
+                       chan = agent_new(newlyavailable, AST_STATE_DOWN, p->owner ? ast_channel_linkedid(p->owner) : NULL);
                        parent = p->owner;
                        p->abouttograb = 1;
                        ast_mutex_unlock(&p->lock);
@@ -1285,8 +1285,8 @@ static int check_availability(struct agent_pvt *newlyavailable, int needlock)
                        /* Don't do beep here */
                        res = 0;
                } else {
-                       ast_debug(3, "Playing beep, lang '%s'\n", newlyavailable->chan->language);
-                       res = ast_streamfile(newlyavailable->chan, beep, newlyavailable->chan->language);
+                       ast_debug(3, "Playing beep, lang '%s'\n", ast_channel_language(newlyavailable->chan));
+                       res = ast_streamfile(newlyavailable->chan, beep, ast_channel_language(newlyavailable->chan));
                        ast_debug(3, "Played beep, result '%d'\n", res);
                        if (!res) {
                                res = ast_waitstream(newlyavailable->chan, "");
@@ -1340,8 +1340,8 @@ static int check_beep(struct agent_pvt *newlyavailable, int needlock)
                AST_LIST_UNLOCK(&agents);
        if (p) {
                ast_mutex_unlock(&newlyavailable->lock);
-               ast_debug(3, "Playing beep, lang '%s'\n", newlyavailable->chan->language);
-               res = ast_streamfile(newlyavailable->chan, beep, newlyavailable->chan->language);
+               ast_debug(3, "Playing beep, lang '%s'\n", ast_channel_language(newlyavailable->chan));
+               res = ast_streamfile(newlyavailable->chan, beep, ast_channel_language(newlyavailable->chan));
                ast_debug(1, "Played beep, result '%d'\n", res);
                if (!res) {
                        res = ast_waitstream(newlyavailable->chan, "");
@@ -1386,7 +1386,7 @@ static struct ast_channel *agent_request(const char *type, struct ast_format_cap
                                /* Agent must be registered, but not have any active call, and not be in a waiting state */
                                if (!p->owner && p->chan) {
                                        /* Fixed agent */
-                                       chan = agent_new(p, AST_STATE_DOWN, requestor ? requestor->linkedid : NULL);
+                                       chan = agent_new(p, AST_STATE_DOWN, requestor ? ast_channel_linkedid(requestor) : NULL);
                                }
                                if (chan) {
                                        ast_mutex_unlock(&p->lock);
@@ -1409,7 +1409,7 @@ static struct ast_channel *agent_request(const char *type, struct ast_format_cap
                                        /* Agent must be registered, but not have any active call, and not be in a waiting state */
                                        if (!p->owner && p->chan) {
                                                /* Could still get a fixed agent */
-                                               chan = agent_new(p, AST_STATE_DOWN, requestor ? requestor->linkedid : NULL);
+                                               chan = agent_new(p, AST_STATE_DOWN, requestor ? ast_channel_linkedid(requestor) : NULL);
                                        }
                                        if (chan) {
                                                ast_mutex_unlock(&p->lock);
@@ -1428,7 +1428,7 @@ static struct ast_channel *agent_request(const char *type, struct ast_format_cap
                        ast_debug(1, "Creating place holder for '%s'\n", s);
                        p = add_agent(data, 1);
                        p->group = groupmatch;
-                       chan = agent_new(p, AST_STATE_DOWN, requestor ? requestor->linkedid : NULL);
+                       chan = agent_new(p, AST_STATE_DOWN, requestor ? ast_channel_linkedid(requestor) : NULL);
                        if (!chan) 
                                ast_log(LOG_WARNING, "Weird...  Fix this to drop the unused pending agent\n");
                } else {
@@ -2011,7 +2011,7 @@ static int login_exec(struct ast_channel *chan, const char *data)
                                        ast_mutex_unlock(&p->lock);
                                        AST_LIST_UNLOCK(&agents);
                                        if( !res && play_announcement==1 )
-                                               res = ast_streamfile(chan, filename, chan->language);
+                                               res = ast_streamfile(chan, filename, ast_channel_language(chan));
                                        if (!res)
                                                ast_waitstream(chan, "");
                                        AST_LIST_LOCK(&agents);
@@ -2043,10 +2043,10 @@ static int login_exec(struct ast_channel *chan, const char *data)
                                                              "Agent: %s\r\n"
                                                              "Channel: %s\r\n"
                                                              "Uniqueid: %s\r\n",
-                                                             p->agent, ast_channel_name(chan), chan->uniqueid);
+                                                             p->agent, ast_channel_name(chan), ast_channel_uniqueid(chan));
                                                if (update_cdr && chan->cdr)
                                                        snprintf(chan->cdr->channel, sizeof(chan->cdr->channel), "Agent/%s", p->agent);
-                                               ast_queue_log("NONE", chan->uniqueid, agent, "AGENTLOGIN", "%s", ast_channel_name(chan));
+                                               ast_queue_log("NONE", ast_channel_uniqueid(chan), agent, "AGENTLOGIN", "%s", ast_channel_name(chan));
                                                ast_verb(2, "Agent '%s' logged in (format %s/%s)\n", p->agent,
                                                                    ast_getformatname(&chan->readformat), ast_getformatname(&chan->writeformat));
                                                /* Login this channel and wait for it to go away */
@@ -2135,8 +2135,8 @@ static int login_exec(struct ast_channel *chan, const char *data)
                                                              "Agent: %s\r\n"
                                                              "Logintime: %ld\r\n"
                                                              "Uniqueid: %s\r\n",
-                                                             p->agent, logintime, chan->uniqueid);
-                                               ast_queue_log("NONE", chan->uniqueid, agent, "AGENTLOGOFF", "%s|%ld", ast_channel_name(chan), logintime);
+                                                             p->agent, logintime, ast_channel_uniqueid(chan));
+                                               ast_queue_log("NONE", ast_channel_uniqueid(chan), agent, "AGENTLOGOFF", "%s|%ld", ast_channel_name(chan), logintime);
                                                ast_verb(2, "Agent '%s' logged out\n", p->agent);
                                                /* If there is no owner, go ahead and kill it now */
                                                ast_devstate_changed(AST_DEVICE_UNAVAILABLE, "Agent/%s", p->agent);
index 8f38090..4f06ba4 100644 (file)
@@ -582,7 +582,7 @@ static struct ast_channel *alsa_new(struct chan_alsa_pvt *p, int state, const ch
        if (!ast_strlen_zero(p->exten))
                ast_copy_string(tmp->exten, p->exten, sizeof(tmp->exten));
        if (!ast_strlen_zero(language))
-               ast_string_field_set(tmp, language, language);
+               ast_channel_language_set(tmp, language);
        p->owner = tmp;
        ast_module_ref(ast_module_info->self);
        ast_jb_configure(tmp, &global_jbconf);
@@ -615,7 +615,7 @@ static struct ast_channel *alsa_request(const char *type, struct ast_format_cap
        if (alsa.owner) {
                ast_log(LOG_NOTICE, "Already have a call on the ALSA channel\n");
                *cause = AST_CAUSE_BUSY;
-       } else if (!(tmp = alsa_new(&alsa, AST_STATE_DOWN, requestor ? requestor->linkedid : NULL))) {
+       } else if (!(tmp = alsa_new(&alsa, AST_STATE_DOWN, requestor ? ast_channel_linkedid(requestor) : NULL))) {
                ast_log(LOG_WARNING, "Unable to create new ALSA channel\n");
        }
 
index 3e12b39..dd37af6 100644 (file)
@@ -166,11 +166,11 @@ static struct ast_channel *bridge_request(const char *type, struct ast_format_ca
        }
 
        /* Try to grab two Asterisk channels to use as input and output channels */
-       if (!(p->input = ast_channel_alloc(1, AST_STATE_UP, 0, 0, "", "", "", requestor ? requestor->linkedid : NULL, 0, "Bridge/%p-input", p))) {
+       if (!(p->input = ast_channel_alloc(1, AST_STATE_UP, 0, 0, "", "", "", requestor ? ast_channel_linkedid(requestor) : NULL, 0, "Bridge/%p-input", p))) {
                ao2_ref(p, -1);
                return NULL;
        }
-       if (!(p->output = ast_channel_alloc(1, AST_STATE_UP, 0, 0, "", "", "", requestor ? requestor->linkedid : NULL, 0, "Bridge/%p-output", p))) {
+       if (!(p->output = ast_channel_alloc(1, AST_STATE_UP, 0, 0, "", "", "", requestor ? ast_channel_linkedid(requestor) : NULL, 0, "Bridge/%p-output", p))) {
                p->input = ast_channel_release(p->input);
                ao2_ref(p, -1);
                return NULL;
index 7e23010..68e3402 100644 (file)
@@ -428,7 +428,7 @@ static struct ast_channel *console_new(struct console_pvt *pvt, const char *ext,
        pvt->owner = chan;
 
        if (!ast_strlen_zero(pvt->language))
-               ast_string_field_set(chan, language, pvt->language);
+               ast_channel_language_set(chan, pvt->language);
 
        ast_jb_configure(chan, &global_jbconf);
 
@@ -467,7 +467,7 @@ static struct ast_channel *console_request(const char *type, struct ast_format_c
        }
 
        console_pvt_lock(pvt);
-       chan = console_new(pvt, NULL, NULL, AST_STATE_DOWN, requestor ? requestor->linkedid : NULL);
+       chan = console_new(pvt, NULL, NULL, AST_STATE_DOWN, requestor ? ast_channel_linkedid(requestor) : NULL);
        console_pvt_unlock(pvt);
 
        if (!chan)
index da167d6..2380149 100644 (file)
@@ -2173,7 +2173,7 @@ static void dahdi_ami_channel_event(struct dahdi_pvt *p, struct ast_channel *cha
                "DAHDISpan: %d\r\n"
                "DAHDIChannel: %s\r\n",
                ast_channel_name(chan),
-               chan->uniqueid,
+               ast_channel_uniqueid(chan),
                p->span,
                ch_name);
 }
@@ -2569,7 +2569,7 @@ static struct ast_channel *my_new_analog_ast_channel(void *pvt, int state, int s
        struct dahdi_pvt *p = pvt;
        int dsub = analogsub_to_dahdisub(sub);
 
-       return dahdi_new(p, state, startpbx, dsub, 0, requestor ? requestor->linkedid : "");
+       return dahdi_new(p, state, startpbx, dsub, 0, requestor ? ast_channel_linkedid(requestor) : "");
 }
 
 #if defined(HAVE_PRI) || defined(HAVE_SS7)
@@ -2624,7 +2624,7 @@ static struct ast_channel *my_new_pri_ast_channel(void *pvt, int state, enum sig
                        newlaw = DAHDI_LAW_MULAW;
                        break;
        }
-       return dahdi_new(p, state, 0, SUB_REAL, newlaw, requestor ? requestor->linkedid : "");
+       return dahdi_new(p, state, 0, SUB_REAL, newlaw, requestor ? ast_channel_linkedid(requestor) : "");
 }
 #endif /* defined(HAVE_PRI) */
 
@@ -3484,7 +3484,7 @@ static struct ast_channel *my_new_ss7_ast_channel(void *pvt, int state, enum sig
                newlaw = DAHDI_LAW_MULAW;
                break;
        }
-       return dahdi_new(p, state, 0, SUB_REAL, newlaw, requestor ? requestor->linkedid : "");
+       return dahdi_new(p, state, 0, SUB_REAL, newlaw, requestor ? ast_channel_linkedid(requestor) : "");
 }
 #endif /* defined(HAVE_SS7) */
 
@@ -9675,19 +9675,19 @@ static struct ast_channel *dahdi_new(struct dahdi_pvt *i, int state, int startpb
                tmp->pickupgroup = i->pickupgroup;
        }
        if (!ast_strlen_zero(i->parkinglot))
-               ast_string_field_set(tmp, parkinglot, i->parkinglot);
+               ast_channel_parkinglot_set(tmp, i->parkinglot);
        if (!ast_strlen_zero(i->language))
-               ast_string_field_set(tmp, language, i->language);
+               ast_channel_language_set(tmp, i->language);
        if (!i->owner)
                i->owner = tmp;
        if (!ast_strlen_zero(i->accountcode))
-               ast_string_field_set(tmp, accountcode, i->accountcode);
+               ast_channel_accountcode_set(tmp, i->accountcode);
        if (i->amaflags)
                tmp->amaflags = i->amaflags;
        i->subs[idx].owner = tmp;
        ast_copy_string(tmp->context, i->context, sizeof(tmp->context));
        if (!analog_lib_handles(i->sig, i->radio, i->oprmode)) {
-               ast_string_field_set(tmp, call_forward, i->call_forward);
+               ast_channel_call_forward_set(tmp, i->call_forward);
        }
        /* If we've been told "no ADSI" then enforce it */
        if (!i->adsi)
@@ -10167,7 +10167,7 @@ static void *analog_ss_thread(void *data)
                                ast_log(LOG_WARNING, "Unable to start special tone on %d\n", p->channel);
                        else
                                sleep(1);
-                       res = ast_streamfile(chan, "ss-noservice", chan->language);
+                       res = ast_streamfile(chan, "ss-noservice", ast_channel_language(chan));
                        if (res >= 0)
                                ast_waitstream(chan, "");
                        res = tone_zone_play_tone(p->subs[idx].dfd, DAHDI_TONE_CONGESTION);
@@ -13692,7 +13692,7 @@ static struct ast_channel *dahdi_request(const char *type, struct ast_format_cap
                                tmp = sig_ss7_request(p->sig_pvt, SIG_SS7_DEFLAW, requestor, transcapdigital);
 #endif /* defined(HAVE_SS7) */
                        } else {
-                               tmp = dahdi_new(p, AST_STATE_RESERVED, 0, p->owner ? SUB_CALLWAIT : SUB_REAL, 0, requestor ? requestor->linkedid : "");
+                               tmp = dahdi_new(p, AST_STATE_RESERVED, 0, p->owner ? SUB_CALLWAIT : SUB_REAL, 0, requestor ? ast_channel_linkedid(requestor) : "");
                        }
                        if (!tmp) {
                                p->outgoing = 0;
@@ -16029,8 +16029,8 @@ static int action_dahdishowchannels(struct mansession *s, const struct message *
                                        "\r\n",
                                        tmp->channel,
                                        ast_channel_name(tmp->owner),
-                                       tmp->owner->uniqueid,
-                                       tmp->owner->accountcode,
+                                       ast_channel_uniqueid(tmp->owner),
+                                       ast_channel_accountcode(tmp->owner),
                                        sig2str(tmp->sig),
                                        tmp->sig,
                                        tmp->context,
index 21b80e2..d9464d1 100644 (file)
@@ -1181,15 +1181,15 @@ static struct ast_channel *gtalk_new(struct gtalk *client, struct gtalk_pvt *i,
        tmp->caller.id.name.presentation = client->callingpres;
        tmp->caller.id.number.presentation = client->callingpres;
        if (!ast_strlen_zero(client->accountcode))
-               ast_string_field_set(tmp, accountcode, client->accountcode);
+               ast_channel_accountcode_set(tmp, client->accountcode);
        if (client->amaflags)
                tmp->amaflags = client->amaflags;
        if (!ast_strlen_zero(client->language))
-               ast_string_field_set(tmp, language, client->language);
+               ast_channel_language_set(tmp, client->language);
        if (!ast_strlen_zero(client->musicclass))
-               ast_string_field_set(tmp, musicclass, client->musicclass);
+               ast_channel_musicclass_set(tmp, client->musicclass);
        if (!ast_strlen_zero(client->parkinglot))
-               ast_string_field_set(tmp, parkinglot, client->parkinglot);
+               ast_channel_parkinglot_set(tmp, client->parkinglot);
        i->owner = tmp;
        ast_module_ref(ast_module_info->self);
        ast_copy_string(tmp->context, client->context, sizeof(tmp->context));
@@ -1940,7 +1940,7 @@ static struct ast_channel *gtalk_request(const char *type, struct ast_format_cap
        ASTOBJ_WRLOCK(client);
        p = gtalk_alloc(client, strchr(sender, '@') ? sender : client->connection->jid->full, strchr(to, '@') ? to : client->user, NULL);
        if (p) {
-               chan = gtalk_new(client, p, AST_STATE_DOWN, to, requestor ? requestor->linkedid : NULL);
+               chan = gtalk_new(client, p, AST_STATE_DOWN, to, requestor ? ast_channel_linkedid(requestor) : NULL);
        }
        ASTOBJ_UNLOCK(client);
        return chan;
index 80970a9..ce4ce57 100644 (file)
@@ -1098,7 +1098,7 @@ static struct ast_channel *__oh323_new(struct oh323_pvt *pvt, int state, const c
                ast_copy_string(ch->exten, pvt->exten, sizeof(ch->exten));
                ch->priority = 1;
                if (!ast_strlen_zero(pvt->accountcode)) {
-                       ast_string_field_set(ch, accountcode, pvt->accountcode);
+                       ast_channel_accountcode_set(ch, pvt->accountcode);
                }
                if (pvt->amaflags) {
                        ch->amaflags = pvt->amaflags;
@@ -1860,7 +1860,7 @@ static struct ast_channel *oh323_request(const char *type, struct ast_format_cap
        ast_mutex_unlock(&caplock);
 
        ast_mutex_lock(&pvt->lock);
-       tmpc = __oh323_new(pvt, AST_STATE_DOWN, tmp1, requestor ? requestor->linkedid : NULL);
+       tmpc = __oh323_new(pvt, AST_STATE_DOWN, tmp1, requestor ? ast_channel_linkedid(requestor) : NULL);
        ast_mutex_unlock(&pvt->lock);
        if (!tmpc) {
                oh323_destroy(pvt);
index c799955..2255801 100644 (file)
@@ -5177,8 +5177,8 @@ static int iax2_call(struct ast_channel *c, char *dest, int timeout)
                iax_ie_append_str(&ied, IAX_IE_CALLING_ANI, c->connected.ani.number.str);
        }
 
-       if (!ast_strlen_zero(c->language))
-               iax_ie_append_str(&ied, IAX_IE_LANGUAGE, c->language);
+       if (!ast_strlen_zero(ast_channel_language(c)))
+               iax_ie_append_str(&ied, IAX_IE_LANGUAGE, ast_channel_language(c));
        if (!ast_strlen_zero(c->dialed.number.str)) {
                iax_ie_append_str(&ied, IAX_IE_DNID, c->dialed.number.str);
        }
@@ -5824,7 +5824,7 @@ static struct ast_channel *ast_iax2_new(int callno, int state, iax2_format capab
        tmp->tech_pvt = CALLNO_TO_PTR(i->callno);
 
        if (!ast_strlen_zero(i->parkinglot))
-               ast_string_field_set(tmp, parkinglot, i->parkinglot);
+               ast_channel_parkinglot_set(tmp, i->parkinglot);
        /* Don't use ast_set_callerid() here because it will
         * generate a NewCallerID event before the NewChannel event */
        if (!ast_strlen_zero(i->ani)) {
@@ -5844,9 +5844,9 @@ static struct ast_channel *ast_iax2_new(int callno, int state, iax2_format capab
        tmp->caller.id.number.plan = i->calling_ton;
        tmp->dialed.transit_network_select = i->calling_tns;
        if (!ast_strlen_zero(i->language))
-               ast_string_field_set(tmp, language, i->language);
+               ast_channel_language_set(tmp, i->language);
        if (!ast_strlen_zero(i->accountcode))
-               ast_string_field_set(tmp, accountcode, i->accountcode);
+               ast_channel_accountcode_set(tmp, i->accountcode);
        if (i->amaflags)
                tmp->amaflags = i->amaflags;
        ast_copy_string(tmp->context, i->context, sizeof(tmp->context));
@@ -9390,8 +9390,8 @@ static int iax_park(struct ast_channel *chan1, struct ast_channel *chan2, const
        struct ast_channel *chan1m, *chan2m;/* Chan2m: The transferer, chan1m: The transferee */
        pthread_t th;
 
-       chan1m = ast_channel_alloc(0, AST_STATE_DOWN, 0, 0, chan2->accountcode, chan1->exten, chan1->context, chan1->linkedid, chan1->amaflags, "Parking/%s", ast_channel_name(chan1));
-       chan2m = ast_channel_alloc(0, AST_STATE_DOWN, 0, 0, chan2->accountcode, chan2->exten, chan2->context, chan2->linkedid, chan2->amaflags, "IAXPeer/%s", ast_channel_name(chan2));
+       chan1m = ast_channel_alloc(0, AST_STATE_DOWN, 0, 0, ast_channel_accountcode(chan2), chan1->exten, chan1->context, ast_channel_linkedid(chan1), chan1->amaflags, "Parking/%s", ast_channel_name(chan1));
+       chan2m = ast_channel_alloc(0, AST_STATE_DOWN, 0, 0, ast_channel_accountcode(chan2), chan2->exten, chan2->context, ast_channel_linkedid(chan2), chan2->amaflags, "IAXPeer/%s", ast_channel_name(chan2));
        d = ast_calloc(1, sizeof(*d));
        if (!chan1m || !chan2m || !d) {
                if (chan1m) {
@@ -9441,7 +9441,7 @@ static int iax_park(struct ast_channel *chan1, struct ast_channel *chan2, const
        /* Make formats okay */
        chan2m->readformat = chan2->readformat;
        chan2m->writeformat = chan2->writeformat;
-       ast_string_field_set(chan2m, parkinglot, chan2->parkinglot);
+       ast_channel_parkinglot_set(chan2m, ast_channel_parkinglot(chan2));
 
        /* Prepare for taking over the channel */
        if (ast_channel_masquerade(chan2m, chan2)) {
@@ -10496,7 +10496,7 @@ static int socket_process(struct iax2_thread *thread)
                                                        "Channel: %s\r\n"
                                                        "Uniqueid: %s\r\n",
                                                        ast_channel_name(iaxs[fr->callno]->owner),
-                                                       iaxs[fr->callno]->owner->uniqueid);
+                                                       ast_channel_uniqueid(iaxs[fr->callno]->owner));
                                        }
 
                                        ast_set_flag64(iaxs[fr->callno], IAX_QUELCH);
@@ -10533,7 +10533,7 @@ static int socket_process(struct iax2_thread *thread)
                                                        "Channel: %s\r\n"
                                                        "Uniqueid: %s\r\n",
                                                        ast_channel_name(iaxs[fr->callno]->owner),
-                                                       iaxs[fr->callno]->owner->uniqueid);
+                                                       ast_channel_uniqueid(iaxs[fr->callno]->owner));
                                        }
 
                                        ast_clear_flag64(iaxs[fr->callno], IAX_QUELCH);
@@ -12219,7 +12219,7 @@ static struct ast_channel *iax2_request(const char *type, struct ast_format_cap
        if (cai.found)
                ast_string_field_set(iaxs[callno], host, pds.peer);
 
-       c = ast_iax2_new(callno, AST_STATE_DOWN, cai.capability, requestor ? requestor->linkedid : NULL);
+       c = ast_iax2_new(callno, AST_STATE_DOWN, cai.capability, requestor ? ast_channel_linkedid(requestor) : NULL);
 
        ast_mutex_unlock(&iaxsl[callno]);
 
index aad52e3..af0bd6a 100644 (file)
@@ -893,13 +893,13 @@ static struct ast_channel *jingle_new(struct jingle *client, struct jingle_pvt *
        tmp->caller.id.name.presentation = client->callingpres;
        tmp->caller.id.number.presentation = client->callingpres;
        if (!ast_strlen_zero(client->accountcode))
-               ast_string_field_set(tmp, accountcode, client->accountcode);
+               ast_channel_accountcode_set(tmp, client->accountcode);
        if (client->amaflags)
                tmp->amaflags = client->amaflags;
        if (!ast_strlen_zero(client->language))
-               ast_string_field_set(tmp, language, client->language);
+               ast_channel_language_set(tmp, client->language);
        if (!ast_strlen_zero(client->musicclass))
-               ast_string_field_set(tmp, musicclass, client->musicclass);
+               ast_channel_musicclass_set(tmp, client->musicclass);
        i->owner = tmp;
        ast_copy_string(tmp->context, client->context, sizeof(tmp->context));
        ast_copy_string(tmp->exten, i->exten, sizeof(tmp->exten));
@@ -1583,7 +1583,7 @@ static struct ast_channel *jingle_request(const char *type, struct ast_format_ca
        ASTOBJ_WRLOCK(client);
        p = jingle_alloc(client, to, NULL);
        if (p)
-               chan = jingle_new(client, p, AST_STATE_DOWN, to, requestor ? requestor->linkedid : NULL);
+               chan = jingle_new(client, p, AST_STATE_DOWN, to, requestor ? ast_channel_linkedid(requestor) : NULL);
        ASTOBJ_UNLOCK(client);
 
        return chan;
index 69e6841..4d9ba9d 100644 (file)
@@ -860,9 +860,9 @@ static int local_call(struct ast_channel *ast, char *dest, int timeout)
        ast_connected_line_copy_to_caller(&chan->caller, &owner->connected);
        ast_connected_line_copy_from_caller(&chan->connected, &owner->caller);
 
-       ast_string_field_set(chan, language, owner->language);
-       ast_string_field_set(chan, accountcode, owner->accountcode);
-       ast_string_field_set(chan, musicclass, owner->musicclass);
+       ast_channel_language_set(chan, ast_channel_language(owner));
+       ast_channel_accountcode_set(chan, ast_channel_accountcode(owner));
+       ast_channel_musicclass_set(chan, ast_channel_musicclass(owner));
        ast_cdr_update(chan);
 
        ast_channel_cc_params_init(chan, ast_channel_get_cc_config_params(owner));
@@ -917,7 +917,7 @@ static int local_call(struct ast_channel *ast, char *dest, int timeout)
                      "Context: %s\r\n"
                      "Exten: %s\r\n"
                      "LocalOptimization: %s\r\n",
-                       ast_channel_name(p->owner), ast_channel_name(p->chan), p->owner->uniqueid, p->chan->uniqueid,
+                       ast_channel_name(p->owner), ast_channel_name(p->chan), ast_channel_uniqueid(p->owner), ast_channel_uniqueid(p->chan),
                        p->context, p->exten,
                        ast_test_flag(p, LOCAL_NO_OPTIMIZATION) ? "Yes" : "No");
 
@@ -1131,8 +1131,8 @@ static struct ast_channel *local_new(struct local_pvt *p, int state, const char
 
        /* Allocate two new Asterisk channels */
        /* safe accountcode */
-       if (p->owner && p->owner->accountcode)
-               t = p->owner->accountcode;
+       if (p->owner && ast_channel_accountcode(p->owner))
+               t = ast_channel_accountcode(p->owner);
        else
                t = "";
 
@@ -1192,7 +1192,7 @@ static struct ast_channel *local_request(const char *type, struct ast_format_cap
 
        /* Allocate a new private structure and then Asterisk channel */
        if ((p = local_alloc(data, cap))) {
-               if (!(chan = local_new(p, AST_STATE_DOWN, requestor ? requestor->linkedid : NULL))) {
+               if (!(chan = local_new(p, AST_STATE_DOWN, requestor ? ast_channel_linkedid(requestor) : NULL))) {
                        ao2_unlink(locals, p);
                }
                if (chan && ast_channel_cc_params_init(chan, requestor ? ast_channel_get_cc_config_params((struct ast_channel *)requestor) : NULL)) {
index 8c3ddd0..cdb4bf7 100644 (file)
@@ -1524,16 +1524,16 @@ static struct ast_channel *mgcp_new(struct mgcp_subchannel *sub, int state, cons
                ast_format_copy(&tmp->rawreadformat, &tmpfmt);
                tmp->tech_pvt = sub;
                if (!ast_strlen_zero(i->language))
-                       ast_string_field_set(tmp, language, i->language);
+                       ast_channel_language_set(tmp, i->language);
                if (!ast_strlen_zero(i->accountcode))
-                       ast_string_field_set(tmp, accountcode, i->accountcode);
+                       ast_channel_accountcode_set(tmp, i->accountcode);
                if (i->amaflags)
                        tmp->amaflags = i->amaflags;
                sub->owner = tmp;
                ast_module_ref(ast_module_info->self);
                tmp->callgroup = i->callgroup;
                tmp->pickupgroup = i->pickupgroup;
-               ast_string_field_set(tmp, call_forward, i->call_forward);
+               ast_channel_call_forward_set(tmp, i->call_forward);
                ast_copy_string(tmp->context, i->context, sizeof(tmp->context));
                ast_copy_string(tmp->exten, i->exten, sizeof(tmp->exten));
 
@@ -3091,7 +3091,7 @@ static void *mgcp_ss(void *data)