freeswitch的v_extensions表解析-FusionPBX
freeswitch的v_extensions表解析-FusionPBX
此表在通话记录php 文件中 有用到:路径fusionpbx\app\xml_cdr\xml_cdr.php
//get the extensions
if ($permission['xml_cdr_search_extension']) {
$sql = "select extension_uuid, extension, number_alias from v_extensions ";
$sql .= "where domain_uuid = :domain_uuid ";
if (!$permission['xml_cdr_domain'] && is_array($extension_uuids) && @sizeof($extension_uuids != 0)) {
$sql .= "and extension_uuid in ('".implode("','",$extension_uuids)."') "; //only show the user their extensions
}
$sql .= "order by extension asc, number_alias asc ";
$parameters['domain_uuid'] = $_SESSION['domain_uuid'];
$extensions = $database->select($sql, $parameters, 'all');
}
以下是 v_extensions 表的字段含义注释(基于 FusionPBX 开源 PBX 系统逻辑):
表注释
表名: v_extensions
作用: 存储 FusionPBX 中的分机(Extension)核心配置信息,包括 SIP 认证、呼叫路由、高级功能设置等。
字段注释
| 字段名 | 类型 | 说明 |
|---|---|---|
| extension_uuid | uuid | 主键,分机的唯一标识符 |
| domain_uuid | uuid | 关联的域名/租户 UUID(多租户隔离) |
| extension | text | 分机号码(如 1001) |
| number_alias | text | 分机别名(备用号码) |
| password | text | SIP 认证密码 |
| accountcode | text | 计费账号(用于 CDR 计费关联) |
| effective_caller_id_name | text | 主叫名称(默认显示的名称) |
| effective_caller_id_number | text | 主叫号码(默认显示的号码) |
| outbound_caller_id_name | text | 外线呼出时显示的名称(覆盖默认) |
| outbound_caller_id_number | text | 外线呼出时显示的号码(覆盖默认) |
| emergency_caller_id_name | text | 紧急呼叫时显示的名称 |
| emergency_caller_id_number | text | 紧急呼叫时显示的号码 |
| directory_first_name | text | 分机目录中的名字 |
| directory_last_name | text | 分机目录中的姓氏 |
| directory_visible | text | 是否在目录中可见(true/false) |
| directory_exten_visible | text | 目录中是否显示分机号(true/false) |
| max_registrations | text | 最大 SIP 注册数(如 1) |
| limit_max | text | 并发呼叫限制数 |
| limit_destination | text | 呼叫限制的目标(如国际长途) |
| missed_call_app | text | 未接来电处理方式(如 email/none) |
| missed_call_data | text | 未接来电处理参数(如邮箱地址) |
| user_context | text | FreeSWITCH 拨号计划上下文(路由规则) |
| toll_allow | text | 允许的呼叫类型(如 local/international) |
| call_timeout | numeric | 呼叫超时时间(秒) |
| call_group | text | 呼叫组(用于组振铃) |
| call_screen_enabled | text | 是否启用呼叫筛选(true/false) |
| user_record | text | 通话录音设置(如 all/none) |
| hold_music | text | 呼叫保持时播放的音乐 |
| auth_acl | text | IP 访问控制列表(如 domestic) |
| cidr | text | 允许注册的 IP 网段(CIDR 格式) |
| sip_force_contact | text | 强制 SIP Contact 头字段(nat 穿越相关) |
| nibble_account | text | 实时计费账号 |
| sip_force_expires | numeric | 强制 SIP 注册过期时间(秒) |
| mwi_account | text | 语音邮件通知账号 |
| sip_bypass_media | text | 是否绕过媒体(true/false,用于代理模式) |
| unique_id | numeric | 旧系统兼容性字段(通常为 0) |
| dial_string | text | 拨号字符串(FreeSWITCH 路由核心参数) |
| dial_user | text | SIP 用户名(通常同 extension) |
| dial_domain | text | SIP 域名(如 example.com) |
| do_not_disturb | text | 免打扰模式(true/false) |
| forward_all_destination | text | 无条件呼叫转移目标号码 |
| forward_all_enabled | text | 是否启用无条件转移(true/false) |
| forward_busy_destination | text | 遇忙转移目标号码 |
| forward_busy_enabled | text | 是否启用遇忙转移 |
| forward_no_answer_destination | text | 无应答转移目标号码 |
| forward_no_answer_enabled | text | 是否启用无应答转移 |
| forward_user_not_registered_destination | text | 分机未注册时转移目标 |
| forward_user_not_registered_enabled | text | 是否启用未注册转移 |
| follow_me_uuid | uuid | 关联的 随行(Follow Me) 功能 UUID |
| follow_me_enabled | text | 是否启用随行功能 |
| follow_me_destinations | text | 随行功能的目标号码列表(逗号分隔) |
| extension_language | text | 语音提示语言(如 en/zh) |
| extension_dialect | text | 方言(如 us/uk) |
| extension_voice | text | TTS 语音引擎名称 |
| extension_type | text | 分机类型(如 user/ivr/fifo) |
| enabled | text | 分机启用状态(true/false) |
| description | text | 分机描述信息 |
| absolute_codec_string | text | 强制编解码器(如 PCMU,PCMA) |
| force_ping | text | 强制 SIP OPTIONS 心跳(true/false) |
| insert_date | timestamptz | 记录创建时间 |
| insert_user | uuid | 创建者 UUID |
| update_date | timestamptz | 记录最后更新时间 |
| update_user | uuid | 最后更新者 UUID |
关键字段说明
SIP 核心认证-
extension+password+dial_domain= SIP 注册凭证(如1001@example.com)。呼叫路由-
dial_string定义 FreeSWITCH 如何路由呼叫(如{sip_invite_domain=$${domain}})。高级功能-
follow_me_*实现多设备振铃/顺振。user_record控制通话录音。
多租户隔离-
domain_uuid确保分机属于特定租户(企业/客户)。


评论