VoIP: (05.09) Thiết lập Dialplan Incoming tiếp nhận cuộc gọi tới trên FreeSwitch v1.6

By , 0 View

Mục tiêu thực hành:
- Cấu hình Public Inbound DID trên FreeSwitch v.1.6.
- Hiệu chỉnh ACL trên FreeSwitch v1.6 cho phép tiếp nhận cuộc gọi từ VoiceGateway.
- Thiết lập định tuyến cuộc gọi Dial Peer trên Cisco VoiceGateway.

Các bước triển khai:
Cấu hình Public Inbound DID trên FreeSwitch v.1.6.
- Thiết lập chuyển tiếp cuộc gọi tới DID Number (1001) cho Internal Extension (1001).
vi /usr/local/freeswitch/conf/dialplan/public/01_inbound_did.xml

<include>
    <extension name="1001_did">
        <condition field="destination_number" expression="^(1001)$">
           <action application="transfer" data="1001 XML default"/>
        </condition>
    </extension>
</include>

- Thiết lập chuyển tiếp cuộc gọi tới DID Number (5551212) cho Internal Extension (1000).
vi /usr/local/freeswitch/conf/dialplan/public/00_inbound_did.xml

<include>
  <extension name="public_did">
    <condition field="destination_number" expression="^(5551212)$">
      <!--
          If you're hosting multiple domains you will want to set the
          target_domain on these calls so they hit the proper domain after you
          transfer the caller into the default context.

          $${domain} is the default domain set from vars.xml but you can set it
          to any domain you have setup in your user directory.

      -->
      <action application="set" data="domain_name=$${domain}"/>
      <!-- This example maps the DID 5551212 to ring 1000 in the default context -->
      <action application="transfer" data="1000 XML default"/>
    </condition>
  </extension>
</include>

- Tiến hành reloadxml trên FreeSwitch.
[root@localhost ~]# fs_cli –r
freeswitch@localhost.localdomain> reloadxml

Hiệu chỉnh ACL trên FreeSwitch v1.6 cho phép tiếp nhận cuộc gọi từ VoiceGateway.
- Khai báo địa chỉ IP của VoiceGateway vào danh sách ACL trên FreeSwitch.
vi /usr/local/freeswitch/conf/autoload_configs/acl.conf.xml

<configuration name="acl.conf" description="Network Lists">
  <network-lists>
    <!--
         These ACL's are automatically created on startup.

         rfc1918.auto  - RFC1918 Space
         nat.auto      - RFC1918 Excluding your local lan.
         localnet.auto - ACL for your local lan.
         loopback.auto - ACL for your local lan.
    -->

    <list name="lan" default="allow">
      <node type="deny" cidr="192.168.42.0/24"/>
      <node type="allow" cidr="192.168.42.42/32"/>
    </list>

    <!--
        This will traverse the directory adding all users
        with the cidr= tag to this ACL, when this ACL matches
        the users variables and params apply as if they
        digest authenticated.
    -->
    <list name="domains" default="deny">
      <!-- domain= is special it scans the domain from the directory to build the ACL -->
      <node type="allow" domain="$${domain}"/>
      <!-- use cidr= if you wish to allow ip ranges to this domains acl. -->
      <!-- <node type="allow" cidr="192.168.0.0/24"/> -->
      <node type="allow" cidr="10.10.10.0/24"/>
    </list>

  </network-lists>
</configuration>

- Tiến hành reloadxml trên FreeSwitch.
[root@localhost ~]# fs_cli –r
freeswitch@localhost.localdomain> reloadxml

Thiết lập định tuyến cuộc gọi Dial Peer trên Cisco VoiceGateway.
voice class codec 2
 codec preference 1 g711ulaw
 codec preference 2 g711alaw
 exit

dial-peer voice 42 voip 
  destination-pattern 100[0-9]
  session protocol sipv2
  session target ipv4:10.10.10.188
  dtmf-relay sip-notify
  session transport udp
  voice-class codec 2
  exit
dial-peer voice 43 voip 
  destination-pattern 5551212
  session protocol sipv2
  session target ipv4:10.10.10.188
  dtmf-relay sip-notify
  session transport udp
  voice-class codec 2
  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.

You Might Also Like

0 comments