Asterisk/FreePBX 14
I’ve been working with call files in order to setup a treatment where the caller will call in and enter a number to be called back at. A call file will be generated to initiate the callback and send the call to an FreePBX IVR. This treatment works (the outbound call is made and delivers the user to the IVR); however, when I try to use one of the variables in the call file post call back, in the CLI, the variables do not look like they contain any data (null, “”). I am reading the variables post call back and all I hear is silence, which makes sense if the CLI is not displaying anything.
I am wondering if it has to do with the channel, since the ${ALTCALLBACKID} will always be a customer (i.e. random), external number?
Can anyone point me towards a resource that might be able to help? Thanks in advance for any ideas you may have!
Dial Plan:
[cc-scba-alt-callback-id]
exten => s,1,GotoIf($["${CHANNEL(state)}" = “Up”]?begin)
exten => s,n,Answer
exten => s,n,Wait(1)
exten => s,n(TRYAGAIN),Playback(custom/SCBA_Request_Number,noanswer)
exten => s,n,Read(ALTCALLBACKID,10,3,20)
exten => s,n,SayDigits(${ALTCALLBACKID})
exten => s,n,Playback(custom/SCBA_Confirm_Number,noanswer)
exten => s,n,Read(CIDCONFIRM,1,3,20)
exten => s,n,GotoIf($["${CIDCONFIRM}" = “1”]?CONFIRMED:TRYAGAIN)
exten => s,n(CONFIRMED),System(echo -e “Channel: local/${ALTCALLBACKID}@from-internal\nContext: wake-up\nExtension: 23\nSetVar: DialedNumber = ${CALLERID(dnid)}\nSetVar: OCID = ${CALLERID(num)}”> /tmp/$
exten => s,n,System(mv /tmp/${UNIQUEID}.call /var/spool/asterisk/outgoing/)
exten => s,n,Hangup()
nano
The Generated Call File:
Looks perfect, from what I can tell?
I redacted the phone numbers, but they generate in the file correctly.
Channel: local/REDACTED@from-internal
Context: wake-up
Extension: 23
SetVar: DialedNumber = REDACTED
SetVar: OCID = REDACTED