[OpenSIPS-Devel] [OpenSIPS/opensips] 84a8ce: acc: Fix usage of $acc_* vars in global onreply_r...

Liviu Chircu noreply at github.com
Fri Dec 13 13:33:44 EST 2019

  Branch: refs/heads/master
  Home:   https://github.com/OpenSIPS/opensips
  Commit: 84a8ce7f29afdcdbe03eb561669aca469b703559
  Author: Liviu Chircu <liviu at opensips.org>
  Date:   2019-12-13 (Fri, 13 Dec 2019)

  Changed paths:
    M modules/acc/acc_logic.c

  Log Message:
  acc:  Fix usage of $acc_* vars in global onreply_route

This patch fixes a bug where if the script writer reads or writes to
$acc_extra or $acc_leg within the global (stateless) onreply_route, the
stateful onreply routes will no longer see the $acc_* vars function
properly, as acc will be working on a temporary (empty) context.

The solution is to simply merge and drop this temporary acc context as
soon as the transaction matching is done and the "real" accounting
context is extracted from it.

An interesting side-effect is that the $acc_* variables may now also be
initialized globally, within onreply_route, and their value will still
be carrier over to the lower-level onreply_routes, as well as until the
end of the dialog.

More information about the Devel mailing list