Outgoing Dial Plan PRI E1

Hi Everyone,
I have successfully installed Asterisk with the Sangoma A101d PRI E1 Card and Sangoma A200 Card with FXO and FXS modules. Everything is working perfectly and all the PRI E1 activity are being displayed when executing the “PRI Debug Span 1” command at Asterisk CLI.

In the extension.conf, I have created a sample incomming dial plan as shown below.

///////////////////////////// extension.conf //////////////////////////////////////
[general]

static=yes
writeprotect=yes

[bogon-calls]

exten => _.,1,Congestion

[from-zaptel]

exten => 4319,1,Answer
exten => 4319,n,Wait
exten => 4319,n,Dial(ZAP/35)
exten => 4319,n,HangUp()

////////////////////////////////////////////////////////////////////////////////////

“4319” are the last four digit of the PRI E1 line. When anyone call at this number, then the phone connected at the FXS port starts ringing. A perfect call is established when the ringing phone is off hooked.

What I want is how can i create an outgoing dialplan such that when the phone connected with the FXS port is Offhook and then by dialing 9, one can call any number using the PRI E1 line. In other words i want to dial outside number using the PRI E1 Line.

below are the zaptel and zapata config files of my system

//////////////////////////// zapata.conf ///////////////////////////////////////

;autogenerated by /usr/local/sbin/config-zaptel do not hand edit
;Zaptel Channels Configurations (zapata.conf)
;
;For detailed zapata options, view /etc/asterisk/zapata.conf.orig

[trunkgroups]

[channels]
context=default
usecallerid=yes
hidecallerid=no
callwaiting=yes
usecallingpres=yes
callwaitingcallerid=yes
threewaycalling=yes
transfer=yes
canpark=yes
cancallforward=yes
callreturn=yes
echocancel=yes
echocancelwhenbridged=yes
rxgain=0.0
txgain=0.0
group=1
callgroup=1
pickupgroup=1

immediate=no

;Sangoma A101 port 1 [slot:2 bus:1 span: 1]
switchtype=euroisdn
context=from-zaptel
group=1
signalling=pri_cpe
channel => 1-15,17-31

;Sangoma A200 [slot:1 bus:1 span:2]
context=from-zaptel
group=0
signalling = fxs_ks
channel => 32

context=from-zaptel
group=0
signalling = fxs_ks
channel => 33

context=from-internal
group=1
signalling = fxo_ks
channel => 34

context=from-internal
group=1
signalling = fxo_ks
channel => 35

/////////////////////////////////////////////////////////////////////////////////////

////////////////////////////// zaptel.conf /////////////////////////////////////////
; Autogenerated by /usr/local/sbin/sangoma/setup-sangoma – do not hand edit
; Zaptel Channels Configurations (zapata.conf)

loadzone=us
defaultzone=us
#Sangoma A101 Port 1 [slot:2 bus:1 span:1]
span = 1,0,0,ccs,hdb3,crc4
bchan = 1-15,17-31
dchan = 16

#Sangoma A200 Port 1 [slot:1 bus:1 span:2]
fxsks=32
fxsks=33
fxoks=34
fxoks=35

/////////////////////////////////////////////////////////////////////////////////////
Thanking you,

Nommy.