[queues]
exten => *501,1,Noop(FILA TAGUATINGA)
same => n,ExecIf($["${CDR(calldate_first)}" == ""]?Set(CDR(calldate_first)=${STRFTIME(${EPOCH},,%Y-%m-%d %H:%M:%S)}))
same => n,ExecIf($["${CALLDATE_BILLSEC}" == ""]?Set(CALLDATE_BILLSEC=${STRFTIME(${EPOCH},,%Y-%m-%d %H-%M-%S)}))

same => n,Set(CHANNEL(language)=pt_BR)
same => n,Set(CHANNEL(musicclass)=default)
same => n,Set(_UNIQUEIDQUEUE=${UNIQUEID})
same => n,Set(DB(DESTINOCALL/${UNIQUEIDQUEUE})=Fila - TAGUATINGA)
;;same => n,ExecIf($[$["${CDR(destino)}" == ""]]?Set(CDR(destino)=TAGUATINGA))
;;same => n,ExecIf($[$["${CDR(destino_custom)}" == ""]]?Set(CDR(destino_custom)=*501))
same => n,Set(CDR(destino)=TAGUATINGA)
same => n,Set(CDR(destino_custom)=*501)
same => n,ExecIf($[$["${CDR(tipo)}" == ""]]?Set(CDR(tipo)=FILA))
same => n,Set(ODBC_SQLQUEUECALL()=*501,TAGUATINGA,${CALLERID(num)},${STRFTIME(${EPOCH},,%Y-%m-%d %H:%M:%S)},,,,${UNIQUEID},WAIT,${CONTATO_NOME},${CHANNEL})
same => n,Set(_FILAHANGUP=SIM)
same => n,Set(_SERVICELEVEL=60)
same => n,Set(_TEMPOABANDONADA=0)
same => n,Set(_QUEUENOME=TAGUATINGA)
same => n,Set(_CODIGOQUEUE=*501)
same => n,Set(_QUEUELOGSRVLEVEL=SIM)
same => n,Answer()

same => n,Queue(TAGUATINGA,tk,,,3600,,,)

same => n,Hangup()

[queue-dial]
exten => 101,1,Set(CDR_PROP(disable)=1)
same => n,Set(CHANNEL(language)=pt_BR)
same => n,GotoIf($[${DB_EXISTS(DND/6193033101)}]?dnd:nodnd)
same => n(nodnd),ExecIf($["${DIALER}" == "SIM"]?Set(ODBC_SQLQUEUESTATUS()=${DIALERSTARTSQL},${ID_CAMPANHA},${NOME_CAMPANHA},6193033101,${DIALER_NUMBER_NOME},${DIALER_NUMBER},${DIALER_DESTINO},${SEXO},${EXTRA1},${EXTRA2},${EXTRA3},${EXTRA4},${UNIQUEIDQUEUE},Ring,${NOME_EXTRA1},${NOME_EXTRA2},${NOME_EXTRA3},${NOME_EXTRA4},${SCRIPT_OPERADOR},${ID_DIALER_NUMBER}))
same => n,Dial(SIP/6193033101,,tkL(14400000)U(update-queue-dial,${UNIQUEIDQUEUE},101,PESQUISA)i)
same => n,Hangup()

same => n(dnd),Noop(RAMAL ${EXTEN} COM DND ATIVADO)
same => n,Hangup()