Standardize the option names for consistency (but continue to work with the

existing names for backwards compatibility).
(closes issue #13370)
 Reported by: jsturtevant


git-svn-id: https://origsvn.digium.com/svn/asterisk/trunk@140167 65c4cc65-6c06-0410-ace0-fbb531ad65f3
This commit is contained in:
Tilghman Lesher 2008-08-26 18:05:58 +00:00
parent 36c196abcd
commit 74dfd3fcea
2 changed files with 45 additions and 32 deletions

View File

@ -313,37 +313,50 @@ static int reload_followme(int reload)
featuredigittimeout = 5000; featuredigittimeout = 5000;
} }
takecallstr = ast_variable_retrieve(cfg, "general", "takecall"); if ((takecallstr = ast_variable_retrieve(cfg, "general", "takecall")) && !ast_strlen_zero(takecallstr)) {
if (!ast_strlen_zero(takecallstr))
ast_copy_string(takecall, takecallstr, sizeof(takecall)); ast_copy_string(takecall, takecallstr, sizeof(takecall));
}
declinecallstr = ast_variable_retrieve(cfg, "general", "declinecall"); if ((declinecallstr = ast_variable_retrieve(cfg, "general", "declinecall")) && !ast_strlen_zero(declinecallstr)) {
if (!ast_strlen_zero(declinecallstr))
ast_copy_string(nextindp, declinecallstr, sizeof(nextindp)); ast_copy_string(nextindp, declinecallstr, sizeof(nextindp));
}
tmpstr = ast_variable_retrieve(cfg, "general", "call-from-prompt"); if ((tmpstr = ast_variable_retrieve(cfg, "general", "call-from-prompt")) && !ast_strlen_zero(tmpstr)) {
if (!ast_strlen_zero(tmpstr))
ast_copy_string(callfromprompt, tmpstr, sizeof(callfromprompt)); ast_copy_string(callfromprompt, tmpstr, sizeof(callfromprompt));
} else if ((tmpstr = ast_variable_retrieve(cfg, "general", "call_from_prompt")) && !ast_strlen_zero(tmpstr)) {
ast_copy_string(callfromprompt, tmpstr, sizeof(callfromprompt));
}
tmpstr = ast_variable_retrieve(cfg, "general", "norecording-prompt"); if ((tmpstr = ast_variable_retrieve(cfg, "general", "norecording-prompt")) && !ast_strlen_zero(tmpstr)) {
if (!ast_strlen_zero(tmpstr))
ast_copy_string(norecordingprompt, tmpstr, sizeof(norecordingprompt)); ast_copy_string(norecordingprompt, tmpstr, sizeof(norecordingprompt));
} else if ((tmpstr = ast_variable_retrieve(cfg, "general", "norecording_prompt")) && !ast_strlen_zero(tmpstr)) {
ast_copy_string(callfromprompt, tmpstr, sizeof(callfromprompt));
}
tmpstr = ast_variable_retrieve(cfg, "general", "options-prompt");
if (!ast_strlen_zero(tmpstr)) if ((tmpstr = ast_variable_retrieve(cfg, "general", "options-prompt")) && !ast_strlen_zero(tmpstr)) {
ast_copy_string(optionsprompt, tmpstr, sizeof(optionsprompt)); ast_copy_string(optionsprompt, tmpstr, sizeof(optionsprompt));
} else if ((tmpstr = ast_variable_retrieve(cfg, "general", "options_prompt")) && !ast_strlen_zero(tmpstr)) {
ast_copy_string(optionsprompt, tmpstr, sizeof(optionsprompt));
}
tmpstr = ast_variable_retrieve(cfg, "general", "pls-hold-prompt"); if ((tmpstr = ast_variable_retrieve(cfg, "general", "pls-hold-prompt")) && !ast_strlen_zero(tmpstr)) {
if (!ast_strlen_zero(tmpstr)) ast_copy_string(optionsprompt, tmpstr, sizeof(optionsprompt));
ast_copy_string(plsholdprompt, tmpstr, sizeof(plsholdprompt)); } else if ((tmpstr = ast_variable_retrieve(cfg, "general", "pls_hold_prompt")) && !ast_strlen_zero(tmpstr)) {
ast_copy_string(optionsprompt, tmpstr, sizeof(optionsprompt));
}
tmpstr = ast_variable_retrieve(cfg, "general", "status-prompt"); if ((tmpstr = ast_variable_retrieve(cfg, "general", "status-prompt")) && !ast_strlen_zero(tmpstr)) {
if (!ast_strlen_zero(tmpstr)) ast_copy_string(optionsprompt, tmpstr, sizeof(optionsprompt));
ast_copy_string(statusprompt, tmpstr, sizeof(statusprompt)); } else if ((tmpstr = ast_variable_retrieve(cfg, "general", "status_prompt")) && !ast_strlen_zero(tmpstr)) {
ast_copy_string(optionsprompt, tmpstr, sizeof(optionsprompt));
}
tmpstr = ast_variable_retrieve(cfg, "general", "sorry-prompt"); if ((tmpstr = ast_variable_retrieve(cfg, "general", "sorry-prompt")) && !ast_strlen_zero(tmpstr)) {
if (!ast_strlen_zero(tmpstr)) ast_copy_string(optionsprompt, tmpstr, sizeof(optionsprompt));
ast_copy_string(sorryprompt, tmpstr, sizeof(sorryprompt)); } else if ((tmpstr = ast_variable_retrieve(cfg, "general", "sorry_prompt")) && !ast_strlen_zero(tmpstr)) {
ast_copy_string(optionsprompt, tmpstr, sizeof(optionsprompt));
}
/* Chug through config file */ /* Chug through config file */
while ((cat = ast_category_browse(cfg, cat))) { while ((cat = ast_category_browse(cfg, cat))) {
@ -376,7 +389,7 @@ static int reload_followme(int reload)
init_profile(f); init_profile(f);
free_numbers(f); free_numbers(f);
var = ast_variable_browse(cfg, cat); var = ast_variable_browse(cfg, cat);
while(var) { while (var) {
if (!strcasecmp(var->name, "number")) { if (!strcasecmp(var->name, "number")) {
int idx = 0; int idx = 0;

View File

@ -13,23 +13,23 @@ declinecall=>2
; The global default keypress for the callee to decline taking the current call. This can ; The global default keypress for the callee to decline taking the current call. This can
; be a single digit or multiple digits. Default is "2". ; be a single digit or multiple digits. Default is "2".
; ;
call-from-prompt=>followme/call-from call_from_prompt=>followme/call-from
; The global default for the 'Incoming call from' message. ; The global default for the 'Incoming call from' message.
; ;
norecording-prompt=>followme/no-recording norecording_prompt=>followme/no-recording
; The global default for the 'You have an incoming call' message when the caller elects ; The global default for the 'You have an incoming call' message when the caller elects
; not to leave their name or the option isn't set for them to do so. ; not to leave their name or the option isn't set for them to do so.
; ;
options-prompt=>followme/options options_prompt=>followme/options
; The global default for the 'Press 1 to accept this call or press 2 to decline it' message. ; The global default for the 'Press 1 to accept this call or press 2 to decline it' message.
; ;
pls-hold-prompt=>followme/pls-hold-while-try pls_hold_prompt=>followme/pls-hold-while-try
; The global default for 'Please hold while we try and connect your call' message. ; The global default for 'Please hold while we try and connect your call' message.
; ;
status-prompt=>followme/status status_prompt=>followme/status
; The global default for 'The party you're calling isn't at their desk' message. ; The global default for 'The party you're calling isn't at their desk' message.
; ;
sorry-prompt=>followme/sorry sorry_prompt=>followme/sorry
; The global default for 'I'm sorry, but we were unable to locate your party' message. ; The global default for 'I'm sorry, but we were unable to locate your party' message.
; ;
; ;
@ -59,27 +59,27 @@ declinecall=>2
; The keypress for the callee to decline taking the current call. This can ; The keypress for the callee to decline taking the current call. This can
; be a single digit or multiple digits. Default is the global default. ; be a single digit or multiple digits. Default is the global default.
; ;
call-from-prompt=>followme/call-from call_from_prompt=>followme/call-from
; The 'Incoming call from' message prompt. Default is the global default. ; The 'Incoming call from' message prompt. Default is the global default.
; ;
followme-norecording-prompt=>followme/no-recording norecording_prompt=>followme/no-recording
; The 'You have an incoming call' message prompt when the caller elects ; The 'You have an incoming call' message prompt when the caller elects
; not to leave their name or the option isn't set for them to do so. Default ; not to leave their name or the option isn't set for them to do so. Default
; is the global default. ; is the global default.
; ;
followme-options-prompt=>followme/options options_prompt=>followme/options
; The 'Press 1 to accept this call or press 2 to decline it' message prompt. ; The 'Press 1 to accept this call or press 2 to decline it' message prompt.
; Default is the global default. ; Default is the global default.
; ;
followme-pls-hold-prompt=>followme/pls-hold-while-try pls_hold_prompt=>followme/pls-hold-while-try
; The 'Please hold while we try and connect your call' message prompt. ; The 'Please hold while we try and connect your call' message prompt.
; Default is the global default. ; Default is the global default.
; ;
followme-status-prompt=>followme/status status_prompt=>followme/status
; The 'The party you're calling isn't at their desk' message prompt. ; The 'The party you're calling isn't at their desk' message prompt.
; Default is the global default. ; Default is the global default.
; ;
followme-sorry-prompt=>followme/sorry sorry_prompt=>followme/sorry
; The 'I'm sorry, but we were unable to locate your party' message prompt. Default ; The 'I'm sorry, but we were unable to locate your party' message prompt. Default
; is the global default. ; is the global default.