Delayed Paging

I have had customers that would like to have delayed paging. This cuts down on the feedback if the extension creating the page is near a paging speaker. Here is the code. Both extensions are in the from-internal-custom context.

[from-internal-custom]

; Delayed paging. It this case, you dial 3205 to activate the paging system
; This context records your page, creates a call file that plays the message
; back. Extension 3206 actually plays back the file once the paging system
; answers. The third line of 3205 is used to set the extension number of your
; paging system.
exten => 3205,1,Answer
exten => 3205,2,Wait(2)
exten => 3205,n,set(pageext=“local/305”)
exten => 3205,n,flite(Reecord your message and then press the pound key)
exten => 3205,n,record(asterisk-recording:ulaw)
exten => 3205,n,system(echo “Channel: ${pageext}” > /var/spool/asterisk/tmp/john.call)
exten => 3205,n,system(echo “WaitTime: 20” >> /var/spool/asterisk/tmp/john.call)
exten => 3205,n,system(echo “Context: from-internal” >> /var/spool/asterisk/tmp/john.call)
exten => 3205,n,system(echo “Extension: 3206” >> /var/spool/asterisk/tmp/john.call)
exten => 3205,n,system(echo “Priority: 1” >> /var/spool/asterisk/tmp/john.call)
exten => 3205,n,system(chmod 777 /var/spool/asterisk/outgoing/john.call)
exten => 3205,n,system(mv /var/spool/asterisk/tmp/john.call /var/spool/asterisk/outgoing/)
exten => 3205,n,hangup()

exten => 3206,1,playback(beep)
exten => 3206,n,playback(asterisk-recording)
exten => 3206,n,Wait(2)
exten => 3206,n,Hangup