]> git.ipfire.org Git - thirdparty/asterisk.git/commitdiff
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 b4441f24ff6d11496c467b6b60f4a9c901203ca7..dce519d9416a34826b738ed5404677f48b533042 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 b99b2d7f76a8c015debf7f3d0479a37777af8e74..0588ef81bee6f8173bbd8e795a2786b4a70df763 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 c1a69bcf63e61ced6dbbc2efa2199c509cfcf31a..1ed389a0597f4b4ce9eaba9901a4d7808f25cf99 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 3bdf483906c241058261cfad470b16bb71b02921..45e6d9602332beb5cbc2502c2590cd29b1144f08 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 af816f320f6b74ce507b4649152ec5f84d8445ba..54e47368160344bcdc57a38be77b996de1ffa7fb 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 1103b6e9e3e13efe5bf9384c669e43a4244ee909..46d448a5f4aa65a2150730277af0283ad9fc7455 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 1e06b28f1fdff524d260c81f239f9f3732d59e3a..18cbe8d76dd34ea18ac0e6d463088031f7d4ce23 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 b50fbb044841399205d185622dd71d0d3e64fe3a..6b200177427aa42ea2cb7c1e90670a0035f76c2b 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 dccae948b97ef7d80f243476376484ad017210e9..a4ec93e4cd5418d786716a2d8cf13fa9149f84fd 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 ce175bc20f150dcb97f2e64e3abf34ee70df854d..78830f1c3dfbdfda0de0caa49dc61aa5aaa9d652 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 9b0096f0ac5565fabc2e82756233d6cbe1aae0a4..c59d32edf5721c0da18eac5f8a017ee3fbdd876e 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 d8ff60ab07f9e29b988c03740ae464282ec3a834..9377d2320e7f22dd675b2bea4d41b5caf7ff5c1d 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 65787f92dc9e72d290d5bd4b49dc9b631a0c8e1f..878e2eef1ab0078b380ca1420df1a63c4f62f9d1 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 2b3f5c43f1812e23a8f614d960634f9591a46b69..52f53d2d3e97f19ce42840c2112a40f351cb8101 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 9348b3a8435be32c7e69b648cfe7f17d3fbdf77e..da9f6895482f2fe622f1a29c2e5838522585e6fc 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 1389c792c4ff47c4ddf55ca88d7ae665a0981847..f05b5d87107be037296a6dae31488811f569cc97 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 f245d5929a239defc41ac4d0c2f1222b94797669..2d94db75c6ce4bb43420c72a4d31495f0aaff6c5 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 6db5377ea1b5fd9a51083ff2f3b874eb4300b79f..e9d4d87520394d4a7025d97f2269881a677e38e0 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 6b191771c8eea61167ddef3ba1a1b506c0a8aba1..6c2c95814efdd5dad14775029470985917d3813d 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 c7dc14100f981d144b1d742d9070f3288e0c9912..0f192acb6454e12c04108fcb87ed7fb968cedaaf 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 6e8531d16201f21e05cbb0398a9e71207d52bdb8..dc2e482c37287a68e4579734b8063ee867fe138d 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 18101e460594891433643bfcdf9e42b4692cbf55..420ed0e62ba8fa7916e2de35dce34fb5aa6b0e8d 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 3a8ef4ad8e276767ab648ce31bea1e1b06d4e57d..4dc196e62cf7c7958360c5f845e9f69ba496f4e1 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 8a3756225cb6cd708ed8b3644dc906a99760d42b..32119aca0287dd393e3e4f8517d28fe8d26871b1 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 637aac613a6fb792c7ac2c84afbe9ff1682949bf..078fcf2e9a24d67dae45ffc3be895c176f2f26ee 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 83de481874c7e33bff1b3d671ca0c2e01f712d81..720ca556ed75c3ed434efad21771d8e09909da7f 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 a177227be45f75ce83f91d41b57eab923eac2fe3..5259d6f8fbfee52204242f1133d2bc8cde9559c8 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 59bea65df697ec2bcb30bc14e37031df1d2a5d50..3ebf33289713f9f01abbd82a168eeb15a992b947 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 062e103d0b02e31b0fe545d94c012f591541a835..37c3e94baad089fcd85551898842b4ab870ccaa4 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 75aceacc7c305f75db8027c34c2c98be521fc958..3a9689511716d0f1ecbb8abea51388d1d0af7c1a 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 8f380909acfcac0ccc57cebba5d68dac6a603c03..4f06ba48151ae11641d05df7b76307d31ac98837 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 3e12b3995fbd652d6592824ab080af4aee86bd28..dd37af6087a8cbaf03413c747782e61ade0eaf41 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 7e2301073994b20344de4ed32d5924c2dcfeec48..68e34026f76c3fd88ce2b2f7e0616f591e1f4262 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 da167d64e15731a2cd54a15fb046b14d8b8f7f8c..2380149ff0664e80dadd9800889960c259f0d75f 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 21b80e2540134842dd2487fa57c88c643a6773bc..d9464d1a65d29b4ad80be51237f51b8f4c1500f4 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 80970a9eaf166578aeff0f8f3e74e97bd19cd7f9..ce4ce5741c51175fdcdd42cd2af92a5567889644 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 c799955a013cf332c9f9dd9affc062c1a7747aaa..2255801c0794ca6afe4b5f6b2ec217a798bb5cc7 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 aad52e3cc2cadb7c3b9fad3159e6b1132ee85a45..af0bd6ad8c29320f18628ac0744a5649d7544419 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 69e6841e97bbed23364bdbaa5ac7c5c2c46c29be..4d9ba9d51336969e3dec02e469d2d7606a1d22b4 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 8c3ddd0ce064881fc1ee3ba4395932bf523499d2..cdb4bf79fecccda5cef8d3208725ef86222bcfb4 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)
                } else if (p->callreturn && !strcmp(p->dtmf_buf, "*69")) {
                        res = 0;
                        if (!ast_strlen_zero(p->lastcallerid)) {
-                               res = ast_say_digit_str(chan, p->lastcallerid, "", chan->language);
+                               res = ast_say_digit_str(chan, p->lastcallerid, "", ast_channel_language(chan));
                        }
                        if (!res)
                                /*res = tone_zone_play_tone(p->subs[index].zfd, DAHDI_TONE_DIALRECALL);*/
@@ -3960,7 +3960,7 @@ static struct ast_channel *mgcp_request(const char *type, struct ast_format_cap
                ast_mutex_unlock(&sub->lock);
                return NULL;
        }
-       tmpc = mgcp_new(sub->owner ? sub->next : sub, AST_STATE_DOWN, requestor ? requestor->linkedid : NULL);
+       tmpc = mgcp_new(sub->owner ? sub->next : sub, AST_STATE_DOWN, requestor ? ast_channel_linkedid(requestor) : NULL);
        ast_mutex_unlock(&sub->lock);
        if (!tmpc)
                ast_log(LOG_WARNING, "Unable to make channel for '%s'\n", tmp);
index a9614344a0ed8a8a3cc6df637af68f03636730f8..579b3c2cf72a4bd35a7d4f213e9bf0c816303dcf 100644 (file)
@@ -5919,7 +5919,7 @@ static int read_config(struct chan_list *ch)
        chan_misdn_log(1, port, "read_config: Getting Config\n");
 
        misdn_cfg_get(port, MISDN_CFG_LANGUAGE, lang, sizeof(lang));
-       ast_string_field_set(ast, language, lang);
+       ast_channel_language_set(ast, lang);
 
        misdn_cfg_get(port, MISDN_CFG_MUSICCLASS, ch->mohinterpret, sizeof(ch->mohinterpret));
 
@@ -8005,7 +8005,7 @@ static struct ast_channel *misdn_request(const char *type, struct ast_format_cap
        }
        cl->bc = newbc;
 
-       ast = misdn_new(cl, AST_STATE_RESERVED, args.ext, NULL, cap, requestor ? requestor->linkedid : NULL, port, channel);
+       ast = misdn_new(cl, AST_STATE_RESERVED, args.ext, NULL, cap, requestor ? ast_channel_linkedid(requestor) : NULL, port, channel);
        if (!ast) {
                chan_list_unref(cl, "Failed to create a new channel");
                ast_log(LOG_ERROR, "Could not create Asterisk channel for Dial(%s)\n", dial_str);
@@ -9137,7 +9137,7 @@ static void misdn_facility_ie_handler(enum event_e event, struct misdn_bchannel
                                bc->redirecting.reason = mISDN_REDIRECTING_REASON_DEFLECTION;
 
                                misdn_copy_redirecting_to_ast(ch->ast, &bc->redirecting, bc->incoming_cid_tag);
-                               ast_string_field_set(ch->ast, call_forward, bc->redirecting.to.number);
+                               ast_channel_call_forward_set(ch->ast, bc->redirecting.to.number);
 
                                /* Send back positive ACK */
 #if 1
@@ -9296,7 +9296,7 @@ static void misdn_facility_ie_handler(enum event_e event, struct misdn_bchannel
                        bc->redirecting.reason = mISDN_REDIRECTING_REASON_DEFLECTION;
 
                        misdn_copy_redirecting_to_ast(ch->ast, &bc->redirecting, bc->incoming_cid_tag);
-                       ast_string_field_set(ch->ast, call_forward, bc->redirecting.to.number);
+                       ast_channel_call_forward_set(ch->ast, bc->redirecting.to.number);
 
                        misdn_lib_send_event(bc, EVENT_DISCONNECT);
 
index 929525ffb1bd6ea39984557a8fcebf138821cd4a..f1cabcef42fff21f86f31aa7265bcf31f7bceff9 100644 (file)
@@ -149,7 +149,7 @@ static struct ast_channel *multicast_rtp_request(const char *type, struct ast_fo
                goto failure;
        }
 
-       if (!(chan = ast_channel_alloc(1, AST_STATE_DOWN, "", "", "", "", "", requestor ? requestor->linkedid : "", 0, "MulticastRTP/%p", instance))) {
+       if (!(chan = ast_channel_alloc(1, AST_STATE_DOWN, "", "", "", "", "", requestor ? ast_channel_linkedid(requestor) : "", 0, "MulticastRTP/%p", instance))) {
                ast_rtp_instance_destroy(instance);
                goto failure;
        }
index d9885c14eeddc84c1fcf9b37ac9bbfbaee7c7b30..95b41d4de6606a26a409418def168d530c663095 100644 (file)
@@ -236,7 +236,7 @@ static struct ast_channel *nbs_new(struct nbs_pvt *i, int state, const char *lin
                tmp->tech_pvt = i;
                ast_copy_string(tmp->context, context, sizeof(tmp->context));
                ast_copy_string(tmp->exten, "s",  sizeof(tmp->exten));
-               ast_string_field_set(tmp, language, "");
+               ast_channel_language_set(tmp, "");
                i->owner = tmp;
                i->u = ast_module_user_add(tmp);
                if (state != AST_STATE_DOWN) {
@@ -263,7 +263,7 @@ static struct ast_channel *nbs_request(const char *type, struct ast_format_cap *
        }
        p = nbs_alloc(data);
        if (p) {
-               tmp = nbs_new(p, AST_STATE_DOWN, requestor ? requestor->linkedid : NULL);
+               tmp = nbs_new(p, AST_STATE_DOWN, requestor ? ast_channel_linkedid(requestor) : NULL);
                if (!tmp)
                        nbs_destroy(p);
        }
index f74a3ae36db8767f5463a53eab1f5b3dc32028bb..bf044a420ffdb78a42b6ba9f1f1eea91ec27f652 100644 (file)
@@ -808,7 +808,7 @@ static struct ast_channel *oss_new(struct chan_oss_pvt *o, char *ext, char *ctx,
        c->tech_pvt = o;
 
        if (!ast_strlen_zero(o->language))
-               ast_string_field_set(c, language, o->language);
+               ast_channel_language_set(c, o->language);
        /* Don't use ast_set_callerid() here because it will
         * generate a needless NewCallerID event */
        if (!ast_strlen_zero(o->cid_num)) {
@@ -864,7 +864,7 @@ static struct ast_channel *oss_request(const char *type, struct ast_format_cap *
                *cause = AST_CAUSE_BUSY;
                return NULL;
        }
-       c = oss_new(o, NULL, NULL, AST_STATE_DOWN, requestor ? requestor->linkedid : NULL);
+       c = oss_new(o, NULL, NULL, AST_STATE_DOWN, requestor ? ast_channel_linkedid(requestor) : NULL);
        if (c == NULL) {
                ast_log(LOG_WARNING, "Unable to create new OSS channel\n");
                return NULL;
index 1281f149a9296209558b3c6c5453489c8355db05..e8409941f05b08f63a190d9398037b24635e25d2 100644 (file)
@@ -880,7 +880,7 @@ static struct ast_channel *phone_new(struct phone_pvt *i, int state, char *cntx,
                else
                        strcpy(tmp->exten, "s");
                if (!ast_strlen_zero(i->language))
-                       ast_string_field_set(tmp, language, i->language);
+                       ast_channel_language_set(tmp, i->language);
 
                /* Don't use ast_set_callerid() here because it will
                 * generate a NewCallerID event before the NewChannel event */
@@ -1249,7 +1249,7 @@ static struct ast_channel *phone_request(const char *type, struct ast_format_cap
                if (strncmp(name, p->dev + 5, length) == 0 &&
                    !isalnum(name[length])) {
                    if (!p->owner) {
-                     tmp = phone_new(p, AST_STATE_DOWN, p->context, requestor ? requestor->linkedid : NULL);
+                     tmp = phone_new(p, AST_STATE_DOWN, p->context, requestor ? ast_channel_linkedid(requestor) : NULL);
                      break;
                 } else
                      *cause = AST_CAUSE_BUSY;
index 5b2bfa8a1b8341ca6bff2d4ad253b583dbf392db..a29ca9c55b5f39ad1bbaa079a8c009d5af9ccb3e 100644 (file)
@@ -7174,16 +7174,16 @@ static struct ast_channel *sip_new(struct sip_pvt *i, int state, const char *tit
        tmp->caller.id.name.presentation = i->callingpres;
        tmp->caller.id.number.presentation = i->callingpres;
        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->accountcode)) {
-               ast_string_field_set(tmp, accountcode, i->accountcode);
+               ast_channel_accountcode_set(tmp, i->accountcode);
        }
        if (i->amaflags) {
                tmp->amaflags = i->amaflags;
        }
        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->zone)) {
                if (!(tmp->zone = ast_get_indication_zone(i->zone))) {
@@ -7250,7 +7250,7 @@ static struct ast_channel *sip_new(struct sip_pvt *i, int state, const char *tit
        if (sip_cfg.callevents) {
                manager_event(EVENT_FLAG_SYSTEM, "ChannelUpdate",
                        "Channel: %s\r\nUniqueid: %s\r\nChanneltype: %s\r\nSIPcallid: %s\r\nSIPfullcontact: %s\r\n",
-                       ast_channel_name(tmp), tmp->uniqueid, "SIP", i->callid, i->fullcontact);
+                       ast_channel_name(tmp), ast_channel_uniqueid(tmp), "SIP", i->callid, i->fullcontact);
        }
 
        return tmp;
@@ -8821,7 +8821,7 @@ static void change_hold_state(struct sip_pvt *dialog, struct sip_request *req, i
                              "Uniqueid: %s\r\n",
                              holdstate ? "On" : "Off",
                              ast_channel_name(dialog->owner),
-                             dialog->owner->uniqueid);
+                             ast_channel_uniqueid(dialog->owner));
        append_history(dialog, holdstate ? "Hold" : "Unhold", "%s", req->data->str);
        if (!holdstate) {       /* Put off remote hold */
                ast_clear_flag(&dialog->flags[1], SIP_PAGE2_CALL_ONHOLD);       /* Clear both flags */
@@ -20148,11 +20148,11 @@ static void parse_moved_contact(struct sip_pvt *p, struct sip_request *req, char
                        *host++ = '\0';
                        ast_debug(2, "Found promiscuous redirection to 'SIP/%s::::%s@%s'\n", contact_number, sip_get_transport(transport), host);
                        if (p->owner)
-                               ast_string_field_build(p->owner, call_forward, "SIP/%s::::%s@%s", contact_number, sip_get_transport(transport), host);
+                               ast_channel_call_forward_build(p->owner, "SIP/%s::::%s@%s", contact_number, sip_get_transport(transport), host);
                } else {
                        ast_debug(2, "Found promiscuous redirection to 'SIP/::::%s@%s'\n", sip_get_transport(transport), contact_number);
                        if (p->owner)
-                               ast_string_field_build(p->owner, call_forward, "SIP/::::%s@%s", sip_get_transport(transport), contact_number);
+                               ast_channel_call_forward_build(p->owner, "SIP/::::%s@%s", sip_get_transport(transport), contact_number);
                }
        } else {
                separator = strchr(contact, '@');
@@ -20179,7 +20179,7 @@ static void parse_moved_contact(struct sip_pvt *p, struct sip_request *req, char
                        ast_debug(2, "Received 302 Redirect to extension '%s' (domain %s)\n", contact_number, domain);
                        if (p->owner) {
                                pbx_builtin_setvar_helper(p->owner, "SIPDOMAIN", domain);
-                               ast_string_field_set(p->owner, call_forward, contact_number);
+                               ast_channel_call_forward_set(p->owner, contact_number);
                        }
                }
        }
@@ -20663,7 +20663,7 @@ static void handle_response_invite(struct sip_pvt *p, int resp, const char *rest
                                if (sip_cfg.callevents) {
                                        manager_event(EVENT_FLAG_SYSTEM, "ChannelUpdate",
                                                "Channel: %s\r\nChanneltype: %s\r\nUniqueid: %s\r\nSIPcallid: %s\r\nSIPfullcontact: %s\r\nPeername: %s\r\n",
-                                               ast_channel_name(p->owner), "SIP", p->owner->uniqueid, p->callid, p->fullcontact, p->peername);
+                                               ast_channel_name(p->owner), "SIP", ast_channel_uniqueid(p->owner), p->callid, p->fullcontact, p->peername);
                                }
                        } else {        /* RE-invite */
                                if (p->t38.state == T38_DISABLED || p->t38.state == T38_REJECTED) {
@@ -21933,8 +21933,8 @@ static int sip_park(struct ast_channel *chan1, struct ast_channel *chan2, struct
        struct ast_channel *transferee, *transferer;
        pthread_t th;
 
-       transferee = ast_channel_alloc(0, AST_STATE_DOWN, 0, 0, chan1->accountcode, chan1->exten, chan1->context, chan1->linkedid, chan1->amaflags, "Parking/%s", ast_channel_name(chan1));
-       transferer = ast_channel_alloc(0, AST_STATE_DOWN, 0, 0, chan2->accountcode, chan2->exten, chan2->context, chan2->linkedid, chan2->amaflags, "SIPPeer/%s", ast_channel_name(chan2));
+       transferee = ast_channel_alloc(0, AST_STATE_DOWN, 0, 0, ast_channel_accountcode(chan1), chan1->exten, chan1->context, ast_channel_linkedid(chan1), chan1->amaflags, "Parking/%s", ast_channel_name(chan1));
+       transferer = ast_channel_alloc(0, AST_STATE_DOWN, 0, 0, ast_channel_accountcode(chan2), chan2->exten, chan2->context, ast_channel_linkedid(chan2), chan2->amaflags, "SIPPeer/%s", ast_channel_name(chan2));
        d = ast_calloc(1, sizeof(*d));
        if (!transferee || !transferer || !d) {
                if (transferee) {
@@ -21984,7 +21984,7 @@ static int sip_park(struct ast_channel *chan1, struct ast_channel *chan2, struct
        /* Make formats okay */
        transferer->readformat = chan2->readformat;
        transferer->writeformat = chan2->writeformat;
-       ast_string_field_set(transferer, parkinglot, chan2->parkinglot);
+       ast_channel_parkinglot_set(transferer, ast_channel_parkinglot(chan2));
 
        /* Prepare for taking over the channel */
        if (ast_channel_masquerade(transferer, chan2)) {
@@ -22804,7 +22804,7 @@ static int handle_request_invite(struct sip_pvt *p, struct sip_request *req, int
                        ast_string_field_set(p, theirtag, NULL);
                        /* Treat this as if there were a call forward instead...
                         */
-                       ast_string_field_set(p->owner, call_forward, peerorhost);
+                       ast_channel_call_forward_set(p->owner, peerorhost);
                        ast_queue_control(p->owner, AST_CONTROL_BUSY);
                        res = INV_REQ_FAILED;
                        goto request_invite_cleanup;
@@ -23642,7 +23642,7 @@ static int local_attended_transfer(struct sip_pvt *transferer, struct sip_dual *
 
        ast_set_flag(&transferer->flags[0], SIP_DEFER_BYE_ON_TRANSFER); /* Delay hangup */
 
-       ast_copy_string(transferer_linkedid, transferer->owner->linkedid, sizeof(transferer_linkedid));
+       ast_copy_string(transferer_linkedid, ast_channel_linkedid(transferer->owner), sizeof(transferer_linkedid));
 
        /* Perform the transfer */
        chans[0] = transferer->owner;
@@ -23656,10 +23656,10 @@ static int local_attended_transfer(struct sip_pvt *transferer, struct sip_dual *
                "TargetChannel: %s\r\n"
                "TargetUniqueid: %s\r\n",
                ast_channel_name(transferer->owner),
-               transferer->owner->uniqueid,
+               ast_channel_uniqueid(transferer->owner),
                transferer->callid,
                ast_channel_name(target.chan1),
-               target.chan1->uniqueid);
+               ast_channel_uniqueid(target.chan1));
        ast_party_connected_line_init(&connected_to_transferee);
        ast_party_connected_line_init(&connected_to_target);
        /* No need to lock current->chan1 here since it was locked in sipsock_read */
@@ -23687,7 +23687,7 @@ static int local_attended_transfer(struct sip_pvt *transferer, struct sip_dual *
                transmit_notify_with_sipfrag(transferer, seqno, "200 OK", TRUE);
                append_history(transferer, "Xfer", "Refer succeeded");
                transferer->refer->status = REFER_200OK;
-               if (target.chan2 && !ast_strlen_zero(xfersound) && ast_streamfile(target.chan2, xfersound, target.chan2->language) >= 0) {
+               if (target.chan2 && !ast_strlen_zero(xfersound) && ast_streamfile(target.chan2, xfersound, ast_channel_language(target.chan2)) >= 0) {
                        ast_waitstream(target.chan2, "");
                }
 
@@ -24062,10 +24062,10 @@ static int handle_request_refer(struct sip_pvt *p, struct sip_request *req, int
                        "TransferExten: %s\r\n"
                        "Transfer2Parking: Yes\r\n",
                        ast_channel_name(current.chan1),
-                       current.chan1->uniqueid,
+                       ast_channel_uniqueid(current.chan1),
                        callid,
                        ast_channel_name(current.chan2),
-                       current.chan2->uniqueid,
+                       ast_channel_uniqueid(current.chan2),
                        refer_to);
 
                if (sipdebug) {
@@ -24169,10 +24169,10 @@ static int handle_request_refer(struct sip_pvt *p, struct sip_request *req, int
                        "TransferExten: %s\r\n"
                        "TransferContext: %s\r\n",
                        ast_channel_name(current.chan1),
-                       current.chan1->uniqueid,
+                       ast_channel_uniqueid(current.chan1),
                        callid,
                        ast_channel_name(current.chan2),
-                       current.chan2->uniqueid,
+                       ast_channel_uniqueid(current.chan2),
                        refer_to,
                        refer_to_context);
                /* Success  - we have a new channel */
@@ -26388,7 +26388,7 @@ static int check_rtp_timeout(struct sip_pvt *dialog, time_t t)
                                ast_log(LOG_NOTICE, "Disconnecting call '%s' for lack of RTP activity in %ld seconds\n",
                                        ast_channel_name(dialog->owner), (long) (t - dialog->lastrtprx));
                                manager_event(EVENT_FLAG_CALL, "SessionTimeout", "Source: RTPTimeout\r\n"
-                                               "Channel: %s\r\nUniqueid: %s\r\n", ast_channel_name(dialog->owner), dialog->owner->uniqueid);
+                                               "Channel: %s\r\nUniqueid: %s\r\n", ast_channel_name(dialog->owner), ast_channel_uniqueid(dialog->owner));
                                /* Issue a softhangup */
                                ast_softhangup_nolock(dialog->owner, AST_SOFTHANGUP_DEV);
                                ast_channel_unlock(dialog->owner);
@@ -26642,7 +26642,7 @@ static int proc_session_timer(const void *vp)
                        }
 
                        manager_event(EVENT_FLAG_CALL, "SessionTimeout", "Source: SIPSessionTimer\r\n"
-                                       "Channel: %s\r\nUniqueid: %s\r\n", ast_channel_name(p->owner), p->owner->uniqueid);
+                                       "Channel: %s\r\nUniqueid: %s\r\n", ast_channel_name(p->owner), ast_channel_uniqueid(p->owner));
                        ast_softhangup_nolock(p->owner, AST_SOFTHANGUP_DEV);
                        ast_channel_unlock(p->owner);
                        sip_pvt_unlock(p);
@@ -27272,7 +27272,7 @@ static struct ast_channel *sip_request_call(const char *type, struct ast_format_
        ast_format_cap_joint_copy(cap, p->caps, p->jointcaps);
 
        sip_pvt_lock(p);
-       tmpc = sip_new(p, AST_STATE_DOWN, host, requestor ? requestor->linkedid : NULL);        /* Place the call */
+       tmpc = sip_new(p, AST_STATE_DOWN, host, requestor ? ast_channel_linkedid(requestor) : NULL);    /* Place the call */
        if (sip_cfg.callevents)
                manager_event(EVENT_FLAG_SYSTEM, "ChannelUpdate",
                        "Channel: %s\r\nChanneltype: %s\r\nSIPcallid: %s\r\nSIPfullcontact: %s\r\nPeername: %s\r\n",
index 05ee648bafa6b68ad15bb8c340cd9cad977e1ea8..ab967339f8494800534f775afe9ec22f5580077f 100644 (file)
@@ -4904,11 +4904,11 @@ static struct ast_channel *skinny_new(struct skinny_line *l, struct skinny_subli
                ast_format_copy(&tmp->rawreadformat, &tmpfmt);
 
                if (!ast_strlen_zero(l->language))
-                       ast_string_field_set(tmp, language, l->language);
+                       ast_channel_language_set(tmp, l->language);
                if (!ast_strlen_zero(l->accountcode))
-                       ast_string_field_set(tmp, accountcode, l->accountcode);
+                       ast_channel_accountcode_set(tmp, l->accountcode);
                if (!ast_strlen_zero(l->parkinglot))
-                       ast_string_field_set(tmp, parkinglot, l->parkinglot);
+                       ast_channel_parkinglot_set(tmp, l->parkinglot);
                if (l->amaflags)
                        tmp->amaflags = l->amaflags;
 
@@ -4918,10 +4918,10 @@ static struct ast_channel *skinny_new(struct skinny_line *l, struct skinny_subli
 
                /* XXX Need to figure out how to handle CFwdNoAnswer */
                if (l->cfwdtype & SKINNY_CFWD_ALL) {
-                       ast_string_field_set(tmp, call_forward, l->call_forward_all);
+                       ast_channel_call_forward_set(tmp, l->call_forward_all);
                } else if (l->cfwdtype & SKINNY_CFWD_BUSY) {
                        if (get_devicestate(l) != AST_DEVICE_NOT_INUSE) {
-                               ast_string_field_set(tmp, call_forward, l->call_forward_busy);
+                               ast_channel_call_forward_set(tmp, l->call_forward_busy);
                        }
                }
 
@@ -7107,7 +7107,7 @@ static struct ast_channel *skinny_request(const char *type, struct ast_format_ca
                l = subline->line;
        }
        ast_verb(3, "skinny_request(%s)\n", tmp);
-       tmpc = skinny_new(l, subline, AST_STATE_DOWN, requestor ? requestor->linkedid : NULL, SKINNY_INCOMING);
+       tmpc = skinny_new(l, subline, AST_STATE_DOWN, requestor ? ast_channel_linkedid(requestor) : NULL, SKINNY_INCOMING);
        if (!tmpc) {
                ast_log(LOG_WARNING, "Unable to make channel for '%s'\n", tmp);
        } else if (subline) {
index 45267724e414df05dca6f4da844ff391b9eb72e5..d303f078b2c7c4c58bab1c0bc1aa8c5c8371c473 100644 (file)
@@ -4593,7 +4593,7 @@ static struct ast_channel *unistim_new(struct unistim_subchannel *sub, int state
        tmp->tech_pvt = sub;
        tmp->tech = &unistim_tech;
        if (!ast_strlen_zero(l->language))
-               ast_string_field_set(tmp, language, l->language);
+               ast_channel_language_set(tmp, l->language);
        sub->owner = tmp;
        ast_mutex_lock(&usecnt_lock);
        usecnt++;
@@ -4601,7 +4601,7 @@ static struct ast_channel *unistim_new(struct unistim_subchannel *sub, int state
        ast_update_use_count();
        tmp->callgroup = l->callgroup;
        tmp->pickupgroup = l->pickupgroup;
-       ast_string_field_set(tmp, call_forward, l->parent->call_forward);
+       ast_channel_call_forward_set(tmp, l->parent->call_forward);
        if (!ast_strlen_zero(l->cid_num)) {
                char *name, *loc, *instr;
                instr = ast_strdup(l->cid_num);
@@ -4778,7 +4778,7 @@ static struct ast_channel *unistim_request(const char *type, struct ast_format_c
                return NULL;
        }
        ast_format_cap_copy(sub->parent->cap, cap);
-       tmpc = unistim_new(sub, AST_STATE_DOWN, requestor ? requestor->linkedid : NULL);
+       tmpc = unistim_new(sub, AST_STATE_DOWN, requestor ? ast_channel_linkedid(requestor) : NULL);
        if (!tmpc)
                ast_log(LOG_WARNING, "Unable to make channel for '%s'\n", tmp);
        if (unistimdebug)
index 541a325f35f5979113d2dbf7dc954e76fd24ec17..8afc3fd882577b75e058cf6210a7a75abdb3682b 100644 (file)
@@ -2189,7 +2189,7 @@ static struct ast_channel *usbradio_new(struct chan_usbradio_pvt *o, char *ext,
        c->tech_pvt = o;
 
        if (!ast_strlen_zero(o->language))
-               ast_string_field_set(c, language, o->language);
+               ast_channel_language_set(c, o->language);
        /* Don't use ast_set_callerid() here because it will
         * generate a needless NewCallerID event */
        if (!ast_strlen_zero(o->cid_num)) {
@@ -2241,7 +2241,7 @@ static struct ast_channel *usbradio_request(const char *type, struct ast_format_
                *cause = AST_CAUSE_BUSY;
                return NULL;
        }
-       c = usbradio_new(o, NULL, NULL, AST_STATE_DOWN, requestor ? requestor->linkedid : NULL);
+       c = usbradio_new(o, NULL, NULL, AST_STATE_DOWN, requestor ? ast_channel_linkedid(requestor) : NULL);
        if (c == NULL) {
                ast_log(LOG_WARNING, "Unable to create new usb channel\n");
                return NULL;
index 7a7b34555e24ff9c80c9c7e8318ebb7a27e0acb2..a3457b7a7a5fd01c2c8cff84449d828d9a42c3a7 100644 (file)
@@ -439,7 +439,7 @@ static struct ast_channel * analog_new_ast_channel(struct analog_pvt *p, int sta
 
        c = p->calls->new_ast_channel(p->chan_pvt, state, startpbx, sub, requestor);
        if (c) {
-               ast_string_field_set(c, call_forward, p->call_forward);
+               ast_channel_call_forward_set(c, p->call_forward);
        }
        p->subs[sub].owner = c;
        if (!p->owner) {
@@ -705,7 +705,7 @@ static int analog_attempt_transfer(struct analog_pvt *p, int inthreeway)
                        (owner_real->_state == AST_STATE_RINGING
                                || owner_3way->_state == AST_STATE_RINGING)
                                ? AST_CEL_BLINDTRANSFER : AST_CEL_ATTENDEDTRANSFER,
-                       NULL, owner_3way->linkedid, NULL);
+                       NULL, ast_channel_linkedid(owner_3way), NULL);
 
                /*
                 * The three-way party we're about to transfer is on hold if he
@@ -731,7 +731,7 @@ static int analog_attempt_transfer(struct analog_pvt *p, int inthreeway)
                        (owner_real->_state == AST_STATE_RINGING
                                || owner_3way->_state == AST_STATE_RINGING)
                                ? AST_CEL_BLINDTRANSFER : AST_CEL_ATTENDEDTRANSFER,
-                       NULL, owner_3way->linkedid, NULL);
+                       NULL, ast_channel_linkedid(owner_3way), NULL);
 
                /*
                 * The three-way party we're about to transfer is on hold if he
@@ -2078,7 +2078,7 @@ static void *__analog_ss_thread(void *data)
                        } 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, "");
                        }
@@ -2233,7 +2233,7 @@ static void *__analog_ss_thread(void *data)
                        } else if (p->callreturn && !strcmp(exten, "*69")) {
                                res = 0;
                                if (!ast_strlen_zero(p->lastcid_num)) {
-                                       res = ast_say_digit_str(chan, p->lastcid_num, "", chan->language);
+                                       res = ast_say_digit_str(chan, p->lastcid_num, "", ast_channel_language(chan));
                                }
                                if (!res) {
                                        res = analog_play_tone(p, idx, ANALOG_TONE_DIALRECALL);
index 3c0f908acfd843be3a2cf2522ba234e40529b33f..f9e6581750ec6fd9366f0531f1463fa089734121 100644 (file)
@@ -2217,7 +2217,7 @@ static void sig_pri_mcid_event(struct sig_pri_span *pri, const struct pri_subcmd
                ast_queue_control(owner, AST_CONTROL_MCID);
 
                ast_str_append(&msg, 0, "Channel: %s\r\n", ast_channel_name(owner));
-               ast_str_append(&msg, 0, "UniqueID: %s\r\n", owner->uniqueid);
+               ast_str_append(&msg, 0, "UniqueID: %s\r\n", ast_channel_uniqueid(owner));
 
                sig_pri_event_party_id(&msg, "CallerID", &owner->connected.id);
        } else {
@@ -4228,8 +4228,7 @@ static void sig_pri_handle_subcmds(struct sig_pri_span *pri, int chanpos, int ev
                                ast_party_redirecting_free(&ast_redirecting);
 
                                /* Request the core to forward to the new number. */
-                               ast_string_field_set(owner, call_forward,
-                                       subcmd->u.rerouting.deflection.to.number.str);
+                               ast_channel_call_forward_set(owner, subcmd->u.rerouting.deflection.to.number.str);
 
                                /* Wake up the channel. */
                                ast_queue_frame(owner, &ast_null_frame);
@@ -5081,7 +5080,7 @@ static void sig_pri_ami_hold_event(struct ast_channel *chan, int is_held)
                "Uniqueid: %s\r\n",
                is_held ? "On" : "Off",
                ast_channel_name(chan),
-               chan->uniqueid);
+               ast_channel_uniqueid(chan));
 }
 #endif /* defined(HAVE_PRI_CALL_HOLD) */
 
index ecf9deea2c592d01aff83c16b3f922d044016f47..c45a012520195bc78d7bf5b859cae8c1815201ee 100644 (file)
@@ -289,7 +289,7 @@ ASTERISK_FILE_VERSION(__FILE__, "$Revision$")
 #define locked_string_field_set(chan, field, source) \
        do { \
                ast_channel_lock(chan); \
-               ast_string_field_set(chan, field, source); \
+               ast_channel_##field##_set(chan, source); \
                ast_channel_unlock(chan); \
        } while (0)
 
@@ -329,27 +329,27 @@ static int func_channel_read(struct ast_channel *chan, const char *function,
        } else if (!strcasecmp(data, "tonezone") && chan->zone)
                locked_copy_string(chan, buf, chan->zone->country, len);
        else if (!strcasecmp(data, "language"))
-               locked_copy_string(chan, buf, chan->language, len);
+               locked_copy_string(chan, buf, ast_channel_language(chan), len);
        else if (!strcasecmp(data, "musicclass"))
-               locked_copy_string(chan, buf, chan->musicclass, len);
+               locked_copy_string(chan, buf, ast_channel_musicclass(chan), len);
        else if (!strcasecmp(data, "name")) {
                locked_copy_string(chan, buf, ast_channel_name(chan), len);
        } else if (!strcasecmp(data, "parkinglot"))
-               locked_copy_string(chan, buf, chan->parkinglot, len);
+               locked_copy_string(chan, buf, ast_channel_parkinglot(chan), len);
        else if (!strcasecmp(data, "state"))
                locked_copy_string(chan, buf, ast_state2str(chan->_state), len);
        else if (!strcasecmp(data, "channeltype"))
                locked_copy_string(chan, buf, chan->tech->type, len);
        else if (!strcasecmp(data, "accountcode"))
-               locked_copy_string(chan, buf, chan->accountcode, len);
+               locked_copy_string(chan, buf, ast_channel_accountcode(chan), len);
        else if (!strcasecmp(data, "checkhangup")) {
                ast_channel_lock(chan);
                ast_copy_string(buf, ast_check_hangup(chan) ? "1" : "0", len);
                ast_channel_unlock(chan);
        } else if (!strcasecmp(data, "peeraccount"))
-               locked_copy_string(chan, buf, chan->peeraccount, len);
+               locked_copy_string(chan, buf, ast_channel_peeraccount(chan), len);
        else if (!strcasecmp(data, "hangupsource"))
-               locked_copy_string(chan, buf, chan->hangupsource, len);
+               locked_copy_string(chan, buf, ast_channel_hangupsource(chan), len);
        else if (!strcasecmp(data, "appname") && chan->appl)
                locked_copy_string(chan, buf, chan->appl, len);
        else if (!strcasecmp(data, "appdata") && chan->data)
@@ -359,17 +359,17 @@ static int func_channel_read(struct ast_channel *chan, const char *function,
        else if (!strcasecmp(data, "context") && chan->data)
                locked_copy_string(chan, buf, chan->context, len);
        else if (!strcasecmp(data, "userfield") && chan->data)
-               locked_copy_string(chan, buf, chan->userfield, len);
+               locked_copy_string(chan, buf, ast_channel_userfield(chan), len);
        else if (!strcasecmp(data, "channame") && chan->data)
                locked_copy_string(chan, buf, ast_channel_name(chan), len);
        else if (!strcasecmp(data, "linkedid")) {
                ast_channel_lock(chan);
-               if (ast_strlen_zero(chan->linkedid)) {
+               if (ast_strlen_zero(ast_channel_linkedid(chan))) {
                        /* fall back on the channel's uniqueid if linkedid is unset */
-                       ast_copy_string(buf, chan->uniqueid, len);
+                       ast_copy_string(buf, ast_channel_uniqueid(chan), len);
                }
                else {
-                       ast_copy_string(buf, chan->linkedid, len);
+                       ast_copy_string(buf, ast_channel_linkedid(chan), len);
                }
                ast_channel_unlock(chan);
        } else if (!strcasecmp(data, "peer")) {
@@ -389,7 +389,7 @@ static int func_channel_read(struct ast_channel *chan, const char *function,
                }
                ast_channel_unlock(chan);
        } else if (!strcasecmp(data, "uniqueid")) {
-               locked_copy_string(chan, buf, chan->uniqueid, len);
+               locked_copy_string(chan, buf, ast_channel_uniqueid(chan), len);
        } else if (!strcasecmp(data, "transfercapability")) {
                locked_copy_string(chan, buf, transfercapability_table[chan->transfercapability & 0x1f], len);
        } else if (!strcasecmp(data, "callgroup")) {
@@ -627,7 +627,7 @@ static struct ast_custom_function channels_function = {
 static int func_mchan_read(struct ast_channel *chan, const char *function,
                             char *data, struct ast_str **buf, ssize_t len)
 {
-       struct ast_channel *mchan = ast_channel_get_by_name(chan->linkedid);
+       struct ast_channel *mchan = ast_channel_get_by_name(ast_channel_linkedid(chan));
        char *template = alloca(4 + strlen(data));
        sprintf(template, "${%s}", data); /* SAFE */
        ast_str_substitute_variables(buf, len, mchan ? mchan : chan, template);
@@ -640,7 +640,7 @@ static int func_mchan_read(struct ast_channel *chan, const char *function,
 static int func_mchan_write(struct ast_channel *chan, const char *function,
                              char *data, const char *value)
 {
-       struct ast_channel *mchan = ast_channel_get_by_name(chan->linkedid);
+       struct ast_channel *mchan = ast_channel_get_by_name(ast_channel_linkedid(chan));
        pbx_builtin_setvar_helper(mchan ? mchan : chan, data, value);
        if (mchan) {
                ast_channel_unref(mchan);
index 7ac3fba094bb54d24fcdd2163bbdecbe99019bfd..b4a84e4fe7ad9faabb770e09b049b14d6fb536e3 100644 (file)
@@ -260,7 +260,7 @@ static int shared_write(struct ast_channel *chan, const char *cmd, char *data, c
                "Value: %s\r\n"
                "Uniqueid: %s\r\n", 
                chan ? ast_channel_name(chan) : "none", args.var, value, 
-               chan ? chan->uniqueid : "none");
+               chan ? ast_channel_uniqueid(chan) : "none");
 
        ast_channel_unlock(chan);
 
index d26a25722944ca22ffa1fdc39e1c140b557cb31b..91d6990eb569e54890b12cc8032cd3eebfbcbae4 100644 (file)
@@ -770,18 +770,18 @@ struct ast_channel {
 #endif
 
        AST_DECLARE_STRING_FIELDS(
-               AST_STRING_FIELD(__do_not_use_name); /*!< ASCII unique channel name */
-               AST_STRING_FIELD(language);             /*!< Language requested for voice prompts */
-               AST_STRING_FIELD(musicclass);           /*!< Default music class */
-               AST_STRING_FIELD(accountcode);          /*!< Account code for billing */
-               AST_STRING_FIELD(peeraccount);          /*!< Peer account code for billing */
-               AST_STRING_FIELD(userfield);            /*!< Userfield for CEL billing */
-               AST_STRING_FIELD(call_forward);         /*!< Where to forward to if asked to dial on this interface */
-               AST_STRING_FIELD(uniqueid);             /*!< Unique Channel Identifier */
-               AST_STRING_FIELD(linkedid);             /*!< Linked Channel Identifier -- gets propagated by linkage */
-               AST_STRING_FIELD(parkinglot);           /*! Default parking lot, if empty, default parking lot  */
-               AST_STRING_FIELD(hangupsource);         /*! Who is responsible for hanging up this channel */
-               AST_STRING_FIELD(dialcontext);          /*!< Dial: Extension context that we were called from */
+               AST_STRING_FIELD(__do_not_use_name);         /*!< ASCII unique channel name */
+               AST_STRING_FIELD(__do_not_use_language);     /*!< Language requested for voice prompts */
+               AST_STRING_FIELD(__do_not_use_musicclass);   /*!< Default music class */
+               AST_STRING_FIELD(__do_not_use_accountcode);  /*!< Account code for billing */
+               AST_STRING_FIELD(__do_not_use_peeraccount);  /*!< Peer account code for billing */
+               AST_STRING_FIELD(__do_not_use_userfield);    /*!< Userfield for CEL billing */
+               AST_STRING_FIELD(__do_not_use_call_forward); /*!< Where to forward to if asked to dial on this interface */
+               AST_STRING_FIELD(__do_not_use_uniqueid);     /*!< Unique Channel Identifier */
+               AST_STRING_FIELD(__do_not_use_linkedid);     /*!< Linked Channel Identifier -- gets propagated by linkage */
+               AST_STRING_FIELD(__do_not_use_parkinglot);   /*! Default parking lot, if empty, default parking lot  */
+               AST_STRING_FIELD(__do_not_use_hangupsource); /*! Who is responsible for hanging up this channel */
+               AST_STRING_FIELD(__do_not_use_dialcontext);  /*!< Dial: Extension context that we were called from */
        );
 
        struct timeval whentohangup;                    /*!< Non-zero, set to actual time when channel is to be hung up */
@@ -3546,13 +3546,37 @@ int ast_channel_get_cc_agent_type(struct ast_channel *chan, char *agent_type, si
 void ast_channel_unlink(struct ast_channel *chan);
 
 /* ACCESSOR FUNTIONS */
-/*! \brief Get the channel name */
-const char *ast_channel_name(const struct ast_channel *chan);
-
 /*! \brief Set the channel name */
 void ast_channel_name_set(struct ast_channel *chan, const char *name);
 
-/*! \brief Set the channel name with a format string */
-void ast_channel_name_set_va(struct ast_channel *chan, const char *name_fmt, va_list ap) __attribute__((format(printf, 2, 0)));
+#define DECLARE_STRINGFIELD_SETTERS_FOR(field) void ast_channel_##field##_set(struct ast_channel *chan, const char *field); \
+void ast_channel_##field##_build_va(struct ast_channel *chan, const char *fmt, va_list ap) __attribute__((format(printf, 2, 0))); \
+void ast_channel_##field##_build(struct ast_channel *chan, const char *fmt, ...) __attribute__((format(printf, 2, 3)));
+
+DECLARE_STRINGFIELD_SETTERS_FOR(name)
+DECLARE_STRINGFIELD_SETTERS_FOR(language)
+DECLARE_STRINGFIELD_SETTERS_FOR(musicclass)
+DECLARE_STRINGFIELD_SETTERS_FOR(accountcode)
+DECLARE_STRINGFIELD_SETTERS_FOR(peeraccount)
+DECLARE_STRINGFIELD_SETTERS_FOR(userfield)
+DECLARE_STRINGFIELD_SETTERS_FOR(call_forward)
+DECLARE_STRINGFIELD_SETTERS_FOR(uniqueid)
+DECLARE_STRINGFIELD_SETTERS_FOR(linkedid)
+DECLARE_STRINGFIELD_SETTERS_FOR(parkinglot)
+DECLARE_STRINGFIELD_SETTERS_FOR(hangupsource)
+DECLARE_STRINGFIELD_SETTERS_FOR(dialcontext)
+       
+const char *ast_channel_name(const struct ast_channel *chan);
+const char *ast_channel_language(const struct ast_channel *chan);
+const char *ast_channel_musicclass(const struct ast_channel *chan);
+const char *ast_channel_accountcode(const struct ast_channel *chan);
+const char *ast_channel_peeraccount(const struct ast_channel *chan);
+const char *ast_channel_userfield(const struct ast_channel *chan);
+const char *ast_channel_call_forward(const struct ast_channel *chan);
+const char *ast_channel_uniqueid(const struct ast_channel *chan);
+const char *ast_channel_linkedid(const struct ast_channel *chan);
+const char *ast_channel_parkinglot(const struct ast_channel *chan);
+const char *ast_channel_hangupsource(const struct ast_channel *chan);
+const char *ast_channel_dialcontext(const struct ast_channel *chan);
 
 #endif /* _ASTERISK_CHANNEL_H */
index aaf4647b9438676cba8da0c0b9cb96781376de45..cb3b057cbb21e333dd58b6febd11bcde5f23dd0c 100644 (file)
@@ -1289,7 +1289,7 @@ static void aoc_request_event(const struct ast_aoc_decoded *decoded, struct ast_
 {
        if (chan) {
                ast_str_append(msg, 0, "Channel: %s\r\n", ast_channel_name(chan));
-               ast_str_append(msg, 0, "UniqueID: %s\r\n", chan->uniqueid);
+               ast_str_append(msg, 0, "UniqueID: %s\r\n", ast_channel_uniqueid(chan));
        }
 
        if (decoded->request_flag) {
@@ -1318,7 +1318,7 @@ static void aoc_s_event(const struct ast_aoc_decoded *decoded, struct ast_channe
 
        if (owner) {
                ast_str_append(msg, 0, "Channel: %s\r\n", ast_channel_name(owner));
-               ast_str_append(msg, 0, "UniqueID: %s\r\n", owner->uniqueid);
+               ast_str_append(msg, 0, "UniqueID: %s\r\n", ast_channel_uniqueid(owner));
        }
 
        ast_str_append(msg, 0, "NumberRates: %d\r\n", decoded->aoc_s_count);
@@ -1391,7 +1391,7 @@ static void aoc_d_event(const struct ast_aoc_decoded *decoded, struct ast_channe
 
        if (chan) {
                ast_str_append(msg, 0, "Channel: %s\r\n", ast_channel_name(chan));
-               ast_str_append(msg, 0, "UniqueID: %s\r\n", chan->uniqueid);
+               ast_str_append(msg, 0, "UniqueID: %s\r\n", ast_channel_uniqueid(chan));
        }
 
        charge_str = aoc_charge_type_str(decoded->charge_type);
@@ -1445,7 +1445,7 @@ static void aoc_e_event(const struct ast_aoc_decoded *decoded, struct ast_channe
 
        if (chan) {
                ast_str_append(msg, 0, "Channel: %s\r\n", ast_channel_name(chan));
-               ast_str_append(msg, 0, "UniqueID: %s\r\n", chan->uniqueid);
+               ast_str_append(msg, 0, "UniqueID: %s\r\n", ast_channel_uniqueid(chan));
        }
 
        charge_str = "ChargingAssociation";
index c27f713415b938bbca5dd2dcbd2418375b1be3cd..d7c14858179a2b8b45c588c4a7781aabad0173a6 100644 (file)
@@ -187,7 +187,7 @@ enum ast_getdata_result ast_app_getdata(struct ast_channel *c, const char *promp
        while ((front = strsep(&filename, "&"))) {
                ast_test_suite_event_notify("PLAYBACK", "Message: %s\r\nChannel: %s", front, ast_channel_name(c));
                if (!ast_strlen_zero(front)) {
-                       res = ast_streamfile(c, front, c->language);
+                       res = ast_streamfile(c, front, ast_channel_language(c));
                        if (res)
                                continue;
                }
@@ -229,7 +229,7 @@ int ast_app_getdata_full(struct ast_channel *c, const char *prompt, char *s, int
        int res, to = 2000, fto = 6000;
 
        if (!ast_strlen_zero(prompt)) {
-               res = ast_streamfile(c, prompt, c->language);
+               res = ast_streamfile(c, prompt, ast_channel_language(c));
                if (res < 0) {
                        return res;
                }
@@ -614,7 +614,7 @@ int ast_control_streamfile(struct ast_channel *chan, const char *file,
 
        for (;;) {
                ast_stopstream(chan);
-               res = ast_streamfile(chan, file, chan->language);
+               res = ast_streamfile(chan, file, ast_channel_language(chan));
                if (!res) {
                        if (pause_restart_point) {
                                ast_seekstream(chan->stream, pause_restart_point, SEEK_SET);
@@ -703,7 +703,7 @@ int ast_play_and_wait(struct ast_channel *chan, const char *fn)
        int d = 0;
 
        ast_test_suite_event_notify("PLAYBACK", "Message: %s\r\nChannel: %s", fn, ast_channel_name(chan));
-       if ((d = ast_streamfile(chan, fn, chan->language))) {
+       if ((d = ast_streamfile(chan, fn, ast_channel_language(chan)))) {
                return d;
        }
 
index d70e2337f8e155e12ca45d57cb214d66e46429f6..823f74d858ffedb8b2ad80ab92a9be33d461be78 100644 (file)
@@ -932,15 +932,15 @@ int ast_cdr_init(struct ast_cdr *cdr, struct ast_channel *c)
 
                        cdr->disposition = (c->_state == AST_STATE_UP) ?  AST_CDR_ANSWERED : AST_CDR_NOANSWER;
                        cdr->amaflags = c->amaflags ? c->amaflags :  ast_default_amaflags;
-                       ast_copy_string(cdr->accountcode, c->accountcode, sizeof(cdr->accountcode));
-                       ast_copy_string(cdr->peeraccount, c->peeraccount, sizeof(cdr->peeraccount));
+                       ast_copy_string(cdr->accountcode, ast_channel_accountcode(c), sizeof(cdr->accountcode));
+                       ast_copy_string(cdr->peeraccount, ast_channel_peeraccount(c), sizeof(cdr->peeraccount));
                        /* Destination information */
                        ast_copy_string(cdr->dst, S_OR(c->macroexten,c->exten), sizeof(cdr->dst));
                        ast_copy_string(cdr->dcontext, S_OR(c->macrocontext,c->context), sizeof(cdr->dcontext));
                        /* Unique call identifier */
-                       ast_copy_string(cdr->uniqueid, c->uniqueid, sizeof(cdr->uniqueid));
+                       ast_copy_string(cdr->uniqueid, ast_channel_uniqueid(c), sizeof(cdr->uniqueid));
                        /* Linked call identifier */
-                       ast_copy_string(cdr->linkedid, c->linkedid, sizeof(cdr->linkedid));
+                       ast_copy_string(cdr->linkedid, ast_channel_linkedid(c), sizeof(cdr->linkedid));
                }
        }
        return 0;
@@ -1022,14 +1022,14 @@ int ast_cdr_setaccount(struct ast_channel *chan, const char *account)
        struct ast_cdr *cdr = chan->cdr;
        const char *old_acct = "";
 
-       if (!ast_strlen_zero(chan->accountcode)) {
-               old_acct = ast_strdupa(chan->accountcode);
+       if (!ast_strlen_zero(ast_channel_accountcode(chan))) {
+               old_acct = ast_strdupa(ast_channel_accountcode(chan));
        }
 
-       ast_string_field_set(chan, accountcode, account);
+       ast_channel_accountcode_set(chan, account);
        for ( ; cdr ; cdr = cdr->next) {
                if (!ast_test_flag(cdr, AST_CDR_FLAG_LOCKED)) {
-                       ast_copy_string(cdr->accountcode, chan->accountcode, sizeof(cdr->accountcode));
+                       ast_copy_string(cdr->accountcode, ast_channel_accountcode(chan), sizeof(cdr->accountcode));
                }
        }
 
@@ -1038,7 +1038,7 @@ int ast_cdr_setaccount(struct ast_channel *chan, const char *account)
                        "Uniqueid: %s\r\n"
                        "AccountCode: %s\r\n"
                        "OldAccountCode: %s\r\n",
-                       ast_channel_name(chan), chan->uniqueid, chan->accountcode, old_acct);
+                       ast_channel_name(chan), ast_channel_uniqueid(chan), ast_channel_accountcode(chan), old_acct);
 
        return 0;
 }
@@ -1048,14 +1048,14 @@ int ast_cdr_setpeeraccount(struct ast_channel *chan, const char *account)
        struct ast_cdr *cdr = chan->cdr;
        const char *old_acct = "";
 
-       if (!ast_strlen_zero(chan->peeraccount)) {
-               old_acct = ast_strdupa(chan->peeraccount);
+       if (!ast_strlen_zero(ast_channel_peeraccount(chan))) {
+               old_acct = ast_strdupa(ast_channel_peeraccount(chan));
        }
 
-       ast_string_field_set(chan, peeraccount, account);
+       ast_channel_peeraccount_set(chan, account);
        for ( ; cdr ; cdr = cdr->next) {
                if (!ast_test_flag(cdr, AST_CDR_FLAG_LOCKED)) {
-                       ast_copy_string(cdr->peeraccount, chan->peeraccount, sizeof(cdr->peeraccount));
+                       ast_copy_string(cdr->peeraccount, ast_channel_peeraccount(chan), sizeof(cdr->peeraccount));
                }
        }
 
@@ -1064,7 +1064,7 @@ int ast_cdr_setpeeraccount(struct ast_channel *chan, const char *account)
                        "Uniqueid: %s\r\n"
                        "PeerAccount: %s\r\n"
                        "OldPeerAccount: %s\r\n",
-                       ast_channel_name(chan), chan->uniqueid, chan->peeraccount, old_acct);
+                       ast_channel_name(chan), ast_channel_uniqueid(chan), ast_channel_peeraccount(chan), old_acct);
 
        return 0;
 }
@@ -1119,9 +1119,9 @@ int ast_cdr_update(struct ast_channel *c)
                        set_one_cid(cdr, c);
 
                        /* Copy account code et-al */
-                       ast_copy_string(cdr->accountcode, c->accountcode, sizeof(cdr->accountcode));
-                       ast_copy_string(cdr->peeraccount, c->peeraccount, sizeof(cdr->peeraccount));
-                       ast_copy_string(cdr->linkedid, c->linkedid, sizeof(cdr->linkedid));
+                       ast_copy_string(cdr->accountcode, ast_channel_accountcode(c), sizeof(cdr->accountcode));
+                       ast_copy_string(cdr->peeraccount, ast_channel_peeraccount(c), sizeof(cdr->peeraccount));
+                       ast_copy_string(cdr->linkedid, ast_channel_linkedid(c), sizeof(cdr->linkedid));
 
                        /* Destination information */ /* XXX privilege macro* ? */
                        ast_copy_string(cdr->dst, S_OR(c->macroexten, c->exten), sizeof(cdr->dst));
index 534faed50ebcec7ac48529162c0809d331e9134b..6e8215f202a55b9b6fa6dd6d8ed0a008b4c0028f 100644 (file)
@@ -373,7 +373,7 @@ static int linkedid_match(void *obj, void *arg, void *data, int flags)
        int res;
 
        ast_channel_lock(c);
-       res = (c != find_dat->chan && c->linkedid && !strcmp(find_dat->linkedid, c->linkedid));
+       res = (c != find_dat->chan && ast_channel_linkedid(c) && !strcmp(find_dat->linkedid, ast_channel_linkedid(c)));
        ast_channel_unlock(c);
 
        return res ? CMP_MATCH | CMP_STOP : 0;
@@ -381,7 +381,7 @@ static int linkedid_match(void *obj, void *arg, void *data, int flags)
 
 void ast_cel_check_retire_linkedid(struct ast_channel *chan)
 {
-       const char *linkedid = chan->linkedid;
+       const char *linkedid = ast_channel_linkedid(chan);
        struct channel_find_data find_dat;
 
        /* make sure we need to do all this work */
@@ -459,11 +459,11 @@ struct ast_channel *ast_cel_fabricate_channel_from_event(const struct ast_event
        ast_copy_string(tchan->exten, record.extension, sizeof(tchan->exten));
        ast_copy_string(tchan->context, record.context, sizeof(tchan->context));
        ast_channel_name_set(tchan, record.channel_name);
-       ast_string_field_set(tchan, uniqueid, record.unique_id);
-       ast_string_field_set(tchan, linkedid, record.linked_id);
-       ast_string_field_set(tchan, accountcode, record.account_code);
-       ast_string_field_set(tchan, peeraccount, record.peer_account);
-       ast_string_field_set(tchan, userfield, record.user_field);
+       ast_channel_uniqueid_set(tchan, record.unique_id);
+       ast_channel_linkedid_set(tchan, record.linked_id);
+       ast_channel_accountcode_set(tchan, record.account_code);
+       ast_channel_peeraccount_set(tchan, record.peer_account);
+       ast_channel_userfield_set(tchan, record.user_field);
 
        if ((newvariable = ast_var_assign("BRIDGEPEER", record.peer))) {
                AST_LIST_INSERT_HEAD(headp, newvariable, entries);
@@ -561,11 +561,11 @@ int ast_cel_report_event(struct ast_channel *chan, enum ast_cel_event_type event
                AST_EVENT_IE_CEL_APPNAME, AST_EVENT_IE_PLTYPE_STR, S_OR(chan->appl, ""),
                AST_EVENT_IE_CEL_APPDATA, AST_EVENT_IE_PLTYPE_STR, S_OR(chan->data, ""),
                AST_EVENT_IE_CEL_AMAFLAGS, AST_EVENT_IE_PLTYPE_UINT, chan->amaflags,
-               AST_EVENT_IE_CEL_ACCTCODE, AST_EVENT_IE_PLTYPE_STR, chan->accountcode,
-               AST_EVENT_IE_CEL_PEERACCT, AST_EVENT_IE_PLTYPE_STR, chan->peeraccount,
-               AST_EVENT_IE_CEL_UNIQUEID, AST_EVENT_IE_PLTYPE_STR, chan->uniqueid,
-               AST_EVENT_IE_CEL_LINKEDID, AST_EVENT_IE_PLTYPE_STR, chan->linkedid,
-               AST_EVENT_IE_CEL_USERFIELD, AST_EVENT_IE_PLTYPE_STR, chan->userfield,
+               AST_EVENT_IE_CEL_ACCTCODE, AST_EVENT_IE_PLTYPE_STR, ast_channel_accountcode(chan),
+               AST_EVENT_IE_CEL_PEERACCT, AST_EVENT_IE_PLTYPE_STR, ast_channel_peeraccount(chan),
+               AST_EVENT_IE_CEL_UNIQUEID, AST_EVENT_IE_PLTYPE_STR, ast_channel_uniqueid(chan),
+               AST_EVENT_IE_CEL_LINKEDID, AST_EVENT_IE_PLTYPE_STR, ast_channel_linkedid(chan),
+               AST_EVENT_IE_CEL_USERFIELD, AST_EVENT_IE_PLTYPE_STR, ast_channel_userfield(chan),
                AST_EVENT_IE_CEL_EXTRA, AST_EVENT_IE_PLTYPE_STR, extra,
                AST_EVENT_IE_CEL_PEER, AST_EVENT_IE_PLTYPE_STR, peername,
                AST_EVENT_IE_END);
index cc675af97c33789f18e2f57bd9811043064b4d44..d0af7d0a2d151cefa0c1855f5caeab163ffa7c5c 100644 (file)
@@ -1036,17 +1036,17 @@ __ast_channel_alloc_ap(int needqueue, int state, const char *cid_num, const char
        tmp->fout = global_fout;
 
        if (ast_strlen_zero(ast_config_AST_SYSTEM_NAME)) {
-               ast_string_field_build(tmp, uniqueid, "%li.%d", (long) time(NULL), 
+               ast_channel_uniqueid_build(tmp, "%li.%d", (long) time(NULL), 
                        ast_atomic_fetchadd_int(&uniqueint, 1));
        } else {
-               ast_string_field_build(tmp, uniqueid, "%s-%li.%d", ast_config_AST_SYSTEM_NAME, 
+               ast_channel_uniqueid_build(tmp, "%s-%li.%d", ast_config_AST_SYSTEM_NAME, 
                        (long) time(NULL), ast_atomic_fetchadd_int(&uniqueint, 1));
        }
 
        if (!ast_strlen_zero(linkedid)) {
-               ast_string_field_set(tmp, linkedid, linkedid);
+               ast_channel_linkedid_set(tmp, linkedid);
        } else {
-               ast_string_field_set(tmp, linkedid, tmp->uniqueid);
+               ast_channel_linkedid_set(tmp, ast_channel_uniqueid(tmp));
        }
 
        if (!ast_strlen_zero(name_fmt)) {
@@ -1058,7 +1058,7 @@ __ast_channel_alloc_ap(int needqueue, int state, const char *cid_num, const char
                 * uses them to build the string, instead of forming the va_lists internally from the vararg ... list.
                 * This new function was written so this can be accomplished.
                 */
-               ast_channel_name_set_va(tmp, name_fmt, ap);
+               ast_channel_name_build_va(tmp, name_fmt, ap);
                tech = ast_strdupa(ast_channel_name(tmp));
                if ((slash = strchr(tech, '/'))) {
                        if ((slash2 = strchr(slash + 1, '/'))) {
@@ -1084,9 +1084,9 @@ __ast_channel_alloc_ap(int needqueue, int state, const char *cid_num, const char
                tmp->amaflags = ast_default_amaflags;
        
        if (!ast_strlen_zero(acctcode))
-               ast_string_field_set(tmp, accountcode, acctcode);
+               ast_channel_accountcode_set(tmp, acctcode);
        else
-               ast_string_field_set(tmp, accountcode, ast_default_accountcode);
+               ast_channel_accountcode_set(tmp, ast_default_accountcode);
                
        if (!ast_strlen_zero(context))
                ast_copy_string(tmp->context, context, sizeof(tmp->context));
@@ -1113,7 +1113,7 @@ __ast_channel_alloc_ap(int needqueue, int state, const char *cid_num, const char
 
        AST_LIST_HEAD_INIT_NOLOCK(&tmp->autochans);
        
-       ast_string_field_set(tmp, language, defaultlanguage);
+       ast_channel_language_set(tmp, defaultlanguage);
 
        tmp->tech = &null_tech;
 
@@ -1141,10 +1141,10 @@ __ast_channel_alloc_ap(int needqueue, int state, const char *cid_num, const char
                        ast_state2str(state),
                        S_OR(cid_num, ""),
                        S_OR(cid_name, ""),
-                       tmp->accountcode,
+                       ast_channel_accountcode(tmp),
                        S_OR(exten, ""),
                        S_OR(context, ""),
-                       tmp->uniqueid);
+                       ast_channel_uniqueid(tmp));
        }
 
        return tmp;
@@ -1344,7 +1344,7 @@ int ast_queue_hangup(struct ast_channel *chan)
                        "Channel: %s\r\n"
                        "Uniqueid: %s\r\n",
                        ast_channel_name(chan),
-                       chan->uniqueid);
+                       ast_channel_uniqueid(chan));
                ast_channel_unlock(chan);
        }
        return ast_queue_frame(chan, &f);
@@ -1369,7 +1369,7 @@ int ast_queue_hangup_with_cause(struct ast_channel *chan, int cause)
                        "Uniqueid: %s\r\n"
                        "Cause: %d\r\n",
                        ast_channel_name(chan),
-                       chan->uniqueid,
+                       ast_channel_uniqueid(chan),
                        cause);
                ast_channel_unlock(chan);
        }
@@ -1474,8 +1474,8 @@ static int ast_channel_by_uniqueid_cb(void *obj, void *arg, void *data, int flag
        }
 
        ast_channel_lock(chan);
-       if ((!name_len && strcasecmp(chan->uniqueid, uniqueid)) ||
-                       (name_len && strncasecmp(chan->uniqueid, uniqueid, name_len))) {
+       if ((!name_len && strcasecmp(ast_channel_uniqueid(chan), uniqueid)) ||
+                       (name_len && strncasecmp(ast_channel_uniqueid(chan), uniqueid, name_len))) {
                ret = 0;
        }
        ast_channel_unlock(chan);
@@ -1572,8 +1572,8 @@ static int ast_channel_cmp_cb(void *obj, void *arg, int flags)
                ret = ast_channel_by_name_cb(obj, arg, &name_len, flags);
        } else if (!ast_strlen_zero(cmp_args->exten)) {
                ret = ast_channel_by_exten_cb(obj, cmp_args->context, cmp_args->exten, flags);
-       } else if (!ast_strlen_zero(cmp_args->uniqueid)) {
-               ret = ast_channel_by_uniqueid_cb(obj, (void *) cmp_args->uniqueid, &name_len, flags);
+       } else if (!ast_strlen_zero(ast_channel_uniqueid(cmp_args))) {
+               ret = ast_channel_by_uniqueid_cb(obj, (void *) ast_channel_uniqueid(cmp_args), &name_len, flags);
        } else {
                ret = 0;
        }
@@ -2548,7 +2548,7 @@ int ast_softhangup(struct ast_channel *chan, int cause)
                "Uniqueid: %s\r\n"
                "Cause: %d\r\n",
                ast_channel_name(chan),
-               chan->uniqueid,
+               ast_channel_uniqueid(chan),
                cause);
        ast_channel_unlock(chan);
 
@@ -2579,15 +2579,15 @@ void ast_set_hangupsource(struct ast_channel *chan, const char *source, int forc
        struct ast_channel *bridge;
 
        ast_channel_lock(chan);
-       if (force || ast_strlen_zero(chan->hangupsource)) {
-               ast_string_field_set(chan, hangupsource, source);
+       if (force || ast_strlen_zero(ast_channel_hangupsource(chan))) {
+               ast_channel_hangupsource_set(chan, source);
        }
        bridge = ast_bridged_channel(chan);
        ast_channel_unlock(chan);
 
-       if (bridge && (force || ast_strlen_zero(bridge->hangupsource))) {
+       if (bridge && (force || ast_strlen_zero(ast_channel_hangupsource(bridge)))) {
                ast_channel_lock(bridge);
-               ast_string_field_set(chan, hangupsource, source);
+               ast_channel_hangupsource_set(chan, source);
                ast_channel_unlock(bridge);
        }
 }
@@ -2670,7 +2670,7 @@ int ast_hangup(struct ast_channel *chan)
        chan->generatordata = NULL;
        chan->generator = NULL;
 
-       snprintf(extra_str, sizeof(extra_str), "%d,%s,%s", chan->hangupcause, chan->hangupsource, S_OR(pbx_builtin_getvar_helper(chan, "DIALSTATUS"), ""));
+       snprintf(extra_str, sizeof(extra_str), "%d,%s,%s", chan->hangupcause, ast_channel_hangupsource(chan), S_OR(pbx_builtin_getvar_helper(chan, "DIALSTATUS"), ""));
        ast_cel_report_event(chan, AST_CEL_HANGUP, NULL, extra_str, NULL);
 
        if (ast_test_flag(chan, AST_FLAG_BLOCKING)) {
@@ -2707,7 +2707,7 @@ int ast_hangup(struct ast_channel *chan)
                "Cause: %d\r\n"
                "Cause-txt: %s\r\n",
                ast_channel_name(chan),
-               chan->uniqueid,
+               ast_channel_uniqueid(chan),
                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>"),
                S_COR(chan->connected.id.number.valid, chan->connected.id.number.str, "<unknown>"),
@@ -3475,7 +3475,7 @@ static void send_dtmf_event(struct ast_channel *chan, const char *direction, con
                        "Direction: %s\r\n"
                        "Begin: %s\r\n"
                        "End: %s\r\n",
-                       ast_channel_name(chan), chan->uniqueid, digit, direction, begin, end);
+                       ast_channel_name(chan), ast_channel_uniqueid(chan), digit, direction, begin, end);
 }
 
 static void ast_read_generator_actions(struct ast_channel *chan, struct ast_frame *f)
@@ -5256,7 +5256,7 @@ struct ast_channel *ast_call_forward(struct ast_channel *caller, struct ast_chan
        int res;
 
        /* gather data and request the new forward channel */
-       ast_copy_string(tmpchan, orig->call_forward, sizeof(tmpchan));
+       ast_copy_string(tmpchan, ast_channel_call_forward(orig), sizeof(tmpchan));
        if ((data = strchr(tmpchan, '/'))) {
                *data++ = '\0';
                type = tmpchan;
@@ -5264,7 +5264,7 @@ struct ast_channel *ast_call_forward(struct ast_channel *caller, struct ast_chan
                const char *forward_context;
                ast_channel_lock(orig);
                forward_context = pbx_builtin_getvar_helper(orig, "FORWARD_CONTEXT");
-               snprintf(tmpchan, sizeof(tmpchan), "%s@%s", orig->call_forward, S_OR(forward_context, orig->context));
+               snprintf(tmpchan, sizeof(tmpchan), "%s@%s", ast_channel_call_forward(orig), S_OR(forward_context, orig->context));
                ast_channel_unlock(orig);
                data = tmpchan;
                type = "Local";
@@ -5295,7 +5295,7 @@ struct ast_channel *ast_call_forward(struct ast_channel *caller, struct ast_chan
 
        ast_channel_lock_both(orig, new_chan);
        ast_copy_flags(new_chan->cdr, orig->cdr, AST_CDR_FLAG_ORIGINATED);
-       ast_string_field_set(new_chan, accountcode, orig->accountcode);
+       ast_channel_accountcode_set(new_chan, ast_channel_accountcode(orig));
        ast_party_connected_line_copy(&new_chan->connected, &orig->connected);
        ast_party_redirecting_copy(&new_chan->redirecting, &orig->redirecting);
        ast_channel_unlock(new_chan);
@@ -5394,7 +5394,7 @@ struct ast_channel *__ast_request_and_dial(const char *type, struct ast_format_c
                                break;
                        if (timeout > -1)
                                timeout = res;
-                       if (!ast_strlen_zero(chan->call_forward)) {
+                       if (!ast_strlen_zero(ast_channel_call_forward(chan))) {
                                if (!(chan = ast_call_forward(NULL, chan, NULL, cap, oh, outstate))) {
                                        return NULL;
                                }
@@ -6098,7 +6098,7 @@ int ast_channel_transfer_masquerade(
  */
 static void __ast_change_name_nolink(struct ast_channel *chan, const char *newname)
 {
-       ast_manager_event(chan, EVENT_FLAG_CALL, "Rename", "Channel: %s\r\nNewname: %s\r\nUniqueid: %s\r\n", ast_channel_name(chan), newname, chan->uniqueid);
+       ast_manager_event(chan, EVENT_FLAG_CALL, "Rename", "Channel: %s\r\nNewname: %s\r\nUniqueid: %s\r\n", ast_channel_name(chan), newname, ast_channel_uniqueid(chan));
        ast_channel_name_set(chan, newname);
 }
 
@@ -6244,11 +6244,11 @@ static const char *oldest_linkedid(const char *a, const char *b)
 static void ast_channel_change_linkedid(struct ast_channel *chan, const char *linkedid)
 {
        /* if the linkedid for this channel is being changed from something, check... */
-       if (!ast_strlen_zero(chan->linkedid) && 0 != strcmp(chan->linkedid, linkedid)) {
+       if (!ast_strlen_zero(ast_channel_linkedid(chan)) && 0 != strcmp(ast_channel_linkedid(chan), linkedid)) {
                ast_cel_check_retire_linkedid(chan);
        }
 
-       ast_string_field_set(chan, linkedid, linkedid);
+       ast_channel_linkedid_set(chan, linkedid);
 }
 
 
@@ -6261,21 +6261,21 @@ void ast_channel_set_linkgroup(struct ast_channel *chan, struct ast_channel *pee
        const char* linkedid=NULL;
        struct ast_channel *bridged;
 
-       linkedid = oldest_linkedid(chan->linkedid, peer->linkedid);
-       linkedid = oldest_linkedid(linkedid, chan->uniqueid);
-       linkedid = oldest_linkedid(linkedid, peer->uniqueid);
+       linkedid = oldest_linkedid(ast_channel_linkedid(chan), ast_channel_linkedid(peer));
+       linkedid = oldest_linkedid(linkedid, ast_channel_uniqueid(chan));
+       linkedid = oldest_linkedid(linkedid, ast_channel_uniqueid(peer));
        if (chan->_bridge) {
                bridged = ast_bridged_channel(chan);
                if (bridged != peer) {
-                       linkedid = oldest_linkedid(linkedid, bridged->linkedid);
-                       linkedid = oldest_linkedid(linkedid, bridged->uniqueid);
+                       linkedid = oldest_linkedid(linkedid, ast_channel_linkedid(bridged));
+                       linkedid = oldest_linkedid(linkedid, ast_channel_uniqueid(bridged));
                }
        }
        if (peer->_bridge) {
                bridged = ast_bridged_channel(peer);
                if (bridged != chan) {
-                       linkedid = oldest_linkedid(linkedid, bridged->linkedid);
-                       linkedid = oldest_linkedid(linkedid, bridged->uniqueid);
+                       linkedid = oldest_linkedid(linkedid, ast_channel_linkedid(bridged));
+                       linkedid = oldest_linkedid(linkedid, ast_channel_uniqueid(bridged));
                }
        }
 
@@ -6302,35 +6302,35 @@ void ast_channel_set_linkgroup(struct ast_channel *chan, struct ast_channel *pee
 static void ast_set_owners_and_peers(struct ast_channel *chan1,
                                                                         struct ast_channel *chan2)
 {
-       if (!ast_strlen_zero(chan1->accountcode) && ast_strlen_zero(chan2->peeraccount)) {
+       if (!ast_strlen_zero(ast_channel_accountcode(chan1)) && ast_strlen_zero(ast_channel_peeraccount(chan2))) {
                ast_debug(1, "setting peeraccount to %s for %s from data on channel %s\n",
-                               chan1->accountcode, ast_channel_name(chan2), ast_channel_name(chan1));
-               ast_string_field_set(chan2, peeraccount, chan1->accountcode);
+                               ast_channel_accountcode(chan1), ast_channel_name(chan2), ast_channel_name(chan1));
+               ast_channel_peeraccount_set(chan2, ast_channel_accountcode(chan1));
        }
-       if (!ast_strlen_zero(chan2->accountcode) && ast_strlen_zero(chan1->peeraccount)) {
+       if (!ast_strlen_zero(ast_channel_accountcode(chan2)) && ast_strlen_zero(ast_channel_peeraccount(chan1))) {
                ast_debug(1, "setting peeraccount to %s for %s from data on channel %s\n",
-                               chan2->accountcode, ast_channel_name(chan1), ast_channel_name(chan2));
-               ast_string_field_set(chan1, peeraccount, chan2->accountcode);
+                               ast_channel_accountcode(chan2), ast_channel_name(chan1), ast_channel_name(chan2));
+               ast_channel_peeraccount_set(chan1, ast_channel_accountcode(chan2));
        }
-       if (!ast_strlen_zero(chan1->peeraccount) && ast_strlen_zero(chan2->accountcode)) {
+       if (!ast_strlen_zero(ast_channel_peeraccount(chan1)) && ast_strlen_zero(ast_channel_accountcode(chan2))) {
                ast_debug(1, "setting accountcode to %s for %s from data on channel %s\n",
-                               chan1->peeraccount, ast_channel_name(chan2), ast_channel_name(chan1));
-               ast_string_field_set(chan2, accountcode, chan1->peeraccount);
+                               ast_channel_peeraccount(chan1), ast_channel_name(chan2), ast_channel_name(chan1));
+               ast_channel_accountcode_set(chan2, ast_channel_peeraccount(chan1));
        }
-       if (!ast_strlen_zero(chan2->peeraccount) && ast_strlen_zero(chan1->accountcode)) {
+       if (!ast_strlen_zero(ast_channel_peeraccount(chan2)) && ast_strlen_zero(ast_channel_accountcode(chan1))) {
                ast_debug(1, "setting accountcode to %s for %s from data on channel %s\n",
-                               chan2->peeraccount, ast_channel_name(chan1), ast_channel_name(chan2));
-               ast_string_field_set(chan1, accountcode, chan2->peeraccount);
+                               ast_channel_peeraccount(chan2), ast_channel_name(chan1), ast_channel_name(chan2));
+               ast_channel_accountcode_set(chan1, ast_channel_peeraccount(chan2));
        }
-       if (0 != strcmp(chan1->accountcode, chan2->peeraccount)) {
+       if (0 != strcmp(ast_channel_accountcode(chan1), ast_channel_peeraccount(chan2))) {
                ast_debug(1, "changing peeraccount from %s to %s on %s to match channel %s\n",
-                               chan2->peeraccount, chan1->peeraccount, ast_channel_name(chan2), ast_channel_name(chan1));
-               ast_string_field_set(chan2, peeraccount, chan1->accountcode);
+                               ast_channel_peeraccount(chan2), ast_channel_peeraccount(chan1), ast_channel_name(chan2), ast_channel_name(chan1));
+               ast_channel_peeraccount_set(chan2, ast_channel_accountcode(chan1));
        }
-       if (0 != strcmp(chan2->accountcode, chan1->peeraccount)) {
+       if (0 != strcmp(ast_channel_accountcode(chan2), ast_channel_peeraccount(chan1))) {
                ast_debug(1, "changing peeraccount from %s to %s on %s to match channel %s\n",
-                               chan1->peeraccount, chan2->peeraccount, ast_channel_name(chan1), ast_channel_name(chan2));
-               ast_string_field_set(chan1, peeraccount, chan2->accountcode);
+                               ast_channel_peeraccount(chan1), ast_channel_peeraccount(chan2), ast_channel_name(chan1), ast_channel_name(chan2));
+               ast_channel_peeraccount_set(chan1, ast_channel_accountcode(chan2));
        }
 }
 
@@ -6351,7 +6351,7 @@ static void report_new_callerid(struct ast_channel *chan)
                ast_channel_name(chan),
                S_COR(chan->caller.id.number.valid, chan->caller.id.number.str, ""),
                S_COR(chan->caller.id.name.valid, chan->caller.id.name.str, ""),
-               chan->uniqueid,
+               ast_channel_uniqueid(chan),
                pres,
                ast_describe_caller_presentation(pres)
                );
@@ -6660,7 +6660,7 @@ int ast_do_masquerade(struct ast_channel *original)
        clonechan->monitor = t_pvt;
 
        /* Keep the same language.  */
-       ast_string_field_set(original, language, clonechan->language);
+       ast_channel_language_set(original, ast_channel_language(clonechan));
        /* Copy the FD's other than the generator fd */
        for (x = 0; x < AST_MAX_FDS; x++) {
                if (x != AST_GENERATOR_FD)
@@ -6737,13 +6737,13 @@ int ast_do_masquerade(struct ast_channel *original)
        ast_set_read_format(original, &rformat);
 
        /* Copy the music class */
-       ast_string_field_set(original, musicclass, clonechan->musicclass);
+       ast_channel_musicclass_set(original, ast_channel_musicclass(clonechan));
 
        /* copy over accuntcode and set peeraccount across the bridge */
-       ast_string_field_set(original, accountcode, S_OR(clonechan->accountcode, ""));
+       ast_channel_accountcode_set(original, S_OR(ast_channel_accountcode(clonechan), ""));
        if (original->_bridge) {
                /* XXX - should we try to lock original->_bridge here? */
-               ast_string_field_set(original->_bridge, peeraccount, S_OR(clonechan->accountcode, ""));
+               ast_channel_peeraccount_set(original->_bridge, S_OR(ast_channel_accountcode(clonechan), ""));
                ast_cel_report_event(original, AST_CEL_BRIDGE_UPDATE, NULL, NULL, NULL);
        }
 
@@ -6787,7 +6787,7 @@ int ast_do_masquerade(struct ast_channel *original)
                        "Cause: %d\r\n"
                        "Cause-txt: %s\r\n",
                        ast_channel_name(clonechan),
-                       clonechan->uniqueid,
+                       ast_channel_uniqueid(clonechan),
                        clonechan->hangupcause,
                        ast_cause2str(clonechan->hangupcause)
                        );
@@ -6942,7 +6942,7 @@ int ast_setstate(struct ast_channel *chan, enum ast_channel_state state)
                S_COR(chan->caller.id.name.valid, chan->caller.id.name.str, ""),
                S_COR(chan->connected.id.number.valid, chan->connected.id.number.str, ""),
                S_COR(chan->connected.id.name.valid, chan->connected.id.name.str, ""),
-               chan->uniqueid);
+               ast_channel_uniqueid(chan));
 
        return 0;
 }
@@ -6977,11 +6977,11 @@ static void bridge_playfile(struct ast_channel *chan, struct ast_channel *peer,
        if (!strcmp(sound,"timeleft")) {        /* Queue support */
                ast_stream_and_wait(chan, "vm-youhave", "");
                if (min) {
-                       ast_say_number(chan, min, AST_DIGIT_ANY, chan->language, NULL);
+                       ast_say_number(chan, min, AST_DIGIT_ANY, ast_channel_language(chan), NULL);
                        ast_stream_and_wait(chan, "queue-minutes", "");
                }
                if (sec) {
-                       ast_say_number(chan, sec, AST_DIGIT_ANY, chan->language, NULL);
+                       ast_say_number(chan, sec, AST_DIGIT_ANY, ast_channel_language(chan), NULL);
                        ast_stream_and_wait(chan, "queue-seconds", "");
                }
        } else {
@@ -7232,7 +7232,7 @@ static void manager_bridge_event(int onoff, int type, struct ast_channel *c0, st
                onoff ? "Link" : "Unlink",
                type == 1 ? "core" : "native",
                ast_channel_name(c0), ast_channel_name(c1),
-               c0->uniqueid, c1->uniqueid,
+               ast_channel_uniqueid(c0), ast_channel_uniqueid(c1),
                S_COR(c0->caller.id.number.valid, c0->caller.id.number.str, ""),
                S_COR(c1->caller.id.number.valid, c1->caller.id.number.str, ""));
 }
index 0e624dfb3e989c2171756ff117257a6367cdc357..92e2d7e422e51a41572dea43f2ce5add3e1c57b9 100644 (file)
@@ -56,17 +56,17 @@ AST_DATA_STRUCTURE(ast_callerid, DATA_EXPORT_CALLERID);
        MEMBER(ast_channel, appl, AST_DATA_STRING)                              \
        MEMBER(ast_channel, data, AST_DATA_STRING)                              \
        MEMBER(ast_channel, __do_not_use_name, AST_DATA_STRING) \
-       MEMBER(ast_channel, language, AST_DATA_STRING)                          \
-       MEMBER(ast_channel, musicclass, AST_DATA_STRING)                        \
-       MEMBER(ast_channel, accountcode, AST_DATA_STRING)                       \
-       MEMBER(ast_channel, peeraccount, AST_DATA_STRING)                       \
-       MEMBER(ast_channel, userfield, AST_DATA_STRING)                         \
-       MEMBER(ast_channel, call_forward, AST_DATA_STRING)                      \
-       MEMBER(ast_channel, uniqueid, AST_DATA_STRING)                          \
-       MEMBER(ast_channel, linkedid, AST_DATA_STRING)                          \
-       MEMBER(ast_channel, parkinglot, AST_DATA_STRING)                        \
-       MEMBER(ast_channel, hangupsource, AST_DATA_STRING)                      \
-       MEMBER(ast_channel, dialcontext, AST_DATA_STRING)                       \
+       MEMBER(ast_channel, __do_not_use_language, AST_DATA_STRING)                             \
+       MEMBER(ast_channel, __do_not_use_musicclass, AST_DATA_STRING)                   \
+       MEMBER(ast_channel, __do_not_use_accountcode, AST_DATA_STRING)                  \
+       MEMBER(ast_channel, __do_not_use_peeraccount, AST_DATA_STRING)                  \
+       MEMBER(ast_channel, __do_not_use_userfield, AST_DATA_STRING)                            \
+       MEMBER(ast_channel, __do_not_use_call_forward, AST_DATA_STRING)                 \
+       MEMBER(ast_channel, __do_not_use_uniqueid, AST_DATA_STRING)                             \
+       MEMBER(ast_channel, __do_not_use_linkedid, AST_DATA_STRING)                             \
+       MEMBER(ast_channel, __do_not_use_parkinglot, AST_DATA_STRING)                   \
+       MEMBER(ast_channel, __do_not_use_hangupsource, AST_DATA_STRING)                 \
+       MEMBER(ast_channel, __do_not_use_dialcontext, AST_DATA_STRING)                  \
        MEMBER(ast_channel, rings, AST_DATA_INTEGER)                            \
        MEMBER(ast_channel, priority, AST_DATA_INTEGER)                         \
        MEMBER(ast_channel, macropriority, AST_DATA_INTEGER)                    \
@@ -245,17 +245,51 @@ int ast_channel_data_cmp_structure(const struct ast_data_search *tree,
 
 /* ACCESSORS */
 
-const char *ast_channel_name(const struct ast_channel *chan)
-{
-       return chan->__do_not_use_name;
+#define DEFINE_STRINGFIELD_SETTERS_FOR(field) \
+void ast_channel_##field##_set(struct ast_channel *chan, const char *value) \
+{ \
+       ast_string_field_set(chan, __do_not_use_##field, value); \
+} \
+  \
+void ast_channel_##field##_build_va(struct ast_channel *chan, const char *fmt, va_list ap) \
+{ \
+       ast_string_field_build_va(chan, __do_not_use_##field, fmt, ap); \
+} \
+void ast_channel_##field##_build(struct ast_channel *chan, const char *fmt, ...) \
+{ \
+       va_list ap; \
+       va_start(ap, fmt); \
+       ast_channel_##field##_build_va(chan, fmt, ap); \
+       va_end(ap); \
 }
 
-void ast_channel_name_set(struct ast_channel *chan, const char *name)
-{
-       ast_string_field_set(chan, __do_not_use_name, name);
+DEFINE_STRINGFIELD_SETTERS_FOR(name)
+DEFINE_STRINGFIELD_SETTERS_FOR(language)
+DEFINE_STRINGFIELD_SETTERS_FOR(musicclass)
+DEFINE_STRINGFIELD_SETTERS_FOR(accountcode)
+DEFINE_STRINGFIELD_SETTERS_FOR(peeraccount)
+DEFINE_STRINGFIELD_SETTERS_FOR(userfield)
+DEFINE_STRINGFIELD_SETTERS_FOR(call_forward)
+DEFINE_STRINGFIELD_SETTERS_FOR(uniqueid)
+DEFINE_STRINGFIELD_SETTERS_FOR(linkedid)
+DEFINE_STRINGFIELD_SETTERS_FOR(parkinglot)
+DEFINE_STRINGFIELD_SETTERS_FOR(hangupsource)
+DEFINE_STRINGFIELD_SETTERS_FOR(dialcontext)
+
+#define DEFINE_STRINGFIELD_GETTER_FOR(field) const char *ast_channel_##field(const struct ast_channel *chan) \
+{ \
+       return chan->__do_not_use_##field; \
 }
 
-void ast_channel_name_set_va(struct ast_channel *chan, const char *name_fmt, va_list ap)
-{
-       ast_string_field_build_va(chan, __do_not_use_name, name_fmt, ap);
-}
+DEFINE_STRINGFIELD_GETTER_FOR(name)
+DEFINE_STRINGFIELD_GETTER_FOR(language)
+DEFINE_STRINGFIELD_GETTER_FOR(musicclass)
+DEFINE_STRINGFIELD_GETTER_FOR(accountcode)
+DEFINE_STRINGFIELD_GETTER_FOR(peeraccount)
+DEFINE_STRINGFIELD_GETTER_FOR(userfield)
+DEFINE_STRINGFIELD_GETTER_FOR(call_forward)
+DEFINE_STRINGFIELD_GETTER_FOR(uniqueid)
+DEFINE_STRINGFIELD_GETTER_FOR(linkedid)
+DEFINE_STRINGFIELD_GETTER_FOR(parkinglot)
+DEFINE_STRINGFIELD_GETTER_FOR(hangupsource)
+DEFINE_STRINGFIELD_GETTER_FOR(dialcontext)
index 1923dd3d36eb69d340692bbc7a20c5fd670e5465..69521e1cdddadc8f843d38b1c4e49db82cf9f944 100644 (file)
@@ -918,20 +918,20 @@ static char *handle_chanlist(struct ast_cli_entry *e, int cmd, struct ast_cli_ar
                                        c->appl ? c->appl : "(None)",
                                        S_OR(c->data, ""),      /* XXX different from verbose ? */
                                        S_COR(c->caller.id.number.valid, c->caller.id.number.str, ""),
-                                       S_OR(c->accountcode, ""),
-                                       S_OR(c->peeraccount, ""),
+                                       S_OR(ast_channel_accountcode(c), ""),
+                                       S_OR(ast_channel_peeraccount(c), ""),
                                        c->amaflags, 
                                        durbuf,
                                        bc ? ast_channel_name(bc) : "(None)",
-                                       c->uniqueid);
+                                       ast_channel_uniqueid(c));
                        } else if (verbose) {
                                ast_cli(a->fd, VERBOSE_FORMAT_STRING, ast_channel_name(c), c->context, c->exten, c->priority, ast_state2str(c->_state),
                                        c->appl ? c->appl : "(None)",
                                        c->data ? S_OR(c->data, "(Empty)" ): "(None)",
                                        S_COR(c->caller.id.number.valid, c->caller.id.number.str, ""),
                                        durbuf,
-                                       S_OR(c->accountcode, ""),
-                                       S_OR(c->peeraccount, ""),
+                                       S_OR(ast_channel_accountcode(c), ""),
+                                       S_OR(ast_channel_peeraccount(c), ""),
                                        bc ? ast_channel_name(bc) : "(None)");
                        } else {
                                char locbuf[40] = "(None)";
@@ -1475,13 +1475,13 @@ static char *handle_showchan(struct ast_cli_entry *e, int cmd, struct ast_cli_ar
                "    Application: %s\n"
                "           Data: %s\n"
                "    Blocking in: %s\n",
-               ast_channel_name(c), c->tech->type, c->uniqueid, c->linkedid,
+               ast_channel_name(c), c->tech->type, 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)"),
-               c->language,    
+               ast_channel_language(c),        
                ast_state2str(c->_state), c->_state, c->rings, 
                ast_getformatname_multiple(nf, sizeof(nf), c->nativeformats),
                ast_getformatname(&c->writeformat),
index 7fe49be33146cb10d9ce8001b31cc141b5dc999b..a18e065051d500298c2d023fe69db2c635c5a46c 100644 (file)
@@ -286,10 +286,10 @@ static int begin_dial_channel(struct ast_dial_channel *channel, struct ast_chann
 
                ast_connected_line_copy_from_caller(&channel->owner->connected, &chan->caller);
 
-               ast_string_field_set(channel->owner, language, chan->language);
-               ast_string_field_set(channel->owner, accountcode, chan->accountcode);
-               if (ast_strlen_zero(channel->owner->musicclass))
-                       ast_string_field_set(channel->owner, musicclass, chan->musicclass);
+               ast_channel_language_set(channel->owner, ast_channel_language(chan));
+               ast_channel_accountcode_set(channel->owner, ast_channel_accountcode(chan));
+               if (ast_strlen_zero(ast_channel_musicclass(channel->owner)))
+                       ast_channel_musicclass_set(channel->owner, ast_channel_musicclass(chan));
 
                channel->owner->adsicpe = chan->adsicpe;
                channel->owner->transfercapability = chan->transfercapability;
@@ -331,7 +331,7 @@ static int begin_dial(struct ast_dial *dial, struct ast_channel *chan)
 static int handle_call_forward(struct ast_dial *dial, struct ast_dial_channel *channel, struct ast_channel *chan)
 {
        struct ast_channel *original = channel->owner;
-       char *tmp = ast_strdupa(channel->owner->call_forward);
+       char *tmp = ast_strdupa(ast_channel_call_forward(channel->owner));
        char *tech = "Local", *device = tmp, *stuff;
 
        /* If call forwarding is disabled just drop the original channel and don't attempt to dial the new one */
@@ -567,11 +567,11 @@ static enum ast_dial_result monitor_dial(struct ast_dial *dial, struct ast_chann
                        ast_indicate(chan, AST_CONTROL_RINGING);
        } else if (chan && dial->options[AST_DIAL_OPTION_MUSIC] && 
                !ast_strlen_zero(dial->options[AST_DIAL_OPTION_MUSIC])) {
-               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, dial->options[AST_DIAL_OPTION_MUSIC]);
+               ast_channel_musicclass_set(chan, dial->options[AST_DIAL_OPTION_MUSIC]);
                ast_moh_start(chan, dial->options[AST_DIAL_OPTION_MUSIC], NULL);
-               ast_string_field_set(chan, musicclass, original_moh);
+               ast_channel_musicclass_set(chan, original_moh);
        }
 
        /* Record start time for timeout purposes */
@@ -628,7 +628,7 @@ static enum ast_dial_result monitor_dial(struct ast_dial *dial, struct ast_chann
                        channel = find_relative_dial_channel(dial, who);
 
                /* See if this channel has been forwarded elsewhere */
-               if (!ast_strlen_zero(who->call_forward)) {
+               if (!ast_strlen_zero(ast_channel_call_forward(who))) {
                        handle_call_forward(dial, channel, chan);
                        continue;
                }
index 3232f22b2829911ad91a21a15363b35ac11a8c41..a053d50ee9ade9e4e8f8d63ac35516d7d34acdc8 100644 (file)
@@ -868,7 +868,7 @@ static void check_goto_on_transfer(struct ast_channel *chan)
 
        ast_debug(1, "Attempting GOTO_ON_BLINDXFR=%s for %s.\n", val, ast_channel_name(chan));
 
-       xferchan = ast_channel_alloc(0, AST_STATE_DOWN, 0, 0, "", "", "", chan->linkedid, 0,
+       xferchan = ast_channel_alloc(0, AST_STATE_DOWN, 0, 0, "", "", "", ast_channel_linkedid(chan), 0,
                "%s", ast_channel_name(chan));
        if (!xferchan) {
                return;
@@ -1003,9 +1003,9 @@ static const char *findparkinglotname(struct ast_channel *chan)
 
        /* The channel variable overrides everything */
        name = pbx_builtin_getvar_helper(chan, "PARKINGLOT");
-       if (!name && !ast_strlen_zero(chan->parkinglot)) {
+       if (!name && !ast_strlen_zero(ast_channel_parkinglot(chan))) {
                /* Use the channel's parking lot. */
-               name = chan->parkinglot;
+               name = ast_channel_parkinglot(chan);
        }
        return name;
 }
@@ -1514,7 +1514,7 @@ static int park_call_full(struct ast_channel *chan, struct ast_channel *peer, st
                S_COR(pu->chan->caller.id.name.valid, pu->chan->caller.id.name.str, "<unknown>"),
                S_COR(pu->chan->connected.id.number.valid, pu->chan->connected.id.number.str, "<unknown>"),
                S_COR(pu->chan->connected.id.name.valid, pu->chan->connected.id.name.str, "<unknown>"),
-               pu->chan->uniqueid
+               ast_channel_uniqueid(pu->chan)
                );
 
        if (peer && adsipark && ast_adsi_available(peer)) {
@@ -1544,7 +1544,7 @@ static int park_call_full(struct ast_channel *chan, struct ast_channel *peer, st
                 */
                ast_set_flag(peer, AST_FLAG_MASQ_NOSTREAM);
                /* Tell the peer channel the number of the parking space */
-               ast_say_digits(peer, pu->parkingnum, "", peer->language);
+               ast_say_digits(peer, pu->parkingnum, "", ast_channel_language(peer));
                ast_clear_flag(peer, AST_FLAG_MASQ_NOSTREAM);
        }
        if (peer == chan) { /* pu->notquiteyet = 1 */
@@ -1635,8 +1635,8 @@ static int masq_park_call(struct ast_channel *rchan, struct ast_channel *peer, s
        struct ast_channel *chan;
 
        /* Make a new, channel that we'll use to masquerade in the real one */
-       chan = ast_channel_alloc(0, AST_STATE_DOWN, 0, 0, rchan->accountcode, rchan->exten,
-               rchan->context, rchan->linkedid, rchan->amaflags, "Parked/%s", ast_channel_name(rchan));
+       chan = ast_channel_alloc(0, AST_STATE_DOWN, 0, 0, ast_channel_accountcode(rchan), rchan->exten,
+               rchan->context, ast_channel_linkedid(rchan), rchan->amaflags, "Parked/%s", ast_channel_name(rchan));
        if (!chan) {
                ast_log(LOG_WARNING, "Unable to create parked channel\n");
                if (!ast_test_flag(args, AST_PARK_OPT_SILENCE)) {
@@ -2533,7 +2533,7 @@ static int builtin_atxfer(struct ast_channel *chan, struct ast_channel *peer, st
        /* Dial party C */
        newchan = feature_request_and_dial(transferer, transferer_name_orig, transferer,
                transferee, "Local", transferer->nativeformats, xferto,
-               atxfernoanswertimeout, &outstate, transferer->language);
+               atxfernoanswertimeout, &outstate, ast_channel_language(transferer));
        ast_debug(2, "Dial party C result: newchan:%d, outstate:%d\n", !!newchan, outstate);
 
        if (!ast_check_hangup(transferer)) {
@@ -2640,7 +2640,7 @@ static int builtin_atxfer(struct ast_channel *chan, struct ast_channel *peer, st
                                newchan = feature_request_and_dial(transferer, transferer_name_orig,
                                        transferee, transferee, transferer_tech,
                                        transferee->nativeformats, transferer_name,
-                                       atxfernoanswertimeout, &outstate, transferer->language);
+                                       atxfernoanswertimeout, &outstate, ast_channel_language(transferer));
                                ast_debug(2, "Dial party B result: newchan:%d, outstate:%d\n",
                                        !!newchan, outstate);
                                if (newchan || ast_check_hangup(transferee)) {
@@ -2669,7 +2669,7 @@ static int builtin_atxfer(struct ast_channel *chan, struct ast_channel *peer, st
                                newchan = feature_request_and_dial(transferer, transferer_name_orig,
                                        transferer, transferee, "Local",
                                        transferee->nativeformats, xferto,
-                                       atxfernoanswertimeout, &outstate, transferer->language);
+                                       atxfernoanswertimeout, &outstate, ast_channel_language(transferer));
                                ast_debug(2, "Redial party C result: newchan:%d, outstate:%d\n",
                                        !!newchan, outstate);
                                if (newchan || ast_check_hangup(transferee)) {
@@ -2710,7 +2710,7 @@ static int builtin_atxfer(struct ast_channel *chan, struct ast_channel *peer, st
        /* Initiate the channel transfer of party A to party C (or recalled party B). */
        ast_cel_report_event(transferee, AST_CEL_ATTENDEDTRANSFER, NULL, NULL, newchan);
 
-       xferchan = ast_channel_alloc(0, AST_STATE_DOWN, 0, 0, "", "", "", transferee->linkedid, 0, "Transfered/%s", ast_channel_name(transferee));
+       xferchan = ast_channel_alloc(0, AST_STATE_DOWN, 0, 0, "", "", "", ast_channel_linkedid(transferee), 0, "Transfered/%s", ast_channel_name(transferee));
        if (!xferchan) {
                ast_hangup(newchan);
                ast_party_connected_line_free(&connected_line);
@@ -3444,7 +3444,7 @@ static struct ast_channel *feature_request_and_dial(struct ast_channel *caller,
                goto done;
        }
 
-       ast_string_field_set(chan, language, language);
+       ast_channel_language_set(chan, language);
        ast_channel_inherit_variables(caller, chan);
        pbx_builtin_setvar_helper(chan, "TRANSFERERNAME", caller_name);
 
@@ -3545,7 +3545,7 @@ static struct ast_channel *feature_request_and_dial(struct ast_channel *caller,
                                }
                        }
                } else if (chan == active_channel) {
-                       if (!ast_strlen_zero(chan->call_forward)) {
+                       if (!ast_strlen_zero(ast_channel_call_forward(chan))) {
                                state = 0;
                                ast_autoservice_start(transferee);
                                chan = ast_call_forward(caller, chan, NULL, tmp_cap, NULL, &state);
@@ -3701,10 +3701,10 @@ void ast_channel_log(char *title, struct ast_channel *chan) /* for debug, this i
        ast_log(LOG_NOTICE, "CHAN: name: %s;  appl: %s; data: %s; contxt: %s;  exten: %s; pri: %d;\n",
                ast_channel_name(chan), chan->appl, chan->data, chan->context, chan->exten, chan->priority);
        ast_log(LOG_NOTICE, "CHAN: acctcode: %s;  dialcontext: %s; amaflags: %x; maccontxt: %s;  macexten: %s; macpri: %d;\n",
-               chan->accountcode, chan->dialcontext, chan->amaflags, chan->macrocontext, chan->macroexten, chan->macropriority);
+               ast_channel_accountcode(chan), ast_channel_dialcontext(chan), chan->amaflags, chan->macrocontext, chan->macroexten, chan->macropriority);
        ast_log(LOG_NOTICE, "CHAN: masq: %p;  masqr: %p; _bridge: %p; uniqueID: %s; linkedID:%s\n",
                chan->masq, chan->masqr,
-               chan->_bridge, chan->uniqueid, chan->linkedid);
+               chan->_bridge, ast_channel_uniqueid(chan), ast_channel_linkedid(chan));
        if (chan->masqr) {
                ast_log(LOG_NOTICE, "CHAN: masquerading as: %s;  cdr: %p;\n",
                        ast_channel_name(chan->masqr), chan->masqr->cdr);
@@ -3955,19 +3955,19 @@ int ast_bridge_call(struct ast_channel *chan, struct ast_channel *peer, struct a
                        if (peer_cdr && !ast_strlen_zero(peer_cdr->userfield)) {
                                ast_copy_string(bridge_cdr->userfield, peer_cdr->userfield, sizeof(bridge_cdr->userfield));
                        }
-                       ast_cdr_setaccount(peer, chan->accountcode);
+                       ast_cdr_setaccount(peer, ast_channel_accountcode(chan));
                } else {
                        /* better yet, in a xfer situation, find out why the chan cdr got zapped (pun unintentional) */
                        bridge_cdr = ast_cdr_alloc(); /* this should be really, really rare/impossible? */
                        ast_copy_string(bridge_cdr->channel, ast_channel_name(chan), sizeof(bridge_cdr->channel));
                        ast_copy_string(bridge_cdr->dstchannel, ast_channel_name(peer), sizeof(bridge_cdr->dstchannel));
-                       ast_copy_string(bridge_cdr->uniqueid, chan->uniqueid, sizeof(bridge_cdr->uniqueid));
+                       ast_copy_string(bridge_cdr->uniqueid, ast_channel_uniqueid(chan), sizeof(bridge_cdr->uniqueid));
                        ast_copy_string(bridge_cdr->lastapp, S_OR(chan->appl, ""), sizeof(bridge_cdr->lastapp));
                        ast_copy_string(bridge_cdr->lastdata, S_OR(chan->data, ""), sizeof(bridge_cdr->lastdata));
                        ast_cdr_setcid(bridge_cdr, chan);
                        bridge_cdr->disposition = (chan->_state == AST_STATE_UP) ?  AST_CDR_ANSWERED : AST_CDR_NULL;
                        bridge_cdr->amaflags = chan->amaflags ? chan->amaflags :  ast_default_amaflags;
-                       ast_copy_string(bridge_cdr->accountcode, chan->accountcode, sizeof(bridge_cdr->accountcode));
+                       ast_copy_string(bridge_cdr->accountcode, ast_channel_accountcode(chan), sizeof(bridge_cdr->accountcode));
                        /* Destination information */
                        ast_copy_string(bridge_cdr->dst, chan->exten, sizeof(bridge_cdr->dst));
                        ast_copy_string(bridge_cdr->dcontext, chan->context, sizeof(bridge_cdr->dcontext));
@@ -4512,7 +4512,7 @@ static void post_manager_event(const char *s, struct parkeduser *pu)
                S_COR(pu->chan->caller.id.name.valid, pu->chan->caller.id.name.str, "<unknown>"),
                S_COR(pu->chan->connected.id.number.valid, pu->chan->connected.id.number.str, "<unknown>"),
                S_COR(pu->chan->connected.id.name.valid, pu->chan->connected.id.name.str, "<unknown>"),
-               pu->chan->uniqueid
+               ast_channel_uniqueid(pu->chan)
                );
 }
 
@@ -6868,7 +6868,7 @@ static int action_bridge(struct mansession *s, const struct message *m)
 
        /* create the placeholder channels and grab the other channels */
        if (!(tmpchana = ast_channel_alloc(0, AST_STATE_DOWN, NULL, NULL, NULL, 
-               NULL, NULL, chana->linkedid, 0, "Bridge/%s", ast_channel_name(chana)))) {
+               NULL, NULL, ast_channel_linkedid(chana), 0, "Bridge/%s", ast_channel_name(chana)))) {
                astman_send_error(s, m, "Unable to create temporary channel!");
                chana = ast_channel_unref(chana);
                return 1;
@@ -6895,7 +6895,7 @@ static int action_bridge(struct mansession *s, const struct message *m)
 
        /* create the placeholder channels and grab the other channels */
        if (!(tmpchanb = ast_channel_alloc(0, AST_STATE_DOWN, NULL, NULL, NULL, 
-               NULL, NULL, chanb->linkedid, 0, "Bridge/%s", ast_channel_name(chanb)))) {
+               NULL, NULL, ast_channel_linkedid(chanb), 0, "Bridge/%s", ast_channel_name(chanb)))) {
                astman_send_error(s, m, "Unable to create temporary channels!");
                ast_hangup(tmpchana);
                chanb = ast_channel_unref(chanb);
@@ -6929,7 +6929,7 @@ static int action_bridge(struct mansession *s, const struct message *m)
        tobj->return_to_pbx = 1;
 
        if (ast_true(playtone)) {
-               if (!ast_strlen_zero(xfersound) && !ast_streamfile(tmpchanb, xfersound, tmpchanb->language)) {
+               if (!ast_strlen_zero(xfersound) && !ast_streamfile(tmpchanb, xfersound, ast_channel_language(tmpchanb))) {
                        if (ast_waitstream(tmpchanb, "") < 0)
                                ast_log(LOG_WARNING, "Failed to play a courtesy tone on chan %s\n", ast_channel_name(tmpchanb));
                }
@@ -7559,7 +7559,7 @@ static int bridge_exec(struct ast_channel *chan, const char *data)
 
        /* try to allocate a place holder where current_dest_chan will be placed */
        if (!(final_dest_chan = ast_channel_alloc(0, AST_STATE_DOWN, NULL, NULL, NULL, 
-               NULL, NULL, current_dest_chan->linkedid, 0, "Bridge/%s", ast_channel_name(current_dest_chan)))) {
+               NULL, NULL, ast_channel_linkedid(current_dest_chan), 0, "Bridge/%s", ast_channel_name(current_dest_chan)))) {
                ast_log(LOG_WARNING, "Cannot create placeholder channel for chan %s\n", args.dest_chan);
                ast_manager_event(chan, EVENT_FLAG_CALL, "BridgeExec",
                                        "Response: Failed\r\n"
@@ -7596,7 +7596,7 @@ static int bridge_exec(struct ast_channel *chan, const char *data)
 
        /* we have 2 valid channels to bridge, now it is just a matter of setting up the bridge config and starting the bridge */       
        if (ast_test_flag(&opts, BRIDGE_OPT_PLAYTONE) && !ast_strlen_zero(xfersound)) {
-               if (!ast_streamfile(final_dest_chan, xfersound, final_dest_chan->language)) {
+               if (!ast_streamfile(final_dest_chan, xfersound, ast_channel_language(final_dest_chan))) {
                        if (ast_waitstream(final_dest_chan, "") < 0)
                                ast_log(LOG_WARNING, "Failed to play courtesy tone on %s\n", ast_channel_name(final_dest_chan));
                }
index 8591637c89b09a3245413a6edfb34e36b536bb37..ee2139c0574a3de8f097f359444aa403030639e6 100644 (file)
@@ -1425,7 +1425,7 @@ int ast_stream_and_wait(struct ast_channel *chan, const char *file, const char *
        int res = 0;
        if (!ast_strlen_zero(file)) {
                ast_test_suite_event_notify("PLAYBACK", "Message: %s\r\nChannel: %s", file, ast_channel_name(chan));
-               res = ast_streamfile(chan, file, chan->language);
+               res = ast_streamfile(chan, file, ast_channel_language(chan));
                if (!res) {
                        res = ast_waitstream(chan, digits);
                }
index 3aa22665327a7089a7f88cb8a2fd763617aa4bef..0e956b0c9946b3b465bee9756b7d788749fce2d2 100644 (file)
@@ -158,7 +158,7 @@ int ast_send_image(struct ast_channel *chan, const char *filename)
        struct ast_frame *f;
        int res = -1;
        if (chan->tech->send_image) {
-               f = ast_read_image(filename, chan->language, NULL);
+               f = ast_read_image(filename, ast_channel_language(chan), NULL);
                if (f) {
                        res = chan->tech->send_image(chan, f);
                        ast_frfree(f);
index f7144adc9c1bfe4ebb8674d208de236c23aa8819..4e3e72018a38841645209586689bfa1f6691d370 100644 (file)
@@ -3322,7 +3322,7 @@ static int action_status(struct mansession *s, const struct message *m)
 
                channels++;
                if (c->_bridge) {
-                       snprintf(bridge, sizeof(bridge), "BridgedChannel: %s\r\nBridgedUniqueid: %s\r\n", ast_channel_name(c->_bridge), c->_bridge->uniqueid);
+                       snprintf(bridge, sizeof(bridge), "BridgedChannel: %s\r\nBridgedUniqueid: %s\r\n", ast_channel_name(c->_bridge), ast_channel_uniqueid(c->_bridge));
                } else {
                        bridge[0] = '\0';
                }
@@ -3355,10 +3355,10 @@ static int action_status(struct mansession *s, const struct message *m)
                        S_COR(c->caller.id.name.valid, c->caller.id.name.str, "<unknown>"),
                        S_COR(c->connected.id.number.valid, c->connected.id.number.str, "<unknown>"),
                        S_COR(c->connected.id.name.valid, c->connected.id.name.str, "<unknown>"),
-                       c->accountcode,
+                       ast_channel_accountcode(c),
                        c->_state,
                        ast_state2str(c->_state), c->context,
-                       c->exten, c->priority, (long)elapsed_seconds, bridge, c->uniqueid, ast_str_buffer(str), idText);
+                       c->exten, c->priority, (long)elapsed_seconds, bridge, ast_channel_uniqueid(c), ast_str_buffer(str), idText);
                } else {
                        astman_append(s,
                                "Event: Status\r\n"
@@ -3380,8 +3380,8 @@ static int action_status(struct mansession *s, const struct message *m)
                                S_COR(c->caller.id.name.valid, c->caller.id.name.str, "<unknown>"),
                                S_COR(c->connected.id.number.valid, c->connected.id.number.str, "<unknown>"),
                                S_COR(c->connected.id.name.valid, c->connected.id.name.str, "<unknown>"),
-                               c->accountcode,
-                               ast_state2str(c->_state), bridge, c->uniqueid,
+                               ast_channel_accountcode(c),
+                               ast_state2str(c->_state), bridge, ast_channel_uniqueid(c),
                                ast_str_buffer(str), idText);
                }
 
@@ -3743,7 +3743,7 @@ static void *fast_originate(void *data)
                "CallerIDName: %s\r\n",
                in->idtext, ast_strlen_zero(in->idtext) ? "" : "\r\n", res ? "Failure" : "Success",
                chan ? ast_channel_name(chan) : requested_channel, in->context, in->exten, reason,
-               chan ? chan->uniqueid : "<null>",
+               chan ? ast_channel_uniqueid(chan) : "<null>",
                S_OR(in->cid_num, "<unknown>"),
                S_OR(in->cid_name, "<unknown>")
                );
@@ -4592,13 +4592,13 @@ static int action_coreshowchannels(struct mansession *s, const struct message *m
                        "AccountCode: %s\r\n"
                        "BridgedChannel: %s\r\n"
                        "BridgedUniqueID: %s\r\n"
-                       "\r\n", idText, ast_channel_name(c), c->uniqueid, c->context, c->exten, c->priority, c->_state,
+                       "\r\n", idText, ast_channel_name(c), ast_channel_uniqueid(c), c->context, c->exten, c->priority, c->_state,
                        ast_state2str(c->_state), c->appl ? c->appl : "", c->data ? S_OR(c->data, "") : "",
                        S_COR(c->caller.id.number.valid, c->caller.id.number.str, ""),
                        S_COR(c->caller.id.name.valid, c->caller.id.name.str, ""),
                        S_COR(c->connected.id.number.valid, c->connected.id.number.str, ""),
                        S_COR(c->connected.id.name.valid, c->connected.id.name.str, ""),
-                       durbuf, S_OR(c->accountcode, ""), bc ? ast_channel_name(bc) : "", bc ? bc->uniqueid : "");
+                       durbuf, S_OR(ast_channel_accountcode(c), ""), bc ? ast_channel_name(bc) : "", bc ? ast_channel_uniqueid(bc) : "");
 
                ast_channel_unlock(c);
 
index d2a18fb649cc89e0dd7a1a4319cce88234963b86..204eb88416afc1e9332dd553ad69cb046c9eb435 100644 (file)
@@ -3319,7 +3319,7 @@ const char *ast_str_retrieve_variable(struct ast_str **str, ssize_t maxlen, stru
                } else if (!strcmp(var, "CHANNEL")) {
                        s = ast_channel_name(c);
                } else if (!strcmp(var, "UNIQUEID")) {
-                       s = c->uniqueid;
+                       s = ast_channel_uniqueid(c);
                } else if (!strcmp(var, "HANGUPCAUSE")) {
                        ast_str_set(str, maxlen, "%d", c->hangupcause);
                        s = ast_str_buffer(*str);
@@ -4386,7 +4386,7 @@ static int pbx_extension_helper(struct ast_channel *c, struct ast_context *con,
                                        "Application: %s\r\n"
                                        "AppData: %s\r\n"
                                        "Uniqueid: %s\r\n",
-                                       ast_channel_name(c), c->context, c->exten, c->priority, app->name, passdata, c->uniqueid);
+                                       ast_channel_name(c), c->context, c->exten, c->priority, app->name, passdata, ast_channel_uniqueid(c));
                        return pbx_exec(c, app, passdata);      /* 0 on success, -1 on failure */
                }
        } else if (q.swo) {     /* not found here, but in another switch */
@@ -8335,10 +8335,10 @@ int ast_async_goto(struct ast_channel *chan, const char *context, const char *ex
        /* In order to do it when the channel doesn't really exist within
         * the PBX, we have to make a new channel, masquerade, and start the PBX
         * at the new location */
-       tmpvars.accountcode = ast_strdupa(chan->accountcode);
+       tmpvars.accountcode = ast_strdupa(ast_channel_accountcode(chan));
        tmpvars.exten = ast_strdupa(chan->exten);
        tmpvars.context = ast_strdupa(chan->context);
-       tmpvars.linkedid = ast_strdupa(chan->linkedid);
+       tmpvars.linkedid = ast_strdupa(ast_channel_linkedid(chan));
        tmpvars.name = ast_strdupa(ast_channel_name(chan));
        tmpvars.amaflags = chan->amaflags;
        tmpvars.state = chan->_state;
@@ -9899,7 +9899,7 @@ static int pbx_builtin_background(struct ast_channel *chan, const char *data)
        AST_STANDARD_APP_ARGS(args, parse);
 
        if (ast_strlen_zero(args.lang))
-               args.lang = (char *)chan->language;     /* XXX this is const */
+               args.lang = (char *)ast_channel_language(chan); /* XXX this is const */
 
        if (ast_strlen_zero(args.context)) {
                const char *context;
@@ -10151,7 +10151,7 @@ int pbx_builtin_setvar_helper(struct ast_channel *chan, const char *name, const
                        "Value: %s\r\n"
                        "Uniqueid: %s\r\n",
                        chan ? ast_channel_name(chan) : "none", name, value,
-                       chan ? chan->uniqueid : "none");
+                       chan ? ast_channel_uniqueid(chan) : "none");
        }
 
        if (chan)
@@ -10336,7 +10336,7 @@ static int pbx_builtin_saynumber(struct ast_channel *chan, const char *data)
                }
        }
 
-       if (ast_say_number(chan, atoi(tmp), "", chan->language, options)) {
+       if (ast_say_number(chan, atoi(tmp), "", ast_channel_language(chan), options)) {
                ast_log(LOG_WARNING, "We were unable to say the number %s, is it too large?\n", tmp);
        }
 
@@ -10348,7 +10348,7 @@ static int pbx_builtin_saydigits(struct ast_channel *chan, const char *data)
        int res = 0;
 
        if (data)
-               res = ast_say_digit_str(chan, data, "", chan->language);
+               res = ast_say_digit_str(chan, data, "", ast_channel_language(chan));
        return res;
 }
 
@@ -10357,7 +10357,7 @@ static int pbx_builtin_saycharacters(struct ast_channel *chan, const char *data)
        int res = 0;
 
        if (data)
-               res = ast_say_character_str(chan, data, "", chan->language);
+               res = ast_say_character_str(chan, data, "", ast_channel_language(chan));
        return res;
 }
 
@@ -10366,7 +10366,7 @@ static int pbx_builtin_sayphonetic(struct ast_channel *chan, const char *data)
        int res = 0;
 
        if (data)
-               res = ast_say_phonetic_str(chan, data, "", chan->language);
+               res = ast_say_phonetic_str(chan, data, "", ast_channel_language(chan));
        return res;
 }
 
index dbeb8ba9cd0bff8f00ac7613dbc0ea9205951441..1397cab3676a0bbb1b6fdfc72979d111357e9611 100644 (file)
@@ -7295,7 +7295,7 @@ static int ast_say_number_full_gr(struct ast_channel *chan, int num, const char
  
        if (!num) {
                ast_copy_string(fn, "digits/0", sizeof(fn));
-               res = ast_streamfile(chan, fn, chan->language);
+               res = ast_streamfile(chan, fn, ast_channel_language(chan));
                if (!res)
                        return  ast_waitstream(chan, ints);
        }
@@ -7323,14 +7323,14 @@ static int ast_say_number_full_gr(struct ast_channel *chan, int num, const char
                } else {
                        /* num >  1000 */
                        if (num < 1000000) {
-                               res = ast_say_number_full_gr(chan, (num / 1000), ints, chan->language, audiofd, ctrlfd);
+                               res = ast_say_number_full_gr(chan, (num / 1000), ints, ast_channel_language(chan), audiofd, ctrlfd);
                                if (res)
                                        return res;
                                num %= 1000;
                                snprintf(fn, sizeof(fn), "digits/thousands");
                        }  else {
                                if (num < 1000000000) { /* 1,000,000,000 */
-                                       res = ast_say_number_full_gr(chan, (num / 1000000), ints, chan->language, audiofd, ctrlfd);
+                                       res = ast_say_number_full_gr(chan, (num / 1000000), ints, ast_channel_language(chan), audiofd, ctrlfd);
                                        if (res)
                                                return res;
                                        num %= 1000000;
@@ -7538,7 +7538,7 @@ static int ast_say_date_with_format_gr(struct ast_channel *chan, time_t t, const
                case 'Y':
                        /* Year */
                        
-                       ast_say_number_full_gr(chan, 1900+tm.tm_year, ints, chan->language, -1, -1);
+                       ast_say_number_full_gr(chan, 1900+tm.tm_year, ints, ast_channel_language(chan), -1, -1);
                        break;
                case 'I':
                case 'l':
@@ -8296,11 +8296,11 @@ int ast_say_counted_noun(struct ast_channel *chan, int num, const char noun[])
        char *temp;
        int temp_len;
        const char *ending;
-       if (!strncasecmp(chan->language, "ru", 2)) {        /* Russian */
+       if (!strncasecmp(ast_channel_language(chan), "ru", 2)) {        /* Russian */
                ending = counted_noun_ending_slavic(num);
-       } else if (!strncasecmp(chan->language, "ua", 2)) { /* Ukrainian */
+       } else if (!strncasecmp(ast_channel_language(chan), "ua", 2)) { /* Ukrainian */
                ending = counted_noun_ending_slavic(num);
-       } else if (!strncasecmp(chan->language, "pl", 2)) { /* Polish */
+       } else if (!strncasecmp(ast_channel_language(chan), "pl", 2)) { /* Polish */
                ending = counted_noun_ending_slavic(num);
        } else {                                            /* English and default */
                ending = counted_noun_ending_en(num);
@@ -8338,11 +8338,11 @@ int ast_say_counted_adjective(struct ast_channel *chan, int num, const char adje
        char *temp;
        int temp_len;
        const char *ending;
-       if (!strncasecmp(chan->language, "ru", 2)) {           /* Russian */
+       if (!strncasecmp(ast_channel_language(chan), "ru", 2)) {           /* Russian */
                ending = counted_adjective_ending_ru(num, gender);
-       } else if (!strncasecmp(chan->language, "ua", 2)) {    /* Ukrainian */
+       } else if (!strncasecmp(ast_channel_language(chan), "ua", 2)) {    /* Ukrainian */
                ending = counted_adjective_ending_ru(num, gender);
-       } else if (!strncasecmp(chan->language, "pl", 2)) {    /* Polish */
+       } else if (!strncasecmp(ast_channel_language(chan), "pl", 2)) {    /* Polish */
                ending = counted_adjective_ending_ru(num, gender);
        } else {                                               /* English and default */
                ending = "";
index c3e1556d401049e39cc027a05917da64e9c576e6..83fe85e63ac97abf40c65edbf0b168e26683ba95 100644 (file)
@@ -364,7 +364,7 @@ static int realtime_exec(struct ast_channel *chan, const char *context, const ch
                                                          "Application: %s\r\n"
                                                          "AppData: %s\r\n"
                                                          "Uniqueid: %s\r\n",
-                                                         ast_channel_name(chan), chan->context, chan->exten, chan->priority, app, !ast_strlen_zero(appdata) ? appdata : "(NULL)", chan->uniqueid);
+                                                         ast_channel_name(chan), chan->context, chan->exten, chan->priority, app, !ast_strlen_zero(appdata) ? appdata : "(NULL)", ast_channel_uniqueid(chan));
                                
                                res = pbx_exec(chan, a, appdata);
                        } else
index a5cd5ecc801d70c4929b0018d1c62fffc633b799..2ad1023f864663445e6af97e8962672c1005a508 100644 (file)
@@ -1722,9 +1722,9 @@ static void setup_env(struct ast_channel *chan, char *request, int fd, int enhan
           thing */
        ast_agi_send(fd, chan, "agi_request: %s\n", request);
        ast_agi_send(fd, chan, "agi_channel: %s\n", ast_channel_name(chan));
-       ast_agi_send(fd, chan, "agi_language: %s\n", chan->language);
+       ast_agi_send(fd, chan, "agi_language: %s\n", ast_channel_language(chan));
        ast_agi_send(fd, chan, "agi_type: %s\n", chan->tech->type);
-       ast_agi_send(fd, chan, "agi_uniqueid: %s\n", chan->uniqueid);
+       ast_agi_send(fd, chan, "agi_uniqueid: %s\n", ast_channel_uniqueid(chan));
        ast_agi_send(fd, chan, "agi_version: %s\n", ast_get_version());
 
        /* ANI/DNIS */
@@ -1748,7 +1748,7 @@ static void setup_env(struct ast_channel *chan, char *request, int fd, int enhan
        ast_agi_send(fd, chan, "agi_enhanced: %s\n", enhanced ? "1.0" : "0.0");
 
        /* User information */
-       ast_agi_send(fd, chan, "agi_accountcode: %s\n", chan->accountcode ? chan->accountcode : "");
+       ast_agi_send(fd, chan, "agi_accountcode: %s\n", ast_channel_accountcode(chan) ? ast_channel_accountcode(chan) : "");
        ast_agi_send(fd, chan, "agi_threadid: %ld\n", (long)pthread_self());
 
        /* Send any parameters to the fastagi server that have been passed via the agi application */
@@ -1946,12 +1946,12 @@ static int handle_streamfile(struct ast_channel *chan, AGI *agi, int argc, const
                return RESULT_SHOWUSAGE;
        }
 
-       if (!(fs = ast_openstream(chan, argv[2], chan->language))) {
+       if (!(fs = ast_openstream(chan, argv[2], ast_channel_language(chan)))) {
                ast_agi_send(agi->fd, chan, "200 result=%d endpos=%ld\n", 0, sample_offset);
                return RESULT_SUCCESS;
        }
 
-       if ((vfs = ast_openvstream(chan, argv[2], chan->language))) {
+       if ((vfs = ast_openvstream(chan, argv[2], ast_channel_language(chan)))) {
                ast_debug(1, "Ooh, found a video stream, too\n");
        }
 
@@ -2004,13 +2004,13 @@ static int handle_getoption(struct ast_channel *chan, AGI *agi, int argc, const
                timeout = chan->pbx->dtimeoutms; /* in msec */
        }
 
-       if (!(fs = ast_openstream(chan, argv[2], chan->language))) {
+       if (!(fs = ast_openstream(chan, argv[2], ast_channel_language(chan)))) {
                ast_agi_send(agi->fd, chan, "200 result=%d endpos=%ld\n", 0, sample_offset);
                ast_log(LOG_WARNING, "Unable to open %s\n", argv[2]);
                return RESULT_SUCCESS;
        }
 
-       if ((vfs = ast_openvstream(chan, argv[2], chan->language)))
+       if ((vfs = ast_openvstream(chan, argv[2], ast_channel_language(chan))))
                ast_debug(1, "Ooh, found a video stream, too\n");
 
        ast_verb(3, "Playing '%s' (escape_digits=%s) (timeout %d)\n", argv[2], edigits, timeout);
@@ -2060,7 +2060,7 @@ static int handle_saynumber(struct ast_channel *chan, AGI *agi, int argc, const
                return RESULT_SHOWUSAGE;
        if (sscanf(argv[2], "%30d", &num) != 1)
                return RESULT_SHOWUSAGE;
-       res = ast_say_number_full(chan, num, argv[3], chan->language, argc > 4 ? argv[4] : NULL, agi->audio, agi->ctrl);
+       res = ast_say_number_full(chan, num, argv[3], ast_channel_language(chan), argc > 4 ? argv[4] : NULL, agi->audio, agi->ctrl);
        if (res == 1)
                return RESULT_SUCCESS;
        ast_agi_send(agi->fd, chan, "200 result=%d\n", res);
@@ -2076,7 +2076,7 @@ static int handle_saydigits(struct ast_channel *chan, AGI *agi, int argc, const
        if (sscanf(argv[2], "%30d", &num) != 1)
                return RESULT_SHOWUSAGE;
 
-       res = ast_say_digit_str_full(chan, argv[2], argv[3], chan->language, agi->audio, agi->ctrl);
+       res = ast_say_digit_str_full(chan, argv[2], argv[3], ast_channel_language(chan), agi->audio, agi->ctrl);
        if (res == 1) /* New command */
                return RESULT_SUCCESS;
        ast_agi_send(agi->fd, chan, "200 result=%d\n", res);
@@ -2090,7 +2090,7 @@ static int handle_sayalpha(struct ast_channel *chan, AGI *agi, int argc, const c
        if (argc != 4)
                return RESULT_SHOWUSAGE;
 
-       res = ast_say_character_str_full(chan, argv[2], argv[3], chan->language, agi->audio, agi->ctrl);
+       res = ast_say_character_str_full(chan, argv[2], argv[3], ast_channel_language(chan), agi->audio, agi->ctrl);
        if (res == 1) /* New command */
                return RESULT_SUCCESS;
        ast_agi_send(agi->fd, chan, "200 result=%d\n", res);
@@ -2105,7 +2105,7 @@ static int handle_saydate(struct ast_channel *chan, AGI *agi, int argc, const ch
                return RESULT_SHOWUSAGE;
        if (sscanf(argv[2], "%30d", &num) != 1)
                return RESULT_SHOWUSAGE;
-       res = ast_say_date(chan, num, argv[3], chan->language);
+       res = ast_say_date(chan, num, argv[3], ast_channel_language(chan));
        if (res == 1)
                return RESULT_SUCCESS;
        ast_agi_send(agi->fd, chan, "200 result=%d\n", res);
@@ -2120,7 +2120,7 @@ static int handle_saytime(struct ast_channel *chan, AGI *agi, int argc, const ch
                return RESULT_SHOWUSAGE;
        if (sscanf(argv[2], "%30d", &num) != 1)
                return RESULT_SHOWUSAGE;
-       res = ast_say_time(chan, num, argv[3], chan->language);
+       res = ast_say_time(chan, num, argv[3], ast_channel_language(chan));
        if (res == 1)
                return RESULT_SUCCESS;
        ast_agi_send(agi->fd, chan, "200 result=%d\n", res);
@@ -2140,7 +2140,7 @@ static int handle_saydatetime(struct ast_channel *chan, AGI *agi, int argc, cons
                format = argv[4];
        } else {
                /* XXX this doesn't belong here, but in the 'say' module */
-               if (!strcasecmp(chan->language, "de")) {
+               if (!strcasecmp(ast_channel_language(chan), "de")) {
                        format = "A dBY HMS";
                } else {
                        format = "ABdY 'digits/at' IMp";
@@ -2153,7 +2153,7 @@ static int handle_saydatetime(struct ast_channel *chan, AGI *agi, int argc, cons
        if (ast_get_time_t(argv[2], &unixtime, 0, NULL))
                return RESULT_SHOWUSAGE;
 
-       res = ast_say_date_with_format(chan, unixtime, argv[3], chan->language, format, zone);
+       res = ast_say_date_with_format(chan, unixtime, argv[3], ast_channel_language(chan), format, zone);
        if (res == 1)
                return RESULT_SUCCESS;
 
@@ -2168,7 +2168,7 @@ static int handle_sayphonetic(struct ast_channel *chan, AGI *agi, int argc, cons
        if (argc != 4)
                return RESULT_SHOWUSAGE;
 
-       res = ast_say_phonetic_str_full(chan, argv[2], argv[3], chan->language, agi->audio, agi->ctrl);
+       res = ast_say_phonetic_str_full(chan, argv[2], argv[3], ast_channel_language(chan), agi->audio, agi->ctrl);
        if (res == 1) /* New command */
                return RESULT_SUCCESS;
        ast_agi_send(agi->fd, chan, "200 result=%d\n", res);
@@ -2306,10 +2306,10 @@ static int handle_recordfile(struct ast_channel *chan, AGI *agi, int argc, const
         * caught below and taken to be a beep, else if it is a digit then it is a
         * offset */
        if ((argc >6) && (sscanf(argv[6], "%30ld", &sample_offset) != 1) && (!strchr(argv[6], '=')))
-               res = ast_streamfile(chan, "beep", chan->language);
+               res = ast_streamfile(chan, "beep", ast_channel_language(chan));
 
        if ((argc > 7) && (!strchr(argv[7], '=')))
-               res = ast_streamfile(chan, "beep", chan->language);
+               res = ast_streamfile(chan, "beep", ast_channel_language(chan));
 
        if (!res)
                res = ast_waitstream(chan, argv[4]);
@@ -2947,7 +2947,7 @@ static int handle_speechrecognize(struct ast_channel *chan, AGI *agi, int argc,
        }
 
        /* Start playing prompt */
-       speech_streamfile(chan, prompt, chan->language, offset);
+       speech_streamfile(chan, prompt, ast_channel_language(chan), offset);
 
        /* Go into loop reading in frames, passing to speech thingy, checking for hangup, all that jazz */
        while (ast_strlen_zero(reason)) {
@@ -3005,7 +3005,7 @@ static int handle_speechrecognize(struct ast_channel *chan, AGI *agi, int argc,
                                ast_stopstream(chan);
                                /* If a processing sound exists, or is not none - play it */
                                if (!ast_strlen_zero(speech->processing_sound) && strcasecmp(speech->processing_sound, "none"))
-                                       speech_streamfile(chan, speech->processing_sound, chan->language, 0);
+                                       speech_streamfile(chan, speech->processing_sound, ast_channel_language(chan), 0);
                        }
                        break;
                case AST_SPEECH_STATE_DONE:
index 95d46f3bdcd5bf8de720e8d505c9e3b348534568..7e1a0c20ae92935fd79eb866de7789b5088aa94c 100644 (file)
@@ -1009,7 +1009,7 @@ static struct ast_fax_session *fax_session_new(struct ast_fax_session_details *d
                return NULL;
        }
 
-       if (!(s->chan_uniqueid = ast_strdup(chan->uniqueid))) {
+       if (!(s->chan_uniqueid = ast_strdup(ast_channel_uniqueid(chan)))) {
                fax_session_release(s, token);
                ao2_ref(s, -1);
                return NULL;
index c5ecda4e46e5f45d1f7b16ab9ff4bbf5c6d64ac0..be9c2a84d9e977d07d7963ff3bde9d2c2917a88c 100644 (file)
@@ -393,7 +393,7 @@ int AST_OPTIONAL_API_NAME(ast_monitor_start)(struct ast_channel *chan, const cha
                                        "Channel: %s\r\n"
                                                "Uniqueid: %s\r\n",
                                ast_channel_name(chan),
-                                       chan->uniqueid);
+                                       ast_channel_uniqueid(chan));
        } else {
                ast_debug(1,"Cannot start monitoring %s, already monitored\n", ast_channel_name(chan));
                res = -1;
@@ -511,7 +511,7 @@ int AST_OPTIONAL_API_NAME(ast_monitor_stop)(struct ast_channel *chan, int need_l
                                        "Channel: %s\r\n"
                                "Uniqueid: %s\r\n",
                                ast_channel_name(chan),
-                               chan->uniqueid
+                               ast_channel_uniqueid(chan)
                                );
                pbx_builtin_setvar_helper(chan, "MONITORED", NULL);
        }
index 7ef43ea23f56c7c65e9c928e3251720a5e2160d1..e505c3ee17c36420249c824465142e924c3f44bd 100644 (file)
@@ -297,7 +297,7 @@ static int ast_moh_files_next(struct ast_channel *chan)
 
        if (ast_test_flag(state->class, MOH_ANNOUNCEMENT) && state->announcement == 0) {
                state->announcement = 1;
-               if (ast_openstream_full(chan, state->class->announcement, chan->language, 1)) {
+               if (ast_openstream_full(chan, state->class->announcement, ast_channel_language(chan), 1)) {
                        ast_debug(1, "%s Opened announcement '%s'\n", ast_channel_name(chan), state->class->announcement);
                        return 0;
                }
@@ -336,7 +336,7 @@ static int ast_moh_files_next(struct ast_channel *chan)
        }
 
        for (tries = 0; tries < state->class->total_files; ++tries) {
-               if (ast_openstream_full(chan, state->class->filearray[state->pos], chan->language, 1)) {
+               if (ast_openstream_full(chan, state->class->filearray[state->pos], ast_channel_language(chan), 1)) {
                        break;
                }
 
@@ -504,7 +504,7 @@ static void moh_handle_digit(struct ast_channel *chan, char digit)
        if ((class = get_mohbydigit(digit))) {
                classname = ast_strdupa(class->name);
                class = mohclass_unref(class, "Unreffing ao2_find from finding by digit");
-               ast_string_field_set(chan,musicclass,classname);
+               ast_channel_musicclass_set(chan, classname);
                ast_moh_stop(chan);
                ast_moh_start(chan, classname, NULL);
        }
@@ -847,7 +847,7 @@ static int set_moh_exec(struct ast_channel *chan, const char *data)
                ast_log(LOG_WARNING, "SetMusicOnHold requires an argument (class)\n");
                return -1;
        }
-       ast_string_field_set(chan, musicclass, data);
+       ast_channel_musicclass_set(chan, data);
        return 0;
 }
 
@@ -1371,10 +1371,10 @@ static int local_ast_moh_start(struct ast_channel *chan, const char *mclass, con
         *    option.
         * 4) The default class.
         */
-       if (!ast_strlen_zero(chan->musicclass)) {
-               mohclass = get_mohbyname(chan->musicclass, 1, 0);
+       if (!ast_strlen_zero(ast_channel_musicclass(chan))) {
+               mohclass = get_mohbyname(ast_channel_musicclass(chan), 1, 0);
                if (!mohclass && realtime_possible) {
-                       var = ast_load_realtime("musiconhold", "name", chan->musicclass, SENTINEL);
+                       var = ast_load_realtime("musiconhold", "name", ast_channel_musicclass(chan), SENTINEL);
                }
        }
        if (!mohclass && !var && !ast_strlen_zero(mclass)) {
@@ -1556,7 +1556,7 @@ static int local_ast_moh_start(struct ast_channel *chan, const char *mclass, con
                "Channel: %s\r\n"
                "UniqueID: %s\r\n"
                "Class: %s\r\n",
-               ast_channel_name(chan), chan->uniqueid,
+               ast_channel_name(chan), ast_channel_uniqueid(chan),
                mohclass->name);
 
        ast_set_flag(chan, AST_FLAG_MOH);
@@ -1589,7 +1589,7 @@ static void local_ast_moh_stop(struct ast_channel *chan)
                "State: Stop\r\n"
                "Channel: %s\r\n"
                "UniqueID: %s\r\n",
-               ast_channel_name(chan), chan->uniqueid);
+               ast_channel_name(chan), ast_channel_uniqueid(chan));
        ast_channel_unlock(chan);
 }
 
index ff5410d9665f1fb378f747bea5b0cae6baeaf66a..153106e0dcb15c5e7824d5458d6a3c01fe255fca 100644 (file)
@@ -276,8 +276,8 @@ static u_char *ast_var_channels_table(struct variable *vp, oid *name, size_t *le
                }
                break;
        case ASTCHANLANGUAGE:
-               if (!ast_strlen_zero(chan->language)) {
-                       strncpy(string_ret, chan->language, sizeof(string_ret));
+               if (!ast_strlen_zero(ast_channel_language(chan))) {
+                       strncpy(string_ret, ast_channel_language(chan), sizeof(string_ret));
                        string_ret[sizeof(string_ret) - 1] = '\0';
                        *var_len = strlen(string_ret);
                        ret = (u_char *)string_ret;
@@ -290,8 +290,8 @@ static u_char *ast_var_channels_table(struct variable *vp, oid *name, size_t *le
                ret = (u_char *)string_ret;
                break;
        case ASTCHANMUSICCLASS:
-               if (!ast_strlen_zero(chan->musicclass)) {
-                       strncpy(string_ret, chan->musicclass, sizeof(string_ret));
+               if (!ast_strlen_zero(ast_channel_musicclass(chan))) {
+                       strncpy(string_ret, ast_channel_musicclass(chan), sizeof(string_ret));
                        string_ret[sizeof(string_ret) - 1] = '\0';
                        *var_len = strlen(string_ret);
                        ret = (u_char *)string_ret;
@@ -377,23 +377,23 @@ static u_char *ast_var_channels_table(struct variable *vp, oid *name, size_t *le
                ret = (u_char *)&long_ret;
                break;
        case ASTCHANACCOUNTCODE:
-               if (!ast_strlen_zero(chan->accountcode)) {
-                       strncpy(string_ret, chan->accountcode, sizeof(string_ret));
+               if (!ast_strlen_zero(ast_channel_accountcode(chan))) {
+                       strncpy(string_ret, ast_channel_accountcode(chan), sizeof(string_ret));
                        string_ret[sizeof(string_ret) - 1] = '\0';
                        *var_len = strlen(string_ret);
                        ret = (u_char *)string_ret;
                }
                break;
        case ASTCHANFORWARDTO:
-               if (!ast_strlen_zero(chan->call_forward)) {
-                       strncpy(string_ret, chan->call_forward, sizeof(string_ret));
+               if (!ast_strlen_zero(ast_channel_call_forward(chan))) {
+                       strncpy(string_ret, ast_channel_call_forward(chan), sizeof(string_ret));
                        string_ret[sizeof(string_ret) - 1] = '\0';
                        *var_len = strlen(string_ret);
                        ret = (u_char *)string_ret;
                }
                break;
        case ASTCHANUNIQUEID:
-               strncpy(string_ret, chan->uniqueid, sizeof(string_ret));
+               strncpy(string_ret, ast_channel_uniqueid(chan), sizeof(string_ret));
                string_ret[sizeof(string_ret) - 1] = '\0';
                *var_len = strlen(string_ret);
                ret = (u_char *)string_ret;