]> git.ipfire.org Git - thirdparty/asterisk.git/commitdiff
The passed extension may not be the same in the list as the current entry,
authorTilghman Lesher <tilghman@meg.abyt.es>
Fri, 21 Nov 2008 23:07:46 +0000 (23:07 +0000)
committerTilghman Lesher <tilghman@meg.abyt.es>
Fri, 21 Nov 2008 23:07:46 +0000 (23:07 +0000)
because we strip spaces when copying the extension into the structure.
Therefore, use the copied item to place the item into the list.
(found by lmadsen on -dev, fixed by me)

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

main/pbx.c

index e324d04893dd8f3276a7fea302085bcc0c640b94..99ecee92b71b46ce36fecdef53cf2e951c183254 100644 (file)
@@ -4826,7 +4826,7 @@ int ast_add_extension2(struct ast_context *con,
        ast_mutex_lock(&con->lock);
        res = 0; /* some compilers will think it is uninitialized otherwise */
        for (e = con->root; e; el = e, e = e->next) {   /* scan the extension list */
-               res = ext_cmp(e->exten, extension);
+               res = ext_cmp(e->exten, tmp->exten);
                if (res == 0) { /* extension match, now look at cidmatch */
                        if (!e->matchcid && !tmp->matchcid)
                                res = 0;