Hi,
I am thinking about writing a new module for SER, which will track SIP
dialogs and will serve as an abstraction layer for other modules, much
like the tm module now. We need such module for 2 reasons:
1. Call accounting. Our billing engine is based on the assumption that
a node provides accounting information for completed calls, not for
individual transactions. It is easier for us to extend proxy with
similar features than to modify billing engine to do transaction
matching.
2. Debit card application. Currently, there is no way to use SER for
debit card applications, where it is necessary to set the maximum
duration of the call and terminate it forcefully if that duration is
exceeded.
The raw idea is as follows:
- the module will register callbacks with tm.register_tmcb(), probably
TMCB_REQUEST_IN and TMCB_REPLY_IN ones and will match INVITEs to BYEs
keeping information about the state of ongoing sessions in the shared
memory.
- the module will provide interested modules with ability to register
several callbacks, i.e. on dialog creation/teardown and yet another
callback on dialog timeouts (more about that below).
- the module will provide utility functions for forceful termination
of any ongoing dialog.
- when invoking dialog creation callback function, the module will
give the function opportunity to install a timer on that dialog, so
that if the dialog is still active after timer expires, then some
action is performed. For example, in the debit card applications, in
such case the accounting module can decide to forcefully terminate a
dialog.
What do you think?
-Maxim