官术网_书友最值得收藏!

Stateful Operation

Stateful Operation

This is a simplified description of the stateful operation. You will find a complete and more detailed description in the RFC3261 text. There is a close resemblance between the openser.cfg sections and the figure above. However some processes are manual, such as to check the Max-forwards header, while others are encapsulated in a single command. To illustrate, when you call t_relay() all the forward request processing as described is done automatically.

When operating in stateful mode, a proxy is simply a SIP transaction processor and all these processing steps are required:

  • Validate the request
  • Pre-process the routing information
  • Determine the request's target
  • Forward the request to the target
  • Process all responses

A stateful proxy creates a new server transaction for each new request received. Any retransmissions of the request will then be handled by that server transaction.

Example: For each request traversing our SIP proxy we will:

Step 1: Request validation

  • Check the message size to avoid buffer overflows.
  • Check the Max-forwards header to detect loops.

Step 2: Routing information pre-processing

  • If there is a record-route header, process it.

Step 3: Determine the request target

  • Is it in the location database (registered users)?
  • Is there a route to the destination (gateway destinations)?
  • Is it directed to an external domain (external addresses)?

Step 4: Request forwarding

  • Call the function t_relay() and OpenSER will do all the job for you statefully.

Step 5: Response processing

  • Usually this is done automatically by OpenSER. Sometimes you can use the onreply_route[] section to handle some response. Example: in a "call forward on busy" scenario, we could use the response 486 (Busy) to direct the call to a voicemail server.
主站蜘蛛池模板: 聂荣县| 信宜市| 晋中市| 即墨市| 罗山县| 湖口县| 广南县| 闽清县| 岳西县| 儋州市| 石楼县| 大竹县| 宁远县| 台东县| 巴塘县| 北安市| 县级市| 农安县| 四子王旗| 都安| 湟源县| 江口县| 铁岭县| 平谷区| 盖州市| 布尔津县| 中卫市| 海丰县| 宜川县| 建昌县| 鄂尔多斯市| 丘北县| 突泉县| 石棉县| 北碚区| 汨罗市| 渝中区| 永吉县| 光泽县| 铁岭县| 曲水县|