
 Tests with H.323 channel driver for Asterisk
 ============================================


 Introduction
 ------------
 
 The main configuration, the H.323 channel driver
 has been tested with, is described in this section.
 Also, some configuration parameters, which are important
 for the correct operation of the H.323 channel driver,
 are covered here.

 
 Configuration of H.323 channel driver
 -------------------------------------
 
 For proper operation of the H.323 channel driver inside
 Asterisk, there must be a gatekeeper in the local
 zone. The gatekeeper is used, basically, for terminal
 registration and translation between symbolic aliases
 and IP addresses. In our tests we have used the gatekeeper
 which is decribed in the README file (OpenH323 Gatekeeper).
 The channel driver can register several aliases in
 the gatekeeper. When a H.323 terminal calls one of these
 aliases, the call is forwarded to the host where Asterisk
 is running. The call is then routed inside Asterisk
 according to its "called address". For example, if the 
 terminal 111 is calling 666 (a registered alias of 
 Asterisk), then the call will be directed to Asterisk
 and the entry point of it, inside the "extensions.conf"
 file, will be the one, in the context of H323 calls
 (see "oh323.conf" file), which matches the extension 666
 or something equivalent (like _6XX). 

 For more details check the portions of files "oh323.conf"
 and "extensions.conf" shown below.
 

 file: oh323.conf
...
;
; Set the context of H323 calls
;
context=voip-h323
...
;
; Specify alias(es) of this host.
; It may be used multiple times.
;
alias=ASTERISK
alias=asterisk
alias=662
alias=663
alias=665
alias=666
...
;
; Specify prefix(es) of our gateway.
; It may be used multiple times.
;
gwprefix=00
gwprefix=01
gwprefix=06
...


file: extensions.conf
...
[default]
...
; All 4-digit numbers starting with 9 are outgoing
; H.323 calls. The leading 9 is removed before dialing
; the number.
exten => _9XXX,1,StripMSD,1
exten => _XXX,2,Dial,OH323/${EXTEN}
...
;******************************************
;*                                        *
;*  H.323 incoming calls are routed here  *
;*                                        *
;******************************************
[voip-h323]
;************************************
; Common stuff for all the extensions
;************************************
;exten => s,1,Dial,OH323/192.168.1.222
;exten => s,1,Dial,OH323/server.inaccessnetworks.com
;exten => s,1,Dial,OH323/anotherserver
;--- Entry point of this extension
exten => s,1,Goto,i|1
;--- Extension for timeout
exten => t,1,Playback,demo-thanks
exten => t,2,Hangup
;--- Extension for invalid entries
exten => i,1,Playback,pbx-invalid

;***************************************
; Handle our registered H.323 aliases
;***************************************
;--- We have register to the local gatekeeper a set of
;    3-digit numbers/aliases starting with digit 6.
;    We route all the valid H323 numbers to internal extensions
exten => _6XX,1,StripMSD,1
exten => _XX,2,Goto,${EXTEN}|3
;--- [alias = 666]
exten => 66,3,Wait,2
exten => 66,4,Dial,Phone/phone0
exten => 66,5,Hangup
;--- [alias = 665]
exten => 65,3,Wait,2
exten => 65,4,Dial,OH323/65
exten => 65,5,Hangup
;--- [alias = 663]
exten => 63,3,Wait,2
exten => 63,4,Answer
exten => 63,5,MP3Player,/var/lib/asterisk/sounds/ram.mp3
;--- [alias = 662]
exten => 62,3,Wait,2
exten => 62,4,Playback,lala
exten => 62,5,Hangup
;--- [alias = 661]
exten => 61,3,Wait,2
exten => 61,4,BackGround,demo-instruct
;--- [alias = 660]
exten => 60,3,Playback,demo-echotest	; Let them know what's going on
exten => 60,4,Echo						; Do the echo test
exten => 60,5,Playback,demo-echodone	; Let them know it's over
exten => 60,6,Hangup
;*******************************************
; Handle our registered H.323 G/W prefixes 
;*******************************************
;--- [Prefix = 06]
exten => _06XXX,1,StripMSD,2
exten => _XXX,2,Goto,BYEXTENSION|3
exten => 666,3,Wait,2
exten => 666,4,Playback,lala
exten => 665,3,Wait,1
exten => 665,4,Dial,Phone/phone0|5
exten => 665,5,Voicemail,665
exten => 665,105,Voicemail,665
;exten => 665,3,Voicemail,u665
exten => 664,3,Wait,2
exten => 664,4,Playback,test
;--- [Prefix = 01]
exten => _01X,1,StripMSD,2
exten => _X,2,Goto,BYEXTENSION|3
exten => 1,3,Wait,2
exten => 1,4,Dial,OH323/192.168.1.31
exten => 2,3,Wait,2
exten => 2,4,Dial,OH323/ocean.priv.inaccessnetworks.com
...


 Testing...
 ----------

 With the configuration described above, we run ASTERISK.
 We, also, start Netmeeting on several PCs and ohphone on PCs
 with Quicknet Linejack/Phonecard cards. On the PC running
 ASTERISK, we also have a Quicknet Linejack controlled by the
 pbx as the extension "phone0". We register the H.323 clients
 with the aliases 111 (Netmeeting1), 112 (Ohphone1), 113 (Ohphone2).

 NOTE: In the list of available codecs of Netmeeting, the
 G.711 Alaw has been selected as the preferred codec.

 Now we can call from any H.323 client (PCs with Netmeeting,
 PCs with Ohphone/Openphone) any registered H.323 alias of ASTERISK,
 for example, calling client 666, the phone "phone0" of ASTERISK
 will ring, calling client 662, we will hear a recorded message,
 and so on. We can also call any of the registered H.323 clients
 (111, 112, 113) from the internal extension "phone0" of ASTERISK,
 just by dialing 9111 or 9112 or 9113.

 Results from further tests and any feedback or patches or
 enhancements are welcome.


 Michalis Manousos

 inAccess Networks S.A.
 www.inaccessnetworks.com


