Hello everyone,
I have created a custom pre-dialout trunk dialplan that will use a different area code depending on what area code is dialed.
It looks like this:
[from-internal-custom]
exten => _9NXXXXXXXXX,1,Verbose(Number dialed ${EXTEN})
same => n,Set(Dialed=${EXTEN:1}) ;Remove leading 9
same => n,Verbose(Evaluating ${Dialed} for NPA)
same => n,Set(NPA=${Dialed:0:3}) ;Sets 3 digit NPA
same => n,Verbose(Sorting for NPA of ${NPA})
same => n,GotoIf($[$["${NPA}" = "205"] | $["${NPA}" = "251"] | $["${NPA}" = "256"] | $[ "${NPA}" = "334"] | $["${NPA}" = "938"]]?Alabama)
REPEAT for all states
same => n,Goto(InvalidNPA);This must remain the last line for NPA sorting error catching
same => n(Alabama),Verbose(Dialing ${Dialed} based on NPA of ${NPA} in the state of Alabama)
same => n,Set(CALLERID(num)=+1XXXXXXXXXX)
REPEAT for all states
same => n(InvalidNPA),Verbose(Bad NPA of ${NPA} for ${Dialed}, no match. Please contact your admin to add this new NPA of ${NPA} and state)
same => n,Set(CALLERID(num)=+1XXXXXXXXX)
same => n,Verbose(No valid NPA of ${NPA} for ${Dialed} can be found, applying default CallerID of ${CALLERID(num)}. Please contact your admin to add this new NPA of ${NPA} and state)
same => n,Dial(SIP/TRUNK/5464*1${Dialed},300,Tt)
same => n,HangUp()
My question is, is there an easy way to “hook” into what Freepbx uses for call recording so these outbound calls can get recorded like a normal outbound call or perhaps a better way to do this in general that would allow call recording?
Thanks for the help, it is greatly appreciated!