Make sure that your sox/soxmix has MP3 encoding support, by executing "soxmix -h". If you have mp3 support, you will see it listed in the supported filetypes. If soxmix says mp3 (readonly), your version of sox was compiled without lame mp3 encoder support.
On my debian system I had to download the lame mp3 encoder source, compile and install, then download sox source, compile and install. The "apt-get install sox" version of sox doesn't include lame mp3 encoding support.
3. Extract lame, then ./configure ; make ; make install
4. Same for sox.
note: on current debian unstable, you might need to "apt-get install g++" before compiling lame or sox, I had c pre-processor (cpplus1) problems after upgrading some debian packages to current, including gcc, installing g++ resolved it.
222
333Working example of recording outbound sip calls.
by , Friday 05 of November, 2004 [12:12:08 UTC]
This is currently running on my asterisk box, and works very well.
Any abound call with the prefix of 8 is recorded.
;Setup variable for the directory
exten => _8.,1,SetVar(DIREC=/var/spool/asterisk/monitor)
;Setup the variable for the filename
exten => _8.,2,SetVar(CALLFILENAME=${TIMESTAMP}-${CALLERIDNUM}-${EXTEN:1})
;Dial the number via sip provider
exten => _8.,4,Dial(SIP/${EXTEN:1}@sipproxy.pipecall.com,60,t)
;Clean up after outbound calls which have been recorded.
; Combines the two files from asterisk and makes into one audio file.
exten => h,1,System(/usr/bin/soxmix ${DIREC}/${CALLFILENAME}-in.gsm ${DIREC}/${CALLFILENAME}-out.gsm ${DIREC}/${CALLFILENAME}.gsm)
;Remove the two files which we have converted to one.
exten => h,2,System(rm ${DIREC}/${CALLFILENAME}-in.gsm ${DIREC}/${CALLFILENAME}-out.gsm)
You will need soxmix compiled to do the combine of the two audio files.
After you have hung up, you will land up with one audio file of the conversation which has a file name that has the number dialed in it, the extension making the call and the time date stamp.
Bare in mind that the timestamp is different than the one in cdr log as the timestamp on the file is the time at the begining of the call and not the end, as it is in cdr. If you minus duration of the call from the timestamp in cdr you will get the timestamp on the audio file.
222
333soxmix. not somix
by , Wednesday 27 of October, 2004 [20:12:10 UTC]
Obviously a typo.
It is soxmix not somix as originally stated.
222
333Yes, soxmix
by , Monday 04 of October, 2004 [18:57:50 UTC]
From man sox:
sox infile outfile
...
soxmix infile1 infile2 outfile
...
soxmix is functionally the same as the command line program sox
expect sic that it takes two files as input and mixes the
audio together to produce a single file as output. It has a
restriction that both input files must be of the same data
type and sample rates.
This is simply another way to call sox. If you do not see this
option in your distribution, try upgrading sox.
222
333Somix?
by , Wednesday 29 of September, 2004 [01:04:24 UTC]
I have no idea what "somix" is. I know what, and have used "sox" for ages. The page above points to "sox", not "somix", and a search on the main "sox" page does not show anything called "somix".
If people are referring to sox, a common application, then please call it what it's page, and the application are called. "Sox", not "somix". If people are referring to "somix", which I can't find, then please point it to the somix page, or to the part of the Sox page that talks about somix...
Thanks
222
333Doesn't seem to work if called from an AGI Script
by , Sunday 12 of September, 2004 [19:45:29 UTC]
I set up the example as shown and it works for a phone dialing 8 then the number, but when called by a dial command from an agi script it stops working.
The only difference I see is that there is an extra answer on the console.
Any ideas?
Thanks.
222
333does this work with channel sip ?
by usear, Monday 30 of August, 2004 [21:52:06 UTC]
I have a laptop that's frequently behind firewalls and SIP frequently won't work. I've set up Asterisk on my home server, and I can contact the server and place calls either to the internal network or route them out through my DID provider - it also works in reverse. However, what I cannot do is place a call directly to a SIP phone without having to have created a context for the company.
In other words, I want to dial 1234@example.com from KIAX and have the phone with a SIP number of 1234@example.com ring with no example.com context in the extensions.conf file
It seems like I should be able to do it, but the IAX call handles the @ as a context marker & rejects the calls.
Any help would be appriciated
Using the Manager interface, I issue an Originate command. It indeed dials, and is handled in the dialpan, but the DIALSTATUS value is empty (I have tried answered and unanswered calls).
I am using Trixbox 2.6.18-53.1.4.el5 (SMP)
Any idea why this is so? (How can I determine how the call went?)
exten => s,1,NoOp(HANGUPCAUSE is ${HANGUPCAUSE})
...
Comments
333Re: Working example of recording outbound sip calls.
333Re: does this work with channel sip ?
333Working example of recording SIP inbound calls (and convert to MP3!)
Requires: soxmix (from sox distribution) and L.A.M.E.
exten => 2,1,Answer
exten => 2,2,Wait,1
exten => 2,3,SetVar(MONITOR_EXEC=/pbx/bin/soxmixmp3.sh)
exten => 2,4,SetVar(CALLFILENAME=pbx/recordings/${TIMESTAMP})
exten => 2,5,Monitor(wav|${CALLFILENAME}|mb)
exten => 2,6,Dial(SIP/100)
exten => 2,7,Hangup
==========================
/pbx/bin/soxmixmp3.sh :
- ! /bin/bash
outputfile=`echo $3 | sed s/\.wav$/\.mp3/`/usr/local/bin/soxmix $1 $2 $outputfile
rm $1 $2
==========================
Make sure that your sox/soxmix has MP3 encoding support, by executing "soxmix -h". If you have mp3 support, you will see it listed in the supported filetypes. If soxmix says mp3 (readonly), your version of sox was compiled without lame mp3 encoder support.
On my debian system I had to download the lame mp3 encoder source, compile and install, then download sox source, compile and install. The "apt-get install sox" version of sox doesn't include lame mp3 encoding support.
1. Download L.A.M.E. from:
http://lame.sourceforge.net/using.html
2. Download sox form:
http://sox.sourceforge.net/
3. Extract lame, then ./configure ; make ; make install
4. Same for sox.
note: on current debian unstable, you might need to "apt-get install g++" before compiling lame or sox, I had c pre-processor (cpplus1) problems after upgrading some debian packages to current, including gcc, installing g++ resolved it.
333Working example of recording outbound sip calls.
Any abound call with the prefix of 8 is recorded.
;Setup variable for the directory
exten => _8.,1,SetVar(DIREC=/var/spool/asterisk/monitor)
;Setup the variable for the filename
exten => _8.,2,SetVar(CALLFILENAME=${TIMESTAMP}-${CALLERIDNUM}-${EXTEN:1})
;Start recording
exten => _8.,3,Monitor(gsm,${CALLFILENAME})
;Dial the number via sip provider
exten => _8.,4,Dial(SIP/${EXTEN:1}@sipproxy.pipecall.com,60,t)
;Clean up after outbound calls which have been recorded.
; Combines the two files from asterisk and makes into one audio file.
exten => h,1,System(/usr/bin/soxmix ${DIREC}/${CALLFILENAME}-in.gsm ${DIREC}/${CALLFILENAME}-out.gsm ${DIREC}/${CALLFILENAME}.gsm)
;Remove the two files which we have converted to one.
exten => h,2,System(rm ${DIREC}/${CALLFILENAME}-in.gsm ${DIREC}/${CALLFILENAME}-out.gsm)
You will need soxmix compiled to do the combine of the two audio files.
After you have hung up, you will land up with one audio file of the conversation which has a file name that has the number dialed in it, the extension making the call and the time date stamp.
Bare in mind that the timestamp is different than the one in cdr log as the timestamp on the file is the time at the begining of the call and not the end, as it is in cdr. If you minus duration of the call from the timestamp in cdr you will get the timestamp on the audio file.
333soxmix. not somix
It is soxmix not somix as originally stated.
333Yes, soxmix
sox infile outfile
...
soxmix infile1 infile2 outfile
...
soxmix is functionally the same as the command line program sox
expect sic that it takes two files as input and mixes the
audio together to produce a single file as output. It has a
restriction that both input files must be of the same data
type and sample rates.
This is simply another way to call sox. If you do not see this
option in your distribution, try upgrading sox.
333Somix?
I have no idea what "somix" is. I know what, and have used "sox" for ages. The page above points to "sox", not "somix", and a search on the main "sox" page does not show anything called "somix".
If people are referring to sox, a common application, then please call it what it's page, and the application are called. "Sox", not "somix". If people are referring to "somix", which I can't find, then please point it to the somix page, or to the part of the Sox page that talks about somix...
Thanks
333Doesn't seem to work if called from an AGI Script
The only difference I see is that there is an extra answer on the console.
Any ideas?
Thanks.
333does this work with channel sip ?