Keep Alive Interval Setting

New features you'd like see on SIP Sorcery
jack9901
Posts: 277
Joined: Tue Jan 29, 2008 7:30 pm

Keep Alive Interval Setting

Post by jack9901 » Sat Sep 05, 2009 3:44 am

I found a WinCE program PortSIP quite usable with its G.729 codec. However, it stops refreshing registration if the phone is in standby. But Keep Alive can keep it connected. One problem with the Keep Alive is that the 15 seconds interval makes the GSM data session active almost all the time and the battery drains quickly. If the interval can be set longer, the data session can have longer dormant period which saves the battery.

Aaron
Site Admin
Posts: 4652
Joined: Thu Jul 12, 2007 12:13 am

Post by Aaron » Sat Sep 05, 2009 7:48 am

In that case you're better off turning the NAT keepalives off and setting your registration expiry to the desired interval.

jack9901
Posts: 277
Joined: Tue Jan 29, 2008 7:30 pm

Post by jack9901 » Sat Sep 05, 2009 3:58 pm

Thanks, that's what I was looking for. This softphone has no settings for NAT keep alive and registration expiry. I just now poked around it and found it has an option called "disable sleeping habbit" which seemed to keep registration refreshing in phone standby mode but it looks like it also triggered the short-interval'ed NAT keep alive though the phone is on public IP.

jack9901
Posts: 277
Joined: Tue Jan 29, 2008 7:30 pm

Post by jack9901 » Sat Sep 05, 2009 5:09 pm

Update: the "disable sleeping habit" did not function well and after a while the phone stopped refreshing registration though the GSM data connection is alive. The interesting thing is that the server side Keep Alive can keep this softphone refreshing registration. All WM softphones I tried seem too buggy to be usable.

fixup77
Posts: 93
Joined: Sun Jan 27, 2008 1:56 am

Post by fixup77 » Wed Sep 09, 2009 7:57 am

Your problem has nothing to do with NAT keep alive. The problem is the phone went into sleep and will not wake up even it is registered to SS or whatever provider.

A solution is to also call your cellphone #. This will wake up the phone and ring. You hit the cancel button, so the cellphone will not pick up the call. Then PortSIP will show up and ring, pick it up and you are connected.

If this is with GoogleVoice, it is farely easy: just forward to both your cell # and SIP.

jack9901
Posts: 277
Joined: Tue Jan 29, 2008 7:30 pm

Post by jack9901 » Wed Sep 09, 2009 11:40 pm

Right, it is not a NAT issue, as the feature name suggested, it is "Keep Alive", which can do the job of either keeping NAT alive or keeping softphone in standby alive, by sending packets with an appropriate interval.

I did a little test. The softphone and some other applications have no problem to send packets in standby mode if the phone is being charged or if the WiFi is connected. Obviously, GSM data connection in standby mode with charger disconnected has a deeper sleep mode, in which applications cannot send packets or are in sleep mode but inbound packets somehow resume the communication or wake up the target application. I did some search but didn't find a solution that can make apps reach internet in standby (no charger, no WiFi). So the "keep alive" could be the way to do it.

The sugguestion to do forwarding to both the cell and the softphone is a good one. It just has some inconveniences in my situation. First, when the cell incoming is dismissed, the voicemail will pick up the call, give no chance to the softphone, and voicemail cannot be disabled with my provider and I also need it. This method works with Google Voice call presentation however. Second, assume the first problem is solved, after the cell incoming is dismissed, data connection resumes and the softphone begins to register and the server gets the binding. So depending on how quickly I pick up the phone and how long it takes the softphone to register, I have to design a delay method in the dial plan to check if the binding is alive or will be alive and then do the SIP forward, at which time the cell's voicemail may have already picked up the call.

Ideally, the call is forwarded to the softphone first and if the softphone is not available, then forwarded to the cell. That's why I think the "no response time" is useful if I walk into a building and the data connection cuts off.

Anyway, the softphone on the cell is only a toy. If it works, good. But I will not depend on it, and if I am a heavy user, it is best to upgrade the cell plan. :D

fixup77
Posts: 93
Joined: Sun Jan 27, 2008 1:56 am

Post by fixup77 » Thu Sep 10, 2009 5:14 pm

"Keep alive" cannot do anything about this issue. Because it is not about a broken registration while the screen is dark. AGEPhone is the same on this regard. A SIP call won't ring the phone as long as the screen is dark. The only solution is to ring the cell phone # at the same time.

The only softphone that will ring from a SIP call is the one built into WM6.

jack9901
Posts: 277
Joined: Tue Jan 29, 2008 7:30 pm

Post by jack9901 » Thu Sep 10, 2009 7:29 pm

Well, there is no magic with WM6Voip. If something is not working, that's because the softphone author does not know or does not have the access to get to know the appropriate API to do the work. Just like the semi-hacked earpiece function, till now, still nobody knows how to correctly program it except developers from MS and manufacturers.

The following are the behaviors in standby mode from some softphones I tried, (before lost registration)

WM6Voip AND SJphone ppc2003, incoming call (ring) activates sound and screen
AGEphone mobile, incoming call only activates screen not sound, can do vibrate as workaround
PortSIP, incoming call activates neither. If you turn the phone on, you'll see PortSIP is actually ringing at the time, with no sound.

Contact me if you want your AGEphone or PortSIP to ring the sound in standby.

Keep Alive did a fine job to resume the data session in standby to keep the softphone from losing registration. It worked for me. I watched the monitor screen when a direct IP SIP call rang PortSIP that already lost registration. Immediately upon receiving the INVITE, PortSIP updated the registration, which proved my guess that incoming packets activate the data session in standby.

fixup77
Posts: 93
Joined: Sun Jan 27, 2008 1:56 am

Post by fixup77 » Thu Sep 10, 2009 10:54 pm

Here is the situation:

AGEPhone - everything is perfect except no g729 support. Useless, as 3G simply cannot handle g711u reliably.

PortSIP - uses too much CPU time even under sleep/dark mode. Useless, because it runs battery out in no time.

So, I only use PortSIP to call out and close it after done. So far there is no good SIP call-in solution.

jack9901
Posts: 277
Joined: Tue Jan 29, 2008 7:30 pm

Post by jack9901 » Fri Sep 11, 2009 12:09 am

So I guess newer version of AGEphone fixed those bugs. The one I tried months ago could not activate sound(ring) in standby, and it ran super hot in standby because it sent out NAT Keep Alive every 15 seconds even it was on the public IP. You can force it to use GSM codec. It is in \My Documents\My Phone Booth\sipd.conf, change the MediaTypes= line to

MediaTypes=3 101

But its sound quality is not so good even with G.711 codec.

PortSIP registers every 90 seconds and by watching the discharge current (I haven't done packet capture) it seems to send out Keep Alive packets in short intervals on public IP as well. No way to change the behavior at the current version.

If you meant it runs hot in standby mode, with GSM/CDMA data session, with the charger disconnected, then it means your WM6 can send outbound data in this mode but mine cannot. I was searching for the fix to do this but now I do not need it. I use the recorded binding address to forward calls to the softphone. And after I finished the call, I press the power button to put the phone in standby, and the softphone cannot send out a single byte of data---the phone is as cool as it can be.

Post Reply