AAstra 9143i STUN client broken?

darrin
Posts: 11
Member Since:
2009-10-23

Hi All,

Has anyone been able to get STUN working on their 9143i phone? I have configured it with the web interface but I can verify by dumping network packets on the Trixbox machine that the phone is not inserting it's public IP addr/port information in the SIP messages.

Firmware is 2.5.1.41.

The STUN log messages from the phone are shown below.

Any tips on making it work would be very much appreciated.

Thanks.

Oct 22 00:00:29 10.0.1.8 00: 00:23.850000 StunStart: (STUN) FUNC: Enter
Oct 22 00:00:29 10.0.1.8 00: 00:23.850000 StunStart: (STUN) INFO: StunStart() - STUN service started
Oct 22 00:00:33 10.0.1.8 00: 00:28.920000 ExtractSecDialToneStrings: (CC) INFO: _ResolveAddress(): DNS A resolving stunserver.org
Oct 22 00:00:33 10.0.1.8 00: 00:28.920000 GetPrependData: (CC) INFO: GetHostAddr(): stunserver.org -> 84b17b0d
Oct 22 00:00:33 10.0.1.8 00: 00:28.920000 GetPrependData: (CC) INFO: _ResolveAddress(): DNS A resolving stunserver.org
Oct 22 00:00:33 10.0.1.8 00: 00:28.920000 GetPrependData: (CC) INFO: GetHostAddr(): stunserver.org -> 84b17b0d
Oct 22 00:00:33 10.0.1.8 00: 00:28.920000 GetPrependData: (CC) INFO: _ResolveAddress(): DNS A resolving stunserver.org
Oct 22 00:00:33 10.0.1.8 00: 00:28.920000 UpdateDialPlan: (CC) INFO: GetHostAddr(): stunserver.org -> 84b17b0d
Oct 22 00:00:33 10.0.1.8 00: 00:28.920000 GetPrependData: (CC) INFO: _ResolveAddress(): DNS A resolving stunserver.org
Oct 22 00:00:33 10.0.1.8 00: 00:28.920000 GetPrependData: (CC) INFO: GetHostAddr(): stunserver.org -> 84b17b0d
Oct 22 00:00:33 10.0.1.8 00: 00:29.040000 StunInstanceCreate: (STUN) INFO: line index is -1
Oct 22 00:00:33 10.0.1.8 00: 00:29.040000 _PrintStateChange: (STUN) INFO: STUN Client 80dca8a8 changing to state 0
Oct 22 00:00:33 10.0.1.8 00: 00:29.040000 _PrintStateChange: (STUN) INFO: TURN Client 80dca8a8 changing to state 0
Oct 22 00:00:33 10.0.1.8 00: 00:29.040000 _ResolveAddresses: (STUN) INFO: line index is -1
Oct 22 00:00:33 10.0.1.8 00: 00:29.050000 _ResolveAddresses: (STUN) INFO: line index is -1
Oct 22 00:00:33 10.0.1.8 00: 00:29.050000 StunInstanceCreate: (STUN) INFO: line index is -1
Oct 22 00:00:33 10.0.1.8 00: 00:29.070000 _PrintStateChange: (STUN) INFO: TURN Client 80dcb248 changing to state 0
Oct 22 00:00:33 10.0.1.8 00: 00:29.070000 _ResolveAddresses: (STUN) INFO: _ResolveAddress(): DNS A resolving stunserver.org
Oct 22 00:00:33 10.0.1.8 00: 00:29.080000 _ResolveAddresses: (STUN) INFO: GetHostAddr(): stunserver.org -> 84b17b0d
Oct 22 00:00:33 10.0.1.8 00: 00:29.080000 StunInstanceCreate: (STUN) INFO: Client 80dcb330 created (socket 36, IP=a000108:3009)
Oct 22 00:00:33 10.0.1.8 00: 00:29.080000 _PrintStateChange: (STUN) INFO: STUN Client 80dcb330 changing to state 0
Oct 22 00:00:33 10.0.1.8 00: 00:29.080000 _PrintStateChange: (STUN) INFO: TURN Client 80dcb330 changing to state 0
Oct 22 00:00:33 10.0.1.8 00: 00:29.080000 _ResolveAddresses: (STUN) INFO: _ResolveAddress(): DNS A resolving stunserver.org
Oct 22 00:00:33 10.0.1.8 00: 00:29.080000 _ResolveAddresses: (STUN) INFO: GetHostAddr(): stunserver.org -> 84b17b0d
Oct 22 00:00:33 10.0.1.8 00: 00:29.080000 StunInstanceCreate: (STUN) INFO: Client 80dcb418 created (socket 37, IP=a000108:3010)

..etc..



Atcom Alberta
Posts: 219
Member Since:
2008-07-14
I've tried to get STUN

I've tried to get STUN working on a number of 9480i phones - no luck whatsoever. Had to use Linksys 962's instead...



darrin
Posts: 11
Member Since:
2009-10-23
Some success

I spent some more time investigating this. First, I updated the firmware to the latest 2.5.2.1010. The phone had trouble starting up after that, I had to do a factory reset and re-provision it (fortunately we have an FTP server set up for that).

Second, it seems I was using a bad STUN server, so I changed from stunserver.org to stun01.sipphone.com.

After that the SIP messages still had private IP addresses in them. However I was able to make the phone work by setting nat=yes on the Trixbox machine, but I was looking for a solution that didn't need this setting.

What I have found is that the phone can discover its external address/port with STUN, but only when it sets up the RTP stream to make a call! Of course if the SIP messages aren't properly mapped with the external address/port then the phone can never register and never make calls in the first place.

Setting nat=yes on the server allows the SIP conversation to work (telling Asterisk to ignore the IP address given by the phone). When the first call is made, the phone's STUN client springs to life and finds the correct external address. You can see that its working by log line that says:

InternalRegisterA: (SIP) INFO: localCurrentUrl: DisplayName: John Smith Host: 1.2.3.4
(where 1.2.3.4 is the external public IP address).

Followed by lots of:
_SendOneByteKeepAlivePacket: (STUN) INFO: Client 80dca9b8 sent keep-alive packet to 69.0.208.27:3478

Once it obtains an external IP address it almost works. In fact I tried settingh nat=no on the server at this point to see if it would register correctly. Subsequent register packets have the external IP in the Contact field, but they still have the private IP in the Via field. Asterisk is trying to send replies to that private address.

So, if any Aastra developers are reading this, it'd be worth testing your firmware on a network behind a NAT router with the server outside the local network. It's probably a good idea to make sure UPnP isn't enabled either.

(I'm happy to supply Wireshark traces and test firmware for you if it helps)



darrin
Posts: 11
Member Since:
2009-10-23
Atcom Alberta - I have a

Atcom Alberta - I have a couple of 9480i phones in the office. I intend to try them on remotely as well, once I have the 9143i working properly. I wouldn't be surprised if they have exactly the same issue.



darrin
Posts: 11
Member Since:
2009-10-23
Update

Hi All,

Just a quick update on this situation. I've been in contact with Aastra support and at their request made some Wireshark dumps showing the errors in the SIP conversation. I have a very cheap VanAccess phone which does the right thing with STUN so I sent them a trace of that phone as well for comparison.

I haven't heard back from their developers yet, but hopefully we'll see a STUN fix in a future firmware version.

Darrin



darrin
Posts: 11
Member Since:
2009-10-23
Still broken!

Looks like this issue still exists with the 2.5.3.18 Jan 2010 firmware. Very disappointing.



darrin
Posts: 11
Member Since:
2009-10-23
An answer from Aastra

Well its taken a while, but I've spent some time with Aastra support looking into this.

It turns out that the STUN support in the Aastra phones is not used for SIP messaging. It's only used for the RTP stream setup. This is a design decision by Aastra.

Aastra recommend using "rport" (RFC 3581) for handsets behind a NAT firewall. When this is enabled, the handset tells the serve that its behind NAT, and the server sends SIP replies back to the UDP source address rather than the address in the Via header.

The problem is, it seems to me that rport support is broken in Asterisk 1.6 (Trixbox 2.8.0.1). My debug suggests the server is seeing the rport flag and compensating accordingly, but is still trying to use the Via addr/port for sending replies.

In the release notes for Asterisk 1.8, there is a suggestion that this function has been reworked, so hopefully a future trixbox will have this fix:

 * The 'nat' option has now been been changed to have yes, no, force_rport, and
   comedia as valid values. Setting it to yes forces RFC 3581 behavior and enables
   symmetric RTP support. Setting it to no only enables RFC 3581 behavior if the
   remote side requests it and disables symmetric RTP support. Setting it to
   force_rport forces RFC 3581 behavior and disables symmetric RTP support.
   Setting it to comedia enables RFC 3581 behavior if the remote side requests it
   and enables symmetric RTP support.

In the meantime, it seems the only way to use an Aastra phone behind NAT is to use the Asterisk "nat=yes" option for the extension which forces rport behavior and routes all RTP audio via the Asterisk server.



Comment viewing options

Select your preferred way to display the comments and click "Save settings" to activate your changes.