[OpenSIPS-Devel] [OpenSIPS/opensips] 0ed7a0: Add the `$route` variable (current route call stack)

Liviu Chircu noreply at github.com
Wed Nov 25 11:28:43 EST 2020


  Branch: refs/heads/master
  Home:   https://github.com/OpenSIPS/opensips
  Commit: 0ed7a0ace961985ad5156c3f7b646ba9d0304715
      https://github.com/OpenSIPS/opensips/commit/0ed7a0ace961985ad5156c3f7b646ba9d0304715
  Author: Liviu Chircu <liviu at opensips.org>
  Date:   2020-11-25 (Wed, 25 Nov 2020)

  Changed paths:
    M action.c
    M action.h
    M async.c
    M cfg.y
    M modules/b2b_entities/dlg.c
    M modules/b2b_logic/logic.c
    M modules/cpl_c/cpl_sig.c
    M modules/dialog/dlg_handlers.c
    M modules/dispatcher/dispatch.c
    M modules/drouting/drouting.c
    M modules/event_route/event_route.c
    M modules/event_route/route_send.c
    M modules/event_route/route_send.h
    M modules/event_routing/ebr_data.c
    M modules/pike/pike_funcs.c
    M modules/presence_dfks/presence_dfks.c
    M modules/script_helper/script_helper.c
    M modules/sipcapture/sipcapture.c
    M modules/tm/async.c
    M modules/tm/t_fwd.c
    M modules/tm/t_reply.c
    M modules/tm/uac.c
    M net/trans_trace.c
    M pvar.c
    M pvar.h
    M receive.c
    M route.c
    M route.h
    M str.h
    M timer.c

  Log Message:
  -----------
  Add the `$route` variable (current route call stack)

The new $route variable offers access to the current route call stack.
Assuming a call stack of "route > route[FOO] > route[BAR]", we have:

Positive indexing:
    * $route == $(route[0]) == "route[BAR]"
    * $(route[1]) == "route[FOO]"
    * $(route[2]) == "route"
    * $(route[3]) == "<null>"

Negative indexing:
    * $(route[-1]) == "route"
    * $(route[-2]) == "route[FOO]"
    * $(route[-3]) == "route[BAR]"
    * $(route[-4]) == "<null>"

Full printing:
    * $(route[*]) == "route > route[FOO] > route[BAR]"

Closes #1963





More information about the Devel mailing list