Asterisk
  1. Asterisk
  2. ASTERISK-3199

SIP stack stops working when externhost is set and DNS resolution fails

    Details

    • Type: Bug Bug
    • Status: Closed
    • Severity: Minor Minor
    • Resolution: Fixed
    • Affects Version/s: None
    • Target Release Version/s: None
    • Component/s: Core/General
    • Labels:
      None
    • Mantis ID:
      3262
    • Regression:
      No

      Description

      scenario externhost=xxx.dyndns.org
      dyndns.org name server stop working (they are not working good right now)
      all the sip stack is unavailable, internal sip calls too cause the dns lookup delay/fail
      the ast_sip_ouraddrfor function should 1st try to test the localnet to handle the local sip calls
      It should check the externhost and externrefresh just when the local test fails. If the gethostbyname fails (temporary dns downtime) it should still use the latest externhost ip address resolved

      Jan 6 21:10:36 NOTICE[19081]: chan_sip.c:654 ast_sip_ouraddrfor: Warning: Re-lookup of 'xxxx.dyndns.org' failed!
      so when this warning is printed all the sip system is unable to work properly

                • STEPS TO REPRODUCE ******

      set the externhost
      just remove dns from /etc/resolv.conf
      try to made a sip call

        Activity

        Hide
        cherso added a comment -

        sorry mark I just updated the chan_sip.c with your patch but it didn't fix the problem
        I will add the log of the same sip call to 612@fwd
        still no audio and there is a problem with the externhost substitution
        I've added some ast_log line to show them and us.
        as you can see it uses the local ip address going out and
        ast_log(LOG_DEBUG, "Target address %s is not local, substituting externip\n"
        as not been executed
        why it takes so long? 01:10:32 to 01:11:11 to start sending sip packets to fwd?
        an 8 01:10:31 VERBOSE[27862]: – Executing Dial("SIP/9-747d", "sip/612@fwd.pulver.com|60") in new stack
        Jan 8 01:10:32 DEBUG[27859]: Auto destroying call '50F5C699-C161-40C4-8891-AC22878726C2@192.168.0.202'
        Jan 8 01:11:11 DEBUG[27862]: We are in ast_sip_ouraddrfor them: 69.90.155.70, us: 192.168.0.100

        edited on: 01-07-05 18:21

        Show
        cherso added a comment - sorry mark I just updated the chan_sip.c with your patch but it didn't fix the problem I will add the log of the same sip call to 612@fwd still no audio and there is a problem with the externhost substitution I've added some ast_log line to show them and us. as you can see it uses the local ip address going out and ast_log(LOG_DEBUG, "Target address %s is not local, substituting externip\n" as not been executed why it takes so long? 01:10:32 to 01:11:11 to start sending sip packets to fwd? an 8 01:10:31 VERBOSE [27862] : – Executing Dial("SIP/9-747d", "sip/612@fwd.pulver.com|60") in new stack Jan 8 01:10:32 DEBUG [27859] : Auto destroying call '50F5C699-C161-40C4-8891-AC22878726C2@192.168.0.202' Jan 8 01:11:11 DEBUG [27862] : We are in ast_sip_ouraddrfor them: 69.90.155.70, us: 192.168.0.100 edited on: 01-07-05 18:21
        Hide
        cherso added a comment -

        got it change
        memcpy(&externip.sin_addr, hp->h_addr, sizeof(externip));
        to
        memcpy(&externip.sin_addr, hp->h_addr, sizeof(externip.sin_addr));

        my patch is working better. all the local sip calls are working even when the dns fails
        externhost is refreshed only when we really need to go out

        the delay problem reported yesterday is still there tho

        Show
        cherso added a comment - got it change memcpy(&externip.sin_addr, hp->h_addr, sizeof(externip)); to memcpy(&externip.sin_addr, hp->h_addr, sizeof(externip.sin_addr)); my patch is working better. all the local sip calls are working even when the dns fails externhost is refreshed only when we really need to go out the delay problem reported yesterday is still there tho
        Hide
        Mark Spencer added a comment -

        Fixed in CVS head re the sizeof() and moving the externexpire code, as for the delay, well, don't have a broken DNS server. This is as much work around for broken DNS as I feel comfortable with at this time.

        Show
        Mark Spencer added a comment - Fixed in CVS head re the sizeof() and moving the externexpire code, as for the delay, well, don't have a broken DNS server. This is as much work around for broken DNS as I feel comfortable with at this time.
        Hide
        Russell Bryant added a comment -

        not in 1.0

        Show
        Russell Bryant added a comment - not in 1.0
        Hide
        Digium Subversion added a comment -

        Repository: asterisk
        Revision: 4722

        U trunk/channels/chan_sip.c

        ------------------------------------------------------------------------
        r4722 | markster | 2008-01-15 15:20:40 -0600 (Tue, 15 Jan 2008) | 2 lines

        Minor externip fixes (bug ASTERISK-3199)

        ------------------------------------------------------------------------

        http://svn.digium.com/view/asterisk?view=rev&revision=4722

        Show
        Digium Subversion added a comment - Repository: asterisk Revision: 4722 U trunk/channels/chan_sip.c ------------------------------------------------------------------------ r4722 | markster | 2008-01-15 15:20:40 -0600 (Tue, 15 Jan 2008) | 2 lines Minor externip fixes (bug ASTERISK-3199 ) ------------------------------------------------------------------------ http://svn.digium.com/view/asterisk?view=rev&revision=4722

          People

          • Watchers:
            0 Start watching this issue

            Dates

            • Created:
              Updated:
              Resolved:

              Development