[asterisk-bugs] [JIRA] (ASTERISK-23020) PJSip - Multihomed machine returning wrong IP address
xrobau (JIRA)
noreply at issues.asterisk.org
Tue Dec 17 17:19:03 CST 2013
[ https://issues.asterisk.org/jira/browse/ASTERISK-23020?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=213095#comment-213095 ]
xrobau commented on ASTERISK-23020:
-----------------------------------
Even when EXPLICITLY specifying the IP address in the transport, it's still returning incorrect information.
[root at localhost a12]# ip addr
1: lo: <LOOPBACK,UP,LOWER_UP> mtu 16436 qdisc noqueue state UNKNOWN
link/loopback 00:00:00:00:00:00 brd 00:00:00:00:00:00
inet 127.0.0.1/8 scope host lo
inet6 ::1/128 scope host
valid_lft forever preferred_lft forever
2: eth0: <BROADCAST,MULTICAST,UP,LOWER_UP> mtu 1500 qdisc pfifo_fast state UP qlen 1000
link/ether 90:fb:a6:27:ac:be brd ff:ff:ff:ff:ff:ff
inet6 fe80::92fb:a6ff:fe27:acbe/64 scope link
valid_lft forever preferred_lft forever
7: eth0.100 at eth0: <BROADCAST,MULTICAST,UP,LOWER_UP> mtu 1500 qdisc noqueue state UP
link/ether 90:fb:a6:27:ac:be brd ff:ff:ff:ff:ff:ff
inet 192.168.15.5/24 brd 192.168.15.255 scope global eth0.100
inet6 fe80::92fb:a6ff:fe27:acbe/64 scope link
valid_lft forever preferred_lft forever
8: eth0.30 at eth0: <BROADCAST,MULTICAST,UP,LOWER_UP> mtu 1500 qdisc noqueue state UP
link/ether 90:fb:a6:27:ac:be brd ff:ff:ff:ff:ff:ff
inet 192.168.5.247/24 brd 192.168.5.255 scope global eth0.30
inet6 fe80::92fb:a6ff:fe27:acbe/64 scope link
valid_lft forever preferred_lft forever
This is a Cisco SPA 504g:
[root at localhost a12]# ping 192.168.5.248
PING 192.168.5.248 (192.168.5.248) 56(84) bytes of data.
64 bytes from 192.168.5.248: icmp_seq=1 ttl=64 time=0.450 ms
64 bytes from 192.168.5.248: icmp_seq=2 ttl=64 time=0.468 ms
^C
--- 192.168.5.248 ping statistics ---
2 packets transmitted, 2 received, 0% packet loss, time 1316ms
rtt min/avg/max/mdev = 0.450/0.459/0.468/0.009 ms
/etc/asterisk/pjsip.conf
[transport-default]
protocol=udp
bind=192.168.5.247:5060
type=transport
[300]
type=endpoint
aors=300
auth=300-auth
allow=g722,speex16,slin16,ulaw,alaw
context=from-internal
callerid=device <300>
dtmf_mode=rfc4733
mailboxes=300 at device
transport=transport-default
[300-auth]
type=auth
auth_type=userpass
password=62b5942b6aabb2aa53df28074c1b834f
username=300
[300]
type=aor
max_contacts=1
Note that this machine now has NO default gateway:
[root at localhost a12]# netstat -nr
Kernel IP routing table
Destination Gateway Genmask Flags MSS Window irtt Iface
192.168.5.0 0.0.0.0 255.255.255.0 U 0 0 0 eth0.30
192.168.15.0 0.0.0.0 255.255.255.0 U 0 0 0 eth0.100
169.254.0.0 0.0.0.0 255.255.0.0 U 0 0 0 eth0
169.254.0.0 0.0.0.0 255.255.0.0 U 0 0 0 eth0.100
169.254.0.0 0.0.0.0 255.255.0.0 U 0 0 0 eth0.30
[root at localhost a12]#
pjsip understands the bind line, as it's listening on the correct IP:
[root at localhost a12]# netstat -nap | grep 5060
udp 0 0 192.168.5.247:5060 0.0.0.0:* 28225/asterisk
[root at localhost a12]#
However, TCPdump shows this:
09:15:20.129048 IP (tos 0x0, ttl 64, id 0, offset 0, flags [DF], proto UDP (17), length 884)
192.168.5.247.sip > 192.168.5.248.5062: SIP, length: 856
SIP/2.0 200 OK
Via: SIP/2.0/UDP 192.168.5.248:5062;rport;received=192.168.5.248;branch=z9hG4bK-936f477e
Call-ID: dfbc9fc-bd72cfb6 at 192.168.5.248
From: "A12" <sip:300 at 192.168.5.247>;tag=810bf544406b5d0eo2
To: <sip:*43 at 192.168.5.247>;tag=7ba26edc-68c2-42d5-a657-f842768515f4
CSeq: 102 INVITE
Contact: <sip:192.168.5.247:5060>
Allow: OPTIONS, SUBSCRIBE, NOTIFY, PUBLISH, INVITE, ACK, BYE, CANCEL, UPDATE, PRACK, REFER, REGISTER, MESSAGE
Supported: 100rel, timer, replaces, norefersub
Content-Type: application/sdp
Content-Length: 311
v=0
o=- 7683843 7683845 IN IP4 localhost.localdomain
s=Asterisk
c=IN IP4 192.168.15.5
t=0 0
m=audio 16354 RTP/AVP 9 0 8 101
c=IN IP4 192.168.15.5
a=rtpmap:9 G722/8000
a=rtpmap:0 PCMU/8000
a=rtpmap:8 PCMA/8000
a=rtpmap:101 telephone-event/8000
a=fmtp:101 0-16
a=ptime:20
a=maxptime:150
a=sendrecv
Note that it's STILL Returning the wrong IP address. Asterisk has been restarted after the default route was removed, too.
> PJSip - Multihomed machine returning wrong IP address
> -----------------------------------------------------
>
> Key: ASTERISK-23020
> URL: https://issues.asterisk.org/jira/browse/ASTERISK-23020
> Project: Asterisk
> Issue Type: Bug
> Security Level: None
> Components: Channels/chan_pjsip
> Affects Versions: 12.0.0-beta2
> Reporter: xrobau
> Attachments: sip_trace.txt
>
>
> Multihomed machine has two interfaces:
> eth0.10 = 192.168.15.5/24 (default gateway via this int)
> eth0.20 = 192.168.5.247/24
> Phone endpoint is connected to eth0.20, with the IP Address 192.168.5.248
> Connecting works fine, but in the OK packet returned from the server, the wrong IP address is handed back:
> {noformat}
> v=0
> o=- 7132004 7132006 IN IP4 localhost.localdomain
> s=Asterisk
> c=IN IP4 192.168.15.5
> t=0 0
> m=audio 17940 RTP/AVP 8 101
> c=IN IP4 192.168.15.5
> a=rtpmap:8 PCMA/8000
> a=rtpmap:101 telephone-event/8000
> a=fmtp:101 0-16
> a=ptime:20
> a=maxptime:150
> a=sendrecv
> {noformat}
> This causes the phone to try to connect to the wrong IP address which is not reachable from the other network.
> Larger TCPdump attached
--
This message is automatically generated by JIRA.
If you think it was sent incorrectly, please contact your JIRA administrators: https://issues.asterisk.org/jira/secure/ContactAdministrators!default.jspa
For more information on JIRA, see: http://www.atlassian.com/software/jira
More information about the asterisk-bugs
mailing list