[Home]

Summary:ASTERISK-01667: Correct IAX message count reporting to return a valid message count value.
Reporter:Steven Sokol (ssokol)Labels:
Date Opened:2004-05-20 17:31:35Date Closed:2008-01-15 15:00:53.000-0600
Priority:MinorRegression?No
Status:Closed/CompleteComponents:Core/General
Versions:Frequency of
Occurrence
Related
Issues:
Environment:Attachments:( 0) chan_iax2.c.patch.txt
Description:IAX2 currently returns 65535 if an account's mailbox has messages, and 0 if not.  This trivial patch calls ast_app_messagecount and returns the actual combined total message count (new and saved).  Perhaps this option should be in the account (on a user-by-user basis) instead of global?

****** ADDITIONAL INFORMATION ******

Only concern - large systems with LOTS of IAX accounts may be dragged down by querying the message count at each REG.  Not an issue on most systems but....  I would also like to see two IEs used - IAX_IE_MSGCOUNT_NEW and IAX_IE_MSGCOUNT_SAVED.  Much more meaningful that a raw combined count.  Just my $0.02.
Comments:By: Brian West (bkw918) 2004-05-20 20:59:50

msgcount should only be new messages.

bkw

By: Mark Spencer (markster) 2004-05-21 00:25:56

Actually, it works like this:

msgcount is a 16-bit number...

The number represents the number of new messages only, with 65535 being a special case indicating "unknown number of messages"

It's generally not efficient to count them all all the time.

By: twisted (twisted) 2004-06-16 23:46:53

markster, is this something that's going to take shape, or should we just close it out since technically this is working as designed?

By: James Golovich (jamesgolovich) 2004-06-17 00:38:10

I really don't think its a good idea to call ast_app_messagecount that frequently since it can take a small amount of time to complete.

I suppose if there was a cache kept so we didn't have to repeatedly walk the dirs to count then it wouldn't be so bad.

I can definitely see the usefulness of having the real value but we don't want to cause any kind of performance hit.

By: Mark Spencer (markster) 2004-06-26 17:09:25

Added to CVS, but you must specify that you want the "detailed" version with "mailboxdetail=yes".

Note that the value is (oldmsg << 8 | newmsgs)

By: Digium Subversion (svnbot) 2008-01-15 15:00:53.000-0600

Repository: asterisk
Revision: 3323

U   trunk/channels/chan_iax2.c
U   trunk/configs/iax.conf.sample

------------------------------------------------------------------------
r3323 | markster | 2008-01-15 15:00:52 -0600 (Tue, 15 Jan 2008) | 2 lines

Add ability to send detailed mailbox info (bug ASTERISK-1667)

------------------------------------------------------------------------

http://svn.digium.com/view/asterisk?view=rev&revision=3323