diff --git a/apps/app_voicemail.c b/apps/app_voicemail.c index 31b81dee14..bd01be0fe8 100755 --- a/apps/app_voicemail.c +++ b/apps/app_voicemail.c @@ -1332,16 +1332,22 @@ static int leave_voicemail(struct ast_channel *chan, char *ext, int silent, int } /* Check for a '0' here */ if (res == '0') { - transfer: - strncpy(chan->exten, "o", sizeof(chan->exten) - 1); - if (!ast_strlen_zero(vmu->exit)) { - strncpy(chan->context, vmu->exit, sizeof(chan->context) - 1); - } else if (ousemacro && !ast_strlen_zero(chan->macrocontext)) { - strncpy(chan->context, chan->macrocontext, sizeof(chan->context) - 1); + transfer: + if (vmu->operator) { + strncpy(chan->exten, "o", sizeof(chan->exten) - 1); + if (!ast_strlen_zero(vmu->exit)) { + strncpy(chan->context, vmu->exit, sizeof(chan->context) - 1); + } else if (ousemacro && !ast_strlen_zero(chan->macrocontext)) { + strncpy(chan->context, chan->macrocontext, sizeof(chan->context) - 1); + } + ast_play_and_wait(chan, "transfer"); + chan->priority = 0; + free_user(vmu); + return 0; + } else { + ast_play_and_wait(chan, "vm-sorry"); + return 0; } - chan->priority = 0; - free_user(vmu); - return 0; } if (res < 0) { free_user(vmu); @@ -4605,9 +4611,7 @@ static int play_record_review(struct ast_channel *chan, char *playfile, char *re /* User has hung up, no options to give */ return res; if (cmd == '0') { - /* Erase the message if 0 pushed during playback */ - ast_play_and_wait(chan, "vm-deleted"); - vm_delete(recordfile); + break; } else if (cmd == '*') { break; } @@ -4660,13 +4664,11 @@ static int play_record_review(struct ast_channel *chan, char *playfile, char *re return 1; #endif case '0': - if (outsidecaller && vmu->operator) { - if (message_exists) - ast_play_and_wait(chan, "vm-msgsaved"); - return cmd; - } else - cmd = ast_play_and_wait(chan, "vm-sorry"); - break; + if (message_exists || recorded) { + ast_play_and_wait(chan, "vm-deleted"); + vm_delete(recordfile); + } + return cmd; default: /* If the caller is an ouside caller, and the review option is enabled, allow them to review the message, but let the owner of the box review diff --git a/include/asterisk/lock.h b/include/asterisk/lock.h index 7d2807d858..dad4fcc0a9 100755 --- a/include/asterisk/lock.h +++ b/include/asterisk/lock.h @@ -368,6 +368,8 @@ static inline int ast_mutex_trylock(ast_mutex_t *pmutex) #define AST_MUTEX_INITIALIZER __use_AST_MUTEX_DEFINE_STATIC_rather_than_AST_MUTEX_INITIALIZER__ #define gethostbyname __gethostbyname__is__not__reentrant__use__ast_gethostbyname__instead__ +#ifndef __linux__ #define pthread_create __use_ast_pthread_create_instead__ +#endif #endif diff --git a/include/asterisk/utils.h b/include/asterisk/utils.h index 4543cd498b..7c47fac893 100755 --- a/include/asterisk/utils.h +++ b/include/asterisk/utils.h @@ -15,6 +15,7 @@ #include #include #include +#include static inline int ast_strlen_zero(const char *s) { @@ -41,7 +42,7 @@ extern int ast_utils_init(void); #endif #define inet_ntoa __dont__use__inet_ntoa__use__ast_inet_ntoa__instead__ -#ifdef LINUX +#ifdef __linux__ #define ast_pthread_create pthread_create #define ast_strcasestr strcasestr #else @@ -50,7 +51,7 @@ extern int ast_utils_init(void); #define PTHREAD_ATTR_STACKSIZE 2097152 #endif /* PTHREAD_ATTR_STACKSIZE */ extern int ast_pthread_create(pthread_t *thread, pthread_attr_t *attr, void *(*start_routine)(void *), void *data); -#endif /* LINUX */ +#endif /* __linux__ */ extern char *ast_strcasestr(const char *, const char *); diff --git a/pbx.c b/pbx.c index 47048de6f2..b5696e028f 100755 --- a/pbx.c +++ b/pbx.c @@ -4818,7 +4818,7 @@ static int pbx_builtin_background(struct ast_channel *chan, void *data) res = ast_waitstream(chan, AST_DIGIT_ANY); ast_stopstream(chan); } else { - ast_log(LOG_WARNING, "ast_streamfile failed on %s fro %s\n", chan->name, (char*)data); + ast_log(LOG_WARNING, "ast_streamfile failed on %s for %s\n", chan->name, (char*)data); res = 0; } } diff --git a/utils.c b/utils.c index a454ea4bf9..49fe1f3fe9 100755 --- a/utils.c +++ b/utils.c @@ -365,7 +365,7 @@ int ast_utils_init(void) } -#ifndef LINUX +#ifndef __linux__ #undef pthread_create /* For ast_pthread_create function only */ int ast_pthread_create(pthread_t *thread, pthread_attr_t *attr, void *(*start_routine)(void *), void *data) { @@ -381,6 +381,8 @@ int ast_pthread_create(pthread_t *thread, pthread_attr_t *attr, void *(*start_ro } #endif /* ! LINUX */ +/* Case-insensitive substring matching */ +#ifndef LINUX static char *upper(const char *orig, char *buf, int bufsize) { int i; @@ -394,8 +396,6 @@ static char *upper(const char *orig, char *buf, int bufsize) return buf; } -/* Case-insensitive substring matching */ -#ifndef LINUX char *ast_strcasestr(const char *haystack, const char *needle) { char *u1, *u2;