V5

XSwitch v5.0.4 版发布

更新和 Bug 修复

XSwitch 更新

  • 使用1.10.9-dev git bd4d474 2022-12-27 02:36:08Z 64bit
  • 修改mod_xcc模块应答功能;
  • 修改无视频头像;
  • 增加SIP_WS_PORTSIP_WSS_PORT配置;

XUI 更新

  • 使用xui-lua-4.0.3-20230104105835
  • 增加几个命令行小工具;
  • 重构路由查询相关代码;
  • xdb增加find_cols_by_cond方法;
  • SIP Profile中增加WebRTC支持相关参数;
  • 增加verto配置;
  • 修改sip_ip及端口;
  • 修复网页端 Bug;

升级建议

可以按照部署文档重新从头搭建。

如果系统中使用的5.0.4版本,需要修改镜像名称和版本号以及更新数据库,具体操作如下:

Linux 修改docker-compose.yml文件,Mac 修改docker-compose-mac.yml文件,将文件中servicexswitchimage一行的版本号由5.0.3改为5.0.4

ccr.ccs.tencentyun.com/free/xswitch-community:5.0.3

修改为

ccr.ccs.tencentyun.com/free/xswitch-community:5.0.4

如果用 Nginx,还需要按照上边把servicexswitch-nginx-xuiimage一行的镜像名称和版本号也修改为5.0.4

此次更新数据库操作。

ALTER TABLE extensions ADD hotline_number VARCHAR;
ALTER TABLE extensions ADD enable_hotline INTEGER DEFAULT 0;

UPDATE dicts SET v = '4.0.8' WHERE realm = 'XUI' and k = 'DBVER';
INSERT INTO logs (resource, action, user_id, user_name, summary, message)
	VALUES('XUI', 'UPDATE', 0, 'SYSTEM', '4.0.8', '{"DEVER": "4.0.8"}');

ALTER TABLE meetings ADD auto_mute INTEGER DEFAULT 0;
UPDATE dicts SET v = '4.0.9' WHERE realm = 'XUI' and k = 'DBVER';
INSERT INTO logs (resource, action, user_id, user_name, summary, message)
	VALUES('XUI', 'UPDATE', 0, 'SYSTEM', '4.0.9', '{"DEVER": "4.0.9"}');

-- verto.conf settings
INSERT INTO params (realm, k, v) VALUES ('REALMS', 'VERTO-SETTINGS', 'Verto Settings');
--verto.conf variables
INSERT INTO params (realm, k, v) VALUES ('REALMS', 'VERTO-PROFILE', 'Verto Variables');
CREATE TABLE verto_profiles (
	id SERIAL PRIMARY KEY,
	name VARCHAR NOT NULL,
	description VARCHAR,
	disabled INTEGER DEFAULT 0,

	created_at TIMESTAMP(0) DEFAULT now(),
	updated_at TIMESTAMP(0) DEFAULT now(),
	deleted_at TIMESTAMP(0)
);
CREATE UNIQUE INDEX verto_profiles_name ON verto_profiles(name);
CREATE INDEX verto_profiles_deleted_at ON verto_profiles(deleted_at);
INSERT INTO system_menus (k, url, sort, module_id, icon) VALUES ('Verto', '/settings/verto', 7, (SELECT id FROM system_modules WHERE v = 'SMENUS_Modules'), 'UnorderedListOutlined');

INSERT INTO verto_profiles(name, description, disabled) VALUES('default-v4', 'default-v4', 0);
INSERT INTO verto_profiles(name, description, disabled) VALUES('docker-internal', 'docker-internal', 1);

CREATE TABLE verto_vhosts (
	id SERIAL PRIMARY KEY,
	realm VARCHAR NOT NULL,
	vhost_id INTEGER,
	k VARCHAR NOT NULL,
	v VARCHAR,
	ref_id INTEGER,
	disabled INTEGER DEFAULT 0,
	created_at TIMESTAMP(0) DEFAULT now(),
	updated_at TIMESTAMP(0) DEFAULT now(),
	deleted_at TIMESTAMP(0)
);

CREATE INDEX verto_vhosts_realm ON verto_vhosts(realm);
CREATE UNIQUE INDEX verto_vhosts_rrk ON verto_vhosts(realm, ref_id, k);
CREATE INDEX verto_vhosts_deleted_at ON verto_vhosts(deleted_at);
CREATE TRIGGER t_auto_update_updated_at_on_verto_profiles BEFORE UPDATE ON verto_profiles FOR EACH ROW EXECUTE PROCEDURE auto_update_updated_at();

INSERT INTO verto_vhosts(realm, vhost_id, k, v, ref_id, disabled) VALUES('VERTO-PROFILE-VHOST', 1, 'alias', 'seven.local freeswitch.org', 0, 0);
INSERT INTO verto_vhosts(realm, vhost_id, k, v, ref_id, disabled) VALUES('VERTO-PROFILE-VHOST', 1, 'root', '$${base_dir}/xui/www', 0, 0);
INSERT INTO verto_vhosts(realm, vhost_id, k, v, ref_id, disabled) VALUES('VERTO-PROFILE-VHOST', 1, 'script-root', '$${base_dir}/xui/lua/xui', 0, 0);
INSERT INTO verto_vhosts(realm, vhost_id, k, v, ref_id, disabled) VALUES('VERTO-PROFILE-VHOST', 1, 'index', 'index.html', 0, 0);
INSERT INTO verto_vhosts(realm, vhost_id, k, v, ref_id, disabled) VALUES('VERTO-PROFILE-VHOST-REWRITE', 1, '^/api', '/init.lua', 0, 0);

INSERT INTO verto_vhosts(realm, vhost_id, k, v, ref_id, disabled) VALUES('VERTO-PROFILE-VHOST', 1, 'alias', 'seven.local freeswitch.org', 1, 0);
INSERT INTO verto_vhosts(realm, vhost_id, k, v, ref_id, disabled) VALUES('VERTO-PROFILE-VHOST', 1, 'root', '$${base_dir}/xui/www', 1, 0);
INSERT INTO verto_vhosts(realm, vhost_id, k, v, ref_id, disabled) VALUES('VERTO-PROFILE-VHOST', 1, 'script-root', '$${base_dir}/xui/lua/xui', 1, 0);
INSERT INTO verto_vhosts(realm, vhost_id, k, v, ref_id, disabled) VALUES('VERTO-PROFILE-VHOST', 1, 'index', 'index.html', 1, 0);
INSERT INTO verto_vhosts(realm, vhost_id, k, v, ref_id, disabled) VALUES('VERTO-PROFILE-VHOST-REWRITE', 1, '^/api', '/init.lua', 1, 0);

INSERT INTO verto_vhosts(realm, vhost_id, k, v, ref_id, disabled) VALUES('VERTO-PROFILE-VHOST', 1, 'alias', 'seven.local freeswitch.org', 2, 0);
INSERT INTO verto_vhosts(realm, vhost_id, k, v, ref_id, disabled) VALUES('VERTO-PROFILE-VHOST', 1, 'root', '$${base_dir}/xui/www', 2, 0);
INSERT INTO verto_vhosts(realm, vhost_id, k, v, ref_id, disabled) VALUES('VERTO-PROFILE-VHOST', 1, 'script-root', '$${base_dir}/xui/lua/xui', 2, 0);
INSERT INTO verto_vhosts(realm, vhost_id, k, v, ref_id, disabled) VALUES('VERTO-PROFILE-VHOST', 1, 'index', 'index.html', 2, 0);
INSERT INTO verto_vhosts(realm, vhost_id, k, v, ref_id, disabled) VALUES('VERTO-PROFILE-VHOST-REWRITE', 1, '^/api', '/init.lua', 2, 0);

-- verto
INSERT INTO params(realm, k, v, ref_id, disabled) VALUES('VERTO-SETTINGS', 'enable-fs-events', 'true', 0, 0);
INSERT INTO params(realm, k, v, ref_id, disabled) VALUES('VERTO-SETTINGS', 'enable-presence', 'true', 0, 0);
INSERT INTO params(realm, k, v, ref_id, disabled) VALUES('VERTO-SETTINGS', 'event-channel-enable-hierarchy-deliver', 'true', 0, 0);
INSERT INTO params(realm, k, v, ref_id, disabled) VALUES('VERTO-PROFILE', 'bind-local', '$${local_ip_v4}:$${VERTO_WS_PORT}', 0, 0);
INSERT INTO params(realm, k, v, ref_id, disabled) VALUES('VERTO-PROFILE', 'bind-local-1', '$${local_ip_v4}:$${VERTO_WSS_PORT}', 0, 0);
INSERT INTO params(realm, k, v, ref_id, disabled) VALUES('VERTO-PROFILE', 'force-register-domain', '$${domain}', 0, 0);
INSERT INTO params(realm, k, v, ref_id, disabled) VALUES('VERTO-PROFILE', 'secure-combined', '$${certs_dir}/wss.pem', 0, 0);
INSERT INTO params(realm, k, v, ref_id, disabled) VALUES('VERTO-PROFILE', 'secure-chain', '$${certs_dir}/wss.pem', 0, 0);
INSERT INTO params(realm, k, v, ref_id, disabled) VALUES('VERTO-PROFILE', 'userauth', 'true', 0, 0);
INSERT INTO params(realm, k, v, ref_id, disabled) VALUES('VERTO-PROFILE', 'blind-reg', 'false', 0, 0);
INSERT INTO params(realm, k, v, ref_id, disabled) VALUES('VERTO-PROFILE', 'mcast-ip', '224.1.1.1', 0, 0);
INSERT INTO params(realm, k, v, ref_id, disabled) VALUES('VERTO-PROFILE', 'mcast-port', '1337', 0, 0);
INSERT INTO params(realm, k, v, ref_id, disabled) VALUES('VERTO-PROFILE', 'rtp-ip', '$${local_ip_v4}', 0, 0);
INSERT INTO params(realm, k, v, ref_id, disabled) VALUES('VERTO-PROFILE', 'ext-rtp-ip', '$${ext_rtp_ip}', 0, 0);
INSERT INTO params(realm, k, v, ref_id, disabled) VALUES('VERTO-PROFILE', 'local-network', 'localnet.auto', 0, 0);
INSERT INTO params(realm, k, v, ref_id, disabled) VALUES('VERTO-PROFILE', 'outbound-codec-string', 'opus,vp8', 0, 0);
INSERT INTO params(realm, k, v, ref_id, disabled) VALUES('VERTO-PROFILE', 'inbound-codec-string', 'opus,vp8', 0, 0);
INSERT INTO params(realm, k, v, ref_id, disabled) VALUES('VERTO-PROFILE', 'apply-candidate-acl', 'localnet.auto', 0, 0);
INSERT INTO params(realm, k, v, ref_id, disabled) VALUES('VERTO-PROFILE', 'apply-candidate-acl-1', 'wan_v4.auto', 0, 0);
INSERT INTO params(realm, k, v, ref_id, disabled) VALUES('VERTO-PROFILE', 'apply-candidate-acl-2', 'rfc1918.auto', 0, 0);
INSERT INTO params(realm, k, v, ref_id, disabled) VALUES('VERTO-PROFILE', 'apply-candidate-acl-3', 'any_v4.auto', 0, 0);
INSERT INTO params(realm, k, v, ref_id, disabled) VALUES('VERTO-PROFILE', 'timer-name', 'soft', 0, 0);
INSERT INTO params(realm, k, v, ref_id, disabled) VALUES('VERTO-PROFILE', 'xui-auth', 'hash', 0, 0);
INSERT INTO params(realm, k, v, ref_id, disabled) VALUES('VERTO-PROFILE', 'options-cross-domain', '*', 0, 0);

INSERT INTO params(realm, k, v, ref_id, disabled) VALUES('VERTO-PROFILE', 'bind-local', '$${local_ip_v4}:$${VERTO_WS_PORT}', 1, 0);
INSERT INTO params(realm, k, v, ref_id, disabled) VALUES('VERTO-PROFILE', 'bind-local-1', '$${local_ip_v4}:$${VERTO_WSS_PORT}:true', 1, 0);
INSERT INTO params(realm, k, v, ref_id, disabled) VALUES('VERTO-PROFILE', 'force-register-domain', '$${domain}', 1, 0);
INSERT INTO params(realm, k, v, ref_id, disabled) VALUES('VERTO-PROFILE', 'secure-combined', '$${certs_dir}/wss.pem', 1, 0);
INSERT INTO params(realm, k, v, ref_id, disabled) VALUES('VERTO-PROFILE', 'secure-chain', '$${certs_dir}/wss.pem', 1, 0);
INSERT INTO params(realm, k, v, ref_id, disabled) VALUES('VERTO-PROFILE', 'userauth', 'true', 1, 0);
INSERT INTO params(realm, k, v, ref_id, disabled) VALUES('VERTO-PROFILE', 'blind-reg', 'false', 1, 0);
INSERT INTO params(realm, k, v, ref_id, disabled) VALUES('VERTO-PROFILE', 'mcast-ip', '224.1.1.1', 1, 0);
INSERT INTO params(realm, k, v, ref_id, disabled) VALUES('VERTO-PROFILE', 'mcast-port', '1337', 1, 0);
INSERT INTO params(realm, k, v, ref_id, disabled) VALUES('VERTO-PROFILE', 'rtp-ip', '$${local_ip_v4}', 1, 0);
INSERT INTO params(realm, k, v, ref_id, disabled) VALUES('VERTO-PROFILE', 'ext-rtp-ip', '$${ext_rtp_ip}', 1, 0);
INSERT INTO params(realm, k, v, ref_id, disabled) VALUES('VERTO-PROFILE', 'local-network', 'localnet.auto', 1, 0);
INSERT INTO params(realm, k, v, ref_id, disabled) VALUES('VERTO-PROFILE', 'outbound-codec-string', 'opus,vp8', 1, 0);
INSERT INTO params(realm, k, v, ref_id, disabled) VALUES('VERTO-PROFILE', 'inbound-codec-string', 'opus,vp8', 1, 0);
INSERT INTO params(realm, k, v, ref_id, disabled) VALUES('VERTO-PROFILE', 'apply-candidate-acl', 'localnet.auto', 1, 0);
INSERT INTO params(realm, k, v, ref_id, disabled) VALUES('VERTO-PROFILE', 'apply-candidate-acl-1', 'wan_v4.auto', 1, 0);
INSERT INTO params(realm, k, v, ref_id, disabled) VALUES('VERTO-PROFILE', 'apply-candidate-acl-2', 'rfc1918.auto', 1, 0);
INSERT INTO params(realm, k, v, ref_id, disabled) VALUES('VERTO-PROFILE', 'apply-candidate-acl-3', 'any_v4.auto', 1, 0);
INSERT INTO params(realm, k, v, ref_id, disabled) VALUES('VERTO-PROFILE', 'timer-name', 'soft', 1, 0);
INSERT INTO params(realm, k, v, ref_id, disabled) VALUES('VERTO-PROFILE', 'xui-auth', 'hash', 1, 0);
INSERT INTO params(realm, k, v, ref_id, disabled) VALUES('VERTO-PROFILE', 'options-cross-domain', '*', 1, 0);

INSERT INTO params(realm, k, v, ref_id, disabled) VALUES('VERTO-PROFILE', 'bind-local', '$${local_ip_v4}:80', 2, 0);
INSERT INTO params(realm, k, v, ref_id, disabled) VALUES('VERTO-PROFILE', 'force-register-domain', '$${domain}', 2, 0);
INSERT INTO params(realm, k, v, ref_id, disabled) VALUES('VERTO-PROFILE', 'secure-combined', '$${certs_dir}/wss.pem', 2, 0);
INSERT INTO params(realm, k, v, ref_id, disabled) VALUES('VERTO-PROFILE', 'secure-chain', '$${certs_dir}/wss.pem', 2, 0);
INSERT INTO params(realm, k, v, ref_id, disabled) VALUES('VERTO-PROFILE', 'userauth', 'true', 2, 0);
INSERT INTO params(realm, k, v, ref_id, disabled) VALUES('VERTO-PROFILE', 'blind-reg', 'false', 2, 0);
INSERT INTO params(realm, k, v, ref_id, disabled) VALUES('VERTO-PROFILE', 'mcast-ip', '224.1.1.1', 2, 0);
INSERT INTO params(realm, k, v, ref_id, disabled) VALUES('VERTO-PROFILE', 'rtp-ip', '$${local_ip_v4}', 2, 0);
INSERT INTO params(realm, k, v, ref_id, disabled) VALUES('VERTO-PROFILE', 'ext-rtp-ip', '$${ext_rtp_ip}', 2, 0);
INSERT INTO params(realm, k, v, ref_id, disabled) VALUES('VERTO-PROFILE', 'local-network', 'localnet.auto', 2, 0);
INSERT INTO params(realm, k, v, ref_id, disabled) VALUES('VERTO-PROFILE', 'outbound-codec-string', 'opus,vp8', 2, 0);
INSERT INTO params(realm, k, v, ref_id, disabled) VALUES('VERTO-PROFILE', 'inbound-codec-string', 'opus,vp8', 2, 0);
INSERT INTO params(realm, k, v, ref_id, disabled) VALUES('VERTO-PROFILE', 'apply-candidate-acl', 'localnet.auto', 2, 0);
INSERT INTO params(realm, k, v, ref_id, disabled) VALUES('VERTO-PROFILE', 'apply-candidate-acl-1', 'wan_v4.auto', 2, 0);
INSERT INTO params(realm, k, v, ref_id, disabled) VALUES('VERTO-PROFILE', 'apply-candidate-acl-2', 'rfc1918.auto', 2, 0);
INSERT INTO params(realm, k, v, ref_id, disabled) VALUES('VERTO-PROFILE', 'apply-candidate-acl-3', 'any_v4.auto', 2, 0);
INSERT INTO params(realm, k, v, ref_id, disabled) VALUES('VERTO-PROFILE', 'timer-name', 'soft', 2, 0);
INSERT INTO params(realm, k, v, ref_id, disabled) VALUES('VERTO-PROFILE', 'xui-auth', 'hash', 2, 0);

UPDATE dicts SET v = '4.0.10' WHERE realm = 'XUI' and k = 'DBVER';
INSERT INTO logs (resource, action, user_id, user_name, summary, message)
	VALUES('XUI', 'UPDATE', 0, 'SYSTEM', '4.0.10', '{"DEVER": "4.0.10"}');

修改后,执行make down关闭服务。

再执行make up重新启动服务,如果想用 nginx 则执行make up-nginx

结语

如果您刚接触 XSwitch,可以先阅读XSwitch 快速入门

如果大家在使用过程中遇到什么问题,可以参考https://xswitch.cn/pages/howto/trouble-shoot/

如果大家对我们的产品有好的意见或建议,欢迎给我们反馈。感谢您使用 XSwitch。

5.0.5