Archive for the 'linux' category
Here’s how you can record calls to mp3 files with Asterisk. Insert these to extensions.conf: 123456789[globals] MONITOR_EXEC=/usr/local/bin/asterisk-wav2mp3 [macro-record] exten => s,1,Set(CALLFILENAME=${STRFTIME(${EPOCH},,%Y%m%d%H%M%S)}-${MACRO_CONTEXT}-${DIALEDPEERNUMBER}) exten => s,n,Set(POSTFIX=$["${CALLFILENAME}" =~ "\/([0-9a-zA-Z#_\-]+)$"]) exten => s,n,Set(CALLFILENAME=$["${CALLFILENAME}" : "([0-9a-zA-Z#_\-]+)"]${IF($[${LEN(${POSTFIX})}=0]?: _${POSTFIX})}) exten => s,n,Monitor(wav,${CALLFILENAME},m) Recording start example: exten => 555,1,Dial(SIP/1234,,M(record)) The script asterisk-wav2mp3 can be downloaded here. Make sure it’s runnable (chmod +x asterisk-wav2mp3). […]
If you have 2 or more outbound lines, and want to prioritize them, use this macro: 1234567exten => 1234,1,Macro(dialWithFallback,555666) [macro-dialWithFallback] exten => s,1,Dial(SIP/line1/${ARG1}) exten => s,n,GotoIf($["${DIALSTATUS}" = "CHANUNAVAIL"]?tryLine2) exten => s,n,Hangup() exten => s,n(tryLine2),Dial(SIP/line2/${ARG1}) In this case, 555666 will be called first on line1, and if it fails (channel unavailable), it will be called using […]
The problem: small upload at home (ADSL, 80kb/s), big FLAC files on HDD, serve them via www so a remote client can play them realtime – solution: on-demand mp3 streaming, which automatically converts FLAC file streams to MP3 data. So if a client wants a FLAC file from the webserver, it returns the file in […]
I wanted a script to automatically watch for new emails, get the sender, subject and attachments from them, move the attachments to a directory and insert sender/subject info into a MySQL database. I needed a solution for extracing mail files from big UNIX-style mailbox files, then parse them and extract attachments separately.
About me
I'm Nonoo. This is my blog about music, sounds, filmmaking, amateur radio, computers, programming, electronics and other things I'm obsessed with.
... »