13-FreeSwitch-批量创建用户
原创
©著作权归作者所有:来自51CTO博客作者杨虎成博客的原创作品,请联系作者获取转载授权,否则将追究法律责任
文章目录
- 1.1方法一:使用命令:使用sed的s将1000换成1020然后重定向输出
- 1.2方法二:使用shell脚本
- 1.3方法三:使用自带脚本添加一个1026
- 1.3.1放在默认位置
- 1.3.2 放在指定位置放在指定文件夹下的directory的domain指定的文件夹下
- 1.3.3放在批量操作--users 范围 范围
- 2.生效 F6( reloadxml) 重新加载或者重启freeswitch就可以了
一.批量创建用户
1.1方法一:使用命令:使用sed的s将1000换成1020然后重定向输出
sed -e "/1000/1020" 1000.xml >1020
1.2方法二:使用shell脚本
for i in `seq 1020 1039`; do sed -e "s/1000/$i/" 1000.xml >$i.xml ; done
1.3方法三:使用自带脚本添加一个1026
在Freeswitch源代码下/usr/local/freeswitch-1.6/scripts/perl
1.3.1放在默认位置
[root@luckYang ~]# cd /usr/local/freeswitch-1.6/scripts/perl
[root@luckYang /usr/local/freeswitch-1.6/scripts/perl]# ./add_user 1026
Added 1026 in file /usr/local/freeswitch/conf/directory/default/1026.xml
Operation complete. 1 user added.
Be sure to reloadxml.
If CPAN module Regexp::Assemble were installed this program would be able to suggest a regex for your new users.
[root@luckYang /usr/local/freeswitch-1.6/scripts/perl]#
1.3.2 放在指定位置放在指定文件夹下的directory的domain指定的文件夹下
./add_user 1027 --domain=my_domain --confpath=/usr/local/freeswitch/conf
1.3.3放在批量操作–users 范围 范围
./add_user --users=1020-1039
2.生效 F6( reloadxml) 重新加载或者重启freeswitch就可以了