aboutsummaryrefslogtreecommitdiffstats
path: root/channels
diff options
context:
space:
mode:
authormarkster <markster@f38db490-d61c-443f-a65b-d21fe96a405b>2004-01-10 20:11:48 +0000
committermarkster <markster@f38db490-d61c-443f-a65b-d21fe96a405b>2004-01-10 20:11:48 +0000
commit1fcdac0b0ad21a6126e50b79c30dad7f29f2a0c7 (patch)
tree3484f0797a040c14dcd6d1988960b95569c5bbc1 /channels
parentd26a983148c1a603fb53a5f2cdb44da84a61409d (diff)
Reorder events in IAX, make "IAX1" compatibility
git-svn-id: http://svn.digium.com/svn/asterisk/trunk@1917 f38db490-d61c-443f-a65b-d21fe96a405b
Diffstat (limited to 'channels')
-rwxr-xr-xchannels/chan_iax.c29
1 files changed, 19 insertions, 10 deletions
diff --git a/channels/chan_iax.c b/channels/chan_iax.c
index 091c8a1fc..aa16c2200 100755
--- a/channels/chan_iax.c
+++ b/channels/chan_iax.c
@@ -83,7 +83,8 @@ static char mydbname[80];
static char *desc = "Inter Asterisk eXchange";
static char *tdesc = "Inter Asterisk eXchange Drver";
-static char *type = "IAX";
+static char *ctype = "IAX";
+static char *type = "IAX1";
static char context[80] = "default";
@@ -5404,15 +5405,6 @@ int load_module(void)
set_config(config,&sin);
- if (ast_channel_register(type, tdesc, iax_capability, iax_request)) {
- ast_log(LOG_ERROR, "Unable to register channel class %s\n", type);
- __unload_module();
- return -1;
- }
-
- if (ast_register_switch(&iax_switch))
- ast_log(LOG_ERROR, "Unable to register IAX switch\n");
-
/* Make a UDP socket */
netsocket = socket(AF_INET, SOCK_DGRAM, IPPROTO_IP);
@@ -5422,6 +5414,8 @@ int load_module(void)
}
if (bind(netsocket,(struct sockaddr *)&sin, sizeof(sin))) {
ast_log(LOG_ERROR, "Unable to bind to %s port %d: %s\n", inet_ntoa(sin.sin_addr), ntohs(sin.sin_port), strerror(errno));
+ close(netsocket);
+ netsocket = -1;
return -1;
}
@@ -5431,6 +5425,21 @@ int load_module(void)
if (setsockopt(netsocket, IPPROTO_IP, IP_TOS, &tos, sizeof(tos)))
ast_log(LOG_WARNING, "Unable to set TOS to %d\n", tos);
+ if (ast_channel_register(type, tdesc, iax_capability, iax_request)) {
+ ast_log(LOG_ERROR, "Unable to register channel class %s\n", type);
+ __unload_module();
+ return -1;
+ }
+
+ if (ast_channel_register(ctype, tdesc, iax_capability, iax_request)) {
+ ast_log(LOG_ERROR, "Unable to register channel class %s\n", type);
+ __unload_module();
+ return -1;
+ }
+
+ if (ast_register_switch(&iax_switch))
+ ast_log(LOG_ERROR, "Unable to register IAX switch\n");
+
if (!res) {
res = start_network_thread();
if (option_verbose > 1)