| 48 | Interestingly, it doesn't seem to modify the private IP address in ICE host candidate when STUN is enabled. Perhaps the router has a heuristic to disable IP mangling when it sees the SDP contains parts with public IP address in it (which indicates that the client is NAT aware). |
| 49 | |
| 50 | Below is the SDP as sent by client and as received by server, when STUN is '''not''' used: |
| 51 | |
| 52 | {{{ |
| 53 | v=0 |
| 54 | o=- 3435482710 3435482710 IN IP4 192.168.0.15 |
| 55 | s=pjmedia |
| 56 | c=IN IP4 192.168.0.15 |
| 57 | t=0 0 |
| 58 | a=X-nat:0 |
| 59 | m=audio 3160 RTP/AVP 118 0 8 119 120 101 |
| 60 | a=rtcp:3161 IN IP4 192.168.0.15 |
| 61 | a=rtpmap:118 iLBC/8000 |
| 62 | a=fmtp:118 mode=30 |
| 63 | a=rtpmap:0 PCMU/8000 |
| 64 | a=rtpmap:8 PCMA/8000 |
| 65 | a=rtpmap:119 AMR/8000 |
| 66 | a=rtpmap:120 AMR-WB/16000 |
| 67 | a=sendrecv |
| 68 | a=rtpmap:101 telephone-event/8000 |
| 69 | a=fmtp:101 0-15 |
| 70 | a=ice-ufrag:4fdc3f4e |
| 71 | a=ice-pwd:03476f5f |
| 72 | a=candidate:H 1 UDP 39 192.168.0.15 3160 typ host |
| 73 | a=candidate:H 2 UDP 38 192.168.0.15 3161 typ host |
| 74 | }}} |
| 75 | |
| 76 | {{{ |
| 77 | v=0 |
| 78 | o=- 3435482710 3435482710 IN IP4 81.178.58.134 |
| 79 | s=pjmedia |
| 80 | c=IN IP4 81.178.58.134 |
| 81 | t=0 0 |
| 82 | a=X-nat:0 |
| 83 | m=audio 3176 RTP/AVP 118 0 8 119 120 101 |
| 84 | a=rtcp:3161 IN IP4 81.178.58.134 |
| 85 | a=rtpmap:118 iLBC/8000 |
| 86 | a=fmtp:118 mode=30 |
| 87 | a=rtpmap:0 PCMU/8000 |
| 88 | a=rtpmap:8 PCMA/8000 |
| 89 | a=rtpmap:119 AMR/8000 |
| 90 | a=rtpmap:120 AMR-WB/16000 |
| 91 | a=sendrecv |
| 92 | a=rtpmap:101 telephone-event/8000 |
| 93 | a=fmtp:101 0-15 |
| 94 | a=ice-ufrag:4fdc3f4e |
| 95 | a=ice-pwd:03476f5f |
| 96 | a=candidate:H 1 UDP 39 81.178.58.134 3160 typ host |
| 97 | a=candidate:H 2 UDP 38 81.178.58.134 3161 typ host |
| 98 | }}} |
| 99 | |
| 100 | And below is the SDPs as sent by client and as received by server when STUN '''is''' used: |
| 101 | |
| 102 | {{{ |
| 103 | v=0 |
| 104 | o=- 3435482833 3435482833 IN IP4 81.178.58.134 |
| 105 | s=pjmedia |
| 106 | c=IN IP4 81.178.58.134 |
| 107 | t=0 0 |
| 108 | a=X-nat:5 |
| 109 | m=audio 3174 RTP/AVP 118 0 8 119 120 101 |
| 110 | a=rtcp:3175 IN IP4 81.178.58.134 |
| 111 | a=rtpmap:118 iLBC/8000 |
| 112 | a=fmtp:118 mode=30 |
| 113 | a=rtpmap:0 PCMU/8000 |
| 114 | a=rtpmap:8 PCMA/8000 |
| 115 | a=rtpmap:119 AMR/8000 |
| 116 | a=rtpmap:120 AMR-WB/16000 |
| 117 | a=sendrecv |
| 118 | a=rtpmap:101 telephone-event/8000 |
| 119 | a=fmtp:101 0-15 |
| 120 | a=ice-ufrag:7c334999 |
| 121 | a=ice-pwd:32960288 |
| 122 | a=candidate:S 1 UDP 31 81.178.58.134 3174 typ srflx raddr 192.168.0.15 rport 3174 |
| 123 | a=candidate:H 1 UDP 23 192.168.0.15 3174 typ host |
| 124 | a=candidate:S 2 UDP 30 81.178.58.134 3175 typ srflx raddr 192.168.0.15 rport 3175 |
| 125 | a=candidate:H 2 UDP 22 192.168.0.15 3175 typ host |
| 126 | }}} |
| 127 | |
| 128 | {{{ |
| 129 | v=0 |
| 130 | o=- 3435482833 3435482833 IN IP4 81.178.58.134 |
| 131 | s=pjmedia |
| 132 | c=IN IP4 81.178.58.134 |
| 133 | t=0 0 |
| 134 | a=X-nat:5 |
| 135 | m=audio 3174 RTP/AVP 118 0 8 119 120 101 |
| 136 | a=rtcp:3175 IN IP4 81.178.58.134 |
| 137 | a=rtpmap:118 iLBC/8000 |
| 138 | a=fmtp:118 mode=30 |
| 139 | a=rtpmap:0 PCMU/8000 |
| 140 | a=rtpmap:8 PCMA/8000 |
| 141 | a=rtpmap:119 AMR/8000 |
| 142 | a=rtpmap:120 AMR-WB/16000 |
| 143 | a=sendrecv |
| 144 | a=rtpmap:101 telephone-event/8000 |
| 145 | a=fmtp:101 0-15 |
| 146 | a=ice-ufrag:7c334999 |
| 147 | a=ice-pwd:32960288 |
| 148 | a=candidate:S 1 UDP 31 81.178.58.134 3174 typ srflx raddr 192.168.0.15 rport 3174 |
| 149 | a=candidate:H 1 UDP 23 192.168.0.15 3174 typ host |
| 150 | a=candidate:S 2 UDP 30 81.178.58.134 3175 typ srflx raddr 192.168.0.15 rport 3175 |
| 151 | a=candidate:H 2 UDP 22 192.168.0.15 3175 typ host |
| 152 | }}} |
| 153 | |
| 154 | |
| 155 | This behavior can be bypassed by changing the destination/public server port to port number other than 5060, or by using TCP. |
| 156 | |