[asterisk-dev] ASTERISK-26113 res_pjsip: Lots of DNS lookups of local hostname

Ross Beer ross.beer at outlook.com
Tue Jun 14 07:42:09 CDT 2016


Hi,


I'm still looking into why there are so many own name lookups occurring in Asterisk 13.


After sanity checking the physical server configuration by comparing this to an Asterisk 1.8 build, I can confirm that only the Asterisk 13 server is performing thousands of lookup numbers per minute.


Looking at the res_pjsup.c file it looks like each time a dialogue is created it looks up the local IP addresses (line 2391) in this piece of code:


/* Get the local bound address for the transport that will be used when communicating with the provided URI */
if (pjsip_tpmgr_find_local_addr(pjsip_endpt_get_tpmgr(ast_sip_get_pjsip_endpoint()), pool, type, selector,
     &local_addr, &local_port) != PJ_SUCCESS) {

/* If no local address can be retrieved using the transport manager use the host one */
pj_strdup(pool, &local_addr, pj_gethostname());
local_port = pjsip_transport_get_default_port_for_type(PJSIP_TRANSPORT_UDP);
}


If the transport is set to bound=0.0.0.0 there is no IP address set and therefore a DNS lookup is carriedout to discover the addresses.


Is there a better way to manage this situation, if the 'res_pjsip_multihomed' code does a lookup on startup, can this not store the address and re-use them here?


Kind regards,


Ross
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.digium.com/pipermail/asterisk-dev/attachments/20160614/23f509f2/attachment.html>


More information about the asterisk-dev mailing list