-
Notifications
You must be signed in to change notification settings - Fork 7
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
eddie murphy
committed
Dec 22, 2024
1 parent
19d43db
commit 4bec8a1
Showing
6 changed files
with
2,359 additions
and
3 deletions.
There are no files selected for viewing
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,42 @@ | ||
--- | ||
title: "路由执行的顺序" | ||
date: "2024-12-22 16:20:42" | ||
draft: false | ||
type: posts | ||
tags: | ||
- all | ||
categories: | ||
- all | ||
--- | ||
|
||
# 1. 请求消息处理过程 | ||
|
||
请求可以 | ||
|
||
- 直接丢弃,不返回任何响应。对于恶意请求,SIP Flood攻击,最好不要返回任何响应。 | ||
- 直接返回状态码,不做转发,例如直接返回301重定向 | ||
- 无状态转发 | ||
- 有状态转发 | ||
- 执行分支路由,分支路由也可以将消息丢弃 | ||
- 无论有无状态,请求发出去前都会执行onsend_route路由,在onsend_route内部,已经不能对SIP消息再做拦截 | ||
|
||
|
||
![](atta/2024-12-22-17-46-29.png) | ||
|
||
# 2. 响应消息处理过程 | ||
|
||
- 首先执行reply_route{}, 在这个路由里可以将消息丢弃 | ||
- 然后判断消息是否有状态的 | ||
- 有状态,这执行onreply_route[ID]路由 | ||
- 如果响应是失败的,还可以执行failure_route[ID], 当前前提是在请求路由里是否设置了钩子 | ||
- 在失败路由可以,可以再次设置新的目标地址,进行转发; 设置了新的目标地址后,还可以设置分支路由 | ||
|
||
{{< notice tip >}} | ||
这里要注意的是,响应路由在失败路由之前执行。 | ||
{{< /notice >}} | ||
|
||
![](atta/2024-12-22-17-47-27.png) | ||
|
||
# 3. 重传处理 | ||
|
||
![](atta/2024-12-22-17-49-19.png) |
Large diffs are not rendered by default.
Oops, something went wrong.
Large diffs are not rendered by default.
Oops, something went wrong.