[asterisk-users] SIP Realtime peers

Antony Stone Antony.Stone at asterisk.open.source.it
Sat Mar 13 09:13:04 CST 2021

On Thursday 11 March 2021 at 14:03:23, Antony Stone wrote:

> Hi.
> I'm using MariaDB (via ODBC) to store realtime SIP peers with Asterisk 13
> and 16.
> In general it's all working fine, however there's something that puzzles
> me:
> If I connect to the Asterisk console and use the command "sip show peers" I
> get a list of the peers including the last qualify time in the "Status"
> column.  The "Realtime" column tells me "Cached RT".
> Some of my peers are in the same data centre as the server I'm querying,
> and generally show a qualify time of 1ms; some are in another data centre
> and have qualify times around 15ms.
> However, if I go to my database server and ask "select * from sippeers" I
> get the same list of peers but the "lastms" field is always zero.  I had
> expected this to show me the last qualify time in milliseconds for each
> peer.
> Am I just totally misinterpreting what "lastms" means in the table, or do I
> need to do something else to get this value to reflect what Asterisk itself
> will tell me?

I've done a little more investigating, and from both documentation and the 
source code I've established that this field should be getting updated provided 
that "rtupdate" is set to "yes" in sip.conf, however as that is the default 
and I have not set it to "no", I had expected the value indeed to be "yes".

Setting it explicitly to "yes" makes no difference.

The totally unexpected part, though, is that if I modify the value of "lastms" 
in the database table, and then just wait about 30 seconds, Asterisk changes 
all the values back to zero.

So, Asterisk definitely *is* updating this field in the database table; it's 
just not using the correct values.

Can anyone please comment on whether this is the bug it looks like to me, or 
whether I'm just missing some configuration setting which would make this work 
as expected?



BASIC is to computer languages what Roman numerals are to arithmetic.

                                                   Please reply to the list;
                                                         please *don't* CC me.

More information about the asterisk-users mailing list