que es

viernes, 22 de julio de 2022

linux logs rotation

configurando la rotación de logs en linux:

/etc/logrotate.d

 vi nameFileLog.logrotate

/var/log/asterisk/ecus.txt {
   missingok
   rotate 2
   daily
   su asterisk asterisk
}

jueves, 21 de julio de 2022

python gtts

file tts.py

libraries

from gtts import gTTS

# The text that you want to convert to audio
mytext = "Bienvenido toroautos"

# Language in which you want to convert
language = 'en'

# Passing the text and language to the engine
tts = gTTS(text=mytext, lang=language, slow=False)

# Saving the converted audio in a wav file named sample
tts.save('tts.mp3')


Call

[tts]
exten => 220,1,Answer
    same => n,Background(welcome)
    same => n,Set(result=$(SHELL(python3 py/tts.py )))
    same => n,Background(py/tts.mp3)
    same => n,Background(es/thanks-for-calling-today.gsm)
    same => n,Hangup()