Re: [reSIProcate] Sending "Keep alives"
Hello, I quickly dig in resiprocate sources and found some interesting
code fragments.
Profile.hxx:
class Profile
{
...
///time between CR/LF keepalive messages in seconds. Set to 0 to
disable.
///Default is 30 seconds for datagram and 180 seconds for stream.
///Note: You must set a KeepAliveManager on DUM for this to work.
virtual void setKeepAliveTimeForDatagram(int keepAliveTime);
virtual int getKeepAliveTimeForDatagram() const;
virtual void unsetKeepAliveTimeForDatagram();
virtual void setKeepAliveTimeForStream(int keepAliveTime);
virtual int getKeepAliveTimeForStream() const;
virtual void unsetKeepAliveTimeForStream();
...
};
DialogUsageManager.hxx:
class DialogUsageManager
{
...
void setKeepAliveManager(std::auto_ptr<KeepAliveManager> keepAlive);
...
};
Probably it will interest you. IMHO, you must only use
DialogUsageManager::setKeepAliveManager method. But if you want to
change default values of keep-alive intervals than you should use
Profile methods.
> In debugging my SIP phone, I can connect just fine and have an audio
> conversation, then it will stop in about a minute or so.
>
> Further investigation indicates my SIP stack is not sending keep
> alive packets.
>
> I fired up TCPDump, and sure enough, I'm not sending any keep
> alives to the SIP server. What could be the reason? I obviously
> suspect I'm not setting it up properly.
>
> My what mechanism do I make sure Keep alives are sent about every
> 5 secs or so. Does the SIP stack do this automatically, or do I
> have to implement a timer to do this myself? I presume the
> keep alive is a simple header and carriage return, right?
>
> Is there a resip function or method that allows me to control
> this? It appears I haven't setup my SIP stack properly, because
> it isn't sending them.
>