Mục tiêu thực hành:
- Khởi tạo tài khoản SIP Phone bằng Perl Script trên FreeSwitch v1.6.
- Định nghĩa dải Extension Number được phép register tới FreeSwitch v1.6.
- Thiết lập 3CX Softphone tiến hành register tới FreeSwitch v1.6.
- Thay đổi mật khẩu login cho tài khoản SIP Phone trên FreeSwitch v1.6.
Các bước triển khai:
Khởi tạo tài khoản SIP Phone bằng Perl Script trên FreeSwitch v1.6.
[root@static ~]# /usr/src/freeswitch-1.6.20/scripts/perl/add_user 1020Added 1020 in file /usr/local/freeswitch/conf/directory/default/1020.xmlOperation 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@static ~]#
[root@static ~]# cat /usr/local/freeswitch/conf/directory/default/1020.xml<include><user id="1020"><params><param name="password" value="$${default_password}"/><param name="vm-password" value="1020"/></params><variables><variable name="toll_allow" value="domestic,international,local"/><variable name="accountcode" value="1020"/><variable name="user_context" value="default"/><variable name="effective_caller_id_name" value="Extension 1020"/><variable name="effective_caller_id_number" value="1020"/><variable name="outbound_caller_id_name" value="$${outbound_caller_name}"/><variable name="outbound_caller_id_number" value="$${outbound_caller_id}"/><variable name="callgroup" value="techsupport"/></variables></user></include>[root@static ~]#
Định nghĩa dải Extension Number được phép register tới FreeSwitch v1.6.
cat /usr/local/freeswitch/conf/dialplan/default.xml
...<extension name="Local_Extension"><condition field="destination_number" expression="^(10[01][0-9])$"><action application="export" data="dialed_extension=$1"/><!-- bind_meta_app can have these args <key> [a|b|ab] [a|b|o|s] <app> --><action application="bind_meta_app" data="1 b s execute_extension::dx XML features"/><action application="bind_meta_app" data="2 b s record_session::$${recordings_dir}/${caller_id_number}.${strftime(%Y-%m-%d-%H-%M-%S)}.wav"/>...
vi /usr/local/freeswitch/conf/dialplan/default.xml
...<extension name="Local_Extension"><condition field="destination_number" expression="^(10[012][0-9])$"><action application="export" data="dialed_extension=$1"/><!-- bind_meta_app can have these args <key> [a|b|ab] [a|b|o|s] <app> --><action application="bind_meta_app" data="1 b s execute_extension::dx XML features"/><action application="bind_meta_app" data="2 b s record_session::$${recordings_dir}/${caller_id_number}.${strftime(%Y-%m-%d-%H-%M-%S)}.wav"/>...
[root@static ~]# fs_cli –rfreeswitch@static.vnpt.vn> reloadxml+OK [Success]2021-04-22 22:10:02.131774 [INFO] mod_enum.c:879 ENUM Reloaded2021-04-22 22:10:02.131774 [INFO] switch_time.c:1423 Timezone reloaded 1750 definitionsfreeswitch@static.vnpt.vn> /exit
Thiết lập 3CX Softphone tiến hành register tới FreeSwitch v1.6.
- Khai báo Password Default là 1234.
- Kiểm tra trạng thái Register Status của SIP Phone trên FreeSwitch.
[root@localhost ~]# fs_cli –rfreeswitch@static.vnpt.vn> show registrationsreg_user,realm,token,url,expires,network_ip,network_port,network_proto,hostname,metadata1020,10.10.10.188,NzJiNDU4ZTIxMjQyZDg0MzQ1ZWQ3YWE4OTQ5ZDk0NDQ.,sofia/internal/sip:1020@10.10.10.25:60597;rinstance=77776111f56fa5e1,1619144214,10.10.10.25,60597,udp,static.vnpt.vn,1 total.freeswitch@static.vnpt.vn> /exit
Thay đổi mật khẩu login cho tài khoản SIP Phone trên FreeSwitch v1.6.
[root@static ~]# cat /usr/local/freeswitch/conf/directory/default/1020.xml<include><user id="1020"><params><param name="password" value="$${default_password}"/><param name="vm-password" value="1020"/></params>...
vi /usr/local/freeswitch/conf/directory/default/1020.xml
<include><user id="1020"><params><param name="password" value="1020"/><param name="vm-password" value="1020"/></params>...
[root@static ~]# fs_cli –rfreeswitch@static.vnpt.vn> reloadxmlfreeswitch@static.vnpt.vn> /exit
Tham khảo các Videos lý thuyết CCNA Voice (Collaboration) trước khi tham khảo các bài hướng dẫn thực hành VoIP. Mọi thắc mắc, các bạn vui lòng liên lạc với mình thông qua kênh Zalo (Jade Bùi) 076.877.2021.
0 comments