I am using Asterix / FreePBX with a GSM box to send out appointment reminders for multiple companies and wondering, just how much can be scripted in the outbound call file queue? Here is where this is heading. I have this as a call file:
Channel: SIP/4805551234@192.168.1.55
MaxRetries: 5
Callerid: "Joe Smith" <2095551212>
RetryTime: 300
WaitTime: 45
Context: outboundmsg1
Extension: s
Priority: 1
This calls me, plays a message and waits for a response because of the “Context” which looks like this:
[outboundmsg1]
exten => s,1,Set(TIMEOUT(digit)=5) ; Set Digit Timeout to 5 seconds
exten => s,2,Set(TIMEOUT(response)=10) ; Set Response Timeout to 10 seconds
exten => s,3,Answer
exten => s,4,Wait(1)
exten => s,5,Background(outboundmsgs/msg1) ; "play outbound msg"
exten => s,6,Background(outboundmsgs/how_to_ack) ; "Press 1 to replay or 2 to acknowledge receiving this message"
exten => 1,1,Goto(s,5) ; replay message
exten => 2,1,Goto(msgack,s,1) ; acknowledge message
exten => t,1,Playback(vm-goodbye)
exten => t,2,Hangup
I see I can do a lot of scripting things in the extensions_custom.conf, but in my case I have multiple companies with appointments at 10 minute increments, so about 48 different combinations per company, so it seems better to script that from the outbound call file queue than to keep editing the extensions_custom.conf file.
With that in mind, I have this which using the “Data” attribute allows me to script any audio file, but then the “Context” seems to be ignored.
Channel: SIP/1111
Application: Playback
Context: outboundmsg1
Data: outboundmsgs/msg1
CallerID: Asterisk <(555) 555-1212>
extensions_custom.conf:
[readresponses]
exten => s,1,Set(TIMEOUT(digit)=5) ; Set Digit Timeout to 5 seconds
exten => s,2,Set(TIMEOUT(response)=10) ; Set Response Timeout to 10 seconds
exten => s,3,Answer
exten => s,4,Wait(1)
exten => 1,1,Goto(msgack,s,1) ; acknowledge message
### Here I would love to insert a database / http call, or some other way of recording their response
exten => t,1,Playback(vm-goodbye)
exten => t,2,Hangup
Is there a way using the call files to send variables through to the extensions_custom.conf where you would expect to have more scripting ability, or is there a way in the call file to use the Read() function, and maybe do a little scripting?
Can I use the “Data” variable more than once for example if I wanted to insert an extra part into the playback?
I realize I may be stepping into building an “Application” or maybe using the AGI, if there is a better / simpler way of doing this, I am happy to do so.