[Asterisk-Dev] Sip stops when DNS fails

Ole Reinartz ole.reinartz at gmx.de
Sun Oct 3 12:51:43 MST 2004


Hi,
I'm new to the list and I'm using asterisk for some time now. Its 
running on my router (an old PC) and bridges my ISDN- telephones to my 
sip- provider.
Every now and then (once a day maybe) gethostbyname() , called in  
create_addr() in chan_sip.c, returns with the funny (imo) error code 
TRY_AGAIN. This error only creates a warning but otherwise seems to be 
ignored. Instead the communication towards the sip server 'silently' 
stops. asterisk reports itself still 'registered', but phonecalls are no 
longer possible.
Now I hacked the problem and put the gethostbyname() call into a loop. 
That works for me.
Is that already solved in some version? If not I would propose to put a 
fix into the wrapper ast_gethostbyname(), which would be a loop that 
runs until gethostbyname() returns something else but TRY_AGAIN.

What do you think?

The version I'm running is 
CVS-HEAD-08/13/04-12:00:00-BRI-stuffed-0.1.0-RC4a.

Ole




More information about the asterisk-dev mailing list