News:

"The phone is a remarkably complex, simple device,
and very rarely ever needs repairs, once you fix them." - Dan/Panther

Main Menu

Instructions for Getting on C*NET with FreePBX

Started by Hill Haven Telephone Company, January 12, 2019, 04:44:53 PM

Previous topic - Next topic

Hill Haven Telephone Company

There wasn't much as far as Howto's or documentation on connecting to C*NET with FreePBX so I wrote a howto to make it easier for folks who want to get on C*NET but prefer the nice gui interface that FreePBX provides. 

Here is a link to the blog post documenting every step of the way.   I plan on writing another post about how to configure Lenny with C*NET and a bunch of other things. 


     https://thephreakshowtelco.wordpress.com/2019/01/12/cnet-configuration-with-freepbx/

ka1axy

#1
Ugh...need better glasses...I see there's an attached PDF. Thanks for that!

ka1axy

#2
I used the attached PDF to get started, but I'm still having some issues. Outbound calls fail due to no trunk available. I'll post when I get those worked out. I believe I will be learning a lot about Asterisk, FreePBX and how they interact (or don't) in the near future!

I think there's a typo in step 2 and step 3: "Local/$OUTNUM@cnet-out" should be "Local/$OUTNUM$@cnet-out"
($ at the beginning *and* end of OUTNUM?). It's presented both ways and I'm not sure which is correct. Also, it doesn't seem to make a difference!

Finally, trying to copy and paste the extensions_custom.conf file at the end of the PDF results in gibberish, so I have attached a text copy of it below.

;Put this file at the bottom of extensions_custom.conf

[macro-dialcnet]

;
; Collectors' Network
;
exten => s,1,Set(E164NETWORKS=std.ckts.info)
;
; Check to see if ARG1 is preceded by a "+"
exten => s,2,GotoIf($[ ${ARG1:0:1} = "+"]?startloop)
;
; Skip next line if it already is prefixed by a plus;
; Otherwise, add one to the beginning.
exten => s,3,Set(ARG1=+${ARG1})
exten => s,4(startloop),Set(ENUM=${ENUMLOOKUP(${ARG1},ALL,,1,std.ckts.info)})
;exten =>s,4(startloop),Set(ENUM=${ENUMLOOKUP(${ARG1}.std.ckts.info,ALL,,std.ckts.info)})
;
; Sanity check the return, make sure there's something in there.
; If not, send it to CONTINUE.
exten => s,5,GotoIf($[${LEN(${ENUM})} = 0 ]?continue)
;
; If the return includes the word SIP, go to SIPURI
exten => s,6,GotoIf($[${ENUM:0:3} = sip ]?sipuri)
;
; Otherwise, if the return includes the word IAX, go IAXURI
exten => s,7,GotoIf($[${ENUM:0:3} = iax ]?iaxuri)
;
; And, if the return includes the word H323, send it to H323URI
exten => s,8,GotoIf($[${ENUM:0:3} = h32 ]?h323uri)
;
; If we're here, it's not a protocol we know about. Let's increment the pointer
; and if it's more than ENUMCOUNT, we know we've run out of options.
;
; This is the generic CANT BE ROUTED spot
exten => s,9(continue),Macro(invalid-office-code,${ARG1})
exten => s,10,Wait(5)
exten => s,11,Hangup
;
; If the prefix is 'sip:'...
exten => s,12(sipuri),Set(DIALSTR=SIP/${ENUM:4})
exten => s,13,Goto(dodial)
;
; If it's IAX2...
exten => s,14(iaxuri), Set (DIALSTR=IAX2/${ENUM:5})
exten => s,15,Goto(dodial)
;
; Or even if it's H323.
exten => s,16(h323uri), Set (DIALSTR=H323/${ENUM:5})
;
; And this is where we end up if we actually CAN route the call.
exten => s,17(dodial),Dial(${DIALSTR})
exten => s,18,Goto(q-${DIALSTATUS},1)
;
exten => q-CONGESTION,1,Macro(congestion)
exten => q-CONGESTION,n,Hangup
;
exten => q-CHANUNAVAIL,1,Macro(chanunavail)
exten => q-CHANUNAVAIL,n,Hangup
;
exten => q-BUSY,1,Busy
exten => q-BUSY,n,Hangup
;
exten => _q-.,1,Hangup()

;

[cnet-out]

exten => _1NXXXXXX,1,Macro(dialcnet, ${EXTEN})
exten => _INXXXXXX, 2, Congestion

exten => _X.,1,Macro(dialcnet, ${EXTEN})
exten => _X.,2,Congestion

[from-cnet]

;This context is called from the IAX trunk definition defined within the FreePBX environment.
;
;Select incoming called number blocks are rewritten to conform to the local 3 or4 digit dial plan
;and then passed on to contexts managed by FreePBX.
;
; 555xxxx - Direct station calls to your phones - replace 555(5) with your office code,
; e.g.: 15555xxx for 3-digit extensions, 1555xxxx for 4-digit

;3 digit ext numbers

exten => _15555xxx,1, set(destnum=${EXTEN:-3}) ;strip 1555Xxxx to match local 3 digit dial plan
exten => _15555xxx,n, SIPAddHeader("Alert-Info:<http://127.0.0.1/Bellcore-dr3>")
exten => _15555xxx,n,Gosub(app-blacklist-check,s,1)
exten => _15555xxx,n, goto(from-internal,${destnum},1)

;4 digit ext numbers

;exten => _1555xxxx,1,set(destnum=${EXTEN:-4}) ;strip 1555 to match local 4 digit dial plan
;exten => _1555xxxx,n, SIPAddHeader("Alert-Info:<http://127.0.0.1/Bellcore-dr3>")
;exten => _1555xxxx,n,Gosub(app-blacklist-check,s,1)
;exten => _1555xxxx,n, goto(from-internal,${destnum},1)

ka1axy

Double-Ugh!

Replace the lines above with these, otherwise you won't be able to dial out. White space matters in this scripting language.


[cnet-out]

exten => _1NXXXXXX,1,Macro(dialcnet,${EXTEN})
exten => _INXXXXXX, 2, Congestion

exten => _X.,1,Macro(dialcnet,${EXTEN})
exten => _X.,2,Congestion