วิธีการคอมไพลให้ Asterisk รองรับ H.323

Asterisk Opensource IP Pbx

วิธีการคอมไพลให้ Asterisk รองรับ H.323

โพสต์โดย voip4share » 03 ม.ค. 2010 15:46

การคอมไพล์ Asterisk ให้รองรับ H.323 มีขั้นตอนดังต่อไปนี้

1. สร้างไฟล์ complier.h เพื่อให้คอมไพล์ openh323 ผ่าน

โค้ด: เลือกทั้งหมด
vi /usr/include/linux/compiler.h


ใส่ข้อมูลต่อไปนี้

#ifndef __LINUX_COMPILER_H
#define __LINUX_COMPILER_H
#define likely(x) __builtin_expect((x),1)
#define unlikely(x) __builtin_expect((x),0)
#endif /* __LINUX_COMPILER_H */


เซฟไฟล์แล้วออกจากโปรแกรม

2. ติดตั้ง pwlib

โค้ด: เลือกทั้งหมด
cd /tmp
wget http://sourceforge.net/projects/openh323/files/pwlib/1.10.3/pwlib-v1_10_3-src-tar.gz/download
tar xzvf pwlib-v1_10_3-src-tar.gz -C /usr/src
cd /usr/src/pwlib_v1_10_3
./configure --prefix=/usr --exec-prefix=/usr --localstatedir=/var --sysconfdir=/etc
make optshared
make install

บางเว็บไซต์บอกว่าไม่ต้อง make install แต่ผมแนะนำให้ make install ครับ

3. ติดตั้ง openh323

โค้ด: เลือกทั้งหมด
cd /tmp
wget http://sourceforge.net/projects/openh323/files/openh323/1.18.0/openh323-v1_18_0-src-tar.gz/download
wget http://www.voxgratia.org/releases/openh323-v1_18_0-src-tar.gz
tar xzvf openh323-v1_18_0-src-tar.gz -C /usr/src
cd /usr/src/openh323-v1_18_0

export PWLIBDIR=/usr/src/pwlib_v1_10_3
export OPENH323DIR=/usr/src/openh323_v1_18_0
export LD_LIBRARY_PATH=$PWLIBDIR/lib:$OPENH323DIR/lib

./configure --prefix=/usr --exec-prefix=/usr --localstatedir=/var --sysconfdir=/etc --with-net-snmp
make optshared
make install

cd lib
cp libh323_linux_x86_r.so.1.18.0 /usr/lib


4. คอมไพล์ Asterisk
4.1 คอมไพล์ สมมติว่าเป็น Asterisk เวอร์ชั่น 1.6.1.6 นะครับ
โค้ด: เลือกทั้งหมด
cd /usr/src/asterisk-1.6.1.6
export PWLIBDIR=/usr/src/pwlib_v1_10_3
export OPENH323DIR=/usr/src/openh323_v1_18_0
export LD_LIBRARY_PATH=$PWLIBDIR/lib:$OPENH323DIR/lib

./configure --prefix=/usr --exec-prefix=/usr --sysconfdir=/etc --localstatedir=/var
make menuselect


เลื่อนปุ่มลูกศรมาที่ "Channel Dreivers" แล้วกด Enter
asterisk-h323-make-menuselect.png
Asterisk Make Menu Select
asterisk-h323-make-menuselect.png (9.48 KiB) เปิดดู 4963 ครั้ง

ดูที่ "chan_h323" จะมี * อยู่ด้านหน้า ถ้าไม่มีให้เลื่อนปุ่มลูกศรมา เคาะปุ่ม Spacebar (เว้นวรรค) 1 ครั้ง
asterisk-h323-select-h323.png
Asterisk H.323 Channel
asterisk-h323-select-h323.png (9.1 KiB) เปิดดู 4963 ครั้ง

กดปุ่ม esc แล้วกดปุ่ม s เพื่อบันทึก
โค้ด: เลือกทั้งหมด
make
make install

ถ้าเป็นการติดตั้งเพิ่มเติม ไม่ต้อง make sampels นะครับ

4.2 ก๊อบไฟล์คอนฟิก h323.conf ไปไว้ที่ /etc/asterisk
เฉพาะการติดตั้งเพิ่มเติมนะครับ
โค้ด: เลือกทั้งหมด
cd /usr/src/asterisk-1.6.1.6/configs
cp h323.conf.sample /etc/asterisk/h323.conf


5. รีสตาร์ท Asterisk

6. ไฟล์คอนฟิก H.323
ไฟล์ /etc/asterisk/h323.conf

; The NuFone Network's
; Open H.323 driver configuration
;
[general]
port = 1720
;bindaddr = 1.2.3.4 ; this SHALL contain a single, valid IP address for this machine
;
; See qos.tex or Quality of Service section of asterisk.pdf for a description of these parameters.
;tos_audio=ef ; Sets TOS for RTP audio packets.
;cos_audio=5 ; Sets 802.1p priority for RTP audio packets.
;
; You may specify a global default AMA flag for iaxtel calls. It must be
; one of 'default', 'omit', 'billing', or 'documentation'. These flags
; are used in the generation of call detail records.
;
;amaflags = default
;
; You may specify a default account for Call Detail Records in addition
; to specifying on a per-user basis
;
;accountcode=lss0101
;
; You can fine tune codecs here using "allow" and "disallow" clauses
; with specific codecs. Use "all" to represent all formats.
;
;disallow=all
;allow=all ; turns on all installed codecs
;disallow=g723.1 ; Hm... Proprietary, don't use it...
;allow=gsm ; Always allow GSM, it's cool :)
;allow=ulaw ; see doc/rtp-packetization for framing options
;
; User-Input Mode (DTMF)
;
; valid entries are: rfc2833, inband, cisco, h245-signal
; default is rfc2833
;dtmfmode=rfc2833
;
; Default RTP Payload to send RFC2833 DTMF on. This is used to
; interoperate with broken gateways which cannot successfully
; negotiate a RFC2833 payload type in the TerminalCapabilitySet.
; To specify required payload type, put it after colon in dtmfmode
; option like
;dtmfmode=rfc2833:101
; or
;dtmfmode=cisco:121
;
; Set the gatekeeper
; DISCOVER - Find the Gk address using multicast
; DISABLE - Disable the use of a GK
; <IP address> or <Host name> - The acutal IP address or hostname of your GK
;gatekeeper = DISABLE
;
;
; Tell Asterisk whether or not to accept Gatekeeper
; routed calls or not. Normally this should always
; be set to yes, unless you want to have finer control
; over which users are allowed access to Asterisk.
; Default: YES
;
;AllowGKRouted = yes
;
; When the channel works without gatekeeper, there is possible to
; reject calls from anonymous (not listed in users) callers.
; Default is to allow anonymous calls.
;
;AcceptAnonymous = yes
;
; Optionally you can determine a user by Source IP versus its H.323 alias.
; Default behavour is to determine user by H.323 alias.
;
;UserByAlias=no
;
; Default context gets used in siutations where you are using
; the GK routed model or no type=user was found. This gives you
; the ability to either play an invalid message or to simply not
; use user authentication at all.
;
;context=default
;
; Use this option to help Cisco (or other) gateways to setup backward voice
; path to pass inband tones to calling user (see, for example,
; http://www.cisco.com/warp/public/788/voip/ringback.html)
;
; Add PROGRESS information element to SETUP message sent on outbound calls
; to notify about required backward voice path. Valid values are:
; 0 - don't add PROGRESS information element (default);
; 1 - call is not end-end ISDN, further call progress information can
; possibly be available in-band;
; 3 - origination address is non-ISDN (Cisco accepts this value only);
; 8 - in-band information or an appropriate pattern is now available;
;progress_setup = 3
;
; Add PROGRESS information element (IE) to ALERT message sent on incoming
; calls to notify about required backwared voice path. Valid values are:
; 0 - don't add PROGRESS IE (default);
; 8 - in-band information or an appropriate pattern is now available;
;progress_alert = 8
;
; Generate PROGRESS message when H.323 audio path has established to create
; backward audio path at other end of a call.
;progress_audio = yes
;
; Specify how to inject non-standard information into H.323 messages. When
; the channel receives messages with tunneled information, it automatically
; enables the same option for all further outgoing messages independedly on
; options has been set by the configuration. This behavior is required, for
; example, for Cisco CallManager when Q.SIG tunneling is enabled for a
; gateway where Asterisk lives.
; The option can be used multiple times, one option per line.
;tunneling=none ; Totally disable tunneling (default)
;tunneling=cisco ; Enable Cisco-specific tunneling
;tunneling=qsig ; Enable tunneling via Q.SIG messages
;
; Specify how to pass hold notification to remote party. Default is to
; use H.450.4 supplementary service message.
;hold=none ; Do not pass hold/retrieve notifications
;hold=notify ; Use H.225 NOTIFY message
;hold=q931only ; Use stripped H.225 NOTIFY message (Q.931 part
; ; only, usable for Cisco CallManager)
;hold=h450 ; Pass notification as H.450.4 supplementary
; ; service
;
;------------------------------ JITTER BUFFER CONFIGURATION --------------------------
; jbenable = yes ; Enables the use of a jitterbuffer on the receiving side of a
; H323 channel. Defaults to "no". An enabled jitterbuffer will
; be used only if the sending side can create and the receiving
; side can not accept jitter. The H323 channel can accept jitter,
; thus an enabled jitterbuffer on the receive H323 side will only
; be used if the sending side can create jitter and jbforce is
; also set to yes.

; jbforce = no ; Forces the use of a jitterbuffer on the receive side of a H323
; channel. Defaults to "no".

; jbmaxsize = 200 ; Max length of the jitterbuffer in milliseconds.

; jbresyncthreshold = 1000 ; Jump in the frame timestamps over which the jitterbuffer is
; resynchronized. Useful to improve the quality of the voice, with
; big jumps in/broken timestamps, usualy sent from exotic devices
; and programs. Defaults to 1000.

; jbimpl = fixed ; Jitterbuffer implementation, used on the receiving side of a H323
; channel. Two implementations are currenlty available - "fixed"
; (with size always equals to jbmax-size) and "adaptive" (with
; variable size, actually the new jb of IAX2). Defaults to fixed.

; jblog = no ; Enables jitterbuffer frame logging. Defaults to "no".
;-----------------------------------------------------------------------------------
;
; H.323 Alias definitions
;
; Type 'h323' will register aliases to the endpoint
; and Gatekeeper, if there is one.
;
; Example: if someone calls time@your.asterisk.box.com
; Asterisk will send the call to the extension 'time'
; in the context default
;
; [default]
; exten => time,1,Answer
; exten => time,2,Playback,current-time
;
; Keyword's 'prefix' and 'e164' are only make sense when
; used with a gatekeeper. You can specify either a prefix
; or E.164 this endpoint is responsible for terminating.
;
; Example: The H.323 alias 'det-gw' will tell the gatekeeper
; to route any call with the prefix 1248 to this alias. Keyword
; e164 is used when you want to specifiy a full telephone
; number. So a call to the number 18102341212 would be
; routed to the H.323 alias 'time'.
;
;[time]
;type=h323
;e164=18102341212
;context=default
;
;[det-gw]
;type=h323
;prefix=1248,1313
;context=detroit
;
;
; Inbound H.323 calls from BillyBob would land in the incoming
; context with a maximum of 4 concurrent incoming calls
;
;
; Note: If keyword 'incominglimit' are omitted Asterisk will not
; enforce any maximum number of concurrent calls.
;
;[BillyBob]
;type=user
;host=192.168.1.1
;context=incoming
;incominglimit=4
;h245Tunneling=no
;
;
; Outbound H.323 call to Larry using SlowStart
;
;[Larry]
;type=peer
;host=192.168.2.1
;fastStart=no


เทคนิคการติดตั้ง Asterisk 16.x + DAHDI 2.11.1 บน CentOS 7
เทคนิคการติดตั้ง Asterisk 15.x + DAHDI 2.11.1 บน CentOS 7
voip4share
Administrator
 
โพสต์: 656
ลงทะเบียนเมื่อ: 18 พ.ย. 2009 11:26
ที่อยู่: รามคำแหง กรุงเทพฯ

ย้อนกลับไปยัง Asterisk SIP Server

ผู้ใช้งานขณะนี้

่กำลังดูบอร์ดนี้: ไม่มีสมาชิกใหม่ และ บุคคลทั่วไป 1 ท่าน

cron