ซื้อสินค้า VoIP คลิกไปที่ https://www.lazada.co.th/shop/adventek/

Tested on Debian 8 + Asterisk 11

1. G.729 Codec

G.729 Codec เป็นมาตรฐานการบีบอัดเสียงที่นิยมในระบบ VoIP เพราะใช้ bandwidth ต่ำ คือ 8 kbps ในขณะที่ G.711 ใช้ 64 kbps อย่างไรก็ตามเมื่อเราติดตั้ง Asterisk, Elastix หรือ trixbox ce จะไม่มี G.729 Codec   เราจะต้อง download จากเน็ตมาติดตั้งเพิ่มเติม

2. ติดตั้ง G.729 Codec

ขั้นแรกต้องตรวจสอบ version ของ Asterisk และชนิดของ CPU

ใช้คำสั่ง asterisk -r เพื่อตรวจสอบ version ของ Asterisk

=========================================================================

root@debian:~# asterisk -r
Asterisk 11.13.1~dfsg-2+deb8u3, Copyright (C) 1999 - 2013 Digium, Inc. and others.
Created by Mark Spencer <This email address is being protected from spambots. You need JavaScript enabled to view it.>
Asterisk comes with ABSOLUTELY NO WARRANTY; type 'core show warranty' for details.
This is free software, with components licensed under the GNU General Public
License version 2 and other licenses; you are welcome to redistribute it under
certain conditions. Type 'core show license' for details.
=========================================================================
Connected to Asterisk 11.13.1~dfsg-2+deb8u3 currently running on debian (pid = 793)
debian*CLI>

=========================================================================

ปรากฏว่าเป็น version 11.13.1

ใช้คำสั่ง cat /proc/cpuinfo เพื่อตรวจสอบชนิดของ CPU

=========================================================================

root@debian:~# cat /proc/cpuinfo
processor       : 0
vendor_id       : GenuineIntel
cpu family      : 6
model           : 22
model name      : Intel(R) Celeron(R) CPU          430  @ 1.80GHz
stepping        : 1
microcode       : 0x38
cpu MHz         : 1795.022
cache size      : 512 KB

=========================================================================

ปรากฏว่าเป็น Intel Celeron

download G.729 Codec binary จาก  http://asterisk.hosting.lv/

โดยเลือกให้ตรงกับ version ของ Asterisk และ ชนิดของ CPU

เนื่องจาก HW และ OS ที่ใช้งานเป็น X86_64 ดังนั้นเลือก Codec ที่ใกล้เคียงที่สุด คือ

codec_g729-ast110-gcc4-glibc-x86_64-pentium4.so

เปลี่ยนชื่อเป็น codec_g729.so แล้ว copy ไปไว้ที่ /usr/lib/asterisk/modules/

เปลี่ยน permission

# chmod 755 codec_g729.so

โหลด module codec_g729.so ดังนี้

elastix*CLI> module load codec_g729.so

ตรวจสอบว่า module codec_g729.so ติดตั้งเรียบร้อยแล้ว

=========================================================================

elastix*CLI> core show translation
         Translation times between formats (in milliseconds) for one second of data
          Source Format (Rows) Destination Format (Columns)

          g723 gsm ulaw alaw g726aal2 adpcm slin lpc10 g729 speex ilbc g726 g722
     g723    -   -    -    -        -     -    -     -    -     -    -    -    -
      gsm    -   -    2    2        2     2    1     2    7     8    -    2    2
     ulaw    -   2    -    1        2     2    1     2    7     8    -    2    2
     alaw    -   2    1    -        2     2    1     2    7     8    -    2    2
    g726aal2    -   9    9    9        -     9    8     9   14    15    -    9    9
    adpcm    -   2    2    2        2     -    1     2    7     8    -    2    2
     slin    -   1    1    1        1     1    -     1    6     7    -    1    1
    lpc10    -   2    2    2        2     2    1     -    7     8    -    2    2
     g729    -   3    3    3        3     3    2     3    -     9    -    3    3
    speex    -   2    2    2        2     2    1     2    7     -    -    2    2
     ilbc    -   -    -    -        -     -    -     -    -     -    -    -    -
     g726    -   2    2    2        2     2    1     2    7     8    -    -    2
     g722    -   2    2    2        2     2    1     2    7     8    -    2    -
elastix*CLI>

=========================================================================

ระบบจะแสดง translation time ระหว่าง codec g729 และ codecs อื่นๆ แสดงว่า g729 พร้อมใช้งานแล้ว

3. ขั้นตอนสุดท้าย 

ให้กำหนดใน PBX -> PBX Configuration -> Extensions

          disallow = all

          allow=g729

เป็นการกำหนดให้ extensions นั้นใช้ Codec G.729 อย่าลืม IP Phone หรือ Softphone ที่ต่ออยู่ต้องสนับสนุน Codec G.729 ด้วย