How to configure Asterisk with a Lucent iMerge
Configure asterisk to use the asterisk-oh323 driver
I have not been able to get the default NuFone driver packaged with Asterisk to work with the iMerge. The inAccess H323 driver is available at http://www.inaccessnetworks.com/projects/asterisk-oh323 I used version 0.6.5 in conjunction with asterisk-1.0.1. Follow the installation and configuration instructions included with the source download.
Once the inAccess driver is installed, remove the NuFone driver by moving chan_h323.so out of /usr/lib/asterisk/modules and move h323.conf from /etc/asterisk to another location. You should have chan_oh323.so and oh323.conf in their place, respectively. Make sure your library path is set correctly as stated in the instructions.
Update:
The iMerge does not understand the H.225 InformationRequestReponses returned by the oh323 driver resulting in dropped calls after 40-90 seconds. This may be an incompatibily between v2 (iMerge) and v4 (oh323) of the H.225 spec. Here’s the fix:
Modify openh323/src/gkclient.cxx in the openh323-Janus_patch4 source.
In ::OnReceiveInfoRequest, comment out lines 1889 to 1910
from
if (irq.m_callReferenceValue == 0) {
to
} // end of if-else block
This effectively prevents the inclusion of the perCallInfo fields into the IRR, which the iMerge apparently does not like. You will get a compiler warning about ‘H225_InfoRequestResponse &irr’ not getting used. This can be ignored.
Recompile the asterisk-oh323 driver with ‘make clean && make’. The asterisk-oh323 can be compiled with statically linked oh323 and pwlib libraries (the default since 0.6.4), which decreases Asterisk load time and makes the module a lot easier to maintain.
Configuration
Allow the following ports through your firewall:
1718-1721 tcp/udp : h.323
10000:20000 udp : rtp (range specified in oh323.conf)
— oh323.conf —
Make sure fastStart=yes and that G711U is the default codec. Outgoing calls from Asterisk did not work corectly with G711A. I have not tested any of the other supported codecs.
;
; Configuration file of OpenH323 channel driver
;
;-----------------------------------------
; General configuration options
; (ports, jitter, GK, ...)
;-----------------------------------------
[general]
;
; Address to bind to for incoming connections.
; Default is ALL.
;
listenAddress=0.0.0.0
;
; Port to listen to.
; Default value is 1720.
;
listenPort=1720
;
; Port to connect to.
; (Used only when we don't have a gatekeeper)
; Default value is 1720.
;
connectPort=1720
;
; Configure TCP port range to be used by H.323
;
tcpStart=10000
tcpEnd=20000
;
; Configure UDP port range to be used by H.323
; Note: The port range used by RTP are configured from
; "rtp.conf"
;
udpStart=10000
udpEnd=20000
;
; Enable fast start (yes,no).
;
fastStart=yes
;
; Enable H.245 tunnelling (yes,no).
;
h245Tunnelling=no
;
; Enable early H.245 messages in call SETUP message.
;
h245inSetup=no
;
; Enable in-band-DTMF detection.
; (Note: Netmeeting uses in-band DTMFs)
;
inBandDTMF=yes
;
; Enable silence suppression.
;
silenceSuppression=no
;
; Set jitter buffer (in milliseconds, 20...10000).
;
jitterMin=20
jitterMax=100
;
; Set IP Type-of-Service byte for RTP channels.
; Valid values for this option are:
; lowdelay, throughput, reliability, mincost, none
;
ipTos=none
;
; Set the maximum number of inbound/outbound/simultaneous
; H.323 connections.
;
outboundMax=10
inboundMax=10
simultaneousMax=10
;
; Set the bandwidth limit for H.323 connections.
; The value is in Kbps.
;
;bandwidthLimit=1024
;
; Set tracing options for the wrapper library and for the
; OpenH323 library.
; libTraceFile can be 'stdout' or a full path name to the tracefile.
; Only trace info for OpenH323 is logged in libTraceFile.
;
wrapLibTraceLevel=1
libTraceLevel=1
libTraceFile=stdout
;
; Disable gatekeeper or specify a gatekeeper.
; Valid values for this option are:
; DISABLE,
; DISCOVER,
; <gatekeeper's DNS name>,
; <gatekeeper's ip>,
; GKID:<gatekeeper's id>
;
gatekeeper=<iMerge GK ip>
;
;
; Set the gatekeeper password
;
;gatekeeperPassword=secret
;
; Set the gatekeeper registration timeout
;
gatekeeperTTL=600
;
; Set the mode for sending user-input
; Valid values for this option are:
; Q931 - Q.931 Keypad Information Element
; STRING - H.245 string
; TONE - H.245 tone
; RFC2833 - RFC2833
;
userInputMode=TONE
;
; AMA flags (default, omit, billing, documentation)
;
amaFlags=default
;
; Account code
;
accountCode=H323
;
; Set the default context of H.323 calls.
;
context=local
;-----------------------------------------
; Configure H.323 aliases, prefixes and
; related ASTERISK's contexts
;-----------------------------------------
[register]
;
; Aliases/prefixes associated with the default context
; defined in section [general].
;
context=local
alias=<registered number>
;
;
;alias=asterisk
;alias=123
;
; Aliases/prefixes routed in "all-aliases" context.
;
;context=all-aliases
;alias=ASTERISK
;alias=666
;
; Aliases/prefixes routed in "more-aliases" context.
;
;context=more-aliases
;alias=665
;
; Aliases/prefixes routed in "all-prefixes" context.
;
;context=all-prefixes
;gwprefix=00
;gwprefix=01
;
; Aliases/prefixes routed in "more-stuff" context.
;
;context=more-stuff
;alias=664
;gwprefix=02
;-----------------------------------------
; Specify and configure CODEC related
; options
;-----------------------------------------
[codecs]
;
; Define the codec list of the channel driver.
; Every "codec" option may have a "frames" option
; associated with it.
; Valid values for the "codec" option are:
; G711U - G.711 u-Law
; G711A - G.711 A-Law
; G7231 - G.723.1(6.3k)
; G72316K3 - G.723.1(6.3k)
; G72315K3 - G.723.1(5.3k)
; G7231A6K3 - G.723.1A(6.3k)
; G7231A6K3 - G.723.1A(6.3k)
; G726 - G.726(32k)
; G72616K - G.726(16k)
; G72624K - G.726(24k)
; G72632K - G.726(32k)
; G72640K - G.726(40k)
; G728 - G.728
; G729 - G.729
; G729A - G.729A
; G729B - G.729B
; G729AB - G.729AB
; GSM0610 - GSM 0610
; MSGSM - Microsoft GSM Audio Capability
; LPC10 - LPC-10
; Number of frames in RTP packet (if not specified) is 1.
;
;codec=G711A
;frames=20
codec=G711U
frames=20
;codec=GSM0610
;frames=4
;codec=G7231
;frames=2
;codec=G729
;frames=2
— extensions.conf —
Outgoing calls: OH323/<exten>
[general]
static=yes
writeprotect=no
[globals]
CONSOLE=Console/dsp ; Console interface for demo
IAXINFO=guest ; IAXtel username/password
TRUNK=Zap/g2 ; Trunk interface
TRUNKMSD=1 ; MSD digits to strip (usually 1 or 0)
IAXTRUNK1=IAX2/uname:passwd@vpconnect-t01
IAXTRUNK2=IAX2/uname:passwd@vpconnect-t02
PHONE1=SIP/test-laptop
[iaxtel700]
exten => _91700NXXXXXX,1,Dial(IAX2/${IAXINFO}@iaxtel.com/${EXTEN:1}@iaxtel)
[iaxprovider]
[trunkint]
exten => _9011.,1,Dial(${TRUNK}/${EXTEN:${TRUNKMSD}})
exten => _9011.,2,Congestion
[trunkld]
exten => _91NXXNXXXXXX,1,Dial(${TRUNK}/${EXTEN:${TRUNKMSD}})
exten => _91NXXNXXXXXX,2,Congestion
[trunklocal]
exten => _9NXXXXXX,1,Dial(${TRUNK}/${EXTEN:${TRUNKMSD}})
exten => _9NXXXXXX,2,Congestion
[trunktollfree]
exten => _91800NXXXXXX,1,Dial(${TRUNK}/${EXTEN:${TRUNKMSD}})
exten => _91800NXXXXXX,2,Congestion
exten => _91888NXXXXXX,1,Dial(${TRUNK}/${EXTEN:${TRUNKMSD}})
exten => _91888NXXXXXX,2,Congestion
exten => _91877NXXXXXX,1,Dial(${TRUNK}/${EXTEN:${TRUNKMSD}})
exten => _91877NXXXXXX,2,Congestion
exten => _91866NXXXXXX,1,Dial(${TRUNK}/${EXTEN:${TRUNKMSD}})
exten => _91866NXXXXXX,2,Congestion
[international]
ignorepat => 9
include => longdistance
include => trunkint
[longdistance]
ignorepat => 9
include => local
include => trunkld
[local]
exten => 21,1,Dial(${PHONE1},30,t)
exten => 21,2,Voicemail(u21)
exten => 21,3,Hangup
exten => 21,102,Voicemail(u21)
exten => 21,103,Hangup
exten => 22,1,Dial(${PHONE2}&${PHONE5},30,t)
exten => 22,2,Voicemail(22)
exten => 22,3,Hangup
exten => 22,102,Voicemail(u22)
exten => 22,103,Hangup
exten => 23,1,Dial(${PHONE3},30,t)
exten => 23,2,Voicemail(u23)
exten => 23,3,Hangup
exten => 23,102,Voicemail(u23)
exten => 23,103,Hangup
exten => 24,1,Dial(${PHONE5},30,t)
exten => 24,2,Voicemail(u22)
exten => 24,3,Hangup
exten => 24,102,Voicemail(u22)
exten => 24,103,Hangup
exten => 99,1,Dial(${PHONE4},30,t)
exten => 99,2,Voicemail(u99)
exten => 99,3,Hangup
exten => 99,102,Voicemail(u99)
exten => 99,103,Hangup
;Allow outgoing H323 calls
;No need to specify GK ip if GK is set in oh323.conf
exten => _XXXXXXXXXX,1,Wait,2
exten => _XXXXXXXXXX,2,Dial(OH323/${EXTEN});
;Accept incoming H323 calls
exten => <H323 alias>,1,Wait,1
exten => <H323 alias>,2,Answer
exten => <H323 alias>,3,DigitTimeout,5 ; Set Digit Timeout to 5 seconds
exten => <H323 alias>,4,ResponseTimeout,10
exten => <H323 alias>,5,Background(demo-thanks)
exten => <H323 alias>,6,Hangup
ignorepat => 9
include => default
include => parkedcalls
include => trunklocal
include => iaxtel700
include => trunktollfree
include => iaxprovider
include => outbound
[macro-stdexten];
exten => s,1,Dial(${ARG2},20) ; Ring the interface, 20 seconds maximum
exten => s,2,Voicemail(u${ARG1}) ; If unavailable, send to voicemail w/ unavail announce
exten => s,3,Goto(default,s,1) ; If they press #, return to start
exten => s,102,Voicemail(b${ARG1}) ; If busy, send to voicemail w/ busy announce
exten => s,103,Goto(default,s,1) ; If they press #, return to start
[voicepulse-in]
include => default
include => local
exten => <vp number>,1,Wait,1 ; Wait a second, just for fun
exten => <vp number>,2,Answer ; Answer the line
exten => <vp number>,3,DigitTimeout,5 ; Set Digit Timeout to 5 seconds
exten => <vp number>,4,ResponseTimeout,10 ; Set Response Timeout to 10 seconds
exten => <vp number>,5,BackGround(demo-thanks)
[default]
exten => 85,1,VoicemailMain
exten => 85,2,Hangup