Algumas aplicações requerem um ajuste no dialplan do gateway. Por padrão, o gateway exige que se disque um prefixo para acesso à portas. O dialplan que segue torna isso transparente, ou seja, a associação das contas às portas se dá automaticamente conforme configurado pela interface WEB:


[general]
static=yes
writeprotect=no
autofallthrough=yes
clearglobalvars=no
priorityjumping=no

[globals]
#include account_names.conf

[from-fxs]
exten => _[*#0-9].,1,Noop(${CHANNEL:6:1})
exten => _[*#0-9].,n,Dial(SIP/${EXTEN}@${USER${CHANNEL:6:1}})

[from-fxo]
exten => s,1,Noop(${CHANNEL:6:1})
exten => s,n,Dial(SIP/${USER${CHANNEL:6:1}})
exten => s,n,Hangup()

[from-sip]
exten => _X.,1,NoOp(Origem: ${CALLERID(num)} Destino: ${EXTEN} Canal: ${CHANNEL})
same => n,Set(chann=${REPLACE(CHANNEL,-,\,)})
same => n,Set(chann=${REPLACE(chann,\/,\,)})
same => n,Set(ARRAY(n1,n2,n3)=${chann})
same => n,GotoIf($[${USER1} == ${n2}]?from-sip-dial,1#${EXTEN},1)
same => n,GotoIf($[${USER2} == ${n2}]?from-sip-dial,2#${EXTEN},1)
same => n,GotoIf($[${USER3} == ${n2}]?from-sip-dial,3#${EXTEN},1)
same => n,GotoIf($[${USER4} == ${n2}]?from-sip-dial,4#${EXTEN},1)
same => n,GotoIf($[${USER5} == ${n2}]?from-sip-dial,5#${EXTEN},1)
same => n,GotoIf($[${USER6} == ${n2}]?from-sip-dial,6#${EXTEN},1)
same => n,GotoIf($[${USER7} == ${n2}]?from-sip-dial,7#${EXTEN},1)
same => n,GotoIf($[${USER8} == ${n2}]?from-sip-dial,8#${EXTEN},1)
same => n,Hangup

[from-sip-dial]
exten => _X.,1,Set(CHANNEL=${EXTEN:0:1})
same  => n,GotoIf($[${CHANNEL} <= 4]?fxs:fxo)
same  => n(fxs),Dial(DAHDI/${EXTEN:0:1})
same  => n,Hangup()
same  => n(fxo),Dial(DAHDI/${EXTEN:0:1}/${EXTEN:2})
same  => n,Hangup()