当前位置: 首页 > news >正文

Kamailio dispather 选中目标节点后获取目标属性

attrs字段样式:

duid=10.245.1.1:5060;type=cc
duid=10.245.1.2:5061;type=sbc
duid=10.245.1.2:5062;type=vos

如需获取attrs字段属性:

... modparam("dispatcher","xavp_dst","$var(_dsdst_)" ... route[DETECT_NETWORK_SRC] { if (!ds_select_dst("1","10")) { ... } $var(network_type) = $(xavp(_dsdst_=>attrs){param.value,type}); if ($var(network_type) == "CC") { //转发到CC侧 ... } else if ($var(network_type) == "sbc") {//转发到sbc侧 ... } else if ($var(network_type) == "vos") {//转达到vos侧 ... } else {//转发目标未分类 ... } }

xavp_dst(str)参数说明:

The name of the XAVP which will hold the list with addresses and associated properties, in the order they have been selected by the chosen algorithm. If use_default is 1, the values of last XAVP correspond to the last address in destination set. In case of using dispatcher.list file, you have to set the priority field for each destination to ensure a particular order there. The first XAVP is the current selected destination. All the other addresses from the destination set will be added in the XAVP list to be able to implement serial forking.

Note

You must set this parameter if you want to do load balancing fail over.

Default value is “_dsdst_”.

xavp_dst_mode(int)参数说明:

Control what fields are added to the XAVP specified by xavp_dst parameter.

The addeded fields are:

  • grp - the set id (group id).

  • uri - the URI address.

  • sock - the socket pointer.

  • socket - the socket string - it is added only if xavp_dst_mode has bit 2 set (value 2).

  • sockname - the sockname string - it is added only if xavp_dst_mode has bit 3 set (value 3).

  • dstid - the destination unique id (in case of call load distribution algorithm).

  • attrs - the attributes - they are added if xavp_dst_mode does not have the bit 1 set (value 1).

Default value is “0” (add all fields).

ds_select_dst(set, alg[, limit])方法说明:

The method selects a destination from addresses set. It returns true if a new destination is set. The selected address is set to dst_uri field (aka the outbound proxy address or the $du variable), not being visible in the SIP request.

If the bit 2 in 'flags' parameter is set, the rest of the addresses from the destination set are stored in XAVP list (limited with an optional 'limit' parameter). You can use 'ds_next_dst()' to use next address in order to achieve serial forking to all possible destinations.

Meaning of the parameters is as follows:

  • set- the id of the set from where to pick up destination address. It is the first column in destination list file. The parameter can be an integer or a variable holding an integer.

  • alg- the algorithm used to select the destination address. The parameter can be an integer or a variable holding an integer.

  • limit- the maximum number of items to be stored in XAVP list for further fail-overs (the first selected destination and default destination are the first to be put in the list). This can improve the performance especially if you are using a large list of gateways.

EG:

... ds_select_dst("1", "0"); ... $var(a) = 4; ds_select_dst("1", "$var(a)"); ... ds_select_dst("1", "4", "3"); ...
http://www.jsqmd.com/news/457831/

相关文章:

  • 合同系统实施踩坑实录(二):当蓝图未定,开发已跑——一个“高效”背后的交付陷阱
  • Ingestion服务介绍(数据摄取服务,把外部系统的数据导入到内部数据系统中)(Batch Ingestion批处理摄取、Streaming Ingestion实时摄取)
  • OpenClaw 深度解析
  • Kamailio 对CC发起外呼出局时加0拨打
  • 基于标签的SOP任务编排——用Celery实现精准定时群发
  • OpenClaw 玩家必备!讯飞星辰Coding Plan上线
  • 焕新出发|快快云安全邀您开启云安全的AI时代
  • 素数判断:C语言实现详解
  • 目前靠谱的橡胶木板材制造企业推荐榜 - 品牌推荐(官方)
  • 拒绝PPT概念!实测全球首个通用智能体“实在Agent”:零售电商大促复盘的“救命稻草”
  • 一文读懂BEV感知:将多视角摄像头统一到鸟瞰空间的范式革命
  • Python项目开发结构,以及如何包内如何相互导入及如何运行命令行
  • AI搜索引擎迭代下
  • 野火STM32_HAL库版课程笔记-串口发送之发送字节
  • PAT 乙级 1017
  • 矽塔科技 SA8311 2.5-10.0V/2.0A 单通道 H 桥电机驱动器 SOP8 技术解析
  • 2026夸克网盘扩容1 TB最新教程 必得1024GB~
  • 【系统分析师】11.1 软件需求
  • PTA 实验7-2-6 打印杨辉三角
  • 苍穹外卖学习day01:项目概述与环境搭建
  • 语言太“标准”反被疑?百考通注入人类写作特征,自然过检
  • 用户的精细化运营
  • 国自然申报最后10天!AI救了我的申请书,写审改一条龙太香了
  • 人工智能之语言领域 自然语言处理 第六章 情感分析
  • c++小知识点
  • 最新版国产龙虾(CoPaw0.0.5.Post1)windows10一键安装成功,用ollama选本地部署的大模型,成功使用!
  • 企业效率工具盘点:基于DeepMiner的可信智能体,人机协同新选择
  • JavaScript入门指南:从基础到实战
  • 2026年智能驾驶模拟器价格大揭秘,教你如何选到高性价比产品 - 工业品网
  • Visual Studio 2022 安装失败:无法安装 Microsoft.Net.4.8.FullRedist.20H2 解决