Address already in use

I was assuming an outgoing registration. If this is an incoming one, then it isn’t reaching the router and you need to debug upstream of the router.

1 Like

ivr@ivr-OptiPlex-3050:~$ sudo tcpdump -ni any udp and port 5060
tcpdump: data link type LINUX_SLL2
tcpdump: verbose output suppressed, use -v[v]… for full protocol decode
listening on any, link-type LINUX_SLL2 (Linux cooked v2), snapshot length 262144 bytes
19:29:41.427884 enp1s0 In IP 192.168.0.101.33678 > 192.168.0.230.5060: SIP
19:30:07.452136 enp1s0 In IP 192.168.0.101.33678 > 192.168.0.230.5060: SIP: REGISTER sip:192.168.0.230:5060;transport=UDP SIP/2.0
19:30:07.452805 enp1s0 Out IP 192.168.0.230.5060 > 192.168.0.101.33678: SIP: SIP/2.0 401 Unauthorized
19:30:07.553930 enp1s0 In IP 192.168.0.101.33678 > 192.168.0.230.5060: SIP: REGISTER sip:192.168.0.230:5060;transport=UDP SIP/2.0
19:30:07.555315 enp1s0 Out IP 192.168.0.230.5060 > 192.168.0.101.33678: SIP: SIP/2.0 200 OK
19:30:11.428141 enp1s0 In IP 192.168.0.101.33678 > 192.168.0.230.5060: SIP

This is what Im getting

Means that no port forwarding enabled

1 Like

run tcpdump -ni any src or dst to see if traffic is existing

1 Like

19:56:47.823582 enp1s0 In IP 184.105.99.43.443 > 192.168.0.230.59188: Flags [.], ack 18747, win 83, options [nop,nop,TS val 2657875231 ecr 826232826], length 0
19:56:47.928343 enp1s0 In IP 184.105.99.43.443 > 192.168.0.230.59188: Flags [.], ack 18846, win 83, options [nop,nop,TS val 2657875336 ecr 826232932], length 0
19:56:47.928346 enp1s0 In IP 184.105.99.43.443 > 192.168.0.230.59188: Flags [.], ack 19566, win 82, options [nop,nop,TS val 2657875336 ecr 826232932], length 0
19:56:47.928422 enp1s0 In IP 184.105.99.43.443 > 192.168.0.230.59188: Flags [P.], seq 13973:14021, ack 19566, win 83, options [nop,nop,TS val 2657875336 ecr 826232932], length 48
19:56:47.969055 enp1s0 Out IP 192.168.0.230.59188 > 184.105.99.43.443: Flags [.], ack 14021, win 1348, options [nop,nop,TS val 826233267 ecr 2657875336], length 0
19:56:48.140748 enp1s0 In IP 184.105.99.43.443 > 192.168.0.230.59188: Flags [P.], seq 14021:14535, ack 19566, win 83, options [nop,nop,TS val 2657875548 ecr 826232932], length 514
19:56:48.140804 enp1s0 Out IP 192.168.0.230.59188 > 184.105.99.43.443: Flags [.], ack 14535, win 1348, options [nop,nop,TS val 826233438 ecr 2657875548], length 0
19:56:48.684890 enp1s0 Out ARP, Request who-has 192.168.0.101 tell 192.168.0.230, length 28
19:56:48.685194 enp1s0 In ARP, Reply 192.168.0.101 is-at 50:9a:4c:20:4e:d2, length 46
I’m getting this

Am I missing anything in sip.conf file?

This seems not UDP trafic but TCP on port 443. Try the same by adding and udp to the tcpdump command

1 Like
ivr@ivr-OptiPlex-3050:~$ sudo nmap -v -sU 192.168.0.230 -p 5060
[sudo] password for ivr: 
Starting Nmap 7.80 ( https://nmap.org ) at 2024-01-21 13:32 IST
Initiating Parallel DNS resolution of 1 host. at 13:32
Completed Parallel DNS resolution of 1 host. at 13:32, 0.05s elapsed
Initiating UDP Scan at 13:32
Scanning ivr-OptiPlex-3050 (192.168.0.230) [1 port]
Completed UDP Scan at 13:32, 0.01s elapsed (1 total ports)
Nmap scan report for ivr-OptiPlex-3050 (192.168.0.230)
Host is up (0.000081s latency).

PORT     STATE  SERVICE
5060/udp closed sip

Read data files from: /usr/bin/../share/nmap
Nmap done: 1 IP address (1 host up) scanned in 0.16 seconds
           Raw packets sent: 1 (28B) | Rcvd: 2 (84B)

I think I got the real problem as you can see in log 5060/udp closed. But not getting any proper solution to open it.

Here is my port status

sudo ufw status
Status: active

To                         Action      From
--                         ------      ----
5060/udp                   ALLOW       Anywhere                  
10000:20000/udp            ALLOW       Anywhere                  
5060 (v6)                  ALLOW       Anywhere (v6)             
5060/udp (v6)              ALLOW       Anywhere (v6)             
10000:20000/udp (v6)       ALLOW       Anywhere (v6)             
5060/tcp (v6)              ALLOW       Anywhere (v6)

Can anyone guide me whats going wrong.

Thank you.

Can’t understand how the UDP/5060 port is closed on your asterisk server and in the mean time your phone from local network are connected as you showed earlier with IP 192.168.0.101!

run tcpdump -ni any src or dst 87.193.70.149 and udp

1 Like

Now I opened that by doing some network troubleshooting. Still not working from outside network.

is my local_net=192.168.0.94/24 is in correct formation?

sudo nmap -v -sU 192.168.0.94 -p 5060
Starting Nmap 7.80 ( https://nmap.org ) at 2024-01-21 18:42 IST
Initiating Parallel DNS resolution of 1 host. at 18:42
Completed Parallel DNS resolution of 1 host. at 18:42, 0.05s elapsed
Initiating UDP Scan at 18:42
Scanning ivr-OptiPlex-3050 (192.168.0.94) [1 port]
Completed UDP Scan at 18:42, 2.02s elapsed (1 total ports)
Nmap scan report for ivr-OptiPlex-3050 (192.168.0.94)
Host is up.

PORT     STATE         SERVICE
5060/udp open|filtered sip

Read data files from: /usr/bin/../share/nmap
Nmap done: 1 IP address (1 host up) scanned in 2.14 seconds
           Raw packets sent: 2 (56B) | Rcvd: 2 (56B)

Solve your network problem: you need to see UDP traffic to & from your outside provider on your asterisk box.

I changed the port to 7060 and its got connected now but after this in Zoiper I’m getting PUSH flags and in Asterisk console I’m getting these error.

[Jan 21 19:03:29] WARNING[3369]: pjproject: <?>: 	       sip_transport.c Dropping 40 bytes packet from UDP 192.168.0.101:42828 : PJSIP syntax error exception when parsing 'Request Line' header on line 1 col 1

[Jan 21 19:03:35] WARNING[3369]: pjproject: <?>: 	       sip_transport.c Dropping 40 bytes packet from UDP 192.168.0.101:42828 : PJSIP syntax error exception when parsing 'Request Line' header on line 1 col 1

[Jan 21 19:03:48] WARNING[3369]: pjproject: <?>: 	       sip_transport.c Dropping 40 bytes packet from UDP 192.168.0.101:42828 : PJSIP syntax error exception when parsing 'Request Line' header on line 1 col 1

[Jan 21 19:04:06] ERROR[3445]: res_pjsip.c:903 ast_sip_set_tpselector_from_transport_name: Unable to retrieve PJSIP transport 'transport-udp'
[Jan 21 19:04:14] WARNING[3369]: pjproject: <?>: 	       sip_transport.c Dropping 40 bytes packet from UDP 192.168.0.101:42828 : PJSIP syntax error exception when parsing 'Request Line' header on line 1 col 1

[Jan 21 19:07:11] ERROR[3445]: res_pjsip.c:903 ast_sip_set_tpselector_from_transport_name: Unable to retrieve PJSIP transport 'transport-udp'

and call is not going through.

Thank you

Okay this also solved restarted the Asterisk server then started working.

I learned these
When you are configuring pjsip then only you need to edit the following file pjsip.conf and extensions.conf and if 5060 port showing any kind of issues then point to other port and port must be UDP port. Also forward port in your router and try to have subneting and musking knowledge.

My Infra config is Ubuntu 22.04 and Asterisk 20.5.2

Thank you everyone.

1 Like

You went through a lot there to get your system working so it’s also good that you posted your fix.

Yes it took almost 3 days but good very good Idea about initial setups. But now facing other issues like not able to hear voice from outside network but in local everything is working fine.

Voice issue I will solve tomorrow.

Did you open your ports 10000-25000 via the rtp.conf file? since you’re behind NAT I would suggest also setting up STUN Make sure your router has ports forwarded to your server as well

Yes I have forwarded these ports in firewall and also forwarded in router.

Now I solved it as it was a client side problem not server side as client was dialing via only SIP but should be SIP+RTP depending upon your client application or Hardphone.

Thank you

This topic was automatically closed 30 days after the last reply. New replies are no longer allowed.