mirror of
https://github.com/asterisk/asterisk.git
synced 2025-10-13 08:13:22 +00:00
Add SRV Lookup support on outbound calls to chan_iax2. It's listed in the RFC so we might want to support it and please don't hurt me Marko ... (issue #7812 reported by drorlb)
git-svn-id: https://origsvn.digium.com/svn/asterisk/trunk@51560 65c4cc65-6c06-0410-ace0-fbb531ad65f3
This commit is contained in:
1
CHANGES
1
CHANGES
@@ -64,6 +64,7 @@ Changes since Asterisk 1.4-beta was branched:
|
|||||||
* Added G729 passthrough support to chan_phone for Sigma Designs boards.
|
* Added G729 passthrough support to chan_phone for Sigma Designs boards.
|
||||||
* Added the parkedcalltransfers option to features.conf
|
* Added the parkedcalltransfers option to features.conf
|
||||||
* Added 's' option to Page application.
|
* Added 's' option to Page application.
|
||||||
|
* Added the srvlookup option to iax.conf
|
||||||
|
|
||||||
SIP changes
|
SIP changes
|
||||||
-----------
|
-----------
|
||||||
|
@@ -180,6 +180,8 @@ static unsigned int tos = 0;
|
|||||||
static int min_reg_expire;
|
static int min_reg_expire;
|
||||||
static int max_reg_expire;
|
static int max_reg_expire;
|
||||||
|
|
||||||
|
static int srvlookup = 0;
|
||||||
|
|
||||||
static int timingfd = -1; /* Timing file descriptor */
|
static int timingfd = -1; /* Timing file descriptor */
|
||||||
|
|
||||||
static struct ast_netsock_list *netsock;
|
static struct ast_netsock_list *netsock;
|
||||||
@@ -2674,8 +2676,6 @@ struct create_addr_info {
|
|||||||
|
|
||||||
static int create_addr(const char *peername, struct sockaddr_in *sin, struct create_addr_info *cai)
|
static int create_addr(const char *peername, struct sockaddr_in *sin, struct create_addr_info *cai)
|
||||||
{
|
{
|
||||||
struct ast_hostent ahp;
|
|
||||||
struct hostent *hp;
|
|
||||||
struct iax2_peer *peer;
|
struct iax2_peer *peer;
|
||||||
|
|
||||||
ast_clear_flag(cai, IAX_SENDANI | IAX_TRUNK);
|
ast_clear_flag(cai, IAX_SENDANI | IAX_TRUNK);
|
||||||
@@ -2685,18 +2685,14 @@ static int create_addr(const char *peername, struct sockaddr_in *sin, struct cre
|
|||||||
|
|
||||||
if (!(peer = find_peer(peername, 1))) {
|
if (!(peer = find_peer(peername, 1))) {
|
||||||
cai->found = 0;
|
cai->found = 0;
|
||||||
|
if (ast_get_ip_or_srv(sin, peername, srvlookup ? "_iax._udp" : NULL)) {
|
||||||
hp = ast_gethostbyname(peername, &ahp);
|
|
||||||
if (hp) {
|
|
||||||
memcpy(&sin->sin_addr, hp->h_addr, sizeof(sin->sin_addr));
|
|
||||||
sin->sin_port = htons(IAX_DEFAULT_PORTNO);
|
|
||||||
/* use global iax prefs for unknown peer/user */
|
|
||||||
ast_codec_pref_convert(&prefs, cai->prefs, sizeof(cai->prefs), 1);
|
|
||||||
return 0;
|
|
||||||
} else {
|
|
||||||
ast_log(LOG_WARNING, "No such host: %s\n", peername);
|
ast_log(LOG_WARNING, "No such host: %s\n", peername);
|
||||||
return -1;
|
return -1;
|
||||||
}
|
}
|
||||||
|
sin->sin_port = htons(IAX_DEFAULT_PORTNO);
|
||||||
|
/* use global iax prefs for unknown peer/user */
|
||||||
|
ast_codec_pref_convert(&prefs, cai->prefs, sizeof(cai->prefs), 1);
|
||||||
|
return 0;
|
||||||
}
|
}
|
||||||
|
|
||||||
cai->found = 1;
|
cai->found = 1;
|
||||||
@@ -8968,6 +8964,8 @@ static int set_config(char *config_file, int reload)
|
|||||||
|
|
||||||
maxauthreq = 3;
|
maxauthreq = 3;
|
||||||
|
|
||||||
|
srvlookup = 0;
|
||||||
|
|
||||||
v = ast_variable_browse(cfg, "general");
|
v = ast_variable_browse(cfg, "general");
|
||||||
|
|
||||||
/* Seed initial tos value */
|
/* Seed initial tos value */
|
||||||
@@ -9171,6 +9169,8 @@ static int set_config(char *config_file, int reload)
|
|||||||
maxauthreq = 0;
|
maxauthreq = 0;
|
||||||
} else if (!strcasecmp(v->name, "adsi")) {
|
} else if (!strcasecmp(v->name, "adsi")) {
|
||||||
adsi = ast_true(v->value);
|
adsi = ast_true(v->value);
|
||||||
|
} else if (!strcasecmp(v->name, "srvlookup")) {
|
||||||
|
srvlookup = ast_true(v->value);
|
||||||
} /*else if (strcasecmp(v->name,"type")) */
|
} /*else if (strcasecmp(v->name,"type")) */
|
||||||
/* ast_log(LOG_WARNING, "Ignoring %s\n", v->name); */
|
/* ast_log(LOG_WARNING, "Ignoring %s\n", v->name); */
|
||||||
v = v->next;
|
v = v->next;
|
||||||
|
@@ -51,6 +51,10 @@
|
|||||||
;
|
;
|
||||||
;adsi=no
|
;adsi=no
|
||||||
;
|
;
|
||||||
|
; Perform an SRV lookup on outbound calls
|
||||||
|
;
|
||||||
|
;srvlookup=yes
|
||||||
|
;
|
||||||
; You may specify a default account for Call Detail Records in addition
|
; You may specify a default account for Call Detail Records in addition
|
||||||
; to specifying on a per-user basis
|
; to specifying on a per-user basis
|
||||||
;
|
;
|
||||||
|
Reference in New Issue
Block a user