I'm having an interesting problem with SIP and I'm hoping someone out there has seen this before and knows how to fix it..! I'm using an E61 with the S60 3rd edition SDK (I believe it's the maintenance release).
I can register with Asterisk and make SIP calls over the WLAN without any problems. Furthermore I can even unregister from Asterisk and shut down the WLAN connection and then re-establish it, re-register and make another call.
Right - so everything seems fine so far... Except that I've noticed some interesting behaviour if you're not in a call but are still registered with Asterisk when the phone loses the connection to the wireless access point (say, if you move out of range or it's switched off). What happens is the phone seems to have no issues shutting down the WLAN and the connected SIP profile. However, when the access point comes back up again and you attempt to make another SIP call - the phone can't register the SIP profile. The WLAN connection is re-established with no problems (I can browse the internet) but absolutely NOTHING happens when the phone tries to register with Asterisk again. Tethereal tells me not a single packet is being sent despite the standard "Requesting..." progress dialog you get on the phone.
The only way to rectify this problem is to reboot the phone. Then everything works fine - until the phone loses contact with the access point again.
As this happens from both my code AND the built-in telephone app, I'm suspecting that this is a rather nasty bug in the implementation of Symbian's SIP stack or similar. Perhaps the SIP monitor thingy (excuse my lack of technical terminology) doesn't unbind itself from the appropriate port when it's forcibly disconnected... But then, I've noticed that if I force a WLAN disconnection from the connection monitor (Connectivity->Conn. Mgr.->Act. data conn.), the WLAN disconnects and then the phone reconnects and re-registers with Asterisk just fine! I can even make calls as per usual.
This is very strange and frustrating. Does anyone have any clue as to how to fix/circumvent this problem? It's really not viable to have to reboot the phone every time you move out of range of your access point.
My eternal gratitude if you can solve this!