SIP UA --> NAT--> INTERNET--> SIPROXD (NO NAT) --> ASTERISK (REGISTRAR/NO-NAT)
The SIP UA is behind a NAT-only firewall (non-SIP aware) and it s configured to use SIPROXD as its outbound proxy. SIPROXD and Asterisk are on separate boxes both with public, static IP's (each box has a single NIC).
I see the UAClient registration attempts and SIPROXD tries to reply via the client's RFC1918 address with a 408 Request Timed Out. I'm guessing I have something mis-configured but can't seem to find any reference to a similar setup. Seems kind of weird that SIPROXD is replying to the UAC via its contact or VIA address even though I have the Fix Bogus Via plugin enabled . . .
Hi,
Can't seem to make this combination work:
SIP UA --> NAT--> INTERNET--> SIPROXD (NO NAT) --> ASTERISK (REGISTRAR/NO-NAT)
The SIP UA is behind a NAT-only firewall (non-SIP aware) and it s configured to use SIPROXD as its outbound proxy. SIPROXD and Asterisk are on separate boxes both with public, static IP's (each box has a single NIC).
I see the UAClient registration attempts and SIPROXD tries to reply via the client's RFC1918 address with a 408 Request Timed Out. I'm guessing I have something mis-configured but can't seem to find any reference to a similar setup. Seems kind of weird that SIPROXD is replying to the UAC via its contact or VIA address even though I have the Fix Bogus Via plugin enabled . . .
Here's a view from siproxd with debug:
# siproxd debug=-1
13:34:31 INFO:siproxd.c:229 siproxd-0.7.1-4804 i686-pc-linux-gnu starting up
13:34:31 plugins.c:81 load_plugins: opening plugin [/usr/lib/siproxd/plugin_fix_bogus_via.so]
13:34:31 plugins.c:96 load_plugins: init=0xb98a20, process=0xb98790, end=0xb98750
13:34:31 readconf.c:72 trying to read config file
13:34:31 readconf.c:86 ... trying /root/.siproxdrc
13:34:31 readconf.c:86 ... trying /etc/siproxd.conf
13:34:31 readconf.c:210 skipped: "if_inbound = eth0"
13:34:31 readconf.c:210 skipped: "if_outbound = eth0"
13:34:31 readconf.c:210 skipped: "sip_listen_port = 5060"
13:34:31 readconf.c:210 skipped: "daemonize = 0"
13:34:31 readconf.c:210 skipped: "silence_log = 0"
13:34:31 readconf.c:210 skipped: "user = nobody"
13:34:31 readconf.c:210 skipped: "registration_file = /var/run/siproxd/siproxd_registrations"
13:34:31 readconf.c:210 skipped: "autosave_registrations = 300"
13:34:31 readconf.c:210 skipped: "pid_file = /var/run/siproxd/siproxd.pid"
13:34:31 readconf.c:210 skipped: "rtp_proxy_enable = 1"
13:34:31 readconf.c:210 skipped: "rtp_port_low = 7070"
13:34:31 readconf.c:210 skipped: "rtp_port_high = 7089"
13:34:31 readconf.c:210 skipped: "rtp_timeout = 300"
13:34:31 readconf.c:210 skipped: "rtp_input_dejitter = 0"
13:34:31 readconf.c:210 skipped: "rtp_output_dejitter = 0"
13:34:31 readconf.c:210 skipped: "default_expires = 600"
13:34:31 readconf.c:210 skipped: "debug_level = -1"
13:34:31 readconf.c:210 skipped: "debug_port = 0"
13:34:31 readconf.c:210 skipped: "use_rport = 3"
13:34:31 readconf.c:210 skipped: "outbound_proxy_host = freepbx.gcisys.com"
13:34:31 readconf.c:210 skipped: "outbound_proxy_port = 5060"
13:34:31 readconf.c:210 skipped: "plugindir=/usr/lib/siproxd/"
13:34:31 readconf.c:210 skipped: "load_plugin=plugin_fix_bogus_via.so"
13:34:31 readconf.c:210 skipped: "plugin_demo_string = This_is_a_string_passed_to_the_demo_plugin"
13:34:31 readconf.c:210 skipped: "plugin_shortdial_akey = *00"
13:34:31 readconf.c:210 skipped: "plugin_shortdial_entry = 17474743246"
13:34:31 readconf.c:210 skipped: "plugin_shortdial_entry = 17474745000"
13:34:31 readconf.c:210 skipped: "plugin_defaulttarget_log = 1"
13:34:31 readconf.c:210 skipped: "plugin_defaulttarget_target = sip:internal@dddd:port"
13:34:31 readconf.c:216 cfg line:"plugin_fix_bogus_via_networks = 10.0.0.0/8,172.16.0.0/12,192.168.0.0/16"
13:34:31 readconf.c:223 got keyword:"plugin_fix_bogus_via_networks"
13:34:31 readconf.c:233 got argument:"10.0.0.0/8,172.16.0.0/12,192.168.0.0/16"
13:34:31 readconf.c:266 STRING=10.0.0.0/8,172.16.0.0/12,192.168.0.0/16
13:34:31 INFO:plugin_fix_bogus_via.c:84 plugin_fix_bogus_via is initialized
13:34:31 INFO:plugins.c:110 Plugin 'plugin_fix_bogus_via' [Fixes broken VIA headers on incoming calls] loaded with success, exemask=0x40
13:34:31 utils.c:282 running w/uid=0, euid=0, gid=0, egid=0
13:34:31 utils.c:318 changing uid/gid to nobody
13:34:31 utils.c:321 changed gid to 99 - Ok
13:34:31 utils.c:325 changed egid to 99 - Ok
13:34:31 utils.c:329 changed euid to 99 - Ok
13:34:31 utils.c:578 creating PID file [/var/run/siproxd/siproxd.pid]
13:34:31 rtpproxy_relay.c:120 create thread
13:34:31 rtpproxy_relay.c:122 created, sts=0
13:34:31 rtpproxy_relay.c:133 uid=0, euid=99
13:34:31 rtpproxy_relay.c:146 pmin=1, pmax=99, using p=33
13:34:31 INFO:sock.c:65 bound to port 5060
13:34:31 sock.c:66 bound socket 4
13:34:31 INFO:siproxd.c:340 siproxd-0.7.1-4804 i686-pc-linux-gnu started
13:34:31 siproxd.c:347 going into sipsock_wait
13:34:33 register.c:508 sip_agemap, t=1224534873
13:34:35 register.c:508 sip_agemap, t=1224534875
13:34:37 register.c:508 sip_agemap, t=1224534877
13:34:39 register.c:508 sip_agemap, t=1224534879
13:34:41 register.c:508 sip_agemap, t=1224534881
13:34:42 siproxd.c:373 back from sipsock_wait
13:34:42 sock.c:125 received UDP packet from 209.220.169.5, count=578
---BUFFER DUMP follows---
52 45 47 49 53 54 45 52 20 73 69 70 3a 66 72 65 REGISTER sip:fre
65 70 62 78 2e 67 63 69 73 79 73 2e 63 6f 6d 3a epbx.gcisys.com:
35 30 36 30 20 53 49 50 2f 32 2e 30 0d 0a 56 69 5060 SIP/2.0..Vi
61 3a 20 53 49 50 2f 32 2e 30 2f 55 44 50 20 31 a: SIP/2.0/UDP 1
30 2e 32 35 30 2e 31 31 31 2e 31 35 36 3a 34 34 0.250.111.156:44
32 39 30 3b 62 72 61 6e 63 68 3d 7a 39 68 47 34 290;branch=z9hG4
62 4b 2d 64 38 37 35 34 7a 2d 36 65 31 35 37 37 bK-d8754z-6e1577
37 66 32 61 35 62 63 38 35 30 2d 31 2d 2d 2d 64 7f2a5bc850-1---d
38 37 35 34 7a 2d 0d 0a 4d 61 78 2d 46 6f 72 77 8754z-..Max-Forw
61 72 64 73 3a 20 37 30 0d 0a 43 6f 6e 74 61 63 ards: 70..Contac
74 3a 20 3c 73 69 70 3a 32 34 35 37 40 31 30 2e t: <sip:2457@10.
32 35 30 2e 31 31 31 2e 31 35 36 3a 34 34 32 39 250.111.156:4429
30 3b 72 69 6e 73 74 61 6e 63 65 3d 62 33 63 66 0;rinstance=b3cf
63 61 34 34 39 32 33 32 61 64 66 66 3e 0d 0a 54 ca449232adff>..T
6f 3a 20 22 4a 50 53 20 58 6c 69 74 65 22 3c 73 o: "JPS Xlite"<s
69 70 3a 32 34 35 37 40 66 72 65 65 70 62 78 2e ip:2457@freepbx.
67 63 69 73 79 73 2e 63 6f 6d 3a 35 30 36 30 3e gcisys.com:5060>
0d 0a 46 72 6f 6d 3a 20 22 4a 50 53 20 58 6c 69 ..From: "JPS Xli
74 65 22 3c 73 69 70 3a 32 34 35 37 40 66 72 65 te"<sip:2457@fre
65 70 62 78 2e 67 63 69 73 79 73 2e 63 6f 6d 3a epbx.gcisys.com:
35 30 36 30 3e 3b 74 61 67 3d 62 30 32 37 38 39 5060>;tag=b02789
37 64 0d 0a 43 61 6c 6c 2d 49 44 3a 20 59 7a 4d 7d..Call-ID: YzM
30 4e 7a 6c 68 4d 47 4e 6b 5a 6a 51 77 4f 44 4a 0NzlhMGNkZjQwODJ
6b 59 6a 63 77 4d 57 46 6c 4d 57 56 6b 4e 7a 41 kYjcwMWFlMWVkNzA
30 59 6a 5a 6c 4f 57 4d 2e 0d 0a 43 53 65 71 3a 0YjZlOWM...CSeq:
20 31 20 52 45 47 49 53 54 45 52 0d 0a 45 78 70 1 REGISTER..Exp
69 72 65 73 3a 20 33 36 30 30 0d 0a 41 6c 6c 6f ires: 3600..Allo
77 3a 20 49 4e 56 49 54 45 2c 20 41 43 4b 2c 20 w: INVITE, ACK,
43 41 4e 43 45 4c 2c 20 4f 50 54 49 4f 4e 53 2c CANCEL, OPTIONS,
20 42 59 45 2c 20 52 45 46 45 52 2c 20 4e 4f 54 BYE, REFER, NOT
49 46 59 2c 20 4d 45 53 53 41 47 45 2c 20 53 55 IFY, MESSAGE, SU
42 53 43 52 49 42 45 2c 20 49 4e 46 4f 0d 0a 55 BSCRIBE, INFO..U
73 65 72 2d 41 67 65 6e 74 3a 20 58 2d 4c 69 74 ser-Agent: X-Lit
65 20 72 65 6c 65 61 73 65 20 31 31 30 30 6c 20 e release 1100l
73 74 61 6d 70 20 34 37 35 34 36 0d 0a 43 6f 6e stamp 47546..Con
74 65 6e 74 2d 4c 65 6e 67 74 68 3a 20 30 0d 0a tent-Length: 0..
0d 0a ..
---end of BUFFER DUMP---
13:34:42 accessctl.c:50 deny list (SIP):*NULL*
13:34:42 accessctl.c:52 allow list (SIP):*NULL*
13:34:42 accessctl.c:54 allow list (REG):*NULL*
13:34:42 accessctl.c:99 access check =3
13:34:42 security.c:48 security_check_raw: size=578
13:34:42 siproxd.c:461 checking Max-Forwards (=70)
13:34:42 siproxd.c:506 received SIP type REQ:REGISTER
13:34:42 utils.c:95 initializing DNS cache (256 entries)
13:34:42 utils.c:211 DNS lookup - resolved: freepbx.gcisys.com -> 208.97.196.9
13:34:42 utils.c:251 DNS lookup - store into cache, entry 0)
13:34:42 utils.c:382 fetching interface IP by INTERFACE [1]
13:34:42 utils.c:427 initializing ifaddr cache (32 entries)
13:34:42 utils.c:492 get_ip_by_ifname: if eth0 has IP:208.97.196.22 (flags=1043) UP
13:34:42 utils.c:512 ifname lookup - store into cache, entry 0)
13:34:42 utils.c:382 fetching interface IP by INTERFACE [0]
13:34:42 utils.c:454 ifaddr lookup - from cache: eth0 -> 208.97.196.22 UP
13:34:42 siproxd.c:560 proxying REGISTER request to:freepbx.gcisys.com
13:34:42 register.c:238 sip_register:
13:34:42 register.c:324 register: 2457@10.250.111.156 expires=3600 seconds
13:34:42 sip_utils.c:279 comparing urls: sip:2457@freepbx.gcisys.com -> sip:2457@freepbx.gcisys.com
13:34:42 utils.c:130 DNS lookup - from cache: freepbx.gcisys.com -> 208.97.196.9
13:34:42 utils.c:130 DNS lookup - from cache: freepbx.gcisys.com -> 208.97.196.9
13:34:42 register.c:349 found entry for 2457@10.250.111.156 <-> 2457@freepbx.gcisys.com at slot=0, exp=3606
13:34:42 utils.c:382 fetching interface IP by INTERFACE [0]
13:34:42 utils.c:454 ifaddr lookup - from cache: eth0 -> 208.97.196.22 UP
13:34:42 register.c:449 masquerading UA 2457@10.250.111.156 local 2457@208.97.196.22
13:34:42 proxy.c:89 proxy_request
13:34:42 route_processing.c:63 route_preprocess: no Route header present
13:34:42 utils.c:211 DNS lookup - resolved: 10.250.111.156 -> 10.250.111.156
13:34:42 utils.c:251 DNS lookup - store into cache, entry 1)
13:34:42 sip_utils.c:993 sip_find_direction: reghost:10.250.111.156 ip:209.220.169.5
13:34:42 sip_utils.c:279 comparing urls: sip:(null)@freepbx.gcisys.com -> sip:2457@208.97.196.22
13:34:42 sip_utils.c:298 compare_url: NULL username - ignoring
13:34:42 utils.c:130 DNS lookup - from cache: freepbx.gcisys.com -> 208.97.196.9
13:34:42 utils.c:211 DNS lookup - resolved: 208.97.196.22 -> 208.97.196.22
13:34:42 utils.c:251 DNS lookup - store into cache, entry 2)
13:34:42 sip_utils.c:324 compare_url: IP mismatch
13:34:42 sip_utils.c:279 comparing urls: sip:2457@freepbx.gcisys.com -> sip:2457@208.97.196.22
13:34:42 utils.c:130 DNS lookup - from cache: freepbx.gcisys.com -> 208.97.196.9
13:34:42 utils.c:130 DNS lookup - from cache: 208.97.196.22 -> 208.97.196.22
13:34:42 sip_utils.c:324 compare_url: IP mismatch
13:34:42 utils.c:382 fetching interface IP by INTERFACE [1]
13:34:42 utils.c:454 ifaddr lookup - from cache: eth0 -> 208.97.196.22 UP
13:34:42 sip_utils.c:1134 sip_find_direction: unable to determine direction of SIP packet
13:34:42 plugin_fix_bogus_via.c:101 plugin_fix_bogus_via: type=0
13:34:42 proxy.c:226 request [REGISTER] from/to unregistered UA (RQ: 2457@freepbx.gcisys.com -> *NULL*@freepbx.gcisys.com)
13:34:42 sock.c:164 send UDP packet to 10.250.111.156: 44290
---BUFFER DUMP follows---
53 49 50 2f 32 2e 30 20 34 30 38 20 52 65 71 75 SIP/2.0 408 Requ
65 73 74 20 54 69 6d 65 6f 75 74 0d 0a 56 69 61 est Timeout..Via
3a 20 53 49 50 2f 32 2e 30 2f 55 44 50 20 31 30 : SIP/2.0/UDP 10
2e 32 35 30 2e 31 31 31 2e 31 35 36 3a 34 34 32 .250.111.156:442
39 30 3b 62 72 61 6e 63 68 3d 7a 39 68 47 34 62 90;branch=z9hG4b
4b 2d 64 38 37 35 34 7a 2d 36 65 31 35 37 37 37 K-d8754z-6e15777
66 32 61 35 62 63 38 35 30 2d 31 2d 2d 2d 64 38 f2a5bc850-1---d8
37 35 34 7a 2d 0d 0a 46 72 6f 6d 3a 20 22 4a 50 754z-..From: "JP
53 20 58 6c 69 74 65 22 20 3c 73 69 70 3a 32 34 S Xlite" <sip:24
35 37 40 66 72 65 65 70 62 78 2e 67 63 69 73 79 57@freepbx.gcisy
73 2e 63 6f 6d 3a 35 30 36 30 3e 3b 74 61 67 3d s.com:5060>;tag=
62 30 32 37 38 39 37 64 0d 0a 54 6f 3a 20 22 4a b027897d..To: "J
50 53 20 58 6c 69 74 65 22 20 3c 73 69 70 3a 32 PS Xlite" <sip:2
34 35 37 40 66 72 65 65 70 62 78 2e 67 63 69 73 457@freepbx.gcis
79 73 2e 63 6f 6d 3a 35 30 36 30 3e 0d 0a 43 61 ys.com:5060>..Ca
6c 6c 2d 49 44 3a 20 59 7a 4d 30 4e 7a 6c 68 4d ll-ID: YzM0NzlhM
47 4e 6b 5a 6a 51 77 4f 44 4a 6b 59 6a 63 77 4d GNkZjQwODJkYjcwM
57 46 6c 4d 57 56 6b 4e 7a 41 30 59 6a 5a 6c 4f WFlMWVkNzA0YjZlO
57 4d 2e 0d 0a 43 53 65 71 3a 20 31 20 52 45 47 WM...CSeq: 1 REG
49 53 54 45 52 0d 0a 43 6f 6e 74 65 6e 74 2d 4c ISTER..Content-L
65 6e 67 74 68 3a 20 30 0d 0a 0d 0a ength: 0....
---end of BUFFER DUMP---
13:34:42 siproxd.c:347 going into sipsock_wait
13:34:48 register.c:508 sip_agemap, t=1224534888
13:34:49 sock.c:96 select() returned error [4:Interrupted system call]
13:34:49 register.c:508 sip_agemap, t=1224534889
13:34:49 register.c:138 saving registration table
13:34:49 INFO:siproxd.c:636 properly terminating siproxd
13:34:49 siproxd.c:640 deleting PID file [/var/run/siproxd/siproxd.pid]
13:34:49 plugins.c:211 unloading dynamic plugins
13:34:49 plugins.c:221 unload_plugins: 'plugin_fix_bogus_via' unloading ptr=0x9d629f8
13:34:49 INFO:plugin_fix_bogus_via.c:132 plugin_fix_bogus_via ends here
13:34:49 plugins.c:224 unload_plugins: status=success
13:34:49 rtpproxy_relay.c:993 killed RTP proxy thread
Any suggestions?
Thanks in advance!
JPS
Hi jamuel,
you are using siproxd in a way it is NOT intended to be used.
Siproxd can be running
a) on the NAT Router / Firewall host itself
b) "in front of" the NAT Router / Firewall (meaning between UA and Firewall)
Your scenario is a so called "far side NAT traversal" which is not supported by siproxd.
Chapter 7 of the siproxd documentation shows some valid configuration examples:
http://siproxd.sourceforge.net/siproxd_guide/siproxd_guide_c7.html
Regards,
/Thomas
This seem to be the same issue as mime.
: https://sourceforge.net/projects/siproxd/forums/forum/203641/topic/3415699