Asterisk T1 E&M -> Sip Gateway

I’m using asterisk as a sip gateway to my old inter-tel axxess PBX, which does not do sip.
using e&m, or fxo trunks i can emulate a CO, and call into asterisk from my pbx, and make outbound phonecalls through sip no problem.

the problem i’m having is that i am unable to dial out of asterisk, into my pbx.

I’ve been unable to find a dialplan that works, i have 4 digit DNIS, and according to my provider it is currently set up to send just the 4 digits, no symbols,ANI, or anything. I’ve tried this over the e&m, and the LSC trunks and get the same result. Can somebody please help me emulate the CO? I’ve tried all of these combinations, and a few more, but been unsuccessful. 1593 is a valid DNIS in my phone switch.

[from-sip]
exten => 1,1,Dial(Zap/20/#1593)
exten => 2,1,Dial(Zap/20/1593)
exten => 3,1,Dial(Zap/20/+1593)
exten => _XXXX,1,Dial(Zap/20/#${EXTEN})

edit: if i use 2, then i get into my PBX, but it doesnt receive a DNIS, and goes into the generic routing table. 1 and 3 both hang up on me.