mirror of
https://github.com/asterisk/asterisk.git
synced 2025-09-06 12:36:58 +00:00
*** empty log message ***
git-svn-id: https://origsvn.digium.com/svn/asterisk/trunk@5431 65c4cc65-6c06-0410-ace0-fbb531ad65f3
This commit is contained in:
2
Makefile
2
Makefile
@@ -265,7 +265,7 @@ OBJS=io.o sched.o logger.o frame.o loader.o config.o channel.o \
|
|||||||
cdr.o tdd.o acl.o rtp.o manager.o asterisk.o ast_expr.o \
|
cdr.o tdd.o acl.o rtp.o manager.o asterisk.o ast_expr.o \
|
||||||
dsp.o chanvars.o indications.o autoservice.o db.o privacy.o \
|
dsp.o chanvars.o indications.o autoservice.o db.o privacy.o \
|
||||||
astmm.o enum.o srv.o dns.o aescrypt.o aestab.o aeskey.o \
|
astmm.o enum.o srv.o dns.o aescrypt.o aestab.o aeskey.o \
|
||||||
utils.o config_old.o plc.o jitterbuf.o
|
utils.o config_old.o plc.o jitterbuf.o dnsmgr.o
|
||||||
ifeq (${OSARCH},Darwin)
|
ifeq (${OSARCH},Darwin)
|
||||||
OBJS+=poll.o dlfcn.o
|
OBJS+=poll.o dlfcn.o
|
||||||
ASTLINK=-Wl,-dynamic
|
ASTLINK=-Wl,-dynamic
|
||||||
|
@@ -1960,6 +1960,10 @@ int main(int argc, char *argv[])
|
|||||||
printf(term_quit());
|
printf(term_quit());
|
||||||
exit(1);
|
exit(1);
|
||||||
}
|
}
|
||||||
|
if (dnsmgr_init()) {
|
||||||
|
printf(term_quit());
|
||||||
|
exit(1);
|
||||||
|
}
|
||||||
#if 0
|
#if 0
|
||||||
/* This should no longer be necessary */
|
/* This should no longer be necessary */
|
||||||
/* sync cust config and reload some internals in case a custom config handler binded to them */
|
/* sync cust config and reload some internals in case a custom config handler binded to them */
|
||||||
|
@@ -52,5 +52,8 @@ extern int term_init(void);
|
|||||||
extern int astdb_init(void);
|
extern int astdb_init(void);
|
||||||
/* Provided by channel.c */
|
/* Provided by channel.c */
|
||||||
extern void ast_channels_init(void);
|
extern void ast_channels_init(void);
|
||||||
|
/* Provided by dnsmgr.c */
|
||||||
|
extern int dnsmgr_init(void);
|
||||||
|
extern void dnsmgr_reload(void);
|
||||||
|
|
||||||
#endif
|
#endif
|
||||||
|
@@ -37,6 +37,7 @@
|
|||||||
#include <asterisk/causes.h>
|
#include <asterisk/causes.h>
|
||||||
#include <asterisk/localtime.h>
|
#include <asterisk/localtime.h>
|
||||||
#include <asterisk/aes.h>
|
#include <asterisk/aes.h>
|
||||||
|
#include <asterisk/dnsmgr.h>
|
||||||
#include <sys/mman.h>
|
#include <sys/mman.h>
|
||||||
#include <arpa/inet.h>
|
#include <arpa/inet.h>
|
||||||
#include <dirent.h>
|
#include <dirent.h>
|
||||||
@@ -265,6 +266,7 @@ struct iax2_peer {
|
|||||||
char peercontext[AST_MAX_EXTENSION]; /* Context to pass to peer */
|
char peercontext[AST_MAX_EXTENSION]; /* Context to pass to peer */
|
||||||
char mailbox[AST_MAX_EXTENSION]; /* Mailbox */
|
char mailbox[AST_MAX_EXTENSION]; /* Mailbox */
|
||||||
struct ast_codec_pref prefs;
|
struct ast_codec_pref prefs;
|
||||||
|
struct ast_dnsmgr_entry *dnsmgr; /* DNS refresh manager */
|
||||||
struct sockaddr_in addr;
|
struct sockaddr_in addr;
|
||||||
int formats;
|
int formats;
|
||||||
int sockfd; /* Socket to use for transmission */
|
int sockfd; /* Socket to use for transmission */
|
||||||
@@ -7873,7 +7875,7 @@ static struct iax2_peer *build_peer(const char *name, struct ast_variable *v, in
|
|||||||
ast_sched_del(sched, peer->expire);
|
ast_sched_del(sched, peer->expire);
|
||||||
peer->expire = -1;
|
peer->expire = -1;
|
||||||
ast_clear_flag(peer, IAX_DYNAMIC);
|
ast_clear_flag(peer, IAX_DYNAMIC);
|
||||||
if (ast_get_ip(&peer->addr, v->value)) {
|
if (ast_dnsmgr_lookup(v->value, &peer->addr.sin_addr, &peer->dnsmgr)) {
|
||||||
free(peer);
|
free(peer);
|
||||||
return NULL;
|
return NULL;
|
||||||
}
|
}
|
||||||
@@ -8193,6 +8195,8 @@ static void destroy_peer(struct iax2_peer *peer)
|
|||||||
if (peer->callno > 0)
|
if (peer->callno > 0)
|
||||||
iax2_destroy(peer->callno);
|
iax2_destroy(peer->callno);
|
||||||
register_peer_exten(peer, 0);
|
register_peer_exten(peer, 0);
|
||||||
|
if (peer->dnsmgr)
|
||||||
|
ast_dnsmgr_release(peer->dnsmgr);
|
||||||
free(peer);
|
free(peer);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@@ -41,6 +41,7 @@
|
|||||||
#include <asterisk/utils.h>
|
#include <asterisk/utils.h>
|
||||||
#include <asterisk/file.h>
|
#include <asterisk/file.h>
|
||||||
#include <asterisk/astobj.h>
|
#include <asterisk/astobj.h>
|
||||||
|
#include <asterisk/dnsmgr.h>
|
||||||
#ifdef OSP_SUPPORT
|
#ifdef OSP_SUPPORT
|
||||||
#include <asterisk/astosp.h>
|
#include <asterisk/astosp.h>
|
||||||
#endif
|
#endif
|
||||||
@@ -549,6 +550,7 @@ struct sip_peer {
|
|||||||
int rtpkeepalive; /* Send RTP packets for keepalive */
|
int rtpkeepalive; /* Send RTP packets for keepalive */
|
||||||
ast_group_t callgroup; /* Call group */
|
ast_group_t callgroup; /* Call group */
|
||||||
ast_group_t pickupgroup; /* Pickup group */
|
ast_group_t pickupgroup; /* Pickup group */
|
||||||
|
struct ast_dnsmgr_entry *dnsmgr;/* DNS refresh manager for peer */
|
||||||
struct sockaddr_in addr; /* IP address of peer */
|
struct sockaddr_in addr; /* IP address of peer */
|
||||||
struct in_addr mask;
|
struct in_addr mask;
|
||||||
|
|
||||||
@@ -1253,6 +1255,8 @@ static void sip_destroy_peer(struct sip_peer *peer)
|
|||||||
speerobjs--;
|
speerobjs--;
|
||||||
clear_realm_authentication(peer->auth);
|
clear_realm_authentication(peer->auth);
|
||||||
peer->auth = (struct sip_auth *) NULL;
|
peer->auth = (struct sip_auth *) NULL;
|
||||||
|
if (peer->dnsmgr)
|
||||||
|
ast_dnsmgr_release(peer->dnsmgr);
|
||||||
free(peer);
|
free(peer);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
4
loader.c
4
loader.c
@@ -215,6 +215,10 @@ int ast_module_reload(const char *name)
|
|||||||
ast_rtp_reload();
|
ast_rtp_reload();
|
||||||
reloaded = 2;
|
reloaded = 2;
|
||||||
}
|
}
|
||||||
|
if (!name || !strcasecmp(name, "dnsmgr")) {
|
||||||
|
dnsmgr_reload();
|
||||||
|
reloaded = 2;
|
||||||
|
}
|
||||||
time(&ast_lastreloadtime);
|
time(&ast_lastreloadtime);
|
||||||
|
|
||||||
ast_mutex_lock(&modlock);
|
ast_mutex_lock(&modlock);
|
||||||
|
6
utils.c
6
utils.c
@@ -150,8 +150,8 @@ static int gethostbyname_r (const char *name, struct hostent *ret, char *buf,
|
|||||||
|
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
/* Recursive thread safe version of gethostbyname that replaces the
|
/* Re-entrant (thread safe) version of gethostbyname that replaces the
|
||||||
standard gethostbyname (which is not recursive)
|
standard gethostbyname (which is not thread safe)
|
||||||
*/
|
*/
|
||||||
struct hostent *ast_gethostbyname(const char *host, struct ast_hostent *hp)
|
struct hostent *ast_gethostbyname(const char *host, struct ast_hostent *hp)
|
||||||
{
|
{
|
||||||
@@ -457,4 +457,4 @@ char *ast_strcasestr(const char *haystack, const char *needle)
|
|||||||
return NULL;
|
return NULL;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
#endif
|
#endif /* LINUX */
|
||||||
|
Reference in New Issue
Block a user