[asterisk-bugs] [Asterisk 0019223]: [patch] realtime peer update fails, because "" is not a valide int value for lastms

Asterisk Bug Tracker noreply at bugs.digium.com
Fri May 6 04:20:59 CDT 2011


A NOTE has been added to this issue. 
====================================================================== 
https://issues.asterisk.org/view.php?id=19223 
====================================================================== 
Reported By:                marcelloceschia
Assigned To:                
====================================================================== 
Project:                    Asterisk
Issue ID:                   19223
Category:                   Channels/chan_sip/Registration
Reproducibility:            always
Severity:                   trivial
Priority:                   normal
Status:                     ready for testing
Asterisk Version:           SVN 
JIRA:                       SWP-3421 
Regression:                 No 
Reviewboard Link:            
SVN Branch (only for SVN checkouts, not tarball releases): 1.8 
SVN Revision (number only!): 316037 
Request Review:              
====================================================================== 
Date Submitted:             2011-05-04 02:56 CDT
Last Modified:              2011-05-06 04:20 CDT
====================================================================== 
Summary:                    [patch] realtime peer update fails, because "" is
not a valide int value for lastms
Description: 
The issue also present on asterisk 1.6.x
====================================================================== 

---------------------------------------------------------------------- 
 (0134573) marcelloceschia (reporter) - 2011-05-06 04:20
 https://issues.asterisk.org/view.php?id=19223#c134573 
---------------------------------------------------------------------- 
I know the differnce of NULL and not NULL values.
Looking into contrib/realtime/postgresql/realtime.sql, lastms is defined
as 

lastms integer DEFAULT -1 NOT NULL

and thats the truth people know about asterisk realtime. 
I dont say that -1 is the right value in this case, but
destroy_association is called in expire_register and in build_peer.
Within build_peer lastms is explicitly set to -1:

if ((nowtime - regseconds) > 0) {
			destroy_association(peer);
			memset(&peer->addr, 0, sizeof(peer->addr));
			peer->lastms = -1;
			ast_debug(1, "Bah, we're expired (%d/%d/%d)!\n", (int)(nowtime -
regseconds), (int)regseconds, (int)nowtime);
}

In expire_register lastms isnt set, but we know that peer is expired so it
can not be unknown.
Setting the value to NULL means asterisk does not parse this value and so
the lastms has the default 0 value.

Retire my patch and close this issue. 

Issue History 
Date Modified    Username       Field                    Change               
====================================================================== 
2011-05-06 04:20 marcelloceschiaNote Added: 0134573                          
======================================================================




More information about the asterisk-bugs mailing list