CANCELs and negative ACKs are constructed from the INVITE which was sent out
authorMiklos Tirpak <miklos@iptel.org>
Tue, 29 May 2007 15:52:37 +0000 (15:52 +0000)
committerMiklos Tirpak <miklos@iptel.org>
Tue, 29 May 2007 15:52:37 +0000 (15:52 +0000)
commit344c31a9eacf6d50826039d759580fc680816b08
tree1e6110f25f832ff4534c2029a0a38848aff1f542
parent91791c591bdae811157e97f7c67dfb7357e54e12
CANCELs and negative ACKs are constructed from the INVITE which was sent out
instead of building them from the received one. The disadvantage is
that the outgoing INVITE has to be partially reparsed, the advantage is that
the CANCEL/ACK is always RFC-compliant, it always contains the same route-set
as the INVITE message. (closes SER-212)

build_local_reparse() function can be used to construct a CANCEL or ACK, it
reparses the outgoing INVITE and applies the modifications specified by the RFC.

new module parameters:
 - reparse_invite: set it to 0 in order to revert to the old behaviour)
 - ac_extra_hdrs: prefix for additional headers which are kept by build_local_reparse()

new script function:
 - t_relay_cancel() - can be used to catch CANCEL requests at the beginning of the script
                      and bypass the rest of the script processing:

if (!t_relay_cancel()) {  # implicit drop if relaying was successful,
                          # nothing to do

        # corresponding INVITE transaction found but error occurred
        sl_reply("500", "Internal Server Error");
        drop;
}
# bad luck, corresponding INVITE transaction is missing,
# do the same as for INVITEs
...
modules/tm/lw_parser.c [new file with mode: 0644]
modules/tm/lw_parser.h [new file with mode: 0644]
modules/tm/t_cancel.c
modules/tm/t_fwd.c
modules/tm/t_fwd.h
modules/tm/t_msgbuilder.c
modules/tm/t_msgbuilder.h
modules/tm/t_reply.c
modules/tm/tm.c