[macro-find_me] exten => s,1,Wait(0.2) exten => s,n,SET(DB(findme/${UNIQUEID})=FALSE) exten => s,n,SET(FINDME_COUNT=${IF($[ ${ISNULL(${FINDME_COUNT})} = 1 ] ? 0 : ${FINDME_COUNT})}) exten => s,n,SET(FINDME_COUNT=$[ ${FINDME_COUNT} + 1]) exten => s,n,SET(CALLERID(number)=${IF($[ ${ISNULL(${ARG2})} = 1 ] ? ${CALLERIDNUM} : ${ARG2})}) exten => s,n,GotoIf($[${ISNULL(${SCREEN_FILE_${MACRO_EXTEN}})} = 1]?record|1:dial|1) exten => dial,1,GotoIf($[${FINDME_COUNT} = 1] ? 2 : 3) exten => dial,2,Macro(speech|Please hold while we dial the specified number) exten => dial,3,Dial(${ARG1}|60|gmM(screen^${SCREEN_FILE_${MACRO_EXTEN}}^${UNIQUEID})) exten => dial,n,NoOp(${UNIQUEID}) exten => dial,n,GotoIf($[${DB(findme/${UNIQUEID})} = TRUE]?clean|1) exten => clean,1,System(/bin/rm ${SCREEN_FILE}) exten => clean,n,HangUp() exten => record,1,SetVar(SCREEN_FILE_${MACRO_EXTEN}=/tmp/${CALLERID(number)}-${EPOCH}) exten => record,n,Macro(speech|Please record your name after the tone followed by the pound key.) exten => record,n,Record(${SCREEN_FILE_${MACRO_EXTEN}}.gsm|6|25) exten => record,n,Goto(dial|1) exten => h,1,Goto(clean|1) [macro-screen] exten => s,1,Macro(speech|You have a call from) exten => s,n,Playback(${ARG1}) exten => s,n,Macro(speech_file|press 1 to accept this call or any other key to deny) exten => s,n,Read(ACCEPT|${FILE}|1) exten => s,n,GotoIf($[${ACCEPT} = 1 ] ?yes|1:no|1) exten => no,1,SET(DB(findme/${ARG2})=FALSE) exten => no,n,Set(MACRO_RESULT=CONTINUE) exten => yes,1,SET(DB(findme/${ARG2})=TRUE)