Dial out via fxo gateway

My current config:

pstn -> audiocodes fxo gateway -> asterisk -> xlite

every fxo ports are registered with asterisk

I have this extensions.conf

exten => 111,1,answer
exten => 111,n,dial(sip/fxo1)
exten => 111,n,hangup

If we dial 111 by xlite, I could hear dialing tone. I could key in a phone no and connect to the called party. this is a two stage dialing.

How could we preset a phone no. in the extensions.conf without having the sip client keys in the phone no (ONE STAGE DIALING)?

pls kindly advise.

You have to activate the one stage dialing mode in the Audiocodes fxo gateway, then you could use a dialplan like this (9 is the prefix for the outgoing calls):

exten => _9XXX.,1,Dial(SIP/audiocodes/${EXTEN:1})
exten => _9XXX.,n,hangup 

Also I think it’s better if you define, in the Audiocodes, a group of lines and let the gateway choose the free line, then you register to Asterisk the gateway and not the single line.

Cheers.

Marco Bruni