diff options
-rw-r--r-- | CHANGES | 14 | ||||
-rw-r--r-- | apps/app_record.c | 13 | ||||
-rw-r--r-- | apps/app_voicemail.c | 19 | ||||
-rw-r--r-- | configs/samples/voicemail.conf.sample | 7 |
4 files changed, 45 insertions, 8 deletions
@@ -9,6 +9,20 @@ ============================================================================== ------------------------------------------------------------------------------ +--- Functionality changes from Asterisk 13.14.0 to Asterisk 13.15.0 ---------- +------------------------------------------------------------------------------ + +app_record +------------------ + * Added new 'u' option to Record() application which prevents Asterisk from + truncating silence from the end of recorded files. + +app_voicemail +------------------ + * The 'Comedian Mail' prompts can now be overriden using the 'vm-login' and + 'vm-newuser' configuration options in voicemail.conf. + +------------------------------------------------------------------------------ --- Functionality changes from Asterisk 13.13.0 to Asterisk 13.14.0 ---------- ------------------------------------------------------------------------------ diff --git a/apps/app_record.c b/apps/app_record.c index 31a54e663..56dc5f47f 100644 --- a/apps/app_record.c +++ b/apps/app_record.c @@ -81,6 +81,9 @@ ASTERISK_FILE_VERSION(__FILE__, "$Revision$") <option name="t"> <para>use alternate '*' terminator key (DTMF) instead of default '#'</para> </option> + <option name="u"> + <para>Don't truncate recorded silence.</para> + </option> <option name="x"> <para>Ignore all terminator keys (DTMF) and keep recording until hangup.</para> </option> @@ -133,6 +136,7 @@ enum { FLAG_HAS_PERCENT = (1 << 7), OPTION_ANY_TERMINATE = (1 << 8), OPTION_OPERATOR_EXIT = (1 << 9), + OPTION_NO_TRUNCATE = (1 << 10), }; AST_APP_OPTIONS(app_opts,{ @@ -143,6 +147,7 @@ AST_APP_OPTIONS(app_opts,{ AST_APP_OPTION('q', OPTION_QUIET), AST_APP_OPTION('s', OPTION_SKIP), AST_APP_OPTION('t', OPTION_STAR_TERMINATE), + AST_APP_OPTION('u', OPTION_NO_TRUNCATE), AST_APP_OPTION('y', OPTION_ANY_TERMINATE), AST_APP_OPTION('x', OPTION_IGNORE_TERMINATE), }); @@ -194,6 +199,7 @@ static int record_exec(struct ast_channel *chan, const char *data) int dspsilence = 0; int silence = 0; /* amount of silence to allow */ int gotsilence = 0; /* did we timeout for silence? */ + int truncate_silence = 1; /* truncate on complete silence recording */ int maxduration = 0; /* max duration of recording in milliseconds */ int gottimeout = 0; /* did we timeout for maxduration exceeded? */ int terminator = '#'; @@ -245,7 +251,10 @@ static int record_exec(struct ast_channel *chan, const char *data) ast_log(LOG_WARNING, "'%s' is not a valid silence duration\n", args.silence); } } - + + if (ast_test_flag(&flags, OPTION_NO_TRUNCATE)) + truncate_silence = 0; + if (args.maxduration) { if ((sscanf(args.maxduration, "%30d", &i) == 1) && (i > -1)) /* Convert duration to milliseconds */ @@ -445,7 +454,7 @@ static int record_exec(struct ast_channel *chan, const char *data) } } - if (gotsilence) { + if (gotsilence && truncate_silence) { ast_stream_rewind(s, silence - 1000); ast_truncstream(s); } else if (!gottimeout && f) { diff --git a/apps/app_voicemail.c b/apps/app_voicemail.c index 5e4df8ea4..ef210c2ef 100644 --- a/apps/app_voicemail.c +++ b/apps/app_voicemail.c @@ -1036,6 +1036,8 @@ static char listen_control_restart_key[12]; static char listen_control_stop_key[12]; /* custom password sounds */ +static char vm_login[80] = "vm-login"; +static char vm_newuser[80] = "vm-newuser"; static char vm_password[80] = "vm-password"; static char vm_newpassword[80] = "vm-newpassword"; static char vm_passchanged[80] = "vm-passchanged"; @@ -10406,7 +10408,7 @@ static int vm_instructions(struct ast_channel *chan, struct ast_vm_user *vmu, st } -static int vm_newuser(struct ast_channel *chan, struct ast_vm_user *vmu, struct vm_state *vms, char *fmtc, signed char record_gain) +static int vm_newuser_setup(struct ast_channel *chan, struct ast_vm_user *vmu, struct vm_state *vms, char *fmtc, signed char record_gain) { int cmd = 0; int duration = 0; @@ -10996,7 +10998,7 @@ static int vm_authenticate(struct ast_channel *chan, char *mailbox, int mailbox_ adsi_begin(chan, &useadsi); if (!skipuser && useadsi) adsi_login(chan); - if (!silent && !skipuser && ast_streamfile(chan, "vm-login", ast_channel_language(chan))) { + 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; } @@ -11127,7 +11129,6 @@ static int play_message_by_id_helper(struct ast_channel *chan, /* Found the msg, so play it back */ make_file(vms->fn, sizeof(vms->fn), vms->curdir, vms->curmsg); - make_file(vms->fn, sizeof(vms->fn), vms->curdir, vms->curmsg); #ifdef IMAP_STORAGE /*IMAP storage stores any prepended message from a forward @@ -11137,6 +11138,8 @@ static int play_message_by_id_helper(struct ast_channel *chan, wait_file(chan, vms, vms->introfn); } #endif + RETRIEVE(vms->curdir,vms->curmsg,vmu->mailbox, vmu->context); + if ((wait_file(chan, vms, vms->fn)) < 0) { ast_log(AST_LOG_WARNING, "Playback of message %s failed\n", vms->fn); } else { @@ -11148,7 +11151,7 @@ static int play_message_by_id_helper(struct ast_channel *chan, ast_mutex_unlock(&vms->lock); #endif } - + DISPOSE(vms->curdir, vms->curmsg); return 0; } @@ -11493,9 +11496,9 @@ static int vm_execmain(struct ast_channel *chan, const char *data) /* Check to see if this is a new user */ if (!strcasecmp(vmu->mailbox, vmu->password) && (ast_test_flag(vmu, VM_FORCENAME | VM_FORCEGREET))) { - if (ast_play_and_wait(chan, "vm-newuser") == -1) + if (ast_play_and_wait(chan, vm_newuser) == -1) ast_log(AST_LOG_WARNING, "Couldn't stream new user file\n"); - cmd = vm_newuser(chan, vmu, &vms, vmfmts, record_gain); + cmd = vm_newuser_setup(chan, vmu, &vms, vmfmts, record_gain); if ((cmd == 't') || (cmd == '#')) { /* Timeout */ ast_test_suite_event_notify("TIMEOUT", "Message: response from user timed out"); @@ -13912,6 +13915,10 @@ static int actual_load_config(int reload, struct ast_config *cfg, struct ast_con } /* load password sounds configuration */ + if ((val = ast_variable_retrieve(cfg, "general", "vm-login"))) + ast_copy_string(vm_login, val, sizeof(vm_login)); + if ((val = ast_variable_retrieve(cfg, "general", "vm-newuser"))) + ast_copy_string(vm_newuser, val, sizeof(vm_newuser)); if ((val = ast_variable_retrieve(cfg, "general", "vm-password"))) ast_copy_string(vm_password, val, sizeof(vm_password)); if ((val = ast_variable_retrieve(cfg, "general", "vm-newpassword"))) diff --git a/configs/samples/voicemail.conf.sample b/configs/samples/voicemail.conf.sample index 248e142eb..1c91ffb34 100644 --- a/configs/samples/voicemail.conf.sample +++ b/configs/samples/voicemail.conf.sample @@ -333,6 +333,13 @@ sendvoicemail=yes ; Allow the user to compose and send a voicemail while inside ; The default is "no". ; minpassword=0 ; Enforce minimum password length +; vm-login=custom_sound + ; Customize which sound file is used instead of the default + ; prompt that says: "Comedian Mail. Mailbox?" +; vm-newuser=custom_sound + ; Customize which sound file is used instead of the default + ; prompt that says: "Welcome to Comedian Mail. First, I will + ; guide you through a short setup process." ; vm-password=custom_sound ; Customize which sound file is used instead of the default ; prompt that says: "password" |