Warnings and Errors when registering sip

Hello Everyone,
Trying to register sip but I get the following error and warnings after “sip reload” in the asterisk console

[root@ehan asterisk]# asterisk -rvvv
Asterisk 11.21.2, Copyright © 1999 - 2013 Digium, Inc. and others.
Created by Mark Spencer markster@digium.com
Asterisk comes with ABSOLUTELY NO WARRANTY; type ‘core show warranty’ for details.
This is free software, with components licensed under the GNU General Public
License version 2 and other licenses; you are welcome to redistribute it under
certain conditions. Type ‘core show license’ for details.

Connected to Asterisk 11.21.2 currently running on ehan (pid = 26231)
ehanCLI>
ehan
CLI>
ehanCLI> sip
No such command ‘sip’ (type ‘core show help sip’ for other possible commands)
ehan
CLI> sip reload
Reloading SIP
== Parsing ‘/etc/asterisk/sip.conf’: Found
== Parsing ‘/etc/asterisk/users.conf’: Found
[Mar 17 13:31:48] ERROR[26246]: netsock2.c:271 ast_sockaddr_resolve: getaddrinfo(“ehan”, “(null)”, …): Name or service not known
[Mar 17 13:31:48] WARNING[26246]: acl.c:833 resolve_first: Unable to lookup ‘ehan’
== Using SIP CoS mark 4
== Parsing ‘/etc/asterisk/sip_notify.conf’: Found

This is the content of my sip.conf file:

tcpenable=no ; Enable server for incoming TCP connections (default is no)
tcpbindaddr=0.0.0.0 ; IP address for TCP server to bind to (0.0.0.0 binds to all interfaces)
transport=udp ; Set the default transports. The order determines the primary default transport.
srvlookup=yes ; Enable DNS SRV lookups on outbound calls
qualify=yes

[authentication]
basic-options ; a template
dtmfmode=rfc2833
context=from-office
type=friend
natted-phone ; another template inheriting basic-options
directmedia=no
host=dynamic
public-phone ; another template inheriting basic-options
directmedia=yes
my-codecs ; a template for my preferred codecs
disallow=all
allow=ilbc
allow=g729
allow=gsm
allow=g723
allow=ulaw
ulaw-phone ; and another one for ulaw-only
disallow=all
allow=ulaw

[lambert]
type=friend
context=phones
allow=ulaw,alaw
secret=12345678
host=dynamic
[caleb]
type=friend
context=phones
allow=ulaw,alaw
secret=87654321
host=dynamic

Can anyone help me please? Will really appreciate it.
Thanks

Does the hostname of the machine itself resolve? According to the output it doesn’t appear to which can cause problems not just for Asterisk but other applications. An explicit entry is usually placed in /etc/hosts so that resolution does not depend on an outside DNS server.

hi jcolp
I’ve ignored the error and warning and configured “host” in sip.conf with static IPs and now the peers are reachable.
Can sip be configured with static IPs

Thanks

I don’t understand what you mean by configured. You can specify host entries in sip.conf with static IPs as you’ve done. That doesn’t change the fact your system can’t resolve its own name though.

hi,
why is it that when I register my ekiga softphone on my centos with the IP of my asterisk server is says cannot register but when I use my IP gateway it rather registers easily

Without understanding the network topology, where things are, and how it is setup I don’t think anyone could answer that with certainty.