Skip to content
Snippets Groups Projects
Commit ec05153a authored by Russell Bryant's avatar Russell Bryant
Browse files

convert most of the option_*'s to a single ast_flags structure. Also, fix some

formatting, remove some unnecessary casts, and other little code cleanups.


git-svn-id: https://origsvn.digium.com/svn/asterisk/trunk@7331 65c4cc65-6c06-0410-ace0-fbb531ad65f3
parent b6b32ebd
No related branches found
No related tags found
No related merge requests found
...@@ -636,7 +636,7 @@ int ast_play_and_record(struct ast_channel *chan, const char *playfile, const ch ...@@ -636,7 +636,7 @@ int ast_play_and_record(struct ast_channel *chan, const char *playfile, const ch
/* Request a video update */ /* Request a video update */
ast_indicate(chan, AST_CONTROL_VIDUPDATE); ast_indicate(chan, AST_CONTROL_VIDUPDATE);
if (option_transmit_silence_during_record) if (ast_opt_transmit_silence)
silgen = ast_channel_start_silence_generator(chan); silgen = ast_channel_start_silence_generator(chan);
if (x == fmtcnt) { if (x == fmtcnt) {
......
...@@ -143,7 +143,7 @@ static int chanavail_exec(struct ast_channel *chan, void *data) ...@@ -143,7 +143,7 @@ static int chanavail_exec(struct ast_channel *chan, void *data)
if (res < 1) { if (res < 1) {
pbx_builtin_setvar_helper(chan, "AVAILCHAN", ""); pbx_builtin_setvar_helper(chan, "AVAILCHAN", "");
pbx_builtin_setvar_helper(chan, "AVAILORIGCHAN", ""); pbx_builtin_setvar_helper(chan, "AVAILORIGCHAN", "");
if (priority_jump || option_priority_jumping) { if (priority_jump || ast_opt_priority_jumping) {
if (ast_goto_if_exists(chan, chan->context, chan->exten, chan->priority + 101)) { if (ast_goto_if_exists(chan, chan->context, chan->exten, chan->priority + 101)) {
LOCAL_USER_REMOVE(u); LOCAL_USER_REMOVE(u);
return -1; return -1;
......
...@@ -139,7 +139,7 @@ static int controlplayback_exec(struct ast_channel *chan, void *data) ...@@ -139,7 +139,7 @@ static int controlplayback_exec(struct ast_channel *chan, void *data)
pbx_builtin_setvar_helper(chan, "CPLAYBACKSTATUS", "USERSTOPPED"); pbx_builtin_setvar_helper(chan, "CPLAYBACKSTATUS", "USERSTOPPED");
} else { } else {
if (res < 0) { if (res < 0) {
if (priority_jump || option_priority_jumping) { if (priority_jump || ast_opt_priority_jumping) {
if (ast_goto_if_exists(chan, chan->context, chan->exten, chan->priority + 101)) { if (ast_goto_if_exists(chan, chan->context, chan->exten, chan->priority + 101)) {
ast_log(LOG_WARNING, "ControlPlayback tried to jump to priority n+101 as requested, but priority didn't exist\n"); ast_log(LOG_WARNING, "ControlPlayback tried to jump to priority n+101 as requested, but priority didn't exist\n");
} }
......
...@@ -264,7 +264,7 @@ static int get_exec(struct ast_channel *chan, void *data) ...@@ -264,7 +264,7 @@ static int get_exec(struct ast_channel *chan, void *data)
} else { } else {
if (option_verbose > 2) if (option_verbose > 2)
ast_verbose(VERBOSE_PREFIX_3 "DBget: Value not found in database.\n"); ast_verbose(VERBOSE_PREFIX_3 "DBget: Value not found in database.\n");
if (priority_jump || option_priority_jumping) { if (priority_jump || ast_opt_priority_jumping) {
/* Send the call to n+101 priority, where n is the current priority */ /* Send the call to n+101 priority, where n is the current priority */
ast_goto_if_exists(chan, chan->context, chan->exten, chan->priority + 101); ast_goto_if_exists(chan, chan->context, chan->exten, chan->priority + 101);
} }
......
...@@ -418,7 +418,7 @@ static struct ast_channel *wait_for_answer(struct ast_channel *in, struct localu ...@@ -418,7 +418,7 @@ static struct ast_channel *wait_for_answer(struct ast_channel *in, struct localu
strcpy(status, "CONGESTION"); strcpy(status, "CONGESTION");
else if (numnochan) else if (numnochan)
strcpy(status, "CHANUNAVAIL"); strcpy(status, "CHANUNAVAIL");
if (option_priority_jumping || priority_jump) if (ast_opt_priority_jumping || priority_jump)
ast_goto_if_exists(in, in->context, in->exten, in->priority + 101); ast_goto_if_exists(in, in->context, in->exten, in->priority + 101);
} else { } else {
if (option_verbose > 2) if (option_verbose > 2)
...@@ -1453,7 +1453,7 @@ static int dial_exec_full(struct ast_channel *chan, void *data, struct ast_flags ...@@ -1453,7 +1453,7 @@ static int dial_exec_full(struct ast_channel *chan, void *data, struct ast_flags
if ((macro_result = pbx_builtin_getvar_helper(peer, "MACRO_RESULT"))) { if ((macro_result = pbx_builtin_getvar_helper(peer, "MACRO_RESULT"))) {
if (!strcasecmp(macro_result, "BUSY")) { if (!strcasecmp(macro_result, "BUSY")) {
ast_copy_string(status, macro_result, sizeof(status)); ast_copy_string(status, macro_result, sizeof(status));
if (option_priority_jumping || ast_test_flag(&opts, OPT_PRIORITY_JUMP)) { if (ast_opt_priority_jumping || ast_test_flag(&opts, OPT_PRIORITY_JUMP)) {
if (!ast_goto_if_exists(chan, NULL, NULL, chan->priority + 101)) { if (!ast_goto_if_exists(chan, NULL, NULL, chan->priority + 101)) {
ast_set_flag(peerflags, OPT_GO_ON); ast_set_flag(peerflags, OPT_GO_ON);
} }
......
...@@ -122,7 +122,7 @@ static int enumlookup_exec(struct ast_channel *chan, void *data) ...@@ -122,7 +122,7 @@ static int enumlookup_exec(struct ast_channel *chan, void *data)
res = ast_get_enum(chan, args.d, dest, sizeof(dest), tech, sizeof(tech), NULL, NULL); res = ast_get_enum(chan, args.d, dest, sizeof(dest), tech, sizeof(tech), NULL, NULL);
if (!res) { /* Failed to do a lookup */ if (!res) { /* Failed to do a lookup */
if (priority_jump || option_priority_jumping) { if (priority_jump || ast_opt_priority_jumping) {
/* Look for a "busy" place */ /* Look for a "busy" place */
ast_goto_if_exists(chan, chan->context, chan->exten, chan->priority + 101); ast_goto_if_exists(chan, chan->context, chan->exten, chan->priority + 101);
} }
...@@ -180,7 +180,7 @@ static int enumlookup_exec(struct ast_channel *chan, void *data) ...@@ -180,7 +180,7 @@ static int enumlookup_exec(struct ast_channel *chan, void *data)
*t = 0; *t = 0;
pbx_builtin_setvar_helper(chan, "ENUM", tmp); pbx_builtin_setvar_helper(chan, "ENUM", tmp);
ast_log(LOG_NOTICE, "tel: ENUM set to \"%s\"\n", tmp); ast_log(LOG_NOTICE, "tel: ENUM set to \"%s\"\n", tmp);
if (priority_jump || option_priority_jumping) { if (priority_jump || ast_opt_priority_jumping) {
if (ast_goto_if_exists(chan, chan->context, chan->exten, chan->priority + 51)) if (ast_goto_if_exists(chan, chan->context, chan->exten, chan->priority + 51))
res = 0; res = 0;
} }
......
...@@ -177,7 +177,7 @@ static int group_check_exec(struct ast_channel *chan, void *data) ...@@ -177,7 +177,7 @@ static int group_check_exec(struct ast_channel *chan, void *data)
count = ast_app_group_get_count(pbx_builtin_getvar_helper(chan, category), category); count = ast_app_group_get_count(pbx_builtin_getvar_helper(chan, category), category);
if (count > max) { if (count > max) {
pbx_builtin_setvar_helper(chan, "CHECKGROUPSTATUS", "OVERMAX"); pbx_builtin_setvar_helper(chan, "CHECKGROUPSTATUS", "OVERMAX");
if (priority_jump || option_priority_jumping) { if (priority_jump || ast_opt_priority_jumping) {
if (!ast_goto_if_exists(chan, chan->context, chan->exten, chan->priority + 101)) if (!ast_goto_if_exists(chan, chan->context, chan->exten, chan->priority + 101))
res = -1; res = -1;
} }
......
...@@ -162,7 +162,7 @@ static int hasvoicemail_exec(struct ast_channel *chan, void *data) ...@@ -162,7 +162,7 @@ static int hasvoicemail_exec(struct ast_channel *chan, void *data)
if (vmcount > 0) { if (vmcount > 0) {
/* Branch to the next extension */ /* Branch to the next extension */
if (priority_jump || option_priority_jumping) { if (priority_jump || ast_opt_priority_jumping) {
if (ast_goto_if_exists(chan, chan->context, chan->exten, chan->priority + 101)) if (ast_goto_if_exists(chan, chan->context, chan->exten, chan->priority + 101))
ast_log(LOG_WARNING, "VM box %s@%s has new voicemail, but extension %s, priority %d doesn't exist\n", vmbox, context, chan->exten, chan->priority + 101); ast_log(LOG_WARNING, "VM box %s@%s has new voicemail, but extension %s, priority %d doesn't exist\n", vmbox, context, chan->exten, chan->priority + 101);
} }
......
...@@ -96,7 +96,7 @@ static int sendimage_exec(struct ast_channel *chan, void *data) ...@@ -96,7 +96,7 @@ static int sendimage_exec(struct ast_channel *chan, void *data)
if (!ast_supports_images(chan)) { if (!ast_supports_images(chan)) {
/* Does not support transport */ /* Does not support transport */
if (priority_jump || option_priority_jumping) if (priority_jump || ast_opt_priority_jumping)
ast_goto_if_exists(chan, chan->context, chan->exten, chan->priority + 101); ast_goto_if_exists(chan, chan->context, chan->exten, chan->priority + 101);
pbx_builtin_setvar_helper(chan, "SENDIMAGESTATUS", "NOSUPPORT"); pbx_builtin_setvar_helper(chan, "SENDIMAGESTATUS", "NOSUPPORT");
LOCAL_USER_REMOVE(u); LOCAL_USER_REMOVE(u);
......
...@@ -96,7 +96,7 @@ lookupblacklist_exec (struct ast_channel *chan, void *data) ...@@ -96,7 +96,7 @@ lookupblacklist_exec (struct ast_channel *chan, void *data)
} }
if (bl) { if (bl) {
if (priority_jump || option_priority_jumping) if (priority_jump || ast_opt_priority_jumping)
ast_goto_if_exists(chan, chan->context, chan->exten, chan->priority + 101); ast_goto_if_exists(chan, chan->context, chan->exten, chan->priority + 101);
pbx_builtin_setvar_helper(chan, "LOOKUPBLSTATUS", "FOUND"); pbx_builtin_setvar_helper(chan, "LOOKUPBLSTATUS", "FOUND");
} else } else
......
...@@ -156,7 +156,7 @@ static int md5check_exec(struct ast_channel *chan, void *data) ...@@ -156,7 +156,7 @@ static int md5check_exec(struct ast_channel *chan, void *data)
if (option_debug > 2) if (option_debug > 2)
ast_log(LOG_DEBUG, "ERROR: MD5 not verified: %s -- %s\n", args.md5hash, args.string); ast_log(LOG_DEBUG, "ERROR: MD5 not verified: %s -- %s\n", args.md5hash, args.string);
pbx_builtin_setvar_helper(chan, "CHECKMD5STATUS", "NOMATCH"); pbx_builtin_setvar_helper(chan, "CHECKMD5STATUS", "NOMATCH");
if (priority_jump || option_priority_jumping) { if (priority_jump || ast_opt_priority_jumping) {
if (ast_goto_if_exists(chan, chan->context, chan->exten, chan->priority + 101)) if (ast_goto_if_exists(chan, chan->context, chan->exten, chan->priority + 101))
if (option_debug > 2) if (option_debug > 2)
ast_log(LOG_DEBUG, "ERROR: Can't jump to exten+101 (e%s,p%d), sorry\n", chan->exten,chan->priority+101); ast_log(LOG_DEBUG, "ERROR: Can't jump to exten+101 (e%s,p%d), sorry\n", chan->exten,chan->priority+101);
......
...@@ -171,7 +171,7 @@ static int osplookup_exec(struct ast_channel *chan, void *data) ...@@ -171,7 +171,7 @@ static int osplookup_exec(struct ast_channel *chan, void *data)
} }
if (!res) { if (!res) {
/* Look for a "busy" place */ /* Look for a "busy" place */
if (priority_jump || option_priority_jumping) if (priority_jump || ast_opt_priority_jumping)
ast_goto_if_exists(chan, chan->context, chan->exten, chan->priority + 101); ast_goto_if_exists(chan, chan->context, chan->exten, chan->priority + 101);
} else if (res > 0) } else if (res > 0)
res = 0; res = 0;
...@@ -244,7 +244,7 @@ static int ospnext_exec(struct ast_channel *chan, void *data) ...@@ -244,7 +244,7 @@ static int ospnext_exec(struct ast_channel *chan, void *data)
} }
if (!res) { if (!res) {
/* Look for a "busy" place */ /* Look for a "busy" place */
if (priority_jump || option_priority_jumping) if (priority_jump || ast_opt_priority_jumping)
ast_goto_if_exists(chan, chan->context, chan->exten, chan->priority + 101); ast_goto_if_exists(chan, chan->context, chan->exten, chan->priority + 101);
} else if (res > 0) } else if (res > 0)
res = 0; res = 0;
...@@ -317,7 +317,7 @@ static int ospfinished_exec(struct ast_channel *chan, void *data) ...@@ -317,7 +317,7 @@ static int ospfinished_exec(struct ast_channel *chan, void *data)
} }
if (!res) { if (!res) {
/* Look for a "busy" place */ /* Look for a "busy" place */
if (priority_jump || option_priority_jumping) if (priority_jump || ast_opt_priority_jumping)
ast_goto_if_exists(chan, chan->context, chan->exten, chan->priority + 101); ast_goto_if_exists(chan, chan->context, chan->exten, chan->priority + 101);
} else if (res > 0) } else if (res > 0)
res = 0; res = 0;
......
...@@ -130,7 +130,7 @@ static int playback_exec(struct ast_channel *chan, void *data) ...@@ -130,7 +130,7 @@ static int playback_exec(struct ast_channel *chan, void *data)
ast_stopstream(chan); ast_stopstream(chan);
} else { } else {
ast_log(LOG_WARNING, "ast_streamfile failed on %s for %s\n", chan->name, (char *)data); ast_log(LOG_WARNING, "ast_streamfile failed on %s for %s\n", chan->name, (char *)data);
if (priority_jump || option_priority_jumping) if (priority_jump || ast_opt_priority_jumping)
ast_goto_if_exists(chan, chan->context, chan->exten, chan->priority + 101); ast_goto_if_exists(chan, chan->context, chan->exten, chan->priority + 101);
res = 0; res = 0;
mres = 1; mres = 1;
......
...@@ -202,7 +202,7 @@ static int privacy_exec (struct ast_channel *chan, void *data) ...@@ -202,7 +202,7 @@ static int privacy_exec (struct ast_channel *chan, void *data)
ast_verbose (VERBOSE_PREFIX_3 "Changed Caller*ID to %s\n",phone); ast_verbose (VERBOSE_PREFIX_3 "Changed Caller*ID to %s\n",phone);
pbx_builtin_setvar_helper(chan, "PRIVACYMGRSTATUS", "SUCCESS"); pbx_builtin_setvar_helper(chan, "PRIVACYMGRSTATUS", "SUCCESS");
} else { } else {
if (priority_jump || option_priority_jumping) if (priority_jump || ast_opt_priority_jumping)
ast_goto_if_exists(chan, chan->context, chan->exten, chan->priority + 101); ast_goto_if_exists(chan, chan->context, chan->exten, chan->priority + 101);
pbx_builtin_setvar_helper(chan, "PRIVACYMGRSTATUS", "FAILED"); pbx_builtin_setvar_helper(chan, "PRIVACYMGRSTATUS", "FAILED");
} }
......
...@@ -2617,7 +2617,7 @@ static int pqm_exec(struct ast_channel *chan, void *data) ...@@ -2617,7 +2617,7 @@ static int pqm_exec(struct ast_channel *chan, void *data)
if (set_member_paused(args.queuename, args.interface, 1)) { if (set_member_paused(args.queuename, args.interface, 1)) {
ast_log(LOG_WARNING, "Attempt to pause interface %s, not found\n", args.interface); ast_log(LOG_WARNING, "Attempt to pause interface %s, not found\n", args.interface);
if (priority_jump || option_priority_jumping) { if (priority_jump || ast_opt_priority_jumping) {
if (ast_goto_if_exists(chan, chan->context, chan->exten, chan->priority + 101)) { if (ast_goto_if_exists(chan, chan->context, chan->exten, chan->priority + 101)) {
pbx_builtin_setvar_helper(chan, "PQMSTATUS", "NOTFOUND"); pbx_builtin_setvar_helper(chan, "PQMSTATUS", "NOTFOUND");
LOCAL_USER_REMOVE(u); LOCAL_USER_REMOVE(u);
...@@ -2673,7 +2673,7 @@ static int upqm_exec(struct ast_channel *chan, void *data) ...@@ -2673,7 +2673,7 @@ static int upqm_exec(struct ast_channel *chan, void *data)
if (set_member_paused(args.queuename, args.interface, 0)) { if (set_member_paused(args.queuename, args.interface, 0)) {
ast_log(LOG_WARNING, "Attempt to unpause interface %s, not found\n", args.interface); ast_log(LOG_WARNING, "Attempt to unpause interface %s, not found\n", args.interface);
if (priority_jump || option_priority_jumping) { if (priority_jump || ast_opt_priority_jumping) {
if (ast_goto_if_exists(chan, chan->context, chan->exten, chan->priority + 101)) { if (ast_goto_if_exists(chan, chan->context, chan->exten, chan->priority + 101)) {
pbx_builtin_setvar_helper(chan, "UPQMSTATUS", "NOTFOUND"); pbx_builtin_setvar_helper(chan, "UPQMSTATUS", "NOTFOUND");
LOCAL_USER_REMOVE(u); LOCAL_USER_REMOVE(u);
...@@ -2738,7 +2738,7 @@ static int rqm_exec(struct ast_channel *chan, void *data) ...@@ -2738,7 +2738,7 @@ static int rqm_exec(struct ast_channel *chan, void *data)
break; break;
case RES_EXISTS: case RES_EXISTS:
ast_log(LOG_WARNING, "Unable to remove interface '%s' from queue '%s': Not there\n", args.interface, args.queuename); ast_log(LOG_WARNING, "Unable to remove interface '%s' from queue '%s': Not there\n", args.interface, args.queuename);
if (priority_jump || option_priority_jumping) if (priority_jump || ast_opt_priority_jumping)
ast_goto_if_exists(chan, chan->context, chan->exten, chan->priority + 101); ast_goto_if_exists(chan, chan->context, chan->exten, chan->priority + 101);
pbx_builtin_setvar_helper(chan, "RQMSTATUS", "NOTINQUEUE"); pbx_builtin_setvar_helper(chan, "RQMSTATUS", "NOTINQUEUE");
res = 0; res = 0;
...@@ -2814,7 +2814,7 @@ static int aqm_exec(struct ast_channel *chan, void *data) ...@@ -2814,7 +2814,7 @@ static int aqm_exec(struct ast_channel *chan, void *data)
break; break;
case RES_EXISTS: case RES_EXISTS:
ast_log(LOG_WARNING, "Unable to add interface '%s' to queue '%s': Already there\n", args.interface, args.queuename); ast_log(LOG_WARNING, "Unable to add interface '%s' to queue '%s': Already there\n", args.interface, args.queuename);
if (priority_jump || option_priority_jumping) if (priority_jump || ast_opt_priority_jumping)
ast_goto_if_exists(chan, chan->context, chan->exten, chan->priority + 101); ast_goto_if_exists(chan, chan->context, chan->exten, chan->priority + 101);
pbx_builtin_setvar_helper(chan, "AQMSTATUS", "MEMBERALREADY"); pbx_builtin_setvar_helper(chan, "AQMSTATUS", "MEMBERALREADY");
res = 0; res = 0;
......
...@@ -249,7 +249,7 @@ static int record_exec(struct ast_channel *chan, void *data) ...@@ -249,7 +249,7 @@ static int record_exec(struct ast_channel *chan, void *data)
goto out; goto out;
} }
if (option_transmit_silence_during_record) if (ast_opt_transmit_silence)
silgen = ast_channel_start_silence_generator(chan); silgen = ast_channel_start_silence_generator(chan);
/* Request a video update */ /* Request a video update */
......
...@@ -105,7 +105,7 @@ static int sendtext_exec(struct ast_channel *chan, void *data) ...@@ -105,7 +105,7 @@ static int sendtext_exec(struct ast_channel *chan, void *data)
if (!chan->tech->send_text) { if (!chan->tech->send_text) {
ast_mutex_unlock(&chan->lock); ast_mutex_unlock(&chan->lock);
/* Does not support transport */ /* Does not support transport */
if (priority_jump || option_priority_jumping) if (priority_jump || ast_opt_priority_jumping)
ast_goto_if_exists(chan, chan->context, chan->exten, chan->priority + 101); ast_goto_if_exists(chan, chan->context, chan->exten, chan->priority + 101);
LOCAL_USER_REMOVE(u); LOCAL_USER_REMOVE(u);
return 0; return 0;
......
...@@ -111,7 +111,7 @@ static int system_exec_helper(struct ast_channel *chan, void *data, int failmode ...@@ -111,7 +111,7 @@ static int system_exec_helper(struct ast_channel *chan, void *data, int failmode
} else { } else {
if (res < 0) if (res < 0)
res = 0; res = 0;
if (option_priority_jumping && res) if (ast_opt_priority_jumping && res)
ast_goto_if_exists(chan, chan->context, chan->exten, chan->priority + 101); ast_goto_if_exists(chan, chan->context, chan->exten, chan->priority + 101);
if (res != 0) if (res != 0)
......
...@@ -131,7 +131,7 @@ static int transfer_exec(struct ast_channel *chan, void *data) ...@@ -131,7 +131,7 @@ static int transfer_exec(struct ast_channel *chan, void *data)
if (res < 0) { if (res < 0) {
status = "FAILURE"; status = "FAILURE";
if (priority_jump || option_priority_jumping) if (priority_jump || ast_opt_priority_jumping)
ast_goto_if_exists(chan, chan->context, chan->exten, chan->priority + 101); ast_goto_if_exists(chan, chan->context, chan->exten, chan->priority + 101);
res = 0; res = 0;
} else { } else {
......
...@@ -119,7 +119,7 @@ static int txtcidname_exec(struct ast_channel *chan, void *data) ...@@ -119,7 +119,7 @@ static int txtcidname_exec(struct ast_channel *chan, void *data)
} }
if (!res) { if (!res) {
/* Look for a "busy" place */ /* Look for a "busy" place */
if (priority_jump || option_priority_jumping) if (priority_jump || ast_opt_priority_jumping)
ast_goto_if_exists(chan, chan->context, chan->exten, chan->priority + 101); ast_goto_if_exists(chan, chan->context, chan->exten, chan->priority + 101);
pbx_builtin_setvar_helper(chan, "TXTCIDNAMESTATUS", "FAILED"); pbx_builtin_setvar_helper(chan, "TXTCIDNAMESTATUS", "FAILED");
} else if (res > 0) } else if (res > 0)
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment