Asterisk
  1. Asterisk
  2. ASTERISK-3029

[patch] SIP register problems on computers with dynamic IP addresses

    Details

    • Type: New Feature New Feature
    • Status: Closed
    • Severity: Major Major
    • Resolution: Fixed
    • Affects Version/s: None
    • Target Release Version/s: None
    • Labels:
      None
    • Mantis ID:
      3086
    • Regression:
      No

      Description

      I'm having problems registering to a SIP registry on a computer with dynamic (DHCP) IP addresses. Since the IP addresses are dynamic, I cannot use bindaddr= easily (i.e. w/o a post DHCP script that patches the config file). And the computer does not have a resolvable hostname (dhclient apparently does not update the hostname), the SIP channel fails when trying to resolve the hostname.

      I'm currently using the attached patch. It does not fail when the hostname resolution fails, but tries to determine our IP address by resolving the IP address of the first SIP registry and then asking the kernel what IP address it will use to talk to that registry.

      This patch admittedly is a workaround. IMO, the __ourip looks a bit fishy to me. As far as I can see it is mostly used as a fallback if ouraddrfor fails. Ouraddrfor shouldn't fail however, how are we going to communicate with a peer if we have no suitable own address to talk to it. And it is used to build the callid for register messages.

                • ADDITIONAL INFORMATION ******

      Disclaimer sent today.

        Activity

        Hide
        sailer added a comment -

        I've just attached the current version of my patch (against current CVS). And yes, it is basically just calling ast_ouraddrfor() on a root DNS server.

        Show
        sailer added a comment - I've just attached the current version of my patch (against current CVS). And yes, it is basically just calling ast_ouraddrfor() on a root DNS server.
        Hide
        Mark Spencer added a comment -

        Added to CVS with minor modifications. Thanks!

        Show
        Mark Spencer added a comment - Added to CVS with minor modifications. Thanks!
        Hide
        Russell Bryant added a comment -

        added to 1.0 as well, it will be in 1.0.6

        Show
        Russell Bryant added a comment - added to 1.0 as well, it will be in 1.0.6
        Hide
        Digium Subversion added a comment -

        Repository: asterisk
        Revision: 4989

        U trunk/acl.c
        U trunk/channels/chan_sip.c
        U trunk/include/asterisk/acl.h

        ------------------------------------------------------------------------
        r4989 | markster | 2008-01-15 15:24:46 -0600 (Tue, 15 Jan 2008) | 2 lines

        Handle DNS failures on startup more gracefully (bug ASTERISK-3029)

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

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

        Show
        Digium Subversion added a comment - Repository: asterisk Revision: 4989 U trunk/acl.c U trunk/channels/chan_sip.c U trunk/include/asterisk/acl.h ------------------------------------------------------------------------ r4989 | markster | 2008-01-15 15:24:46 -0600 (Tue, 15 Jan 2008) | 2 lines Handle DNS failures on startup more gracefully (bug ASTERISK-3029 ) ------------------------------------------------------------------------ http://svn.digium.com/view/asterisk?view=rev&revision=4989
        Hide
        Digium Subversion added a comment -

        Repository: asterisk
        Revision: 5061

        U branches/v1-0/acl.c
        U branches/v1-0/channels/chan_sip.c

        ------------------------------------------------------------------------
        r5061 | russell | 2008-01-15 15:25:50 -0600 (Tue, 15 Jan 2008) | 2 lines

        handle DNS failures on startup more gracefully (bug ASTERISK-3029)

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

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

        Show
        Digium Subversion added a comment - Repository: asterisk Revision: 5061 U branches/v1-0/acl.c U branches/v1-0/channels/chan_sip.c ------------------------------------------------------------------------ r5061 | russell | 2008-01-15 15:25:50 -0600 (Tue, 15 Jan 2008) | 2 lines handle DNS failures on startup more gracefully (bug ASTERISK-3029 ) ------------------------------------------------------------------------ http://svn.digium.com/view/asterisk?view=rev&revision=5061

          People

          • Watchers:
            0 Start watching this issue

            Dates

            • Created:
              Updated:
              Resolved:

              Development