By Date: <-- -->
By Thread: <-- -->

OPAL: TransmitSIPInfo() method



Hello,
 
I've got a problem with SIPEndPoint::TransmitSIPInfo() function. It occurs when I call Register() - actually TransmitSIPInfo() - with timeout set to default value 0 (in my case - always). For the first time, when there is no active SIPRegisterInfo yet, all works ok - because constructor of that SIPRegisterInfo checks timeout, and if 0, it is set to default registrar TTL value from SIPEndPoint.
But: when I call Register() again, with the same parameters (without corresponding Unregister()), TransmitSIPInfo() function checks list of active SIPInfo's. It finds one, and .... writes the timeout value of 0 to "expires" field in SIP PDU. Because of this endpoint... unregisters from registrar (expires = 0 causes this).
 
I don't know is this intended behaviour, in my opinion not.
 
So I changed code in this function (sipep.cxx, revision 2.97, line 1529) from:
 
info->SetExpire(timeout); // Adjust the expire field
 
to:
 
// Adjust the expire field
if (!timeout) {
  // get default values from endpoint
  if (m == SIP_PDU::Method_REGISTER)
    timeout = registrarTimeToLive.GetSeconds();
  else if (m == SIP_PDU::Method_SUBSCRIBE)
    timeout = notifierTimeToLive.GetSeconds();
}
info->SetExpire(timeout);
 
It seems to work correctly now.
 
Regards:
Jacek Stobnicki