401 Unauthorized -> Then 200 OK

Hello guys,

I fairly new to working with Asterisk.
Recently installed an Asterisk server and I am able to make calls, so what I have configured so far is working fine.

But what I noticed in a Wireshark capture is when my SIP client (Samsung Galaxy S / CSIPSimple) is registering on my server it shows the logging below.
What I expected is just 1 200OK message in response to the REGISTER, but i see a whole lot 200OK’s more, and I don’t know why my SIP server is responding with a 401 message back.

28 216.258064 62.45.x.54 -> 149.210.135.175 SIP 624 Request: REGISTER sip:test-facility.nl (fetch bindings) |
29 216.258438 149.210.135.175 -> 62.45.x.54 SIP 626 Status: 401 Unauthorized (0 bindings) |
30 216.283034 62.45.x.54 -> 149.210.135.175 SIP 839 Request: REGISTER sip:test-facility.nl (fetch bindings) |
31 216.283670 149.210.135.175 -> 62.45.x.54 SIP 645 Status: 200 OK (0 bindings) |
32 216.603255 62.45.x.54 -> 149.210.135.175 SIP 839 Request: REGISTER sip:test-facility.nl (fetch bindings) |
32 33 216.603592 149.210.135.175 -> 62.45.x.54 SIP 638 Status: 401 Unauthorized (0 bindings) |
34 216.630316 62.45.x.54 -> 149.210.135.175 SIP 839 Request: REGISTER sip:test-facility.nl (fetch bindings) |
35 216.631009 149.210.135.175 -> 62.45.x.54 SIP 645 Status: 200 OK (0 bindings) |

Now in my Asterisk CLI I don’t see anything out of the ordinary when the same client is registering.

=========================================================================
Connected to Asterisk 11.7.0~dfsg-1ubuntu1 currently running on test-facility (pid = 21256)
– Registered SIP ‘7002’ at 62.45.x.54:50568
[Aug 8 17:23:26] NOTICE[21277]: chan_sip.c:27783 handle_request_subscribe: Received SIP subscribe for peer without mailbox: 7002
test-facility*CLI>

[Aug 8 17:23:26] NOTICE[21277]: chan_sip.c:27783 handle_request_subscribe: Received SIP subscribe for peer without mailbox: 7002
test-facilityCLI> sip show peers
Name/username Host Dyn Forcerport ACL Port Status Description
7001/7001 (Unspecified) D N 0 Unmonitored
7002/7002 62.45.x.54 D N 50568 Unmonitored
2 sip peers [Monitored: 0 online, 0 offline Unmonitored: 1 online, 1 offline]
test-facility
CLI>

Also I don’t know why I receive this message, but I also must admit that I didn’t investigate this message so far.
Aug 8 17:23:26] NOTICE[21277]: chan_sip.c:27783 handle_request_subscribe: Received SIP subscribe for peer without mailbox: 7002

Can someone explain this to me, or know where I can find out?

Thanks in advance.

Try looking in the RFC 3261. When you use authentication methods there flow goes like:

Register------>
<-----Unauthorized(with Auth Digest,challenge)
Register------>
(with result of challenge)
<----- OK

Thanks, looked into that and came up with some interesting information/links.

voipmechanic.com/sip-call-example.htm
www.voip-info.org/wiki/view/SIP+Authentication

For users in the future who expierenced the same issues…

Also fixed this ‘issue’: Aug 8 17:23:26] NOTICE[21277]: chan_sip.c:27783 handle_request_subscribe: Received SIP subscribe for peer without mailbox: 7002
Disabled the mail checks on my softphone.

Source:
issues.asterisk.org/jira/browse/ASTERISK-21959