Skip to main content

Callback Script without Password

Posted by nomattera on Tue, 02/12/2013

;; Verify Callback pincode

exten => s,1,Wait(0.3)
exten => s,2,NoCDR()
exten => s,3,progress()

exten => s,n,NoCDR()
exten => s,n,progress()
#exten => s,n,read(input,custom/pincode,4,n,,10)
#exten => s,n,NoOp(Pincode: ${ARG3} -- Input: ${input})
#exten => s,n,GotoIf($["${input}" != "${ARG3}"]?7:9)
#exten => s,n,Playback(custom/incorrect_pincode,noanswer)
#exten => s,n,Congestion()

;; Verify Callback pincode
exten => s,1,Wait(0.3)
exten => s,2,NoCDR()
exten => s,3,progress()
exten => s,4,read(input,custom/pincode,4,n,,10)
exten => s,5,NoOp(Pincode: ${ARG3} -- Input: ${input})
exten => s,6,GotoIf($["${input}" != "${ARG3}"]?7:9)
exten => s,7,Playback(custom/incorrect_pincode,noanswer)
exten => s,8,Congestion()

;;Create Callback file
exten => s,9,Set(caller=${CALLERID(num)})
exten => s,10,Set(CALLERID(name)=${ARG2}${CALLERID(name)})
exten => s,11,NoOp(CALLERID(name): $CALLERID(name) -- ${CALLERID(num)})

exten => s,12,system(echo "Channel: SIP/${ARG1}${TL_DASH}${tenant}" > /tmp/${CALLERID(name)}.call)
exten => s,13,system(echo "Callerid: ${CALLERID(name)}" >> /tmp/${CALLERID(name)}.call)
exten => s,14,system(echo "Context: from-inside${TL_DASH}${tenant}" >> /tmp/${CALLERID(name)}.call)
exten => s,15,system(echo "Extension: ${caller}" >> /tmp/${CALLERID(name)}.call)
exten => s,16,system(echo "Archive: yes" >> /tmp/${CALLERID(name)}.call)

;;Kill call wait a sec and initiate callback
exten => s,17,Ringing
exten => s,18,Wait(2)
exten => s,19,system(mv /tmp/${CALLERID(name)}.call /var/spool/asterisk/outgoing/)
exten => s,20,Hangup(17)

exten => t,1,Playback(custom/incorrect_pincode,noanswer)
exten => t,n,Congestion()

Help guys i need to remove the password from this script completely help, it will also help you if you need a callback script with passwords on your server.