How to configure Micronet GW FXO SP5054A/S with asterisk.
Configuring the gateway
I found that it was easier to configure the gateway by telnet/Serial port than by http. Both way con be use to accomplish this step.
If you are using the serial port (First Config) Configure the IP section on the gateway with values which may be convenient for you.
usr/config$ ifaddr –> for more information
usr/config$ ifaddr -ip 192.168.2.11 -mask 255.255.255.0 -gate 192.168.2.254 -mode 0 -http 80
Configure the gateway on proxy mode and configure the 4 lines as asterisk extensions.
usr/config$ sip –> for more information
usr/config$ sip -px 192.168.2.10 -line1 1001 -line2 1002 -line3 1003 -line4 1004 -pxport 5060 -pbsearch 0 -port 5060 -rtp 16384
lets suppose that 192.168.2.10 is the asterisk IP.
Set the username/password for asterisk extension
usr/config$ security –> for more information
usr/config$ security -line 1 -name 1001 -password 1001
usr/config$ security -line 2 -name 1002 -password 1002
usr/config$ security -line 3 -name 1003 -password 1003
usr/config$ security -line 4 -name 1004 -password 1004
Make the gateway forward calls on each port to specific extensions on asterisk. In case I needed to map one port with one user extension, but figure out that could be a queue, or ring group or voice menu.
usr/config$ line -help –> for more information
usr/config$ line -config 1 hunt 1 hotline 2001
usr/config$ line -config 2 hunt 2 hotline 2002
usr/config$ line -config 3 hunt 3 hotline 2003
usr/config$ line -config 4 hunt 4 hotline 2004
Set global variables on the gateway
usr/config$ sysconf –> for more information
usr/config$ sysconf -idtime 3 -keypad 1 -onhook 1 -ivr 0 -sipping 0 -billing 0 -silence 1 -connect 5
Set the voice codecs order and priorities:
usr/config$ voice –> for more information on
usr/config$ voice -send g711u 60 g711a 60 g723 60 g729 60 -echo 1 1 1 1 -nscng 1
- IMPORTANT **
On the following section there are NO configurations to be changed.
route – prefix – phone book
Look that I’ve nothing configured on those sections:
usr/config$ prefix -print
Prefix drop/insert information and configuration
Index Prefix Drop Insert
=======================================================
usr/config$ route -print
Routing table information and configuration
Index Prefix Dst. E.164 Min Max Hunt Drop
=======================================================================
IP Default FXO x
FXO Default IP x
usr/config$ pbook -print
Phone book information and configuration
Index Name E.164 IP Port Drop Insert
==================================================================
usr/config$
Then you need to commit changes to flash memory and then reboot
usr/config$ commit
This may take a few seconds, please wait….
Commit to flash memory ok!
usr/config$ reboot
….
Asterisk Configurations
For X in 1 2 3 4 ; do ……
sip.conf
[100X]
type=friend
secret=100X
port=5060
pickupgroup=
nat=yes
mailbox=100X@device
host=dynamic
dtmfmode=rfc2833
dial=SIP/100X
context=from_gwfxo
canreinvite=no
callgroup=
callerid=device <100X>
accountcode=
call-limit=50
disallow=all
allow=ulaw,alaw,g729,g723
[200X]
type=friend
secret=200X
port=5060
pickupgroup=
nat=yes
mailbox=200X@device
host=dynamic
dtmfmode=rfc2833
dial=SIP/200X
context=from_gwfxo
canreinvite=no
callgroup=
callerid=device <200X>
accountcode=
call-limit=50
disallow=all
allow=ulaw,alaw,g729,g723
extensions.conf
[globals]
GW_FXO = 192.168.2.11
;--------------GW Configurations---------------------------
[from_gwfxo]
; Calling Dial Plan from GW_FXO Micronet SP5054A/S
; GW_Extensions are: 100[1-4]
; Asterisk will engage those calls to admin extensions on: 20[1-4]
exten => _200[1-4],1,Answer()
exten => _200[1-4],n,Dial(SIP/${EXTEN})
exten => _200[1-4],n,Hangup()
[to_gwfxo]
; Dial Plan to call PSTN over GW_FXO Micronet SP5054A/S
include = default
exten => _9.,1,Macro(dial_gw,${CALLERID(number)},${EXTEN:1})
exten => _9.,n,HangUp
[macro-dial_gw]
; ${ARG1} Who is calling
; ${ARG2} Who to call
exten => s,1,Wait(1)
exten => s,2,Goto(s-${ARG1},1)
exten => s-2001,1,Dial(SIP/1001,90,tTrD(ww${ARG2}))
exten => s-2001,2,ExitMacro
exten => s-2002,1,Dial(SIP/1002,90,tTrD(ww${ARG2}))
exten => s-2002,2,ExitMacro
exten => s-2003,1,Dial(SIP/1003,90,tTrD(ww${ARG2}))
exten => s-2003,2,ExitMacro
exten => s-2004,1,Dial(SIP/1004,90,tTrD(${ARG2}))
exten => s-2004,2,ExitMacro