Configuring Asterisk for H323 calls

i am trying to configure ekiga softphone with asterisk 1.4.15 using H323 protocol.
i m getting error at ekiga saying:
“Gatekeeper request failed(Bad username/password)”

im newbie… plz tell me what im missing or doing wrong.??sending the contents of reqd files.Also there are two configuration files for h323, namely h323.conf and ooh323.conf , however their contents are same…but which one to use??

[code];Contents of H323.conf are
[general]
register => 2222:2222@H323/2222; here 2222:2222 are username and password
register => 2222:2222@00H323/2222
register => 1234:1234@OOH323/1234
register => 1234:1234@H323/1234
register => 1235:1235@OOH323/1235
register => 1235:1235@H323/1235

listenAddress=10.XXX.XX.XXX
listenPort = 1720
tcpStart=10000
tcpEnd=20000
udpStart=1000
udpEnd=2000
connectPort=1720
fastStart=yes
h245Tunneling=yes
h245inSetup=yes
inBandDTMF=no
silenceSuppression=no
jitterMin=20
jitterMax=100
ipTos=none
outboundMax=600
inboundMax=600
libLogLevel=0
libLogFile=stddout
;simultaneousMax=10
wrapLibTraceLevel=0
libTraceLevel=0
libTraceFile=/tmp/h323.log
;
;gatekeeper = DISABLE
gatekeeper = 10.XXX.XX.XXX

[2222]
alias=abc
type=user
secret=2222
qualify=yes
nat=no
host=dynamic
canreinvite=no
context=home
insecure=invite
;port=5061 ; Uncomment this line if Ekiga and Asterisk
; are on the same host

[1234]
alias=abc
type=peer
secret=1234
qualify=yes
nat=no
host=dynamic
canreinvite=no
context=home
insecure=invite
;port=5061

[1235]
alias=xyz
type=peer
secret=1235
qualify=yes
nat=no
host=dynamic
canreinvite=no
context=home
insecure=invite
port=5061 ; Uncomment this line if Ekiga and Asterisk
; are on the same host
[/code]

[code];contents of extensions.conf

[home]
exten => 2222,1,Dial(H323/2222)
exten => 2222,1,Dial,OOH323/2222
exten => 1234,1,Dial(H323/1234)
exten => 1234,1,Dial,OOH323/1234
exten => 1235,1,Dial(H323/1235)
exten => 1235,1,Dial,OOH323/1235
[/code]

[code];contents of users.conf(automatically generated by asterisk GUI)

[general]
; Full name of a user
fullname = New User
; Starting point of allocation of extensions
userbase = 6000
;
; Create voicemail mailbox and use use macro-stdexten
;
hasvoicemail = yes
;
; Set voicemail mailbox 6000 password to 1234
;
vmsecret = 1234
;
; Create SIP Peer
;
hassip = yes
;
; Create IAX friend
;
hasiax = yes
;
; Create H.323 friend
hash323 = yes

; Create manager entry
hasmanager = no
;
; Remaining options are not specific to users.conf entries but are general.
callwaiting = yes
threewaycalling = yes
callwaitingcallerid = yes
transfer = yes
canpark = yes
cancallforward = yes
callreturn = yes
callgroup = 1
pickupgroup = 1
localextenlength = 4

[1234]
callwaiting = yes
cid_number = 1234
email = lal@wipro.com
fullname = abc
hasagent = yes
hasdirectory = no
hasiax = yes
hasmanager = yes
hassip = yes
hasvoicemail = yes
deletevoicemail = no
host = dynamic
mailbox = 1234
secret = 1234
threewaycalling = yes
vmsecret = 1234
registeriax = yes
registersip = yes
canreinvite = yes
nat = no
dtmfmode = rfc2833
disallow = all
allow = all

[1235]
callwaiting = yes
cid_number = 1235
email = praja@wipro.com
fullname = xyz
hasagent = yes
hasdirectory = no
hasiax = yes
hasmanager = yes
hassip = yes
hasvoicemail = yes
deletevoicemail = no
host = dynamic
mailbox = 1235
secret = 1235
threewaycalling = yes
vmsecret = 1235
registeriax = yes
registersip = yes
canreinvite = yes
nat = no
dtmfmode = rfc2833
disallow = all
allow = all

[2222]
callwaiting = yes
email = abc.pqr
fullname = abc
hasagent = yes
hasdirectory = no
hasiax = yes
hasmanager = yes
hassip = yes
hasvoicemail = yes
deletevoicemail = no
host = dynamic
mailbox = 2222
secret = 2222
threewaycalling = yes
vmsecret = 2222
registeriax = yes
registersip = yes
canreinvite = yes
nat = no
dtmfmode = rfc2833
disallow = all
allow = all[/code]

plz help me out…what m missing??

There are several H323 modules in asterisk. ooh323 comes with asterisk add ons and h323 comes in the asterisk directory. ooh323 has worked better for me how ever it has crashed my server’s under heavy usage (IMHO H323 support in asterisk is very poor).

In your configuration you seem to be trying to register to a peer called h323 which does not exist.

;Contents of H323.conf are
[general]
register => 2222:2222@H323/2222; here 2222:2222 are username and password
register => 2222:2222@00H323/2222
register => 1234:1234@OOH323/1234
register => 1234:1234@H323/1234
register => 1235:1235@OOH323/1235
register => 1235:1235@H323/1235 

While I have never tried to register using h323 on asterisk it seems that the statements above are register statements to other servers.

Thanks a lot for your reply…

Can you please tell me what changes should i make in ooh323.conf file so that atleast i can establish a call.
at ekiga
user name =2222
password=2222

Thanks again in advance…

I am not sure the exact settings that ekiga requires (i.e. codecs, faststart etc.) but I use the following code below.

ooh323.conf

; Objective System's H323 Configuration example for Asterisk
; ooh323c driver configuration
;
; [general] section defines global parameters
;
; This is followed by profiles which can be of three types - user/peer/friend
; Name of the user profile should match with the h323id of the user device.
; For peer/friend profiles, host ip address must be provided as "dynamic" is
; not supported as of now.
;
; Syntax for specifying a H323 device in extensions.conf is
; For Registered peers/friends profiles:
;        OOH323/name where name is the name of the peer/friend profile.
;
; For unregistered H.323 phones:
;        OOH323/ip[:port] OR if gk is used OOH323/alias where alias can be any H323
;                          alias
;
; For dialing into another asterisk peer at a specific exten
;       OOH323/exten/peer OR OOH323/exten@ip
;
; Domain name resolution is not yet supported.
; 
; When a H.323 user calls into asterisk, his H323ID is matched with the profile
; name and context is determined to route the call
;
; The channel driver will register all global aliases and aliases defined in 
; peer profiles with the gatekeeper, if one exists. So, that when someone
; outside our pbx (non-user) calls an extension, gatekeeper will route that 
; call to our asterisk box, from where it will be routed as per dial plan.


[general]
;Define the asetrisk server h323 endpoint

;The port asterisk should listen for incoming H323 connections.
;Default - 1720
port=1720

;The dotted IP address asterisk should listen on for incoming H323
;connections
;Default - tries to find out local ip address on it's own
bindaddr=0.0.0.0    

;This parameter indicates whether channel driver should register with 
;gatekeeper as a gateway or an endpoint.
;Default - no
gateway=no

;Whether asterisk should use fast-start and tunneling for H323 connections.
;Default - yes
faststart=yes
h245tunneling=yes


;H323-ID to be used for asterisk server
;Default - Asterisk PBX
h323id=ObjSysAsterisk 
e164=100

;CallerID to use for calls
;Default - Same as h323id
callerid=asterisk

;Whether this asterisk server will use gatekeeper.
;Default - DISABLE
;gatekeeper = DISCOVER
;gatekeeper = a.b.c.d
gatekeeper = DISABLE

;Location for H323 log file
Default = /var/log/asterisk/h323_log
logfile=/var/log/asterisk/h323_log


;Following values apply to all users/peers/friends defined below, unless
;overridden within their client definition

;Sets default context all clients will be placed in.
;Default - default
context=from-external

;Sets rtptimeout for all clients, unless overridden
;Default - 60 seconds
;rtptimeout=60	    ; Terminate call if 60 seconds of no RTP activity
                    ; when we're not on hold

;Type of Service
;Default - none (lowdelay, thoughput, reliability, mincost, none)
;tos=lowdelay

;amaflags = default

;The account code used by default for all clients.
;accountcode=h3230101

;The codecs to be used for all clients.Only ulaw and gsm supported as of now.
;Default - ulaw
; ONLY ulaw, gsm, g729 and g7231 supported as of now
disallow=all     ;Note order of disallow/allow is important.
;allow=ulaw
allow=g729

; dtmf mode to be used by default for all clients. Supports rfc2833, q931keypad
; h245alphanumeric, h245signal.
;Default - rfc 2833
dtmfmode=rfc2833


[ekiga]
IP = XX.XX.XX.XX
user=2222
username=2222
secret=2222
port = 1720
type = peer
context = from-external
;dtmfmode = h245alphanumeric
faststart = yes
h245tunneling = yes
disallow = all
allow = g729
dtmfmode=rfc2833

extensions.conf

Exten => _X.,1,Dial(ooh323/${EXTEN}@ekiga)