Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
$route variable: Add support for script "callback routes"
The idea of "callback routes" was missed during the development of $route, with this feature having been first introduced in 3.1. Conceptually, a "callback route" is a contextless route that may be invoked in a nested fashion, during the processing of a SIP message in any of the routes. For example, on a SIP BYE: 1. route 1.1 loose_route() (this triggers the "callback route", e.g. see dlg_on_hangup()) 1.2 route "dlg_on_hangup" is run, contextless! 2. script processing continues! <--- here, $route output was broken This patch fixes the issue, by adding recursion detection into the run_top_route() function, such that the $route variable works as expected regardless of how many (nested) times it is called. Many thanks to Ben Newlin for catching this issue, as well as providing a detailed report! Fixes #2681 (cherry picked from commit bb1fcc2)
- Loading branch information
1 parent
20f59af
commit ae9d2e2
Showing
4 changed files
with
54 additions
and
24 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters