aboutsummaryrefslogtreecommitdiffstats
path: root/channels/chan_iax.c
diff options
context:
space:
mode:
authorjeremy <jeremy@f38db490-d61c-443f-a65b-d21fe96a405b>2004-01-12 07:05:10 +0000
committerjeremy <jeremy@f38db490-d61c-443f-a65b-d21fe96a405b>2004-01-12 07:05:10 +0000
commite093fb83e7bfc066e1ce2b6c63b6e3fd3e59e1bf (patch)
tree5355d7b23794f8856ae3c44cff0feb88af860ae8 /channels/chan_iax.c
parent13ab05db0c47269b3bf04b197598aeecb82904a2 (diff)
Give seperate config option for deprecated chan_iax. Bug #801
git-svn-id: http://svn.digium.com/svn/asterisk/trunk@1978 f38db490-d61c-443f-a65b-d21fe96a405b
Diffstat (limited to 'channels/chan_iax.c')
-rwxr-xr-xchannels/chan_iax.c20
1 files changed, 15 insertions, 5 deletions
diff --git a/channels/chan_iax.c b/channels/chan_iax.c
index aa16c2200..fee5f77e7 100755
--- a/channels/chan_iax.c
+++ b/channels/chan_iax.c
@@ -54,6 +54,10 @@
#define IPTOS_MINCOST 0x02
#endif
+#define IAX_CONF_FILE "iax1.conf"
+/* Deprecated old configuration file */
+#define IAX_OLD_CONF_FILE "iax.conf"
+
/*
* Uncomment to try experimental IAX bridge optimization,
* designed to reduce latency when IAX calls cannot
@@ -4662,7 +4666,7 @@ static struct iax_peer *build_peer(char *name, struct ast_variable *v)
} else if (!strcasecmp(v->value, "yes")) {
peer->maxms = DEFAULT_MAXMS;
} else if (sscanf(v->value, "%d", &peer->maxms) != 1) {
- ast_log(LOG_WARNING, "Qualification of peer '%s' should be 'yes', 'no', or a number of milliseconds at line %d of iax.conf\n", peer->name, v->lineno);
+ ast_log(LOG_WARNING, "Qualification of peer '%s' should be 'yes', 'no', or a number of milliseconds at line %d of " IAX_CONF_FILE "\n", peer->name, v->lineno);
peer->maxms = 0;
}
} //else if (strcasecmp(v->name,"type"))
@@ -4963,14 +4967,17 @@ static int set_config(char *config_file, struct sockaddr_in* sin){
static int reload_config(void)
{
- char *config = "iax.conf";
+ char *config = IAX_CONF_FILE;
struct iax_registry *reg;
struct sockaddr_in dead_sin;
strncpy(accountcode, "", sizeof(accountcode)-1);
amaflags = 0;
srand(time(NULL));
delete_users();
- set_config(config,&dead_sin);
+ if (set_config(config,&dead_sin) == -1) {
+ config = IAX_OLD_CONF_FILE;
+ set_config(config,&dead_sin);
+ }
prune_peers();
for (reg = registrations; reg; reg = reg->next)
iax_do_register(reg);
@@ -5360,7 +5367,7 @@ int unload_module()
int load_module(void)
{
- char *config = "iax.conf";
+ char *config = IAX_CONF_FILE;
int res = 0;
int x;
struct iax_registry *reg;
@@ -5403,7 +5410,10 @@ int load_module(void)
ast_manager_register( "IAXpeers", 0, manager_iax_show_peers, "List IAX Peers" );
- set_config(config,&sin);
+ if (set_config(config,&sin) == -1) {
+ config = IAX_OLD_CONF_FILE;
+ set_config(config,&sin);
+ }
/* Make a UDP socket */
netsocket = socket(AF_INET, SOCK_DGRAM, IPPROTO_IP);