[Asterisk-Dev] MWI Support In IAX2? - Got it.

Steven Sokol ssokol at sokol-associates.com
Tue Jan 20 16:28:11 MST 2004


> I think that IAX2 returns the message count as part of a registration
> reply as IAX_IE_MSGCOUNT.  at least, that's what grep -i message * on
> libiax2 leads me to believe.
> 
> -SteveK

According to iax2-parser.c there is an IE for the message count.  The
value apparently gets parsed out of the iedata and placed in a field of
the iax_ies structure called msgcount.  It appears that this short field
is flooded (65535) if you have messages and zero if you don't.  If you
don't have a mailbox, it seems to return -1.  At least this is my best
guess. 

My next question is -- what is the best way to push this information to
our clients and to sync it with a particular server?  I am "catching" it
as it comes through attached to the IAX_COMMAND_REGACK event in the
iaxc_handle_regreply function.  If we could return some kind of event or
even a return value from iaxc_register that can be matched up with the
session or other identifier with the message count, we could indicate if
messages exist for multiple registrations.

Perhaps returning an identifier (identifying the specific registration)
from the iaxc_register function could be useful for other reasons.  For
example, we could match it to regauth/regreject messages and return an
acknowledgement for the specific server/registration in question.

(Does this make any sense -- it's rather awkward to talk about.)

Mark - Why return a yes/no/error value, rather than the actual message
count or -1 for no mailbox?

Thanks,

Steve






More information about the asterisk-dev mailing list