[OpenSIPS-Devel] SF.net SVN: opensips:[6818] trunk

Maxim Sobolev sobomax at sippysoft.com
Mon Apr 26 09:00:35 CEST 2010


Revision: 6818
          http://opensips.svn.sourceforge.net/opensips/?rev=6818&view=rev
Author:   sobomax
Date:     2010-04-26 07:00:34 +0000 (Mon, 26 Apr 2010)

Log Message:
-----------
This is a mechanism to register per-message callback handlers
to be called at certain points of the message lifecycle.

Apart from the sip_msg structure, each handler is passed a
pointer to a handler type-specific structure from the core
and pointer to an opaque structure allocated by the module.

The following callback types are supported:

 REQ_PRE_FORWARD - called before the request is getting reassembled
 for delively. Can be used to apply some last-minute transformations.
 Depending on the script structure this handler may not be called for
 particular message at all or can be called multiple times. Core will
 pass "struct proxy *" to the handler describing destination for the
 current request.

 MSG_DESTROY - called when the message is being freed. Can be used to
 release any module-specific per-message resources, including any
 dynamic structures passed to the msg_callback_add(). Once
 registered, this handler is guranteed to be invoked exactly once for
 each message.

To avoid memory leaks, code that allocates dynamic structures for use
in the callback handlers should always register MSG_DESTROY handler
and free all memory in there.

Right now it's pretty much a no-op, until there are modules that
use this new interface. Such change for the nathelper is coming.

Modified Paths:
--------------
    trunk/forward.c
    trunk/modules/tm/t_fwd.c
    trunk/parser/msg_parser.c
    trunk/parser/msg_parser.h

Added Paths:
-----------
    trunk/msg_callbacks.c
    trunk/msg_callbacks.h


This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site.



More information about the Devel mailing list