How to make outgoing calls from analog phone on fxs port

Hi I am trying to make a call from a normal analog phone connected to my fxs port and the PSTN connected to my fxo port, It works from my sip clients, as soon as I dial a number from analog phone I get a busy tone

zapata.conf
[channels]
context=pstn
signalling=fxs_ks
group=1
channel=1

context=analog
signalling=fxo_ks
group=2
channel=3

extensions.conf
[globals]
OUTGOING => Zap/g1
INCOMMING => Zap/g2

[default]

;to test from phones
exten => 1026,1,SayUnixTime(,ABdIMp)
exten => 1026,n,Wait(1)
exten => 1026,n,Goto(1)

exten => 2242,1,Dial(Zap/g1/${EXTEN}) ;internal extension server-room

exten => 9,1,Dial(Zap/g1/${EXTEN}) ;SwitchBoard

exten => _0[1-8]XXXXXXXX,1,Dial(Zap/g1/${EXTEN})
exten => _0[7-8]XXXXXXXX,1,Dial(Zap/g1/${EXTEN})

exten => 1000,1,Dial(SIP/1000) ;Sip testing-1

exten => 1001,1,Dial(SIP/1001) ;Sip testing-2

exten => 7,1,Dial(Zap/g1/${EXTEN}) ;To get outside line

exten => _0[1-8]XXXXXXXX,1,Macro(dial,${EXTEN})
exten => _0[7-8]XXXXXXXX,2,Hangup()

;Sends all incomming calls to analog phone on channel 3
[pstn]
exten => s,1,Wait,1
exten => s,n,Answer()
exten => s,n,Dial(Zap/g2/${EXTEN})

;[analog]
;exten => s,1,Dial(Zap/g1/${ARG1})

[macro-dial]
exten => s,1,Set(${ARG1}=${EXTEN})
exten => s,2,Dial(Zap/g2/${ARG1})

include context
default
pstn
analog

Any Ideas!!!

You don’t have an analog context. A console trace would probably have made that obvious.

I don’t understand the include bit at the end, it doesn’t match any standard Asterisk include syntax.

Ok I changed the extensions.conf

[globals]
OUTGOING => Zap/g1
INCOMMING => Zap/g2

[default]

;to test from phones
exten => 1026,1,SayUnixTime(,ABdIMp)
exten => 1026,n,Wait(1)
exten => 1026,n,Goto(1)

exten => 2242,1,Dial(Zap/g1/${EXTEN}) ;internal extension server-room

exten => 9,1,Dial(Zap/g1/${EXTEN}) ;SwitchBoard

exten => _0[1-8]XXXXXXXX,1,Dial(Zap/g1/${EXTEN})
exten => _0[7-8]XXXXXXXX,1,Dial(Zap/g1/${EXTEN})

exten => 1000,1,Dial(SIP/1000) ;Sip testing-1

exten => 1001,1,Dial(SIP/1001) ;Sip testing-2

exten => 7,1,Dial(Zap/g1/${EXTEN}) ;To get outside line

exten => _0[1-8]XXXXXXXX,1,Macro(dial,${EXTEN})
exten => _0[7-8]XXXXXXXX,2,Hangup()

;Sends all incomming calls to analog phone on channel 3
[pstn]
exten => s,1,Wait,1
exten => s,n,Answer()
exten => s,n,Dial(Zap/g2/${EXTEN})

[analog]
exten => s,1,Dial(Zap/g1/${EXTEN})

;[macro-dial]
;exten => s,1,Set(${ARG1}=${EXTEN})
;exten => s,2,Dial(Zap/g2/${ARG1})

[trunk]
exten => _7.,1,Dial(Zap/g1/${EXTEN})

include => default
include => pstn
include => analog
include => trunk

And here is the console trace when I pick up the phone and try to dial

Verbosity was 3 and is now 33
– Starting simple switch on ‘Zap/3-1’
– Hungup ‘Zap/3-1’
[May 6 07:31:56] NOTICE[2825]: cdr.c:434 ast_cdr_free: CDR on channel ‘Zap/3-1’ not posted
voip02*CLI>

I don’t think it has got as far as the dialplan; did you dial any digits.

However, if it did reach the dialplan, it would try to dial either “s” or nothing at all on the outgoing line, so I don’t see how it is going to work.

yes i tried dialing digits, as soon as I dial the first digit it gives me a busy
tone

Any suggestions

I’m not convinced it is getting that far, but I would certainly fix the dialplan to match what you actually dial and to send a valid number to the service provider.

However, at that verbosity, I’d expect some messages if it even got as far as the dialplan.