Admittedly, I'm using freepbx...it just handles most of the stuff quite intelligently.
This is a nuvox trunk, and it worked before with these settings, over an E&M Wink trunk. Now we're using a PRI (which we're also using just fine at other locations), and the dialed DID digits (last 4) don't seem to be being passed...how that even works, I don't know.
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
pbx01*CLI>
-- Going to extension s|1 because of immediate=yes
-- Accepting call from '4044836294' to 's' on channel 0/1, span 1
-- Executing NoOp("Zap/1-1", "Entering from-zaptel with DID == ") in new stack
-- Executing Ringing("Zap/1-1", "") in new stack
-- Executing Set("Zap/1-1", "DID=s") in new stack
-- Executing NoOp("Zap/1-1", "DID is now s") in new stack
-- Executing GotoIf("Zap/1-1", "1?zapok:notzap") in new stack
-- Goto (from-zaptel,s,8)
-- Executing NoOp("Zap/1-1", "Is a Zaptel Channel") in new stack
-- Executing Set("Zap/1-1", "CHAN=1-1") in new stack
-- Executing Set("Zap/1-1", "CHAN=1") in new stack
-- Executing Macro("Zap/1-1", "from-zaptel-1|s|1") in new stack
-- Executing NoOp("Zap/1-1", "Returned from Macro from-zaptel-1") in new stack
-- Executing Goto("Zap/1-1", "from-pstn|s|1") in new stack
-- Goto (from-pstn,s,1)
...
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
The above should be getting $EXTEN=2294, and act accordingly. The corresponding code:
[from-zaptel]
exten => _X.,1,Set(DID=${EXTEN})
exten => _X.,n,Goto(s,1)
exten => s,1,NoOp(Entering from-zaptel with DID == ${DID})
; Some trunks _require_ a RINGING be sent before an Answer.
exten => s,n,Ringing()
; If ($did == "") { $did = "s"; }
exten => s,n,Set(DID=${IF($["${DID}"= ""]?s:${DID})})
exten => s,n,NoOp(DID is now ${DID})
exten => s,n,GotoIf($["${CHANNEL:0:3}"="Zap"]?zapok:notzap)
exten => s,n(notzap),Goto(from-pstn,${DID},1)
; If there's no ext-did,s,1, that means there's not a no did/no cid route. Hangup.
exten => s,n,Macro(hangup)
exten => s,n(zapok),NoOp(Is a Zaptel Channel)
exten => s,n,Set(CHAN=${CHANNEL:4})
exten => s,n,Set(CHAN=${CUT(CHAN,-,1)})
exten => s,n,Macro(from-zaptel-${CHAN},${DID},1)
; If nothing there, then treat it as a DID
exten => s,n,NoOp(Returned from Macro from-zaptel-${CHAN})
exten => s,n,Goto(from-pstn,${DID},1)
exten => fax,1,Goto(ext-fax,in_fax,1)
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
/etc/zaptel.conf :
loadzone = us
defaultzone = us
span = 1,1,0,esf,b8zs
bchan = 1-3
dchan = 24
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
/etc/asterisk/zapata.conf :
[channels]
language = en
echocancel = yes
echocancelwhenbridged = no
echotraining = 800
faxdetect = both
switchtype = national
callerid = asreceived
signalling = pri_cpe
context = from-zaptel
immediate = yes
group = 0
channel => 1-3