This commit is contained in:
parent
44b0fddf07
commit
970f0b30a6
@ -382,11 +382,15 @@ sts=sip_obscure_callid(ticket);
|
||||
*/
|
||||
} else {
|
||||
/* get the destination from the SIP URI */
|
||||
|
||||
/* 1) try SRV record */
|
||||
/*&&&& Here, the SRV record lookup magic must go.
|
||||
In a first implementation we may just try to get the lowest priority,
|
||||
max weighted '_sip._udp.domain' entry and port number.
|
||||
No load balancing and no failover are supported with this.
|
||||
&&&*/
|
||||
|
||||
/* 2) if no SRV record found, resolve A record */
|
||||
sts = get_ip_by_host(request->req_uri->host, &ticket->next_hop.sin_addr);
|
||||
if (sts == STS_FAILURE) {
|
||||
DEBUGC(DBCLASS_PROXY, "proxy_request: cannot resolve URI [%s]",
|
||||
|
||||
@ -52,10 +52,14 @@ static int _resolve(char *name, int class, int type,
|
||||
* dnamelen length of return buffer
|
||||
* port port number of service
|
||||
*/
|
||||
int resolve_SRV(char *name, char *dname, int dnamelen, int *port) {
|
||||
int resolve_SRV(char *name, int proto, char *dname, int dnamelen, int *port) {
|
||||
char nname[256];
|
||||
snprintf(nname, sizeof(nname), "_sip._udp.%s", name);
|
||||
return _resolve(name, C_IN, T_SRV, dname, dnamelen, port);
|
||||
if (proto == IPPROTO_TCP) {
|
||||
snprintf(nname, sizeof(nname), "_sip._tcp.%s", name);
|
||||
} else {
|
||||
snprintf(nname, sizeof(nname), "_sip._udp.%s", name);
|
||||
}
|
||||
return _resolve(nname, C_IN, T_SRV, dname, dnamelen, port);
|
||||
}
|
||||
|
||||
#if USE_NAPTR
|
||||
|
||||
Loading…
x
Reference in New Issue
Block a user