Fix setting CDR variables in the hangup extension
authorTerry Wilson <twilson@digium.com>
Wed, 28 Mar 2012 19:39:24 +0000 (19:39 +0000)
committerTerry Wilson <twilson@digium.com>
Wed, 28 Mar 2012 19:39:24 +0000 (19:39 +0000)
A previous CDR fix for setting CDR variables during a bridge via
custom dialplan features broke setting CDR variables in the
hangup extension. This patch fixes the issue.

Review: https://reviewboard.asterisk.org/r/1794/
........

Merged revisions 358978 from http://svn.asterisk.org/svn/asterisk/branches/1.8
........

Merged revisions 358989 from http://svn.asterisk.org/svn/asterisk/branches/10

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

addons/cdr_mysql.c
addons/chan_ooh323.c
apps/confbridge/conf_config_parser.c
cdr/cdr_adaptive_odbc.c
channels/chan_gtalk.c
channels/chan_jingle.c

index ecdfaea..445f9e3 100644 (file)
@@ -462,6 +462,7 @@ static int my_load_module(int reload)
                if (reload) {
                        AST_RWLIST_UNLOCK(&columns);
                }
+               ast_config_destroy(cfg);
                return AST_MODULE_LOAD_SUCCESS;
        }
 
@@ -502,6 +503,7 @@ static int my_load_module(int reload)
                if (reload) {
                        AST_RWLIST_UNLOCK(&columns);
                }
+               ast_config_destroy(cfg);
                return AST_MODULE_LOAD_FAILURE;
        }
 
index 129a916..f229e86 100644 (file)
@@ -2720,6 +2720,7 @@ int reload_config(int reload)
                        ast_copy_string(gIP, v->value, sizeof(gIP));
                        if (ast_parse_arg(v->value, PARSE_ADDR, &bindaddr)) {
                                ast_log(LOG_WARNING, "Invalid address: %s\n", v->value);
+                               ast_config_destroy(cfg);
                                return 1;
                        }
                        if (ast_sockaddr_is_ipv6(&bindaddr)) {
@@ -2773,6 +2774,7 @@ int reload_config(int reload)
                        pNewAlias = ast_calloc(1, sizeof(struct ooAliases));
                        if (!pNewAlias) {
                                ast_log(LOG_ERROR, "Failed to allocate memory for h323id alias\n");
+                               ast_config_destroy(cfg);
                                return 1;
                        }
                        if (gAliasList == NULL) { /* first h323id - set as callerid if callerid is not set */
@@ -2787,6 +2789,7 @@ int reload_config(int reload)
                        pNewAlias = ast_calloc(1, sizeof(struct ooAliases));
                        if (!pNewAlias) {
                                ast_log(LOG_ERROR, "Failed to allocate memory for e164 alias\n");
+                               ast_config_destroy(cfg);
                                return 1;
                        }
                        pNewAlias->type =  T_H225AliasAddress_dialedDigits;
@@ -2798,6 +2801,7 @@ int reload_config(int reload)
                        pNewAlias = ast_calloc(1, sizeof(struct ooAliases));
                        if (!pNewAlias) {
                                ast_log(LOG_ERROR, "Failed to allocate memory for email alias\n");
+                               ast_config_destroy(cfg);
                                return 1;
                        }
                        pNewAlias->type =  T_H225AliasAddress_email_ID;
index 0ae9ada..d3a75c5 100644 (file)
@@ -1311,6 +1311,7 @@ int conf_load_config(int reload)
        }
 
        remove_all_delme();
+       ast_config_destroy(cfg);
 
        return 0;
 }
index 70e1aea..3f4c786 100644 (file)
@@ -286,6 +286,7 @@ static int load_config(void)
                else
                        ast_free(tableptr);
        }
+       ast_config_destroy(cfg);
        return res;
 }
 
index dcc3c48..95cbe23 100644 (file)
@@ -2286,6 +2286,7 @@ static int gtalk_load_config(void)
                cat = ast_category_browse(cfg, cat);
        }
 
+       ast_config_destroy(cfg);
        gtalk_update_externip();
        gtalk_free_candidates(global_candidates);
        return 1;
index 32c53bb..48cc550 100644 (file)
@@ -1926,6 +1926,7 @@ static int jingle_load_config(void)
                }
                cat = ast_category_browse(cfg, cat);
        }
+       ast_config_destroy(cfg);
        jingle_free_candidates(global_candidates);
        return 1;
 }