summaryrefslogtreecommitdiff
path: root/apps/app_minivm.c
diff options
context:
space:
mode:
authorTerry Wilson <twilson@digium.com>2012-02-13 17:27:06 +0000
committerTerry Wilson <twilson@digium.com>2012-02-13 17:27:06 +0000
commit34c55e8e7c87a92181fca3e0101dc456eef2475b (patch)
treead27fca98a7df582348e14b0aaa42f0065cdef99 /apps/app_minivm.c
parenta955a4770fcdd7874e1337e7df694bcd293e020e (diff)
Opaquify char * and char[] in ast_channel
Review: https://reviewboard.asterisk.org/r/1733/ git-svn-id: https://origsvn.digium.com/svn/asterisk/trunk@354968 65c4cc65-6c06-0410-ace0-fbb531ad65f3
Diffstat (limited to 'apps/app_minivm.c')
-rw-r--r--apps/app_minivm.c36
1 files changed, 17 insertions, 19 deletions
diff --git a/apps/app_minivm.c b/apps/app_minivm.c
index 3ffe06187..9c87a7464 100644
--- a/apps/app_minivm.c
+++ b/apps/app_minivm.c
@@ -1942,9 +1942,9 @@ static int leave_voicemail(struct ast_channel *chan, char *username, struct leav
/* "Mailbox:domain:macrocontext:exten:priority:callerchan:callerid:origdate:origtime:duration:durationstatus:accountcode" */
"%s:%s:%s:%s:%d:%s:%s:%s:%s:%d:%s:%s\n",
username,
- chan->context,
- chan->macrocontext,
- chan->exten,
+ ast_channel_context(chan),
+ ast_channel_macrocontext(chan),
+ ast_channel_exten(chan),
chan->priority,
ast_channel_name(chan),
callerid,
@@ -2308,13 +2308,13 @@ static int minivm_greet_exec(struct ast_channel *chan, const char *data)
strncat(ecodes, "0", sizeof(ecodes) - strlen(ecodes) - 1);
ouseexten = 1;
}
- } else if (ast_exists_extension(chan, chan->context, "o", 1,
+ } else if (ast_exists_extension(chan, ast_channel_context(chan), "o", 1,
S_COR(chan->caller.id.number.valid, chan->caller.id.number.str, NULL))) {
strncat(ecodes, "0", sizeof(ecodes) - strlen(ecodes) - 1);
ouseexten = 1;
}
- else if (!ast_strlen_zero(chan->macrocontext)
- && ast_exists_extension(chan, chan->macrocontext, "o", 1,
+ else if (!ast_strlen_zero(ast_channel_macrocontext(chan))
+ && ast_exists_extension(chan, ast_channel_macrocontext(chan), "o", 1,
S_COR(chan->caller.id.number.valid, chan->caller.id.number.str, NULL))) {
strncat(ecodes, "0", sizeof(ecodes) - strlen(ecodes) - 1);
ousemacro = 1;
@@ -2326,11 +2326,11 @@ static int minivm_greet_exec(struct ast_channel *chan, const char *data)
S_COR(chan->caller.id.number.valid, chan->caller.id.number.str, NULL))) {
strncat(ecodes, "*", sizeof(ecodes) - strlen(ecodes) - 1);
}
- } else if (ast_exists_extension(chan, chan->context, "a", 1,
+ } else if (ast_exists_extension(chan, ast_channel_context(chan), "a", 1,
S_COR(chan->caller.id.number.valid, chan->caller.id.number.str, NULL))) {
strncat(ecodes, "*", sizeof(ecodes) - strlen(ecodes) - 1);
- } else if (!ast_strlen_zero(chan->macrocontext)
- && ast_exists_extension(chan, chan->macrocontext, "a", 1,
+ } else if (!ast_strlen_zero(ast_channel_macrocontext(chan))
+ && ast_exists_extension(chan, ast_channel_macrocontext(chan), "a", 1,
S_COR(chan->caller.id.number.valid, chan->caller.id.number.str, NULL))) {
strncat(ecodes, "*", sizeof(ecodes) - strlen(ecodes) - 1);
ausemacro = 1;
@@ -2371,24 +2371,22 @@ static int minivm_greet_exec(struct ast_channel *chan, const char *data)
/* Check for a '*' here in case the caller wants to escape from voicemail to something
other than the operator -- an automated attendant or mailbox login for example */
if (res == '*') {
- chan->exten[0] = 'a';
- chan->exten[1] = '\0';
+ ast_channel_exten_set(chan, "a");
if (!ast_strlen_zero(vmu->exit)) {
- ast_copy_string(chan->context, vmu->exit, sizeof(chan->context));
- } else if (ausemacro && !ast_strlen_zero(chan->macrocontext)) {
- ast_copy_string(chan->context, chan->macrocontext, sizeof(chan->context));
+ ast_channel_context_set(chan, vmu->exit);
+ } else if (ausemacro && !ast_strlen_zero(ast_channel_macrocontext(chan))) {
+ ast_channel_context_set(chan, ast_channel_macrocontext(chan));
}
chan->priority = 0;
pbx_builtin_setvar_helper(chan, "MVM_GREET_STATUS", "USEREXIT");
res = 0;
} else if (res == '0') { /* Check for a '0' here */
if(ouseexten || ousemacro) {
- chan->exten[0] = 'o';
- chan->exten[1] = '\0';
+ ast_channel_exten_set(chan, "o");
if (!ast_strlen_zero(vmu->exit)) {
- ast_copy_string(chan->context, vmu->exit, sizeof(chan->context));
- } else if (ousemacro && !ast_strlen_zero(chan->macrocontext)) {
- ast_copy_string(chan->context, chan->macrocontext, sizeof(chan->context));
+ ast_channel_context_set(chan, vmu->exit);
+ } else if (ousemacro && !ast_strlen_zero(ast_channel_macrocontext(chan))) {
+ ast_channel_context_set(chan, ast_channel_macrocontext(chan));
}
ast_play_and_wait(chan, "transfer");
chan->priority = 0;