[reSIProcate] Idea for a new API similar to DialogUsage::onReadyToSend
Hi,
My application needs to perform some event logging through a
SIP-oriented call-centric API (note that it is SIP message oriented
and not SIP dialog oriented).
For example, that API provides pre-compiled definitions such as
InviteReceived, InviteSent, OkReceived, OkSent, ... The goal of that
API is to "monitor" what is happening to INVITE dialogs at the "SIP
message" level (as opposed to the "SIP Dialog" level - i.e. like what
is given by resip::DialogEventStateManager et al.).
For outgoing messages, InviteSessionHandler already has the
onReadyToSend method. From this callback I can call a method that will
directly look at the SipMessage (without modifying it...) and produce
the proper event that my event logger needs. However, there is nothing
that currently exists for the other way around: for incoming messages.
I do know about DUM's incoming feature chain, but it only relates to
SIP messages and not SIP messages and their DialogUsage. For example,
the onReadyToSend API not only gives me the message, but it also gives
me the InviteSession (the DialogUsage), which I can then relate to my
AppDialogSets.
Another option would be to call my event generation code within all
InviteSessionHandler::on* callbacks, but I'd rather find a more
generic way.
So, I'd like to propose a new API to be added to DialogUsage and its
children, something like InviteSession::onIncoming(const SipMessage&)
with its matching InviteSessionHandler::onIncoming method. The new
InviteSession::onIncoming method would then most likely be called from
InviteSession::dispatch.
Please let me know if there would be a better way to do this or if it
just doesn't make sense ;)
Thanks,
Francis