0
votes

Today my asterisk could not receive calls for a while. when I checked the asterisk logs, the error below was raising during this period.

Purely numeric hostname (1002), and not a peer--rejecting!

After I restarted the asterisk the problem solved. What is the problem?

1
For a question like this, you may be able to get more help on ServerFault: serverfault.com/questions/tagged/asterisk - Brendan Bullen
I don't know why vote to close this question? - user1968030

1 Answers

1
votes

Very likly that mean your dns server was not working. Use local dns caching server or more then one dns server.

Other posible situation - you calling somethign like SIP/1234, which is not in your sip.conf.

Here is related source part, it have description:

peer = sip_find_peer(peername, NULL, TRUE, FINDPEERS, FALSE, 0);

    if (peer) {
            int res;
            if (newdialog) {
                    set_socket_transport(&dialog->socket, 0);
            }
            res = create_addr_from_peer(dialog, peer);
            dialog->relatedpeer = sip_ref_peer(peer, "create_addr: setting dialog's relatedpeer pointer");
            sip_unref_peer(peer, "create_addr: unref peer from sip_find_peer hashtab lookup");
            return res;
    } else if (ast_check_digits(peername)) {
            /* Although an IPv4 hostname *could* be represented as a 32-bit integer, it is uncommon and
             * it makes dialing SIP/${EXTEN} for a peer that isn't defined resolve to an IP that is
             * almost certainly not intended. It is much better to just reject purely numeric hostnames */
            ast_log(LOG_WARNING, "Purely numeric hostname (%s), and not a peer--rejecting!\n", peername);
            return -1;
    } else {