Can't get SIP example to work

I’m having problems getting the SIP example to work (from the PDF manual, Asterisk, the future of telephony - p 67).

I’ve got Asterisk running under SUSE 10.1, using a TDM400P card. I worked through the previous section on configuring an FXO port, and that worked fine - so I can dial in via the PSTN and get an Echo.

I then tried to get a SIP client (on the same LAN) working, using all the configs from the manual. I can see the SIP requests on the LAN (using Ethereal on both the Asterisk & client machines), but there are no response packets from the server. Also, there is no activiy on the CLI interface (despite having turned on SIP debugging, and turned verbosity to 10).

To me, it appears that Asterisk isn’t receiving the SIP packets - even though I can see them via Ethereal on the same host.

Any help much appreciated,

Mat

Can you show the entries in your sip.conf file? This would help us pin down your problem.

.

Here’s more info about my settup - thanks for any help!

Here’s the sip.conf file (as copied from the Manual):

[general]
context=default
svrlookup=yes

[mat]
type=friend
secret=password
qualify=yes
nat=no
host=dynamic
canreinvite=no
context=internal
(EOF)

I can see that Asterisk has bound to UDP port 5060 (using netstat -nlptu):
linux-a577:/etc/asterisk # netstat -nlptu | grep asterisk
tcp 0 0 0.0.0.0:2000 0.0.0.0:* LISTEN 10474/asterisk
udp 0 0 0.0.0.0:2727 0.0.0.0:* 10474/asterisk
udp 0 0 0.0.0.0:4520 0.0.0.0:* 10474/asterisk
udp 0 0 0.0.0.0:5060 0.0.0.0:* 10474/asterisk
udp 0 0 0.0.0.0:4569 0.0.0.0:* 10474/asterisk

My Asterisk machine IP is 172.16.1.35, and the SIP client (running X-lite) is 172.16.1.33 on the same LAN; the client has account settings:
user name = mat; password = password; authorization name = mat; domain = 172.16.1.35; register with proxy = enabled; proxy = 172.16.1.35:5060

I’ve enabled SIP debug & verbosity =10 via the CLI, but see no activity when the client tries to register.

From the CLI, here are the SIP settings:
*CLI> sip show settings

Global Settings:

SIP Port: 5060
Bindaddress: 0.0.0.0
Videosupport: No
AutoCreatePeer: No
Allow unknown access: Yes
Promsic. redir: No
SIP domain support: No
Call to non-local dom.: Yes
URI user is phone no: No
Our auth realm asterisk
Realm. auth: No
Always auth rejects: No
User Agent: Asterisk PBX
MWI checking interval: 10 secs
Reg. context: (not set)
Caller ID: asterisk
From: Domain:
Record SIP history: On
Call Events: Off
IP ToS: 0x0
OSP Support: No
SIP realtime: Disabled

Global Signalling Settings:

Codecs: none
Relax DTMF: No
Compact SIP headers: No
RTP Timeout: 0 (Disabled)
RTP Hold Timeout: 0 (Disabled)
MWI NOTIFY mime type: application/simple-message-summary
DNS SRV lookup: No
Pedantic SIP support: No
Reg. max duration: 3600 secs
Reg. default duration: 120 secs
Outbound reg. timeout: 20 secs
Outbound reg. attempts: 0
Notify ringing state: Yes

Default Settings:

Context: default
Nat: RFC3581
DTMF: rfc2833
Qualify: 0
Use ClientCode: No
Progress inband: Never
Language: (Defaults to English)
Musicclass: default
Voice Mail Extension: asterisk

+++++++++

Lastly, he packet sniffer (on the Asterisk box) shows sequence:
linux-a577:/etc/asterisk # cat /tmp/ethereal_trace.txt
No. Time Source Destination Protocol Info
1 0.000000 172.16.1.33 172.16.1.35 SIP Request: REGISTER sip:172.16.1.35

Frame 1 (602 bytes on wire, 602 bytes captured)
Ethernet II, Src: AcctonTe_da:ad:24 (00:10:b5:da:ad:24), Dst: 172.16.1.35 (00:03:47:d9:8d:d2)
Internet Protocol, Src: 172.16.1.33 (172.16.1.33), Dst: 172.16.1.35 (172.16.1.35)
User Datagram Protocol, Src Port: 29565 (29565), Dst Port: sip (5060)
Session Initiation Protocol
Request-Line: REGISTER sip:172.16.1.35 SIP/2.0
Message Header

No. Time Source Destination Protocol Info
2 0.501548 172.16.1.33 172.16.1.35 SIP Request: REGISTER sip:172.16.1.35

Frame 2 (602 bytes on wire, 602 bytes captured)
Ethernet II, Src: AcctonTe_da:ad:24 (00:10:b5:da:ad:24), Dst: 172.16.1.35 (00:03:47:d9:8d:d2)
Internet Protocol, Src: 172.16.1.33 (172.16.1.33), Dst: 172.16.1.35 (172.16.1.35)
User Datagram Protocol, Src Port: 29565 (29565), Dst Port: sip (5060)
Session Initiation Protocol
Request-Line: REGISTER sip:172.16.1.35 SIP/2.0
Message Header

No. Time Source Destination Protocol Info
3 1.507376 172.16.1.33 172.16.1.35 SIP Request: REGISTER sip:172.16.1.35

Frame 3 (602 bytes on wire, 602 bytes captured)
Ethernet II, Src: AcctonTe_da:ad:24 (00:10:b5:da:ad:24), Dst: 172.16.1.35 (00:03:47:d9:8d:d2)
Internet Protocol, Src: 172.16.1.33 (172.16.1.33), Dst: 172.16.1.35 (172.16.1.35)
User Datagram Protocol, Src Port: 29565 (29565), Dst Port: sip (5060)
Session Initiation Protocol
Request-Line: REGISTER sip:172.16.1.35 SIP/2.0
Message Header

No. Time Source Destination Protocol Info
4 3.519027 172.16.1.33 172.16.1.35 SIP Request: REGISTER sip:172.16.1.35

Frame 4 (602 bytes on wire, 602 bytes captured)
Ethernet II, Src: AcctonTe_da:ad:24 (00:10:b5:da:ad:24), Dst: 172.16.1.35 (00:03:47:d9:8d:d2)
Internet Protocol, Src: 172.16.1.33 (172.16.1.33), Dst: 172.16.1.35 (172.16.1.35)
User Datagram Protocol, Src Port: 29565 (29565), Dst Port: sip (5060)
Session Initiation Protocol
Request-Line: REGISTER sip:172.16.1.35 SIP/2.0
Message Header

No. Time Source Destination Protocol Info
5 4.036248 172.16.0.1 Broadcast ARP Who has 172.16.1.61? Tell 172.16.0.1

Frame 5 (60 bytes on wire, 60 bytes captured)
Ethernet II, Src: 172.16.0.1 (00:0d:72:82:55:11), Dst: Broadcast (ff:ff:ff:ff:ff:ff)
Address Resolution Protocol (request)

No. Time Source Destination Protocol Info
6 4.056229 172.16.0.1 Broadcast ARP Who has 172.16.1.35? Tell 172.16.0.1

Frame 6 (60 bytes on wire, 60 bytes captured)
Ethernet II, Src: 172.16.0.1 (00:0d:72:82:55:11), Dst: Broadcast (ff:ff:ff:ff:ff:ff)
Address Resolution Protocol (request)

No. Time Source Destination Protocol Info
7 4.056266 172.16.1.35 172.16.0.1 ARP 172.16.1.35 is at 00:03:47:d9:8d:d2

Frame 7 (42 bytes on wire, 42 bytes captured)
Ethernet II, Src: 172.16.1.35 (00:03:47:d9:8d:d2), Dst: 172.16.0.1 (00:0d:72:82:55:11)
Address Resolution Protocol (reply)

No. Time Source Destination Protocol Info
8 4.077088 172.16.0.1 Broadcast ARP Who has 172.16.1.33? Tell 172.16.0.1

Frame 8 (60 bytes on wire, 60 bytes captured)
Ethernet II, Src: 172.16.0.1 (00:0d:72:82:55:11), Dst: Broadcast (ff:ff:ff:ff:ff:ff)
Address Resolution Protocol (request)

No. Time Source Destination Protocol Info
9 4.096949 172.16.0.1 Broadcast ARP Who has 172.16.1.37? Tell 172.16.0.1

Frame 9 (60 bytes on wire, 60 bytes captured)
Ethernet II, Src: 172.16.0.1 (00:0d:72:82:55:11), Dst: Broadcast (ff:ff:ff:ff:ff:ff)
Address Resolution Protocol (request)

No. Time Source Destination Protocol Info
10 4.116835 172.16.0.1 Broadcast ARP Who has 172.16.1.36? Tell 172.16.0.1

Frame 10 (60 bytes on wire, 60 bytes captured)
Ethernet II, Src: 172.16.0.1 (00:0d:72:82:55:11), Dst: Broadcast (ff:ff:ff:ff:ff:ff)
Address Resolution Protocol (request)

No. Time Source Destination Protocol Info
11 4.251756 Cisco_50:9f:40 CDP/VTP CDP Cisco Discovery Protocol

Frame 11 (349 bytes on wire, 349 bytes captured)
IEEE 802.3 Ethernet
Logical-Link Control
Cisco Discovery Protocol

No. Time Source Destination Protocol Info
12 5.156013 172.16.0.1 Broadcast ARP Who has 172.16.1.36? Tell 172.16.0.1

Frame 12 (60 bytes on wire, 60 bytes captured)
Ethernet II, Src: 172.16.0.1 (00:0d:72:82:55:11), Dst: Broadcast (ff:ff:ff:ff:ff:ff)
Address Resolution Protocol (request)

No. Time Source Destination Protocol Info
13 6.206210 172.16.0.1 Broadcast ARP Who has 172.16.1.34? Tell 172.16.0.1

Frame 13 (60 bytes on wire, 60 bytes captured)
Ethernet II, Src: 172.16.0.1 (00:0d:72:82:55:11), Dst: Broadcast (ff:ff:ff:ff:ff:ff)
Address Resolution Protocol (request)

No. Time Source Destination Protocol Info
14 6.306651 172.16.0.1 Broadcast ARP Who has 172.16.1.33? Tell 172.16.0.1

Frame 14 (60 bytes on wire, 60 bytes captured)
Ethernet II, Src: 172.16.0.1 (00:0d:72:82:55:11), Dst: Broadcast (ff:ff:ff:ff:ff:ff)
Address Resolution Protocol (request)

No. Time Source Destination Protocol Info
15 7.542350 172.16.1.33 172.16.1.35 SIP Request: REGISTER sip:172.16.1.35

Frame 15 (602 bytes on wire, 602 bytes captured)
Ethernet II, Src: AcctonTe_da:ad:24 (00:10:b5:da:ad:24), Dst: 172.16.1.35 (00:03:47:d9:8d:d2)
Internet Protocol, Src: 172.16.1.33 (172.16.1.33), Dst: 172.16.1.35 (172.16.1.35)
User Datagram Protocol, Src Port: 29565 (29565), Dst Port: sip (5060)
Session Initiation Protocol
Request-Line: REGISTER sip:172.16.1.35 SIP/2.0
Message Header

No. Time Source Destination Protocol Info
16 10.763356 172.16.1.37 Broadcast ARP Who has 172.16.1.36? Tell 172.16.1.37

Frame 16 (60 bytes on wire, 60 bytes captured)
Ethernet II, Src: 172.16.1.37 (00:10:dc:ff:67:83), Dst: Broadcast (ff:ff:ff:ff:ff:ff)
Address Resolution Protocol (request)

No. Time Source Destination Protocol Info
17 11.565652 172.16.1.33 172.16.1.35 SIP Request: REGISTER sip:172.16.1.35

Frame 17 (602 bytes on wire, 602 bytes captured)
Ethernet II, Src: AcctonTe_da:ad:24 (00:10:b5:da:ad:24), Dst: 172.16.1.35 (00:03:47:d9:8d:d2)
Internet Protocol, Src: 172.16.1.33 (172.16.1.33), Dst: 172.16.1.35 (172.16.1.35)
User Datagram Protocol, Src Port: 29565 (29565), Dst Port: sip (5060)
Session Initiation Protocol
Request-Line: REGISTER sip:172.16.1.35 SIP/2.0
Message Header

No. Time Source Destination Protocol Info
18 14.434687 172.16.1.37 Broadcast ARP Who has 172.16.1.36? Tell 172.16.1.37

Frame 18 (60 bytes on wire, 60 bytes captured)
Ethernet II, Src: 172.16.1.37 (00:10:dc:ff:67:83), Dst: Broadcast (ff:ff:ff:ff:ff:ff)
Address Resolution Protocol (request)

No. Time Source Destination Protocol Info
19 15.588948 172.16.1.33 172.16.1.35 SIP Request: REGISTER sip:172.16.1.35

Frame 19 (602 bytes on wire, 602 bytes captured)
Ethernet II, Src: AcctonTe_da:ad:24 (00:10:b5:da:ad:24), Dst: 172.16.1.35 (00:03:47:d9:8d:d2)
Internet Protocol, Src: 172.16.1.33 (172.16.1.33), Dst: 172.16.1.35 (172.16.1.35)
User Datagram Protocol, Src Port: 29565 (29565), Dst Port: sip (5060)
Session Initiation Protocol
Request-Line: REGISTER sip:172.16.1.35 SIP/2.0
Message Header

No. Time Source Destination Protocol Info
20 15.935051 172.16.1.37 Broadcast ARP Who has 172.16.1.36? Tell 172.16.1.37

Frame 20 (60 bytes on wire, 60 bytes captured)
Ethernet II, Src: 172.16.1.37 (00:10:dc:ff:67:83), Dst: Broadcast (ff:ff:ff:ff:ff:ff)
Address Resolution Protocol (request)

No. Time Source Destination Protocol Info
21 19.673787 172.16.1.33 172.16.1.35 SIP Request: REGISTER sip:172.16.1.35

Frame 21 (602 bytes on wire, 602 bytes captured)
Ethernet II, Src: AcctonTe_da:ad:24 (00:10:b5:da:ad:24), Dst: 172.16.1.35 (00:03:47:d9:8d:d2)
Internet Protocol, Src: 172.16.1.33 (172.16.1.33), Dst: 172.16.1.35 (172.16.1.35)
User Datagram Protocol, Src Port: 29565 (29565), Dst Port: sip (5060)
Session Initiation Protocol
Request-Line: REGISTER sip:172.16.1.35 SIP/2.0
Message Header

No. Time Source Destination Protocol Info
22 21.934953 172.16.1.37 Broadcast ARP Who has 172.16.1.36? Tell 172.16.1.37

Frame 22 (60 bytes on wire, 60 bytes captured)
Ethernet II, Src: 172.16.1.37 (00:10:dc:ff:67:83), Dst: Broadcast (ff:ff:ff:ff:ff:ff)
Address Resolution Protocol (request)

No. Time Source Destination Protocol Info
23 22.390026 172.16.1.33 172.16.1.35 SIP Request: REGISTER sip:172.16.1.35

Frame 23 (602 bytes on wire, 602 bytes captured)
Ethernet II, Src: AcctonTe_da:ad:24 (00:10:b5:da:ad:24), Dst: 172.16.1.35 (00:03:47:d9:8d:d2)
Internet Protocol, Src: 172.16.1.33 (172.16.1.33), Dst: 172.16.1.35 (172.16.1.35)
User Datagram Protocol, Src Port: 41366 (41366), Dst Port: sip (5060)
Session Initiation Protocol
Request-Line: REGISTER sip:172.16.1.35 SIP/2.0
Message Header

No. Time Source Destination Protocol Info
24 22.892419 172.16.1.33 172.16.1.35 SIP Request: REGISTER sip:172.16.1.35

Frame 24 (602 bytes on wire, 602 bytes captured)
Ethernet II, Src: AcctonTe_da:ad:24 (00:10:b5:da:ad:24), Dst: 172.16.1.35 (00:03:47:d9:8d:d2)
Internet Protocol, Src: 172.16.1.33 (172.16.1.33), Dst: 172.16.1.35 (172.16.1.35)
User Datagram Protocol, Src Port: 41366 (41366), Dst Port: sip (5060)
Session Initiation Protocol
Request-Line: REGISTER sip:172.16.1.35 SIP/2.0
Message Header

No. Time Source Destination Protocol Info
25 23.898242 172.16.1.33 172.16.1.35 SIP Request: REGISTER sip:172.16.1.35

Frame 25 (602 bytes on wire, 602 bytes captured)
Ethernet II, Src: AcctonTe_da:ad:24 (00:10:b5:da:ad:24), Dst: 172.16.1.35 (00:03:47:d9:8d:d2)
Internet Protocol, Src: 172.16.1.33 (172.16.1.33), Dst: 172.16.1.35 (172.16.1.35)
User Datagram Protocol, Src Port: 41366 (41366), Dst Port: sip (5060)
Session Initiation Protocol
Request-Line: REGISTER sip:172.16.1.35 SIP/2.0
Message Header

No. Time Source Destination Protocol Info
26 25.909920 172.16.1.33 172.16.1.35 SIP Request: REGISTER sip:172.16.1.35

Frame 26 (602 bytes on wire, 602 bytes captured)
Ethernet II, Src: AcctonTe_da:ad:24 (00:10:b5:da:ad:24), Dst: 172.16.1.35 (00:03:47:d9:8d:d2)
Internet Protocol, Src: 172.16.1.33 (172.16.1.33), Dst: 172.16.1.35 (172.16.1.35)
User Datagram Protocol, Src Port: 41366 (41366), Dst Port: sip (5060)
Session Initiation Protocol
Request-Line: REGISTER sip:172.16.1.35 SIP/2.0
Message Header

No. Time Source Destination Protocol Info
27 25.938719 172.16.1.37 Broadcast ARP Who has 172.16.1.36? Tell 172.16.1.37

Frame 27 (60 bytes on wire, 60 bytes captured)
Ethernet II, Src: 172.16.1.37 (00:10:dc:ff:67:83), Dst: Broadcast (ff:ff:ff:ff:ff:ff)
Address Resolution Protocol (request)

No. Time Source Destination Protocol Info
28 29.933219 172.16.1.33 172.16.1.35 SIP Request: REGISTER sip:172.16.1.35

Frame 28 (602 bytes on wire, 602 bytes captured)
Ethernet II, Src: AcctonTe_da:ad:24 (00:10:b5:da:ad:24), Dst: 172.16.1.35 (00:03:47:d9:8d:d2)
Internet Protocol, Src: 172.16.1.33 (172.16.1.33), Dst: 172.16.1.35 (172.16.1.35)
User Datagram Protocol, Src Port: 41366 (41366), Dst Port: sip (5060)
Session Initiation Protocol
Request-Line: REGISTER sip:172.16.1.35 SIP/2.0
Message Header

No. Time Source Destination Protocol Info
29 29.936663 172.16.1.37 Broadcast ARP Who has 172.16.1.36? Tell 172.16.1.37

Frame 29 (60 bytes on wire, 60 bytes captured)
Ethernet II, Src: 172.16.1.37 (00:10:dc:ff:67:83), Dst: Broadcast (ff:ff:ff:ff:ff:ff)
Address Resolution Protocol (request)

No. Time Source Destination Protocol Info
30 33.956552 172.16.1.33 172.16.1.35 SIP Request: REGISTER sip:172.16.1.35

Frame 30 (602 bytes on wire, 602 bytes captured)
Ethernet II, Src: AcctonTe_da:ad:24 (00:10:b5:da:ad:24), Dst: 172.16.1.35 (00:03:47:d9:8d:d2)
Internet Protocol, Src: 172.16.1.33 (172.16.1.33), Dst: 172.16.1.35 (172.16.1.35)
User Datagram Protocol, Src Port: 41366 (41366), Dst Port: sip (5060)
Session Initiation Protocol
Request-Line: REGISTER sip:172.16.1.35 SIP/2.0
Message Header

No. Time Source Destination Protocol Info
31 34.485835 172.16.0.1 Broadcast ARP Who has 172.16.1.61? Tell 172.16.0.1

Frame 31 (60 bytes on wire, 60 bytes captured)
Ethernet II, Src: 172.16.0.1 (00:0d:72:82:55:11), Dst: Broadcast (ff:ff:ff:ff:ff:ff)
Address Resolution Protocol (request)

No. Time Source Destination Protocol Info
32 34.505836 172.16.0.1 Broadcast ARP Who has 172.16.1.35? Tell 172.16.0.1

Frame 32 (60 bytes on wire, 60 bytes captured)
Ethernet II, Src: 172.16.0.1 (00:0d:72:82:55:11), Dst: Broadcast (ff:ff:ff:ff:ff:ff)
Address Resolution Protocol (request)

No. Time Source Destination Protocol Info
33 34.505873 172.16.1.35 172.16.0.1 ARP 172.16.1.35 is at 00:03:47:d9:8d:d2

Frame 33 (42 bytes on wire, 42 bytes captured)
Ethernet II, Src: 172.16.1.35 (00:03:47:d9:8d:d2), Dst: 172.16.0.1 (00:0d:72:82:55:11)
Address Resolution Protocol (reply)

No. Time Source Destination Protocol Info
34 34.526821 172.16.0.1 Broadcast ARP Who has 172.16.1.33? Tell 172.16.0.1

Frame 34 (60 bytes on wire, 60 bytes captured)
Ethernet II, Src: 172.16.0.1 (00:0d:72:82:55:11), Dst: Broadcast (ff:ff:ff:ff:ff:ff)
Address Resolution Protocol (request)

No. Time Source Destination Protocol Info
35 34.556457 172.16.0.1 Broadcast ARP Who has 172.16.1.36? Tell 172.16.0.1

Frame 35 (60 bytes on wire, 60 bytes captured)
Ethernet II, Src: 172.16.0.1 (00:0d:72:82:55:11), Dst: Broadcast (ff:ff:ff:ff:ff:ff)
Address Resolution Protocol (request)

No. Time Source Destination Protocol Info
36 35.595670 172.16.0.1 Broadcast ARP Who has 172.16.1.36? Tell 172.16.0.1

Frame 36 (60 bytes on wire, 60 bytes captured)
Ethernet II, Src: 172.16.0.1 (00:0d:72:82:55:11), Dst: Broadcast (ff:ff:ff:ff:ff:ff)
Address Resolution Protocol (request)

No. Time Source Destination Protocol Info
37 36.645930 172.16.0.1 Broadcast ARP Who has 172.16.1.34? Tell 172.16.0.1

Frame 37 (60 bytes on wire, 60 bytes captured)
Ethernet II, Src: 172.16.0.1 (00:0d:72:82:55:11), Dst: Broadcast (ff:ff:ff:ff:ff:ff)
Address Resolution Protocol (request)

No. Time Source Destination Protocol Info
38 37.979834 172.16.1.33 172.16.1.35 SIP Request: REGISTER sip:172.16.1.35

Frame 38 (602 bytes on wire, 602 bytes captured)
Ethernet II, Src: AcctonTe_da:ad:24 (00:10:b5:da:ad:24), Dst: 172.16.1.35 (00:03:47:d9:8d:d2)
Internet Protocol, Src: 172.16.1.33 (172.16.1.33), Dst: 172.16.1.35 (172.16.1.35)
User Datagram Protocol, Src Port: 41366 (41366), Dst Port: sip (5060)
Session Initiation Protocol
Request-Line: REGISTER sip:172.16.1.35 SIP/2.0
Message Header

+++++++++++++++++

As I said, the symptom appears to be that the SIP packets aren’t being rx’d by the Asterisk process (at least no visibile activity on the CLI console).

do you have a iptables(other firewall) active?
if it so, try to disable iptables with “service iptables stop” (or reconfiugre it, becous the next reboot it wiil get active)
in similar situation this resolve my problem

regards.

Thanks for the reply - and yes, I did have a firewall running. Two in fact - at least I think that’s what the “Novell AppArmor” was, as well as the built in Firewall.

Once you’d suggested the cause, I used YaST and searched for everything that looked like a firewall. I remember when a *NIX intallation was simple, and didn’t come prepackaged with network security features…

Thanks again!!

Mat