diff options
author | markster <markster@f38db490-d61c-443f-a65b-d21fe96a405b> | 2005-01-25 06:10:20 +0000 |
---|---|---|
committer | markster <markster@f38db490-d61c-443f-a65b-d21fe96a405b> | 2005-01-25 06:10:20 +0000 |
commit | 2207b9a515214bf72785eabf75bd587bd7df23e8 (patch) | |
tree | 5e740f79246c281ef1bc43bcffc87fd21f676005 /channels | |
parent | c7f2030d7977ded782c6430a33e57bbbb69cd6df (diff) |
Merge config updates (bug #3406)
git-svn-id: http://svn.digium.com/svn/asterisk/trunk@4889 f38db490-d61c-443f-a65b-d21fe96a405b
Diffstat (limited to 'channels')
-rwxr-xr-x | channels/chan_agent.c | 4 | ||||
-rwxr-xr-x | channels/chan_alsa.c | 4 | ||||
-rwxr-xr-x | channels/chan_h323.c | 4 | ||||
-rwxr-xr-x | channels/chan_iax2.c | 21 | ||||
-rwxr-xr-x | channels/chan_mgcp.c | 6 | ||||
-rwxr-xr-x | channels/chan_modem.c | 10 | ||||
-rwxr-xr-x | channels/chan_oss.c | 4 | ||||
-rwxr-xr-x | channels/chan_phone.c | 8 | ||||
-rwxr-xr-x | channels/chan_sip.c | 31 | ||||
-rwxr-xr-x | channels/chan_skinny.c | 12 | ||||
-rwxr-xr-x | channels/chan_vpb.c | 4 | ||||
-rwxr-xr-x | channels/chan_zap.c | 18 | ||||
-rwxr-xr-x | channels/iax2-provision.c | 2 |
13 files changed, 63 insertions, 65 deletions
diff --git a/channels/chan_agent.c b/channels/chan_agent.c index fd85007de..ca492cec6 100755 --- a/channels/chan_agent.c +++ b/channels/chan_agent.c @@ -876,7 +876,7 @@ static int read_agent_config(void) autologoff = 0; wrapuptime = 0; ackcall = 1; - cfg = ast_load(config); + cfg = ast_config_load(config); if (!cfg) { ast_log(LOG_NOTICE, "No agent configuration found -- agent support disabled\n"); return 0; @@ -988,7 +988,7 @@ static int read_agent_config(void) p = pn; } ast_mutex_unlock(&agentlock); - ast_destroy(cfg); + ast_config_destroy(cfg); return 0; } diff --git a/channels/chan_alsa.c b/channels/chan_alsa.c index 58de8a8f7..f1663336b 100755 --- a/channels/chan_alsa.c +++ b/channels/chan_alsa.c @@ -990,7 +990,7 @@ int load_module() int x; struct ast_config *cfg; struct ast_variable *v; - if ((cfg = ast_load(config))) { + if ((cfg = ast_config_load(config))) { v = ast_variable_browse(cfg, "general"); while(v) { if (!strcasecmp(v->name, "autoanswer")) @@ -1011,7 +1011,7 @@ int load_module() strncpy(outdevname, v->value, sizeof(outdevname)-1); v=v->next; } - ast_destroy(cfg); + ast_config_destroy(cfg); } res = pipe(sndcmd); if (res) { diff --git a/channels/chan_h323.c b/channels/chan_h323.c index 6309404ed..2b07ca980 100755 --- a/channels/chan_h323.c +++ b/channels/chan_h323.c @@ -1728,7 +1728,7 @@ int reload_config(void) char *cat; char *utype; - cfg = ast_load(config); + cfg = ast_config_load(config); /* We *must* have a config file otherwise stop immediately */ if (!cfg) { @@ -1867,7 +1867,7 @@ int reload_config(void) } cat = ast_category_browse(cfg, cat); } - ast_destroy(cfg); + ast_config_destroy(cfg); /* Register our H.323 aliases if any*/ while (alias) { diff --git a/channels/chan_iax2.c b/channels/chan_iax2.c index 5d5c0449a..2584fe8f9 100755 --- a/channels/chan_iax2.c +++ b/channels/chan_iax2.c @@ -15,7 +15,6 @@ #include <asterisk/frame.h> #include <asterisk/channel.h> #include <asterisk/channel_pvt.h> -#include <asterisk/config_pvt.h> #include <asterisk/logger.h> #include <asterisk/module.h> #include <asterisk/pbx.h> @@ -1470,7 +1469,7 @@ retry: } if (!owner) { if (pvt->vars) { - ast_destroy_realtime(pvt->vars); + ast_variables_destroy(pvt->vars); pvt->vars = NULL; } free(pvt); @@ -2170,7 +2169,7 @@ static struct iax2_peer *realtime_peer(const char *peername) } } } - ast_destroy_realtime(var); + ast_variables_destroy(var); } return peer; } @@ -2201,12 +2200,12 @@ static struct iax2_user *realtime_user(const char *username) tmp = tmp->next; } } - ast_destroy_realtime(var); + ast_variables_destroy(var); } return user; } -static void realtime_update(const char *peername, struct sockaddr_in *sin) +static void realtime_update_peer(const char *peername, struct sockaddr_in *sin) { char port[10]; char ipaddr[20]; @@ -4090,7 +4089,7 @@ static int check_access(int callno, struct sockaddr_in *sin, struct iax_ies *ies /* We found our match (use the first) */ /* copy vars */ for (v = user->vars ; v ; v = v->next) { - if((tmpvar = ast_new_variable(v->name, v->value))) { + if((tmpvar = ast_variable_new(v->name, v->value))) { tmpvar->next = iaxs[callno]->vars; iaxs[callno]->vars = tmpvar; } @@ -4871,7 +4870,7 @@ static int update_registry(char *name, struct sockaddr_in *sin, int callno, char p = find_peer(name); if (p) { if (ast_test_flag(p, IAX_TEMPONLY)) - realtime_update(name, sin); + realtime_update_peer(name, sin); if (inaddrcmp(&p->addr, sin)) { if (iax2_regfunk) iax2_regfunk(p->name, 1); @@ -7297,7 +7296,7 @@ static struct iax2_user *build_user(const char *name, struct ast_variable *v, in if (varname && (varval = strchr(varname,'='))) { *varval = '\0'; varval++; - if((tmpvar = ast_new_variable(varname, varval))) { + if((tmpvar = ast_variable_new(varname, varval))) { tmpvar->next = user->vars; user->vars = tmpvar; } @@ -7421,7 +7420,7 @@ static void destroy_user(struct iax2_user *user) ast_free_ha(user->ha); free_context(user->contexts); if(user->vars) { - ast_destroy_realtime(user->vars); + ast_variables_destroy(user->vars); user->vars = NULL; } free(user); @@ -7521,7 +7520,7 @@ static int set_config(char *config_file, int reload) static unsigned short int last_port=0; #endif - cfg = ast_load(config_file); + cfg = ast_config_load(config_file); if (!cfg) { ast_log(LOG_ERROR, "Unable to load config %s\n", config_file); @@ -7688,7 +7687,7 @@ static int set_config(char *config_file, int reload) } cat = ast_category_browse(cfg, cat); } - ast_destroy(cfg); + ast_config_destroy(cfg); set_timing(); return capability; } diff --git a/channels/chan_mgcp.c b/channels/chan_mgcp.c index 26ee4afd4..4e1995e7b 100755 --- a/channels/chan_mgcp.c +++ b/channels/chan_mgcp.c @@ -4043,7 +4043,7 @@ static int reload_config(void) ast_log(LOG_WARNING, "Unable to get hostname, MGCP disabled\n"); return 0; } - cfg = ast_load(config); + cfg = ast_config_load(config); /* We *must* have a config file otherwise stop immediately */ if (!cfg) { @@ -4144,7 +4144,7 @@ static int reload_config(void) hp = ast_gethostbyname(ourhost, &ahp); if (!hp) { ast_log(LOG_WARNING, "Unable to get our IP address, MGCP disabled\n"); - ast_destroy(cfg); + ast_config_destroy(cfg); return 0; } memcpy(&__ourip, hp->h_addr, sizeof(__ourip)); @@ -4181,7 +4181,7 @@ static int reload_config(void) } } ast_mutex_unlock(&netlock); - ast_destroy(cfg); + ast_config_destroy(cfg); /* SC: send audit only to the new endpoints */ g = gateways; diff --git a/channels/chan_modem.c b/channels/chan_modem.c index 4c4b6b80f..74f9ec7fc 100755 --- a/channels/chan_modem.c +++ b/channels/chan_modem.c @@ -949,7 +949,7 @@ int load_module() struct ast_variable *v; struct ast_modem_pvt *tmp; char driver[80]; - cfg = ast_load(config); + cfg = ast_config_load(config); /* We *must* have a config file otherwise stop immediately */ if (!cfg) { @@ -972,7 +972,7 @@ int load_module() } else { ast_log(LOG_ERROR, "Unable to register channel '%s'\n", v->value); - ast_destroy(cfg); + ast_config_destroy(cfg); ast_mutex_unlock(&iflock); __unload_module(); return -1; @@ -984,7 +984,7 @@ int load_module() if (ast_load_resource(driver)) { ast_log(LOG_ERROR, "Failed to load driver %s\n", driver); - ast_destroy(cfg); + ast_config_destroy(cfg); ast_mutex_unlock(&iflock); __unload_module(); return -1; @@ -1055,11 +1055,11 @@ int load_module() if (ast_channel_register(type, tdesc, /* XXX Don't know our types -- maybe we should register more than one XXX */ AST_FORMAT_SLINEAR, modem_request)) { ast_log(LOG_ERROR, "Unable to register channel class %s\n", type); - ast_destroy(cfg); + ast_config_destroy(cfg); __unload_module(); return -1; } - ast_destroy(cfg); + ast_config_destroy(cfg); /* And start the monitor for the first time */ restart_monitor(); return 0; diff --git a/channels/chan_oss.c b/channels/chan_oss.c index 0219e360d..b6dbeae22 100755 --- a/channels/chan_oss.c +++ b/channels/chan_oss.c @@ -1026,7 +1026,7 @@ int load_module() } for (x=0;x<sizeof(myclis)/sizeof(struct ast_cli_entry); x++) ast_cli_register(myclis + x); - if ((cfg = ast_load(config))) { + if ((cfg = ast_config_load(config))) { v = ast_variable_browse(cfg, "general"); while(v) { if (!strcasecmp(v->name, "autoanswer")) @@ -1045,7 +1045,7 @@ int load_module() playbackonly = ast_true(v->value); v=v->next; } - ast_destroy(cfg); + ast_config_destroy(cfg); } ast_pthread_create(&sthread, NULL, sound_thread, NULL); return 0; diff --git a/channels/chan_phone.c b/channels/chan_phone.c index b5e8d2683..a2a0c461a 100755 --- a/channels/chan_phone.c +++ b/channels/chan_phone.c @@ -1232,7 +1232,7 @@ int load_module() struct phone_pvt *tmp; int mode = MODE_IMMEDIATE; int txgain = DEFAULT_GAIN, rxgain = DEFAULT_GAIN; /* default gain 1.0 */ - cfg = ast_load(config); + cfg = ast_config_load(config); /* We *must* have a config file otherwise stop immediately */ if (!cfg) { @@ -1255,7 +1255,7 @@ int load_module() } else { ast_log(LOG_ERROR, "Unable to register channel '%s'\n", v->value); - ast_destroy(cfg); + ast_config_destroy(cfg); ast_mutex_unlock(&iflock); __unload_module(); return -1; @@ -1316,11 +1316,11 @@ int load_module() AST_FORMAT_G723_1 | AST_FORMAT_SLINEAR | AST_FORMAT_ULAW : prefformat, phone_request)) { ast_log(LOG_ERROR, "Unable to register channel class %s\n", type); - ast_destroy(cfg); + ast_config_destroy(cfg); __unload_module(); return -1; } - ast_destroy(cfg); + ast_config_destroy(cfg); /* And start the monitor for the first time */ restart_monitor(); return 0; diff --git a/channels/chan_sip.c b/channels/chan_sip.c index 232dc9497..41590e87e 100755 --- a/channels/chan_sip.c +++ b/channels/chan_sip.c @@ -18,7 +18,6 @@ #include <asterisk/lock.h> #include <asterisk/channel.h> #include <asterisk/channel_pvt.h> -#include <asterisk/config_pvt.h> #include <asterisk/config.h> #include <asterisk/logger.h> #include <asterisk/module.h> @@ -1137,7 +1136,7 @@ static struct sip_peer *realtime_peer(const char *peername, struct sockaddr_in * while(tmp) { if (!strcasecmp(tmp->name, "type") && !strcasecmp(tmp->value, "user")) { - ast_destroy_realtime(var); + ast_variables_destroy(var); return NULL; } tmp = tmp->next; @@ -1146,7 +1145,7 @@ static struct sip_peer *realtime_peer(const char *peername, struct sockaddr_in * peer = build_peer(peername, var, 1); if (peer) ast_set_flag(peer, SIP_REALTIME); - ast_destroy_realtime(var); + ast_variables_destroy(var); return peer; } @@ -1180,7 +1179,7 @@ static void sip_destroy_user(struct sip_user *user) { ast_free_ha(user->ha); if(user->vars) { - ast_destroy_realtime(user->vars); + ast_variables_destroy(user->vars); user->vars = NULL; } if (ast_test_flag(user, SIP_REALTIME)) @@ -1206,7 +1205,7 @@ static struct sip_user *realtime_user(const char *username) while (tmp) { if (!strcasecmp(tmp->name, "type") && !strcasecmp(tmp->value, "peer")) { - ast_destroy_realtime(var); + ast_variables_destroy(var); return NULL; } tmp = tmp->next; @@ -1220,7 +1219,7 @@ static struct sip_user *realtime_user(const char *username) /* Add some finishing touches, addresses, etc */ ast_set_flag(user, SIP_REALTIME); } - ast_destroy_realtime(var); + ast_variables_destroy(var); return user; } @@ -1531,7 +1530,7 @@ static void __sip_destroy(struct sip_pvt *p, int lockowner) } ast_mutex_destroy(&p->lock); if(p->vars) { - ast_destroy_realtime(p->vars); + ast_variables_destroy(p->vars); p->vars = NULL; } free(p); @@ -2295,7 +2294,7 @@ static struct sip_pvt *sip_alloc(char *callid, struct sockaddr_in *sin, int useg ast_log(LOG_WARNING, "Unable to create RTP session: %s\n", strerror(errno)); ast_mutex_destroy(&p->lock); if(p->vars) { - ast_destroy_realtime(p->vars); + ast_variables_destroy(p->vars); p->vars = NULL; } free(p); @@ -5569,7 +5568,7 @@ static int check_user_full(struct sip_pvt *p, struct sip_request *req, char *cmd ast_copy_flags(p, user, SIP_TRUSTRPID | SIP_USECLIENTCODE | SIP_NAT | SIP_PROG_INBAND | SIP_OSPAUTH); /* copy vars */ for (v = user->vars ; v ; v = v->next) { - if((tmpvar = ast_new_variable(v->name, v->value))) { + if((tmpvar = ast_variable_new(v->name, v->value))) { tmpvar->next = p->vars; p->vars = tmpvar; } @@ -8693,7 +8692,7 @@ static struct sip_user *build_user(const char *name, struct ast_variable *v, int if (varname && (varval = strchr(varname,'='))) { *varval = '\0'; varval++; - if((tmpvar = ast_new_variable(varname, varval))) { + if((tmpvar = ast_variable_new(varname, varval))) { tmpvar->next = user->vars; user->vars = tmpvar; } @@ -9012,7 +9011,7 @@ static int reload_config(void) ast_log(LOG_WARNING, "Unable to get hostname, SIP disabled\n"); return 0; } - cfg = ast_load(config); + cfg = ast_config_load(config); /* We *must* have a config file otherwise stop immediately */ if (!cfg) { @@ -9252,7 +9251,7 @@ static int reload_config(void) if (!hp) { ast_log(LOG_WARNING, "Unable to get IP address for %s, SIP disabled\n", ourhost); if (!__ourip.s_addr) { - ast_destroy(cfg); + ast_config_destroy(cfg); return 0; } } else @@ -9297,12 +9296,12 @@ static int reload_config(void) ast_mutex_unlock(&netlock); /* Release configuration from memory */ - ast_destroy(cfg); + ast_config_destroy(cfg); /* Load the list of manual NOTIFY types to support */ if (notify_types) - ast_destroy(notify_types); - notify_types = ast_load(notify_config); + ast_config_destroy(notify_types); + notify_types = ast_config_load(notify_config); return 0; } @@ -9740,7 +9739,7 @@ int unload_module() /* Free associated memory */ ast_mutex_destroy(&pl->lock); if(pl->vars) { - ast_destroy_realtime(pl->vars); + ast_variables_destroy(pl->vars); pl->vars = NULL; } free(pl); diff --git a/channels/chan_skinny.c b/channels/chan_skinny.c index b2a07d0b6..5cfc053f0 100755 --- a/channels/chan_skinny.c +++ b/channels/chan_skinny.c @@ -2639,7 +2639,7 @@ static int reload_config(void) return 0; } #endif - cfg = ast_load(config); + cfg = ast_config_load(config); /* We *must* have a config file otherwise stop immediately */ if (!cfg) { @@ -2690,7 +2690,7 @@ static int reload_config(void) hp = ast_gethostbyname(ourhost, &ahp); if (!hp) { ast_log(LOG_WARNING, "Unable to get our IP address, Skinny disabled\n"); - ast_destroy(cfg); + ast_config_destroy(cfg); return 0; } memcpy(&__ourip, hp->h_addr, sizeof(__ourip)); @@ -2726,7 +2726,7 @@ static int reload_config(void) skinnysock = socket(AF_INET, SOCK_STREAM, 0); if(setsockopt(skinnysock, SOL_SOCKET, SO_REUSEADDR, &on, sizeof(on)) == -1) { ast_log(LOG_ERROR, "Set Socket Options failed: errno %d, %s", errno, strerror(errno)); - ast_destroy(cfg); + ast_config_destroy(cfg); return 0; } @@ -2739,7 +2739,7 @@ static int reload_config(void) strerror(errno)); close(skinnysock); skinnysock = -1; - ast_destroy(cfg); + ast_config_destroy(cfg); return 0; } @@ -2749,7 +2749,7 @@ static int reload_config(void) strerror(errno)); close(skinnysock); skinnysock = -1; - ast_destroy(cfg); + ast_config_destroy(cfg); return 0; } @@ -2763,7 +2763,7 @@ static int reload_config(void) ast_mutex_unlock(&netlock); /* and unload the configuration when were done */ - ast_destroy(cfg); + ast_config_destroy(cfg); return 0; } diff --git a/channels/chan_vpb.c b/channels/chan_vpb.c index a3a59f48a..6543ac872 100755 --- a/channels/chan_vpb.c +++ b/channels/chan_vpb.c @@ -2425,7 +2425,7 @@ int load_module() int bal3 = -1; char * callerid = NULL; - cfg = ast_load(config); + cfg = ast_config_load(config); /* We *must* have a config file otherwise stop immediately */ if (!cfg) { @@ -2530,7 +2530,7 @@ int load_module() done: (void)0; } ast_mutex_unlock(&iflock); - ast_destroy(cfg); + ast_config_destroy(cfg); if (!error && ast_channel_register(type, tdesc, prefformat, vpb_request) != 0) { ast_log(LOG_ERROR, "Unable to register channel class %s\n", type); diff --git a/channels/chan_zap.c b/channels/chan_zap.c index 33181e3f6..0129987b9 100755 --- a/channels/chan_zap.c +++ b/channels/chan_zap.c @@ -9236,7 +9236,7 @@ static int setup_zap(int reload) struct zt_pri *pri; #endif - cfg = ast_load(config); + cfg = ast_config_load(config); /* We *must* have a config file otherwise stop immediately */ if (!cfg) { @@ -9321,7 +9321,7 @@ static int setup_zap(int reload) if (reload == 0) { if (cur_signalling < 0) { ast_log(LOG_ERROR, "Signalling must be specified before any channels are.\n"); - ast_destroy(cfg); + ast_config_destroy(cfg); ast_mutex_unlock(&iflock); return -1; } @@ -9333,13 +9333,13 @@ static int setup_zap(int reload) if (!strcasecmp(v->name, "crv")) { if (sscanf(c, "%d:%n", &trunkgroup, &y) != 1) { ast_log(LOG_WARNING, "CRV must begin with trunkgroup followed by a colon at line %d\n", v->lineno); - ast_destroy(cfg); + ast_config_destroy(cfg); ast_mutex_unlock(&iflock); return -1; } if (trunkgroup < 1) { ast_log(LOG_WARNING, "CRV trunk group must be a postive number at line %d\n", v->lineno); - ast_destroy(cfg); + ast_config_destroy(cfg); ast_mutex_unlock(&iflock); return -1; } @@ -9352,7 +9352,7 @@ static int setup_zap(int reload) } if (!pri) { ast_log(LOG_WARNING, "No such trunk group %d at CRV declaration at line %d\n", trunkgroup, v->lineno); - ast_destroy(cfg); + ast_config_destroy(cfg); ast_mutex_unlock(&iflock); return -1; } @@ -9370,7 +9370,7 @@ static int setup_zap(int reload) found_pseudo = 1; } else { ast_log(LOG_ERROR, "Syntax error parsing '%s' at '%s'\n", v->value, chan); - ast_destroy(cfg); + ast_config_destroy(cfg); ast_mutex_unlock(&iflock); return -1; } @@ -9401,7 +9401,7 @@ static int setup_zap(int reload) ast_log(LOG_ERROR, "Unable to reconfigure channel '%s'\n", v->value); else ast_log(LOG_ERROR, "Unable to register channel '%s'\n", v->value); - ast_destroy(cfg); + ast_config_destroy(cfg); ast_mutex_unlock(&iflock); return -1; } @@ -9741,7 +9741,7 @@ static int setup_zap(int reload) switchtype = PRI_SWITCH_QSIG; else { ast_log(LOG_ERROR, "Unknown switchtype '%s'\n", v->value); - ast_destroy(cfg); + ast_config_destroy(cfg); ast_mutex_unlock(&iflock); return -1; } @@ -9923,7 +9923,7 @@ static int setup_zap(int reload) } } ast_mutex_unlock(&iflock); - ast_destroy(cfg); + ast_config_destroy(cfg); #ifdef ZAPATA_PRI if (!reload) { for (x=0;x<NUM_SPANS;x++) { diff --git a/channels/iax2-provision.c b/channels/iax2-provision.c index a7be72838..dc31e33c8 100755 --- a/channels/iax2-provision.c +++ b/channels/iax2-provision.c @@ -483,7 +483,7 @@ int iax_provision_reload(void) cur->dead = 1; cur = cur->next; } - cfg = ast_load("iaxprov.conf"); + cfg = ast_config_load("iaxprov.conf"); if (cfg) { /* Load as appropriate */ cat = ast_category_browse(cfg, NULL); |