Incomin calls not working

Hi all,

I have troubles to make incoming calls working on my Asterisk. Outgoing is working well. On my small experience, I was already able to make an Asterisk working with an other provider. The parameters are slithly the same, so I can’t explain me what is the problem.

My network is as follows:

Incoming:
provider (62.65.137.114) -> router (83.77.49.125/192.168.1.1) -> Asterisk (192.168.1.125) -> ATA (192.168.1.102)

raspberrypi*CLI> sip show registry
Host dnsmgr Username Refresh State Reg.Time
sip.netvoip.ch:5060 N 026XXX1931 105 Registered Thu, 06 Feb 2020 12:24:41
1 SIP registrations.

raspberrypi*CLI> sip show peers
Name/username Host Dyn Forcerport Comedia ACL Port Status Description
7C2F806F0216/7C2F806F0216 192.168.1.102 D Yes Yes 5060 Unmonitored VOIP home
provider1/026XXX1931 62.65.137.114 Yes Yes 5060 Unmonitored
2 sip peers [Monitored: 0 online, 0 offline Unmonitored: 2 online, 0 offline]

raspberrypi*CLI> dialplan show LocalSets
[ Context ‘LocalSets’ created by ‘pbx_config’ ]
‘s’ => 1. GotoIf({BLACKLIST()}?blacklisted) [extensions.conf:864] 2. GotoIf(["{CALLERID(num)}" = "Unknown"]?blacklisted) [extensions.conf:865] 3. GotoIf(["{CALLERID(num)}" = "Anonymous"]?blacklisted) [extensions.conf:866] 4. GotoIf(["{CALLERID(num)}" = _0032.]?blacklisted) [extensions.conf:867] 5. GotoIf(["{CALLERID(num)}" = _0033.]?blacklisted) [extensions.conf:868] 6. GotoIf(["{CALLERID(num)}" = _0039.]?blacklisted) [extensions.conf:869] 7. GotoIf(["{CALLERID(num)}" = _0049.]?blacklisted) [extensions.conf:870] 8. Answer() [extensions.conf:871] 9. Dial(Local/channel_1@DelayToRing,,m) [extensions.conf:872] [blacklisted] 10. Hangup() [extensions.conf:873] '_0.' => 1. Dial(SIP/{EXTEN}@provider1) [extensions.conf:885]

-= 2 extensions (11 priorities) in 1 context. =-

sip.conf

[general]
udpbindaddr=192.168.1.125 ; IP address to bind UDP listen socket to (0.0.0.0 binds to all)
bindport=5060 ; Asterisk local port
tcpenable=no ; Enable server for incoming TCP connections (default is no)
transport=udp ; Set the default transports. The order determines the primary default transport.
srvlookup=no ; Enable DNS SRV lookups on outbound calls
disallow=all ; First disallow all codecs
allow=alaw ; Allow codecs in order of preference
language=fr ; Default language setting for all users/peers
tonezone=ch ; Default tonezone for all users/peers
alwaysauthreject = yes ; When an incoming INVITE or REGISTER is to be rejected,
; register SIP
register => 026XXX1931:pwd@sip.netvoip.ch/026XXX1931
;
;externhost=xxx.internet-box.ch:5060 ; refreshed periodically
externip=83.77.49.125:5060
externrefresh=180 ; change the refresh interval
localnet=192.168.1.1/24 ; network to be considred as internal
nat=force_rport,comedia ; nating
context=LocalSets ; Default context for incoming calls. Defaults to ‘default’
allowoverlap=no ; Disable overlap dialing support. (Default is yes)
allowguest=no ; Allow or reject guest calls (default is yes)
; If your Asterisk is connected to the Internet
; and you have allowguest=yes
; you want to check which services you offer everyone
; out there, by enabling them in the default context (see below).
directmedia=no
directmediadeny=0.0.0.0/0
directmediapermit=192.168.1.1/24
;qualify=yes
qualify=no

And the debug shows following details during an icoming call:

raspberrypi*CLI>
Console verbose was OFF and is now 10.

<— SIP read from UDP:192.168.1.102:5060 —>
REGISTER sip:192.168.1.125 SIP/2.0
Via: SIP/2.0/UDP 192.168.1.102:5060;branch=z9hG4bKce1929898ce9fe58e1f923b2a9ae59d;rport
From: “7C2F806F0216” sip:7C2F806F0216@192.168.1.125;tag=1870047004
To: “7C2F806F0216” sip:7C2F806F0216@192.168.1.125
Call-ID: 3518805577@192_168_1_102
CSeq: 639 REGISTER
Contact: sip:7C2F806F0216@192.168.1.102:5060
Max-Forwards: 70
User-Agent: S850A GO/42.240.00.000.000
Expires: 180
Allow: INVITE, ACK, CANCEL, BYE, OPTIONS, INFO, SUBSCRIBE, NOTIFY, REFER, UPDATE
Content-Length: 0

<------------->
— (12 headers 0 lines) —
Sending to 192.168.1.102:5060 (NAT)
Sending to 192.168.1.102:5060 (NAT)

<— Transmitting (NAT) to 192.168.1.102:5060 —>
SIP/2.0 401 Unauthorized
Via: SIP/2.0/UDP 192.168.1.102:5060;branch=z9hG4bKce1929898ce9fe58e1f923b2a9ae59d;received=192.168.1.102;rport=5060
From: “7C2F806F0216” sip:7C2F806F0216@192.168.1.125;tag=1870047004
To: “7C2F806F0216” sip:7C2F806F0216@192.168.1.125;tag=as44db911d
Call-ID: 3518805577@192_168_1_102
CSeq: 639 REGISTER
Server: Asterisk PBX 16.2.1~dfsg-1+deb10u1
Allow: INVITE, ACK, CANCEL, OPTIONS, BYE, REFER, SUBSCRIBE, NOTIFY, INFO, PUBLISH, MESSAGE
Supported: replaces, timer
WWW-Authenticate: Digest algorithm=MD5, realm=“mysip001”, nonce=“11f6858e”
Content-Length: 0

<------------>
Scheduling destruction of SIP dialog ‘3518805577@192_168_1_102’ in 32000 ms (Method: REGISTER)

<— SIP read from UDP:192.168.1.102:5060 —>
REGISTER sip:192.168.1.125 SIP/2.0
Via: SIP/2.0/UDP 192.168.1.102:5060;branch=z9hG4bK565bbfc5e5a701307d51debe95bc6bc3;rport
From: “7C2F806F0216” sip:7C2F806F0216@192.168.1.125;tag=1870047004
To: “7C2F806F0216” sip:7C2F806F0216@192.168.1.125
Call-ID: 3518805577@192_168_1_102
CSeq: 640 REGISTER
Contact: sip:7C2F806F0216@192.168.1.102:5060
Authorization: Digest username=“7C2F806F0216”, realm=“mysip001”, algorithm=MD5, uri=“sip:192.168.1.125”, nonce=“11f6858e”, response=“74df51543e48facb38aeeb4c5a28344b”
Max-Forwards: 70
User-Agent: S850A GO/42.240.00.000.000
Expires: 180
Allow: INVITE, ACK, CANCEL, BYE, OPTIONS, INFO, SUBSCRIBE, NOTIFY, REFER, UPDATE
Content-Length: 0

<------------->
— (13 headers 0 lines) —
Sending to 192.168.1.102:5060 (NAT)

<— Transmitting (NAT) to 192.168.1.102:5060 —>
SIP/2.0 200 OK
Via: SIP/2.0/UDP 192.168.1.102:5060;branch=z9hG4bK565bbfc5e5a701307d51debe95bc6bc3;received=192.168.1.102;rport=5060
From: “7C2F806F0216” sip:7C2F806F0216@192.168.1.125;tag=1870047004
To: “7C2F806F0216” sip:7C2F806F0216@192.168.1.125;tag=as44db911d
Call-ID: 3518805577@192_168_1_102
CSeq: 640 REGISTER
Server: Asterisk PBX 16.2.1~dfsg-1+deb10u1
Allow: INVITE, ACK, CANCEL, OPTIONS, BYE, REFER, SUBSCRIBE, NOTIFY, INFO, PUBLISH, MESSAGE
Supported: replaces, timer
Expires: 180
Contact: sip:7C2F806F0216@192.168.1.102:5060;expires=180
Date: Thu, 06 Feb 2020 12:41:39 GMT
Content-Length: 0

<------------>
Scheduling destruction of SIP dialog ‘687659c8797ba47c0d169b6a689c2ea3@192.168.1.125:5060’ in 32000 ms (Method: NOTIFY)
Reliably Transmitting (NAT) to 192.168.1.102:5060:
NOTIFY sip:7C2F806F0216@192.168.1.102:5060 SIP/2.0
Via: SIP/2.0/UDP 192.168.1.125:5060;branch=z9hG4bK7215e67d;rport
Max-Forwards: 70
From: “asterisk” sip:asterisk@192.168.1.125;tag=as3b379d8f
To: sip:7C2F806F0216@192.168.1.102:5060
Contact: sip:asterisk@192.168.1.125:5060
Call-ID: 687659c8797ba47c0d169b6a689c2ea3@192.168.1.125:5060
CSeq: 102 NOTIFY
User-Agent: Asterisk PBX 16.2.1~dfsg-1+deb10u1
Event: message-summary
Content-Type: application/simple-message-summary
Content-Length: 93

Messages-Waiting: no
Message-Account: sip:asterisk@192.168.1.125
Voice-Message: 0/0 (0/0)


Scheduling destruction of SIP dialog ‘3518805577@192_168_1_102’ in 32000 ms (Method: REGISTER)

<— SIP read from UDP:192.168.1.102:5060 —>
SIP/2.0 200 OK
Via: SIP/2.0/UDP 192.168.1.125:5060;branch=z9hG4bK7215e67d;rport=5060
From: “asterisk” sip:asterisk@192.168.1.125;tag=as3b379d8f
To: sip:7C2F806F0216@192.168.1.102:5060;tag=ar2c268e9g
Call-ID: 687659c8797ba47c0d169b6a689c2ea3@192.168.1.125:5060
CSeq: 102 NOTIFY
User-Agent: S850A GO/42.240.00.000.000
Content-Length: 0

<------------->
— (8 headers 0 lines) —
Really destroying SIP dialog ‘687659c8797ba47c0d169b6a689c2ea3@192.168.1.125:5060’ Method: NOTIFY
Really destroying SIP dialog ‘3518805577@192_168_1_102’ Method: REGISTER
[Feb 6 12:42:11] NOTICE[19763]: chan_sip.c:15828 sip_reregister: – Re-registration for 026XXX1931@sip.netvoip.ch
REGISTER 12 headers, 0 lines
Reliably Transmitting (NAT) to 62.65.137.114:5060:
REGISTER sip:sip.netvoip.ch SIP/2.0
Via: SIP/2.0/UDP 83.77.49.125:5060;branch=z9hG4bK6372636a;rport
Max-Forwards: 70
From: sip:026XXX1931@sip.netvoip.ch;tag=as54404b4b
To: sip:026XXX1931@sip.netvoip.ch
Call-ID: 2374475a10af78d306ddcebd2e7718e3@192.168.1.125
CSeq: 217 REGISTER
Supported: replaces, timer
User-Agent: Asterisk PBX 16.2.1~dfsg-1+deb10u1
Authorization: Digest username=“026XXX1931”, realm=“sip.netvoip.ch”, algorithm=MD5, uri=“sip:sip.netvoip.ch”, nonce=“1580992721:df0bb0245bb3d4e34fc20d93ad2c2fc0”, response=“b7f31102f5e344a6ad856da8f8c5f547”
Expires: 120
Contact: sip:026XXX1931@83.77.49.125:5060
Content-Length: 0


<— SIP read from UDP:62.65.137.114:5060 —>
SIP/2.0 200 OK
Via: SIP/2.0/UDP 83.77.49.125:5060;branch=z9hG4bK6372636a;rport=40803
Contact: sip:026XXX1931@83.77.49.125:5060;transport=UDP;expires=300
To: sip:026XXX1931@sip.netvoip.ch;tag=6dc1f954
From: sip:026XXX1931@sip.netvoip.ch;tag=as54404b4b
Call-ID: 2374475a10af78d306ddcebd2e7718e3@192.168.1.125
CSeq: 217 REGISTER
Date: Thu, 06 Feb 2020 12:42:11 GMT
Content-Length: 0

<------------->
— (9 headers 0 lines) —
[Feb 6 12:42:11] NOTICE[19763]: chan_sip.c:24836 handle_response_register: Outbound Registration: Expiry for sip.netvoip.ch is 120 sec (Scheduling reregistration in 105 s)
Really destroying SIP dialog ‘2374475a10af78d306ddcebd2e7718e3@192.168.1.125’ Method: REGISTER

And during the same call, I have this trace on the OS level:

root@raspberrypi:/etc/asterisk# tcpdump -W2 -C1 -nnAs0 host 62.65.137.114
tcpdump: verbose output suppressed, use -v or -vv for full protocol decode
listening on eth0, link-type EN10MB (Ethernet), capture size 262144 bytes

12:42:02.308524 IP 62.65.137.114.5060 > 192.168.1.125.5001: SIP: INVITE sip:026XXX1931@83.77.49.125:5060;transport=UDP SIP/2.0
E…@.9…>A.r…}…INVITE sip:026XXX1931@83.77.49.125:5060;transport=UDP SIP/2.0
Via: SIP/2.0/UDP 62.65.137.114:5060;branch=z9hG4bK-d8754z-b1620f21612b5601-1—d8754z-;rport
Via: SIP/2.0/UDP 62.65.137.114:5061;branch=z9hG4bK-4eneynyra6nm3fdj;rport=5061
Max-Forwards: 69
Record-Route: sip:62.65.137.114;lr
Contact: "026XXX2550"sip:026XXX2550@62.65.137.114:5061
To: sip:4126XXX1931@62.65.137.114
From: "026XXX2550"sip:026XXX2550@62.65.137.114;tag=u2wppr4cjkpcg4bo.o
Call-ID: 142b29e82c33fed921aec8c022b452de@84.73.164.52:5060~2o
CSeq: 211 INVITE
Expires: 300
Content-Disposition: session
Content-Type: application/sdp
User-Agent: Netstream
h323-conf-id: 3995332154-3423540071-3998560650-94476167
cisco-GUID: 3995332154-3423540071-3998560650-94476167
Content-Length: 251

v=0
o=Netstream 202090472 0 IN IP4 62.65.137.114
s=Asterisk PBX 16.2.1~dfsg-1+deb10u1
t=0 0
m=audio 43754 RTP/AVP 8 101
c=IN IP4 62.65.137.114
a=rtpmap:8 PCMA/8000
a=rtpmap:101 telephone-event/8000
a=fmtp:101 0-16
a=maxptime:150
a=sendrecv

12:42:02.308881 IP 192.168.1.125 > 62.65.137.114: ICMP 192.168.1.125 udp port 5001 unreachable, length 556
E…@r…@.{?..}>A.r…%…E…@.9…>A.r…}…INVITE sip:026XXX1931@83.77.49.125:5060;transport=UDP SIP/2.0
Via: SIP/2.0/UDP 62.65.137.114:5060;branch=z9hG4bK-d8754z-b1620f21612b5601-1—d8754z-;rport
Via: SIP/2.0/UDP 62.65.137.114:5061;branch=z9hG4bK-4eneynyra6nm3fdj;rport=5061
Max-Forwards: 69
Record-Route: sip:62.65.137.114;lr
Contact: "026XXX2550"sip:026XXX2550@62.65.137.114:5061
To: sip:4126XXX1931@62.65.137.114
From: "026XXX2550"sip:026XXX2550@62.65.137.114;tag=u2wppr4cjkpcg4bo.o
Call-ID: 142b29e82c33fed921aec8c022b452de@84.73.164.52:5060
12:42:02.807188 IP 62.65.137.114.5060 > 192.168.1.125.5001: SIP: INVITE sip:026XXX1931@83.77.49.125:5060;transport=UDP SIP/2.0
E…@.9…>A.r…}…INVITE sip:026XXX1931@83.77.49.125:5060;transport=UDP SIP/2.0
Via: SIP/2.0/UDP 62.65.137.114:5060;branch=z9hG4bK-d8754z-b1620f21612b5601-1—d8754z-;rport
Via: SIP/2.0/UDP 62.65.137.114:5061;branch=z9hG4bK-4eneynyra6nm3fdj;rport=5061
Max-Forwards: 69
Record-Route: sip:62.65.137.114;lr
Contact: "026XXX2550"sip:026XXX2550@62.65.137.114:5061
To: sip:4126XXX1931@62.65.137.114
From: "026XXX2550"sip:026XXX2550@62.65.137.114;tag=u2wppr4cjkpcg4bo.o
Call-ID: 142b29e82c33fed921aec8c022b452de@84.73.164.52:5060~2o
CSeq: 211 INVITE
Expires: 300
Content-Disposition: session
Content-Type: application/sdp
User-Agent: Netstream
h323-conf-id: 3995332154-3423540071-3998560650-94476167
cisco-GUID: 3995332154-3423540071-3998560650-94476167
Content-Length: 251

v=0
o=Netstream 202090472 0 IN IP4 62.65.137.114
s=Asterisk PBX 16.2.1~dfsg-1+deb10u1
t=0 0
m=audio 43754 RTP/AVP 8 101
c=IN IP4 62.65.137.114
a=rtpmap:8 PCMA/8000
a=rtpmap:101 telephone-event/8000
a=fmtp:101 0-16
a=maxptime:150
a=sendrecv

12:42:02.807422 IP 192.168.1.125 > 62.65.137.114: ICMP 192.168.1.125 udp port 5001 unreachable, length 556
E…@r…@.{9…}>A.r…%…E…@.9…>A.r…}…INVITE sip:026XXX1931@83.77.49.125:5060;transport=UDP SIP/2.0
Via: SIP/2.0/UDP 62.65.137.114:5060;branch=z9hG4bK-d8754z-b1620f21612b5601-1—d8754z-;rport
Via: SIP/2.0/UDP 62.65.137.114:5061;branch=z9hG4bK-4eneynyra6nm3fdj;rport=5061
Max-Forwards: 69
Record-Route: sip:62.65.137.114;lr
Contact: "026XXX2550"sip:026XXX2550@62.65.137.114:5061
To: sip:4126XXX1931@62.65.137.114
From: "026XXX2550"sip:026XXX2550@62.65.137.114;tag=u2wppr4cjkpcg4bo.o
Call-ID: 142b29e82c33fed921aec8c022b452de@84.73.164.52:5060
12:42:03.807754 IP 62.65.137.114.5060 > 192.168.1.125.5001: SIP: INVITE sip:026XXX1931@83.77.49.125:5060;transport=UDP SIP/2.0
E…@.9…>A.r…}…INVITE sip:026XXX1931@83.77.49.125:5060;transport=UDP SIP/2.0
Via: SIP/2.0/UDP 62.65.137.114:5060;branch=z9hG4bK-d8754z-b1620f21612b5601-1—d8754z-;rport
Via: SIP/2.0/UDP 62.65.137.114:5061;branch=z9hG4bK-4eneynyra6nm3fdj;rport=5061
Max-Forwards: 69
Record-Route: sip:62.65.137.114;lr
Contact: "026XXX2550"sip:026XXX2550@62.65.137.114:5061
To: sip:4126XXX1931@62.65.137.114
From: "026XXX2550"sip:026XXX2550@62.65.137.114;tag=u2wppr4cjkpcg4bo.o
Call-ID: 142b29e82c33fed921aec8c022b452de@84.73.164.52:5060~2o
CSeq: 211 INVITE
Expires: 300
Content-Disposition: session
Content-Type: application/sdp
User-Agent: Netstream
h323-conf-id: 3995332154-3423540071-3998560650-94476167
cisco-GUID: 3995332154-3423540071-3998560650-94476167
Content-Length: 251

v=0
o=Netstream 202090472 0 IN IP4 62.65.137.114
s=Asterisk PBX 16.2.1~dfsg-1+deb10u1
t=0 0
m=audio 43754 RTP/AVP 8 101
c=IN IP4 62.65.137.114
a=rtpmap:8 PCMA/8000
a=rtpmap:101 telephone-event/8000
a=fmtp:101 0-16
a=maxptime:150
a=sendrecv

12:42:03.807995 IP 192.168.1.125 > 62.65.137.114: ICMP 192.168.1.125 udp port 5001 unreachable, length 556
E…@s…@.{…}>A.r…%…E…@.9…>A.r…}…INVITE sip:026XXX1931@83.77.49.125:5060;transport=UDP SIP/2.0
Via: SIP/2.0/UDP 62.65.137.114:5060;branch=z9hG4bK-d8754z-b1620f21612b5601-1—d8754z-;rport
Via: SIP/2.0/UDP 62.65.137.114:5061;branch=z9hG4bK-4eneynyra6nm3fdj;rport=5061
Max-Forwards: 69
Record-Route: sip:62.65.137.114;lr
Contact: "026XXX2550"sip:026XXX2550@62.65.137.114:5061
To: sip:4126XXX1931@62.65.137.114
From: "026XXX2550"sip:026XXX2550@62.65.137.114;tag=u2wppr4cjkpcg4bo.o
Call-ID: 142b29e82c33fed921aec8c022b452de@84.73.164.52:5060
12:42:05.807771 IP 62.65.137.114.5060 > 192.168.1.125.5001: SIP: INVITE sip:026XXX1931@83.77.49.125:5060;transport=UDP SIP/2.0
E…@.9…>A.r…}…INVITE sip:026XXX1931@83.77.49.125:5060;transport=UDP SIP/2.0
Via: SIP/2.0/UDP 62.65.137.114:5060;branch=z9hG4bK-d8754z-b1620f21612b5601-1—d8754z-;rport
Via: SIP/2.0/UDP 62.65.137.114:5061;branch=z9hG4bK-4eneynyra6nm3fdj;rport=5061
Max-Forwards: 69
Record-Route: sip:62.65.137.114;lr
Contact: "026XXX2550"sip:026XXX2550@62.65.137.114:5061
To: sip:4126XXX1931@62.65.137.114
From: "026XXX2550"sip:026XXX2550@62.65.137.114;tag=u2wppr4cjkpcg4bo.o
Call-ID: 142b29e82c33fed921aec8c022b452de@84.73.164.52:5060~2o
CSeq: 211 INVITE
Expires: 300
Content-Disposition: session
Content-Type: application/sdp
User-Agent: Netstream
h323-conf-id: 3995332154-3423540071-3998560650-94476167
cisco-GUID: 3995332154-3423540071-3998560650-94476167
Content-Length: 251

v=0
o=Netstream 202090472 0 IN IP4 62.65.137.114
s=Asterisk PBX 16.2.1~dfsg-1+deb10u1
t=0 0
m=audio 43754 RTP/AVP 8 101
c=IN IP4 62.65.137.114
a=rtpmap:8 PCMA/8000
a=rtpmap:101 telephone-event/8000
a=fmtp:101 0-16
a=maxptime:150
a=sendrecv

12:42:05.808012 IP 192.168.1.125 > 62.65.137.114: ICMP 192.168.1.125 udp port 5001 unreachable, length 556
E…@s…@.{…}>A.r…%…E…@.9…>A.r…}…INVITE sip:026XXX1931@83.77.49.125:5060;transport=UDP SIP/2.0
Via: SIP/2.0/UDP 62.65.137.114:5060;branch=z9hG4bK-d8754z-b1620f21612b5601-1—d8754z-;rport
Via: SIP/2.0/UDP 62.65.137.114:5061;branch=z9hG4bK-4eneynyra6nm3fdj;rport=5061
Max-Forwards: 69
Record-Route: sip:62.65.137.114;lr
Contact: "026XXX2550"sip:026XXX2550@62.65.137.114:5061
To: sip:4126XXX1931@62.65.137.114
From: "026XXX2550"sip:026XXX2550@62.65.137.114;tag=u2wppr4cjkpcg4bo.o
Call-ID: 142b29e82c33fed921aec8c022b452de@84.73.164.52:5060
12:42:09.807679 IP 62.65.137.114.5060 > 192.168.1.125.5001: SIP: INVITE sip:026XXX1931@83.77.49.125:5060;transport=UDP SIP/2.0
E…@.9…>A.r…}…INVITE sip:026XXX1931@83.77.49.125:5060;transport=UDP SIP/2.0
Via: SIP/2.0/UDP 62.65.137.114:5060;branch=z9hG4bK-d8754z-b1620f21612b5601-1—d8754z-;rport
Via: SIP/2.0/UDP 62.65.137.114:5061;branch=z9hG4bK-4eneynyra6nm3fdj;rport=5061
Max-Forwards: 69
Record-Route: sip:62.65.137.114;lr
Contact: "026XXX2550"sip:026XXX2550@62.65.137.114:5061
To: sip:4126XXX1931@62.65.137.114
From: "026XXX2550"sip:026XXX2550@62.65.137.114;tag=u2wppr4cjkpcg4bo.o
Call-ID: 142b29e82c33fed921aec8c022b452de@84.73.164.52:5060~2o
CSeq: 211 INVITE
Expires: 300
Content-Disposition: session
Content-Type: application/sdp
User-Agent: Netstream
h323-conf-id: 3995332154-3423540071-3998560650-94476167
cisco-GUID: 3995332154-3423540071-3998560650-94476167
Content-Length: 251

v=0
o=Netstream 202090472 0 IN IP4 62.65.137.114
s=Asterisk PBX 16.2.1~dfsg-1+deb10u1
t=0 0
m=audio 43754 RTP/AVP 8 101
c=IN IP4 62.65.137.114
a=rtpmap:8 PCMA/8000
a=rtpmap:101 telephone-event/8000
a=fmtp:101 0-16
a=maxptime:150
a=sendrecv

12:42:09.807916 IP 192.168.1.125 > 62.65.137.114: ICMP 192.168.1.125 udp port 5001 unreachable, length 556
E…@sB…@.z…}>A.r…%…E…@.9…>A.r…}…INVITE sip:026XXX1931@83.77.49.125:5060;transport=UDP SIP/2.0
Via: SIP/2.0/UDP 62.65.137.114:5060;branch=z9hG4bK-d8754z-b1620f21612b5601-1—d8754z-;rport
Via: SIP/2.0/UDP 62.65.137.114:5061;branch=z9hG4bK-4eneynyra6nm3fdj;rport=5061
Max-Forwards: 69
Record-Route: sip:62.65.137.114;lr
Contact: "026XXX2550"sip:026XXX2550@62.65.137.114:5061
To: sip:4126XXX1931@62.65.137.114
From: "026XXX2550"sip:026XXX2550@62.65.137.114;tag=u2wppr4cjkpcg4bo.o
Call-ID: 142b29e82c33fed921aec8c022b452de@84.73.164.52:5060
12:42:11.458261 IP 192.168.1.125.5060 > 62.65.137.114.5060: SIP: REGISTER sip:sip.netvoip.ch SIP/2.0
E…@…}>A.r…~REGISTER sip:sip.netvoip.ch SIP/2.0
Via: SIP/2.0/UDP 83.77.49.125:5060;branch=z9hG4bK6372636a;rport
Max-Forwards: 70
From: sip:026XXX1931@sip.netvoip.ch;tag=as54404b4b
To: sip:026XXX1931@sip.netvoip.ch
Call-ID: 2374475a10af78d306ddcebd2e7718e3@192.168.1.125
CSeq: 217 REGISTER
Supported: replaces, timer
User-Agent: Asterisk PBX 16.2.1~dfsg-1+deb10u1
Authorization: Digest username=“026XXX1931”, realm=“sip.netvoip.ch”, algorithm=MD5, uri=“sip:sip.netvoip.ch”, nonce=“1580992721:df0bb0245bb3d4e34fc20d93ad2c2fc0”, response=“b7f31102f5e344a6ad856da8f8c5f547”
Expires: 120
Contact: sip:026XXX1931@83.77.49.125:5060
Content-Length: 0

12:42:11.471701 IP 62.65.137.114.5060 > 192.168.1.125.5060: SIP: SIP/2.0 200 OK
E…@.9…k>A.r…}…
.SIP/2.0 200 OK
Via: SIP/2.0/UDP 83.77.49.125:5060;branch=z9hG4bK6372636a;rport=40803
Contact: sip:026XXX1931@83.77.49.125:5060;transport=UDP;expires=300
To: sip:026XXX1931@sip.netvoip.ch;tag=6dc1f954
From: sip:026XXX1931@sip.netvoip.ch;tag=as54404b4b
Call-ID: 2374475a10af78d306ddcebd2e7718e3@192.168.1.125
CSeq: 217 REGISTER
Date: Thu, 06 Feb 2020 12:42:11 GMT
Content-Length: 0

I don’t understand why it want to connect to port 5001:

12:42:02.308881 IP 192.168.1.125 > 62.65.137.114: ICMP 192.168.1.125 udp port 5001 unreachable

My voip provider tells that the problem is on my side, and when I connect my ATA directly to my provider, both outcoming and icoming are working correctly.

Any idea what could be wrong and how to proceed to debug?

Thanks a lot in advance for any hint

Can you capture the problem from the console with sip set debug on? I am not sure whether port 5001 is relevant here.

This is what I have during an incoming call(I think it is about the same as above):

raspberrypiCLI> sip set debug on
SIP Debugging re-enabled
raspberrypi
CLI> core set verbose 10
Console verbose was OFF and is now 10.
[Feb 7 11:48:13] NOTICE[28881]: chan_sip.c:15828 sip_reregister: – Re-registration for 026XXX1931@sip.netvoip.ch
REGISTER 12 headers, 0 lines
Reliably Transmitting (NAT) to 62.65.137.114:5060:
REGISTER sip:sip.netvoip.ch SIP/2.0
Via: SIP/2.0/UDP 83.77.49.125:5060;branch=z9hG4bK7d9e407a;rport
Max-Forwards: 70
From: sip:026XXX1931@sip.netvoip.ch;tag=as09d0cc86
To: sip:026XXX1931@sip.netvoip.ch
Call-ID: 13a2544e4a58160c6692e81218982df5@192.168.1.125
CSeq: 1026 REGISTER
Supported: replaces, timer
User-Agent: Asterisk PBX 16.2.1~dfsg-1+deb10u1
Authorization: Digest username=“026XXX1931”, realm=“sip.netvoip.ch”, algorithm=MD5, uri=“sip:sip.netvoip.ch”, nonce=“1581075778:8a06a264466231a8a3fed5a60d5b6ca0”, response=“8f097b17b66f477d4fde911c79f8c09b”
Expires: 120
Contact: sip:026XXX1931@83.77.49.125:5060
Content-Length: 0


<— SIP read from UDP:62.65.137.114:5060 —>
SIP/2.0 401 Unauthorized
Via: SIP/2.0/UDP 83.77.49.125:5060;branch=z9hG4bK7d9e407a;rport=40803
To: sip:026XXX1931@sip.netvoip.ch;tag=78e1d205
From: sip:026XXX1931@sip.netvoip.ch;tag=as09d0cc86
Call-ID: 13a2544e4a58160c6692e81218982df5@192.168.1.125
CSeq: 1026 REGISTER
WWW-Authenticate: Digest nonce=“1581076093:4d2e1989ddb1c689554f2264e70ea1bd”,algorithm=MD5,realm=“sip.netvoip.ch”,stale=true
Content-Length: 0

<------------->
— (8 headers 0 lines) —
Responding to challenge, registration to domain/host name sip.netvoip.ch
REGISTER 12 headers, 0 lines
Reliably Transmitting (NAT) to 62.65.137.114:5060:
REGISTER sip:sip.netvoip.ch SIP/2.0
Via: SIP/2.0/UDP 83.77.49.125:5060;branch=z9hG4bK5fbaf472;rport
Max-Forwards: 70
From: sip:026XXX1931@sip.netvoip.ch;tag=as09d0cc86
To: sip:026XXX1931@sip.netvoip.ch
Call-ID: 13a2544e4a58160c6692e81218982df5@192.168.1.125
CSeq: 1027 REGISTER
Supported: replaces, timer
User-Agent: Asterisk PBX 16.2.1~dfsg-1+deb10u1
Authorization: Digest username=“026XXX1931”, realm=“sip.netvoip.ch”, algorithm=MD5, uri=“sip:sip.netvoip.ch”, nonce=“1581076093:4d2e1989ddb1c689554f2264e70ea1bd”, response=“7e9d8b6b3d70391e73218a6174c98727”
Expires: 120
Contact: sip:026XXX1931@83.77.49.125:5060
Content-Length: 0


<— SIP read from UDP:62.65.137.114:5060 —>
SIP/2.0 200 OK
Via: SIP/2.0/UDP 83.77.49.125:5060;branch=z9hG4bK5fbaf472;rport=40803
Contact: sip:026XXX1931@83.77.49.125:5060;transport=UDP;expires=300
To: sip:026XXX1931@sip.netvoip.ch;tag=7fca0f6c
From: sip:026XXX1931@sip.netvoip.ch;tag=as09d0cc86
Call-ID: 13a2544e4a58160c6692e81218982df5@192.168.1.125
CSeq: 1027 REGISTER
Date: Fri, 07 Feb 2020 11:48:13 GMT
Content-Length: 0

<------------->
— (9 headers 0 lines) —
[Feb 7 11:48:13] NOTICE[28881]: chan_sip.c:24836 handle_response_register: Outbound Registration: Expiry for sip.netvoip.ch is 120 sec (Scheduling reregistration in 105 s)
Really destroying SIP dialog ‘13a2544e4a58160c6692e81218982df5@192.168.1.125’ Method: REGISTER

<— SIP read from UDP:192.168.1.102:5060 —>
REGISTER sip:192.168.1.125 SIP/2.0
Via: SIP/2.0/UDP 192.168.1.102:5060;branch=z9hG4bK2404082da2cdcd587c8a367071d9c81e;rport
From: “7C2F806F0216” sip:7C2F806F0216@192.168.1.125;tag=812507764
To: “7C2F806F0216” sip:7C2F806F0216@192.168.1.125
Call-ID: 3518805577@192_168_1_102
CSeq: 1871 REGISTER
Contact: sip:7C2F806F0216@192.168.1.102:5060
Max-Forwards: 70
User-Agent: S850A GO/42.240.00.000.000
Expires: 180
Allow: INVITE, ACK, CANCEL, BYE, OPTIONS, INFO, SUBSCRIBE, NOTIFY, REFER, UPDATE
Content-Length: 0

<------------->
— (12 headers 0 lines) —
Sending to 192.168.1.102:5060 (NAT)
Sending to 192.168.1.102:5060 (NAT)

<— Transmitting (NAT) to 192.168.1.102:5060 —>
SIP/2.0 401 Unauthorized
Via: SIP/2.0/UDP 192.168.1.102:5060;branch=z9hG4bK2404082da2cdcd587c8a367071d9c81e;received=192.168.1.102;rport=5060
From: “7C2F806F0216” sip:7C2F806F0216@192.168.1.125;tag=812507764
To: “7C2F806F0216” sip:7C2F806F0216@192.168.1.125;tag=as1d37049b
Call-ID: 3518805577@192_168_1_102
CSeq: 1871 REGISTER
Server: Asterisk PBX 16.2.1~dfsg-1+deb10u1
Allow: INVITE, ACK, CANCEL, OPTIONS, BYE, REFER, SUBSCRIBE, NOTIFY, INFO, PUBLISH, MESSAGE
Supported: replaces, timer
WWW-Authenticate: Digest algorithm=MD5, realm=“mysip001”, nonce=“4c84147f”
Content-Length: 0

<------------>
Scheduling destruction of SIP dialog ‘3518805577@192_168_1_102’ in 32000 ms (Method: REGISTER)

<— SIP read from UDP:192.168.1.102:5060 —>
REGISTER sip:192.168.1.125 SIP/2.0
Via: SIP/2.0/UDP 192.168.1.102:5060;branch=z9hG4bK2ceb42416807f4892595c9936621669f;rport
From: “7C2F806F0216” sip:7C2F806F0216@192.168.1.125;tag=812507764
To: “7C2F806F0216” sip:7C2F806F0216@192.168.1.125
Call-ID: 3518805577@192_168_1_102
CSeq: 1872 REGISTER
Contact: sip:7C2F806F0216@192.168.1.102:5060
Authorization: Digest username=“7C2F806F0216”, realm=“mysip001”, algorithm=MD5, uri=“sip:192.168.1.125”, nonce=“4c84147f”, response=“58ed84f25fea0f1767312856ba3b0b90”
Max-Forwards: 70
User-Agent: S850A GO/42.240.00.000.000
Expires: 180
Allow: INVITE, ACK, CANCEL, BYE, OPTIONS, INFO, SUBSCRIBE, NOTIFY, REFER, UPDATE
Content-Length: 0

<------------->
— (13 headers 0 lines) —
Sending to 192.168.1.102:5060 (NAT)

<— Transmitting (NAT) to 192.168.1.102:5060 —>
SIP/2.0 200 OK
Via: SIP/2.0/UDP 192.168.1.102:5060;branch=z9hG4bK2ceb42416807f4892595c9936621669f;received=192.168.1.102;rport=5060
From: “7C2F806F0216” sip:7C2F806F0216@192.168.1.125;tag=812507764
To: “7C2F806F0216” sip:7C2F806F0216@192.168.1.125;tag=as1d37049b
Call-ID: 3518805577@192_168_1_102
CSeq: 1872 REGISTER
Server: Asterisk PBX 16.2.1~dfsg-1+deb10u1
Allow: INVITE, ACK, CANCEL, OPTIONS, BYE, REFER, SUBSCRIBE, NOTIFY, INFO, PUBLISH, MESSAGE
Supported: replaces, timer
Expires: 180
Contact: sip:7C2F806F0216@192.168.1.102:5060;expires=180
Date: Fri, 07 Feb 2020 11:48:30 GMT
Content-Length: 0

<------------>
Scheduling destruction of SIP dialog ‘2fb411d87a5857fb362d9a0637088af4@192.168.1.125:5060’ in 32000 ms (Method: NOTIFY)
Reliably Transmitting (NAT) to 192.168.1.102:5060:
NOTIFY sip:7C2F806F0216@192.168.1.102:5060 SIP/2.0
Via: SIP/2.0/UDP 192.168.1.125:5060;branch=z9hG4bK13231c6c;rport
Max-Forwards: 70
From: “asterisk” sip:asterisk@192.168.1.125;tag=as2225abf0
To: sip:7C2F806F0216@192.168.1.102:5060
Contact: sip:asterisk@192.168.1.125:5060
Call-ID: 2fb411d87a5857fb362d9a0637088af4@192.168.1.125:5060
CSeq: 102 NOTIFY
User-Agent: Asterisk PBX 16.2.1~dfsg-1+deb10u1
Event: message-summary
Content-Type: application/simple-message-summary
Content-Length: 93

Messages-Waiting: no
Message-Account: sip:asterisk@192.168.1.125
Voice-Message: 0/0 (0/0)


Scheduling destruction of SIP dialog ‘3518805577@192_168_1_102’ in 32000 ms (Method: REGISTER)

<— SIP read from UDP:192.168.1.102:5060 —>
SIP/2.0 200 OK
Via: SIP/2.0/UDP 192.168.1.125:5060;branch=z9hG4bK13231c6c;rport=5060
From: “asterisk” sip:asterisk@192.168.1.125;tag=as2225abf0
To: sip:7C2F806F0216@192.168.1.102:5060;tag=ar3334acg1
Call-ID: 2fb411d87a5857fb362d9a0637088af4@192.168.1.125:5060
CSeq: 102 NOTIFY
User-Agent: S850A GO/42.240.00.000.000
Content-Length: 0

<------------->
— (8 headers 0 lines) —
Really destroying SIP dialog ‘2fb411d87a5857fb362d9a0637088af4@192.168.1.125:5060’ Method: NOTIFY

There is no incoming call in your log file. Either there was no call, or it did not make it through your router.

If possible, try to get the states of the 62.65.137.114 connection(s) of the router.

Thanks a lot for your help.

I think there is something screwed up ether with my network setup or with Asterisk. First I have seen that there is two lines with inet6 on my network interface:

eth0: flags=4163<UP,BROADCAST,RUNNING,MULTICAST> mtu 1500
inet 192.168.1.125 netmask 255.255.255.0 broadcast 192.168.1.255
inet6 fe80::eaa3:3e03:5686:55e7 prefixlen 64 scopeid 0x20
inet6 2a02:1205:34d3:17d0:42fe:c573:23eb:12ab prefixlen 64 scopeid 0x0
ether b8:27:eb:9e:43:69 txqueuelen 1000 (Ethernet)

This sounds very strange, I must investigate it.

Then if I compare with a working Asterisk server using nmap, my sip gives different results:

my not working sip:
nmap -v -sU -p5060 -A -Pn 192.168.1.125

Nmap scan report for raspberrypi.home (192.168.1.125)
Host is up (0.00022s latency).

PORT STATE SERVICE VERSION
5060/udp open sip-proxy Asterisk PBX 16.2.1~dfsg-1+deb10u1
|_sip-methods: INVITE, ACK, CANCEL, OPTIONS, BYE, REFER, SUBSCRIBE, NOTIFY, INFO, PUBLISH, MESSAGE
Warning: OSScan results may be unreliable because we could not find at least 1 open and 1 closed port
Device type: remote management|phone|general purpose|webcam|storage-misc
Running: Avocent embedded, Google Android 2.X, Linux 2.6.X, AXIS embedded, ZyXEL embedded
OS CPE: cpe:/o:google:android:2.2 cpe:/o:linux:linux_kernel:2.6 cpe:/o:linux:linux_kernel:2.6.17 cpe:/h:axis:210a_network_camera cpe:/h:axis:211_network_camera cpe:/h:zyxel:nsa-210
OS details: Avocent/Cyclades ACS 6000, Android 2.2 (Linux 2.6), Linux 2.6.14 - 2.6.34, Linux 2.6.17, Linux 2.6.17 (Mandriva), Linux 2.6.32, AXIS 210A or 211 Network Camera (Linux 2.6.17), ZyXEL NSA-210 NAS device
Network Distance: 0 hops
Service Info: Device: PBX

On a working Asterisk (complete other network and a single inet6 line):
nmap -v -sU -p5060 -A -Pn 192.168.1.254

Nmap scan report for 192.168.1.254
Host is up (0.00011s latency).

PORT STATE SERVICE VERSION
5060/udp open sip-proxy Asterisk PBX 16.2.1~dfsg-1+deb10u1
Too many fingerprints match this host to give specific OS details
Network Distance: 0 hops
Service Info: Device: PBX

I suppose I must first investigate my network

Do local calls in both directions? My ideas were going into the direction that you’d have to look at the router, but without pinpointing the problem, this is just guessing.
bai zamm, oder so.

Thanks for your help.

You were pointing to the right side. Today I had contact with the support of my ISP. They were telling me that the modem/router has not the orginal Arcadyan firmware but a own branding, wich does not allow voip other than the one of the ISP.

I must figure out an other solution