how to set freepbx call recordings to mp3 stereo? - ubuntu-14.04

how to set freepbx calls to mp3 stereo? Currently, the recordings in mixmonitor WAV. Please help
-freepbx 12.0.76
-ubuntu 14
-asterisk 11

Note, I use Centos. The following may need to be adjusted for your OS.
I use the following script to convert the MixMonitor output to MP3.
You need to install lame on your machine to use this script.
#!/bin/bash
wavfile=/path/to/RecordedWavFiles/$1
lame -b 192 -m m $wavfile ${wavfile%.*}.mp3
rm -f $1
Note that the script deletes the wav file, so maybe remove that line until you are sure it's working properly.
Save it somewhere as converttomp3.sh and set the permissions accordingly with chmod so it can be executed.
In FreePBX, go to Settings> Advanced Settings.
Change Display Readonly Settings to True and save.
Change Override Readonly Settings to True and save.
Refresh the page.
Now you'll find a setting called Post Call Recording Script
Put in the full path to the converttomp3.sh script along with ^${CALLFILENAME}
eg. /usr/bin/converttomp3.sh ^${CALLFILENAME}
I'm not sure you need the ^ character, but that's what the documentation recommends. If it doesn't work, try removing it.
Save and update, and then give it a go.

You need create script which convert wav to mp3(or hire someone).
After that put that script in mixmonitor script field in general options(freepbx options in some versions) tab.

Related

LXDE: Change text in logout session

I have installed LXDE on my Ubuntu PC (not Lubuntu). I want to change the text in the logout session. The default text is "Logout LXDE session ?". But I want to personalize it. I've already changed the picture of the logout session. Can you help me? Thank you very much.
BowStar
I don’t know yet how to solve this in a completely and permanent way, but you can create a new logout dialogue box:
Make a Folder and, inside it, click with the right mouse button to create a new empty file (a simply txt file) with the name "temp-lubuntu-logout" (you can change the file name after the conclusion of the work.
Paste this text, changing the items to fit your options:
!/bin/sh
lxsession-logout --prompt "Your custom message" --banner "Your logo" \
--side "left | top | right | bottom (The position of the logo)"
Open with the terminal the folder where is your temp-lubuntu-logout file and make it executable with this command:
sudo chmod +x temp-lubuntu-logout
That’s all! You just created a script file!
To verify is it is working, write in the terminal:
./temp-lubuntu-logout
(dont forget the dot before the /)
Now I can’t help more them this. You need to link this script to the the command of a app. Or you can change the lubuntu-logout script with your new script file (you may, for example, rename the original script to "former-lubuntu-logout" and your file to "lubuntu-logout". Probably, the path to the "lubuntu-logout" file is /usr/bin).
https://crisnepita.wordpress.com/2012/08/12/cambiar-un-poco-la-ventana-de-cerrar-sesion-en-lubuntu/
https://unix.stackexchange.com/questions/170029/command-to-log-out-of-lxde-directly/171880
http://tunealxde.blogspot.pt/2015/02/tunea-el-dialogo-de-cierre-de-sesion-de.html
I have found a way to change it.
Warning
This requires you to know what you are doing.
Use your favorite hex editor and edit file /usr/bin/lxsession-logout
Scroll all the way down the file, then go up until you see a human-readable section.
Over there, on a long string, there is the logout menu in bytes.
Once you change stuff in there, and save the binary, if you did not break something it will work. For deleting something, just overwrite its section with spaces, same for text and labels.
Tip: only edit and don't change any appearance order or add more bytes at some index because it will scramble the offset table of the file and will become corrupted.

CUPS printing remote(http://) files from command line

I am trying to create a custom script to control my CANON SELPHY PRINTER form the command-line.
lp -d Canon_CP900 -o media="CP_C_size" /Users/sangyookim/Desktop/selphy.jpg
I have the tested the above code and it's working perfectly as I intend it to.
But I have stumbled upon a problem.
When I replace the /Users/sangyookim/Desktop/selphy.jpg or filname to a web link such as the below, it will return me unable to access.. No such file or directory
http://res.cloudinary.com/splexz/image/upload/v1447239237/yer60xuvd6nmeldcbivd.png
How can I print images from the web using CUPS command line?
You cannot directly print a remote web page (because most Linux commands, lp included, do not know about URLs).
At least, you'll need to first fetch that web page using a command line HTTP client like wget or curl, then use another command (with lp or lpr) to print it (and perhaps later remove that downloaded file from your local filesystem).
For images, you probably would need some converter before printing them, e.g. the convert command from ImageMagick (which happens to understand URLs, thanks to Mark Setchell for commenting on this), to convert them to some .pdf or perhaps .ps file (unless you have configured lp or CUPS to do the conversion automagically). Maybe you could use a2ps
You could write some script (or shell function) to do all the job.
In limited cases, you might also consider using some network file systems NFS, CIFS or set up some FUSE (I don't recommend that).

Identifying file updations in NSIS

In NSIS is there any way to identify whether the application file is modified from the user side while updating the application using installer?
My requirement is while updating the application, we need to give warning message in case of user modify the application file. If 'Yes' we need to update the file, otherwise we should not update.
You probably have two options; you can get the modified time with GetFileTime or use something like the MD5 plugin (md5dll::GetMD5File).
You could save the original values in a .ini when you install and then compare with these values when updating...
Use archive attribute. Archive attribute is there especially for such purpose.
Below steps demonstrates the behaviour of archive bit:
Unset archive bit of any file in your pc, using Properties > advanced > untick "File is ready for archiving"
Edit and save the file with an appropriate tool. For example Notepad for a text file.
Note that archive bit of the file is set, signalling that this file is modified.
So the method will be like this:
Unset archive bit of all necessary source files in NSIS compiler PC
In NSIS script use [File /a] to extract the source files to destination computer preserving attributes
While reinstalling use GetFileAttributes to detect if the file is modified or original and take steps accordingly.

"batch" files in bash

I want to make a "batch" file so to say for some bash commands (convert.sh). I think it would be best to describe the situation. i have a $#!^ ton of mp4 videos that i want converted into mp3's. it would take me an unreasonable amount of time to convert them using ffmpeg -i /root/name\ of\ video.mp4 /name\ of\ video.mp3 for every single video. not to mention the fact that all the file names are long and complicated so typos are a possibility. so i want to know how to make a shell script (for bash) that will take every file with the extension .mp4 and convert it to a .mp3 with the same name one by one. as in it converts one then when it done it moves on to the next one. im using a lightweight version of linux so any 3rd part soft probably wont work so i need to use ffmpeg...
many thanks in advance for any assistance you can provide
PS: i cant seem to get the formatting sytax on the website to work right so if somone can format this for me and maybe post a link to a manual on how it works that would be much appreciated =)
PPS: i understand that questions about using the ffmpeg command should be asked on superuser however since i dont so much have any questions about the specific command and this relates more to scripting a bash file i figure this is the right place
A bash for loop should do it for you in no time:
SRC_DIR=/root
DST_DIR=/somewhereelse
for FILE in ${SRC_DIR}/*.mp4
do
ffmpeg -i "${FILE}" "${DST_DIR}/$(basename \"${FILE}\" .mp4).mp3"
done
Sorry - I don't know the ffmpeg command line options, so I just copied exactly what's in your post.
1) use find:
find . -name \*.mp4 | xargs ./my_recode_script.sh
2) my_recode_script.sh - see this question
so you can easily change the extension for output file name
the rest is trivial scripting job:
ffmpeg -i $name $new_name # in my_recode_script.sh after changing extension
this is enough for one-time script, if you want something reusable, wrap it with yet another script which receive path to dir, extensions from which to which to recode and call other parts :)

Stripping Audio From Vob Files through command prompt

What we need to do is either, extract the audio from a group or singular Vob video file and convert it to a .Wav format. Now the process of actually extracting the audio and converting it can be done from a third party application however this application has to be activated from a batch or c# script. The media we are retrieving the vob files from always comes from the CD drive and will always be placed in the same folder location once the conversion is complete.
In shot I need a program or script that can be activated remotely to extract and convert vob files to .WAV.
Any help will be greatly appreciated.
I only install ffmpeg on Windows and put in cmd this command:
ffmpeg -i [VOB_file_route].VOB [WAV_file_output_route].wav
And that's all, just works.
To do somthing like this you will need to use VLC and cmd they work togeather well and will allow you to strip video and audio from a file easily

Resources