mirror of
https://github.com/asterisk/asterisk.git
synced 2025-09-02 11:06:31 +00:00
Version 0.1.6 from FTP
git-svn-id: https://origsvn.digium.com/svn/asterisk/trunk@224 65c4cc65-6c06-0410-ace0-fbb531ad65f3
This commit is contained in:
@@ -12,7 +12,8 @@
|
||||
#
|
||||
|
||||
CHANNEL_LIBS=chan_vofr.so chan_modem.so \
|
||||
chan_modem_aopen.so chan_iax.so chan_oss.so
|
||||
chan_modem_aopen.so chan_iax.so chan_oss.so \
|
||||
chan_modem_i4l.so
|
||||
|
||||
CHANNEL_LIBS+=$(shell [ -f /usr/include/linux/ixjuser.h ] && echo chan_phone.so)
|
||||
|
||||
|
@@ -127,6 +127,15 @@ struct iax_peer {
|
||||
struct sockaddr_in addr;
|
||||
int formats;
|
||||
struct in_addr mask;
|
||||
|
||||
/* Dynamic Registration fields */
|
||||
int dynamic;
|
||||
struct sockaddr_in defaddr;
|
||||
char regsecret[80];
|
||||
char methods[80];
|
||||
struct timeval nexpire;
|
||||
int expire;
|
||||
struct iax_ha *ha;
|
||||
struct iax_peer *next;
|
||||
};
|
||||
|
||||
@@ -2038,16 +2047,23 @@ static struct iax_peer *build_peer(char *name, struct ast_variable *v)
|
||||
if (!strcasecmp(v->name, "secret"))
|
||||
strncpy(peer->secret, v->value, sizeof(peer->secret));
|
||||
else if (!strcasecmp(v->name, "host")) {
|
||||
hp = gethostbyname(v->value);
|
||||
if (hp) {
|
||||
memcpy(&peer->addr.sin_addr, hp->h_addr, sizeof(peer->addr.sin_addr));
|
||||
if (!strcasecmp(v->value, "dynamic")) {
|
||||
/* They'll register with us */
|
||||
peer->dynamic = 1;
|
||||
memset(&peer->addr.sin_addr, 0, 4);
|
||||
} else {
|
||||
ast_log(LOG_WARNING, "Unable to lookup '%s'\n", v->value);
|
||||
free(peer);
|
||||
return NULL;
|
||||
peer->dynamic = 0;
|
||||
hp = gethostbyname(v->value);
|
||||
if (hp) {
|
||||
memcpy(&peer->addr.sin_addr, hp->h_addr, sizeof(peer->addr.sin_addr));
|
||||
} else {
|
||||
ast_log(LOG_WARNING, "Unable to lookup '%s'\n", v->value);
|
||||
free(peer);
|
||||
return NULL;
|
||||
}
|
||||
if (!maskfound)
|
||||
inet_aton("255.255.255.255", &peer->mask);
|
||||
}
|
||||
if (!maskfound)
|
||||
inet_aton("255.255.255.255", &peer->mask);
|
||||
}
|
||||
else if (!strcasecmp(v->name, "mask")) {
|
||||
maskfound++;
|
||||
|
@@ -38,6 +38,10 @@
|
||||
#define AST_IAX_COMMAND_INVAL 10
|
||||
#define AST_IAX_COMMAND_LAGRQ 11
|
||||
#define AST_IAX_COMMAND_LAGRP 12
|
||||
#define AST_IAX_COMMAND_REGRQ 13
|
||||
#define AST_IAX_COMMAND_REGRP 14
|
||||
|
||||
#define AST_DEFAULT_REG_EXPIRE 60 /* By default require re-registration once per minute */
|
||||
|
||||
#define AST_DEFAULT_IAX_PORTNO 5036
|
||||
|
||||
|
Reference in New Issue
Block a user