]> git.ipfire.org Git - thirdparty/asterisk.git/commitdiff
When using users.conf for the entries in the directory, if multiple users had the...
authorMark Michelson <mmichelson@digium.com>
Fri, 20 Jul 2007 18:42:27 +0000 (18:42 +0000)
committerMark Michelson <mmichelson@digium.com>
Fri, 20 Jul 2007 18:42:27 +0000 (18:42 +0000)
in the directory.

(closes issue #10200, reported by mrskippy, patched by me)

git-svn-id: https://origsvn.digium.com/svn/asterisk/branches/1.4@76139 65c4cc65-6c06-0410-ace0-fbb531ad65f3

apps/app_directory.c

index ea370d7db01da984033205b335ea448c97c30d8c..a5fb06e880cd5cf1208090d5561d565967ebd728 100644 (file)
@@ -404,6 +404,7 @@ static int do_directory(struct ast_channel *chan, struct ast_config *cfg, struct
        int lastuserchoice = 0;
        char *start, *conv, *stringp = NULL;
        const char *pos;
+       int breakout = 0;
 
        if (ast_strlen_zero(context)) {
                ast_log(LOG_WARNING,
@@ -527,6 +528,7 @@ static int do_directory(struct ast_channel *chan, struct ast_config *cfg, struct
                                                                 * user hungup
                                                                 */
                                                                lastuserchoice = 0;
+                                                               breakout = 1;
                                                                break;
                                                        case '1':
                                                                /* user pressed '1' and extensions exists;
@@ -534,19 +536,24 @@ static int do_directory(struct ast_channel *chan, struct ast_config *cfg, struct
                                                                   a goto() on the channel
                                                                 */
                                                                lastuserchoice = res;
+                                                               breakout = 1;
                                                                break;
                                                        case '*':
                                                                /* user pressed '*' to skip something found */
                                                                lastuserchoice = res;
+                                                               breakout = 0;
                                                                res = 0;
                                                                break;
                                                        default:
+                                                               breakout = 1;
                                                                break;
                                                        }
                                                        free(conv);
-                                                       break;
+                                                       if (breakout)
+                                                               break;
                                                }
-                                               free(conv);
+                                               else
+                                                       free(conv);
                                        }
                                }
                        }