[Freeswitch-dev] Newbie Q
Hi there I am new to FreeSwitch and I have a question... I'd like to record a call/session outputing same length .wav files (all .wav files to be exactly 30 seconds long). I browsed through the FreeSwitch sources from GIT and I found the module 'mod_snapshot'. Would this module be the best start/base for the functionality I am looking for resp. are there other modules/scripts that I should better check first? -> I tried to build the module in MSVC Express 2010 but I get errors -> Anyone was recently successful building it? Thx in advance, P.
Welcome to FreeSWITCH! First off, let me just mention that this question is probably better suited to our -users list. (This is the -dev list which has a smaller audience and is reserved for more intense discussions.) If you don't get a satisfactory answer here then re-post on freeswitch-users list. Now, as far as your question goes... you have different options available to you but it really depends on how you are generating your calls. Also, do you want the call to last more than 30 seconds and have only the recording be 30 seconds? Do you want recording to start on early media or on answer? As an example of how to do a simple 30-second recording here's one that when you call it, it will start recording, play music for 30 sec, then end the recording and disconnect: <extension name="record 30 sec of MOH"> <condition field="destination_number" expression="^732664$"> <action application="answer"/> <action application="record_session" data="$${recordings_dir}/${uuid}.wav"/> <action application="sched_hangup" data="+30"/> <action application="playback" data="${hold_music}"/> </condition> </extension> Dial 732664 (i.e. "REC MOH" :) and just wait. You'll hear music and then at 30 seconds it will stop recording. Happy FreeSWITCHing! -MC On Tue, Nov 1, 2011 at 1:27 PM, P. Broennimann <peter@enovatiq.com> wrote:
Hi there
I am new to FreeSwitch and I have a question...
I'd like to record a call/session outputing same length .wav files (all .wav files to be exactly 30 seconds long).
I browsed through the FreeSwitch sources from GIT and I found the module 'mod_snapshot'. Would this module be the best start/base for the functionality I am looking for resp. are there other modules/scripts that I should better check first?
-> I tried to build the module in MSVC Express 2010 but I get errors -> Anyone was recently successful building it?
Thx in advance, P.
_______________________________________________ Join us at ClueCon 2011, Aug 9-11, Chicago http://www.cluecon.com 877-7-4ACLUE
FreeSWITCH-dev mailing list FreeSWITCH-dev@lists.freeswitch.org http://lists.freeswitch.org/mailman/listinfo/freeswitch-dev UNSUBSCRIBE:http://lists.freeswitch.org/mailman/options/freeswitch-dev http://www.freeswitch.org
Hi Michael Thx for answering. Sorry next time I'll post on the other list... Basically I am looking for a solution to split "on-the-fly" recordings on answer. The result for each call should be a consecutive/sequential set of wav files of each X seconds (saved on-the-fly in a specific directory and using a specific filename stucture)... I don't want to reinvent the wheel so that's why I asked if something similar already exists. Performance is quiet important here (small latency). P.S: I bought the FreeSwitch book and I am making progress learning :) Thx & cheers, P. 2011/11/1 Michael Collins <msc@freeswitch.org>
Welcome to FreeSWITCH!
First off, let me just mention that this question is probably better suited to our -users list. (This is the -dev list which has a smaller audience and is reserved for more intense discussions.) If you don't get a satisfactory answer here then re-post on freeswitch-users list.
Now, as far as your question goes... you have different options available to you but it really depends on how you are generating your calls. Also, do you want the call to last more than 30 seconds and have only the recording be 30 seconds? Do you want recording to start on early media or on answer?
As an example of how to do a simple 30-second recording here's one that when you call it, it will start recording, play music for 30 sec, then end the recording and disconnect:
<extension name="record 30 sec of MOH"> <condition field="destination_number" expression="^732664$"> <action application="answer"/> <action application="record_session" data="$${recordings_dir}/${uuid}.wav"/> <action application="sched_hangup" data="+30"/> <action application="playback" data="${hold_music}"/> </condition> </extension>
Dial 732664 (i.e. "REC MOH" :) and just wait. You'll hear music and then at 30 seconds it will stop recording.
Happy FreeSWITCHing!
-MC
On Tue, Nov 1, 2011 at 1:27 PM, P. Broennimann <peter@enovatiq.com> wrote:
Hi there
I am new to FreeSwitch and I have a question...
I'd like to record a call/session outputing same length .wav files (all .wav files to be exactly 30 seconds long).
I browsed through the FreeSwitch sources from GIT and I found the module 'mod_snapshot'. Would this module be the best start/base for the functionality I am looking for resp. are there other modules/scripts that I should better check first?
-> I tried to build the module in MSVC Express 2010 but I get errors -> Anyone was recently successful building it?
Thx in advance, P.
_______________________________________________ Join us at ClueCon 2011, Aug 9-11, Chicago http://www.cluecon.com 877-7-4ACLUE
FreeSWITCH-dev mailing list FreeSWITCH-dev@lists.freeswitch.org http://lists.freeswitch.org/mailman/listinfo/freeswitch-dev UNSUBSCRIBE:http://lists.freeswitch.org/mailman/options/freeswitch-dev http://www.freeswitch.org
_______________________________________________ Join us at ClueCon 2011, Aug 9-11, Chicago http://www.cluecon.com 877-7-4ACLUE
FreeSWITCH-dev mailing list FreeSWITCH-dev@lists.freeswitch.org http://lists.freeswitch.org/mailman/listinfo/freeswitch-dev UNSUBSCRIBE:http://lists.freeswitch.org/mailman/options/freeswitch-dev http://www.freeswitch.org
Maybe just record the entire call and then split it up afterwards using a wav-file post-processing program. Maybe sox or ffmpeg or something similar might work? Alternatively, you could use the API in FreeSWITCH to start and stop and start and stop the recording every 30 seconds, but that seems like overkill and lots of extra work compared to just using post-processing software. Plus, you'll miss bits of the recording between when you stop one segment and start the next. Is there some reason you need to be doing this on the fly versus post-processing? Alternatively, you could write a module in C for FreeSWITCH which taps the audio and you could buffer it internally in your module and then save out 30-second segments. This would let you get all of the audio with micro-second precision splits so you wouldn't loose any audio between segments, but it's an awful lot of work to go through compared to post-processing. On Tue, Nov 1, 2011 at 6:50 PM, P. Broennimann <peter@enovatiq.com> wrote:
Hi Michael
Thx for answering. Sorry next time I'll post on the other list...
Basically I am looking for a solution to split "on-the-fly" recordings on answer. The result for each call should be a consecutive/sequential set of wav files of each X seconds (saved on-the-fly in a specific directory and using a specific filename stucture)...
I don't want to reinvent the wheel so that's why I asked if something similar already exists. Performance is quiet important here (small latency).
P.S: I bought the FreeSwitch book and I am making progress learning :)
Thx & cheers, P.
2011/11/1 Michael Collins <msc@freeswitch.org>
Welcome to FreeSWITCH!
First off, let me just mention that this question is probably better suited to our -users list. (This is the -dev list which has a smaller audience and is reserved for more intense discussions.) If you don't get a satisfactory answer here then re-post on freeswitch-users list.
Now, as far as your question goes... you have different options available to you but it really depends on how you are generating your calls. Also, do you want the call to last more than 30 seconds and have only the recording be 30 seconds? Do you want recording to start on early media or on answer?
As an example of how to do a simple 30-second recording here's one that when you call it, it will start recording, play music for 30 sec, then end the recording and disconnect:
<extension name="record 30 sec of MOH"> <condition field="destination_number" expression="^732664$"> <action application="answer"/> <action application="record_session" data="$${recordings_dir}/${uuid}.wav"/> <action application="sched_hangup" data="+30"/> <action application="playback" data="${hold_music}"/> </condition> </extension>
Dial 732664 (i.e. "REC MOH" :) and just wait. You'll hear music and then at 30 seconds it will stop recording.
Happy FreeSWITCHing!
-MC
On Tue, Nov 1, 2011 at 1:27 PM, P. Broennimann <peter@enovatiq.com>wrote:
Hi there
I am new to FreeSwitch and I have a question...
I'd like to record a call/session outputing same length .wav files (all .wav files to be exactly 30 seconds long).
I browsed through the FreeSwitch sources from GIT and I found the module 'mod_snapshot'. Would this module be the best start/base for the functionality I am looking for resp. are there other modules/scripts that I should better check first?
-> I tried to build the module in MSVC Express 2010 but I get errors -> Anyone was recently successful building it?
Thx in advance, P.
_______________________________________________ Join us at ClueCon 2011, Aug 9-11, Chicago http://www.cluecon.com 877-7-4ACLUE
FreeSWITCH-dev mailing list FreeSWITCH-dev@lists.freeswitch.org http://lists.freeswitch.org/mailman/listinfo/freeswitch-dev UNSUBSCRIBE:http://lists.freeswitch.org/mailman/options/freeswitch-dev http://www.freeswitch.org
_______________________________________________ Join us at ClueCon 2011, Aug 9-11, Chicago http://www.cluecon.com 877-7-4ACLUE
FreeSWITCH-dev mailing list FreeSWITCH-dev@lists.freeswitch.org http://lists.freeswitch.org/mailman/listinfo/freeswitch-dev UNSUBSCRIBE:http://lists.freeswitch.org/mailman/options/freeswitch-dev http://www.freeswitch.org
_______________________________________________ Join us at ClueCon 2011, Aug 9-11, Chicago http://www.cluecon.com 877-7-4ACLUE
FreeSWITCH-dev mailing list FreeSWITCH-dev@lists.freeswitch.org http://lists.freeswitch.org/mailman/listinfo/freeswitch-dev UNSUBSCRIBE:http://lists.freeswitch.org/mailman/options/freeswitch-dev http://www.freeswitch.org
-- Eliot Gable "We do not inherit the Earth from our ancestors: we borrow it from our children." ~David Brower "I decided the words were too conservative for me. We're not borrowing from our children, we're stealing from them--and it's not even considered to be a crime." ~David Brower "Esse oportet ut vivas, non vivere ut edas." (Thou shouldst eat to live; not live to eat.) ~Marcus Tullius Cicero
Thx Eliot 4 ur answer Unfortunately post-processing in not an option -> This needs to happen on-the-fly. I am not scared of work and I have time so I will dig deep and try to figure out how to write/modify FreeSwitch C modules... Thanks & cheers, P. 2011/11/2 Eliot Gable <egable+freeswitch@gmail.com>
Maybe just record the entire call and then split it up afterwards using a wav-file post-processing program. Maybe sox or ffmpeg or something similar might work? Alternatively, you could use the API in FreeSWITCH to start and stop and start and stop the recording every 30 seconds, but that seems like overkill and lots of extra work compared to just using post-processing software. Plus, you'll miss bits of the recording between when you stop one segment and start the next. Is there some reason you need to be doing this on the fly versus post-processing? Alternatively, you could write a module in C for FreeSWITCH which taps the audio and you could buffer it internally in your module and then save out 30-second segments. This would let you get all of the audio with micro-second precision splits so you wouldn't loose any audio between segments, but it's an awful lot of work to go through compared to post-processing.
On Tue, Nov 1, 2011 at 6:50 PM, P. Broennimann <peter@enovatiq.com> wrote:
Hi Michael
Thx for answering. Sorry next time I'll post on the other list...
Basically I am looking for a solution to split "on-the-fly" recordings on answer. The result for each call should be a consecutive/sequential set of wav files of each X seconds (saved on-the-fly in a specific directory and using a specific filename stucture)...
I don't want to reinvent the wheel so that's why I asked if something similar already exists. Performance is quiet important here (small latency).
P.S: I bought the FreeSwitch book and I am making progress learning :)
Thx & cheers, P.
2011/11/1 Michael Collins <msc@freeswitch.org>
Welcome to FreeSWITCH!
First off, let me just mention that this question is probably better suited to our -users list. (This is the -dev list which has a smaller audience and is reserved for more intense discussions.) If you don't get a satisfactory answer here then re-post on freeswitch-users list.
Now, as far as your question goes... you have different options available to you but it really depends on how you are generating your calls. Also, do you want the call to last more than 30 seconds and have only the recording be 30 seconds? Do you want recording to start on early media or on answer?
As an example of how to do a simple 30-second recording here's one that when you call it, it will start recording, play music for 30 sec, then end the recording and disconnect:
<extension name="record 30 sec of MOH"> <condition field="destination_number" expression="^732664$"> <action application="answer"/> <action application="record_session" data="$${recordings_dir}/${uuid}.wav"/> <action application="sched_hangup" data="+30"/> <action application="playback" data="${hold_music}"/> </condition> </extension>
Dial 732664 (i.e. "REC MOH" :) and just wait. You'll hear music and then at 30 seconds it will stop recording.
Happy FreeSWITCHing!
-MC
On Tue, Nov 1, 2011 at 1:27 PM, P. Broennimann <peter@enovatiq.com>wrote:
Hi there
I am new to FreeSwitch and I have a question...
I'd like to record a call/session outputing same length .wav files (all .wav files to be exactly 30 seconds long).
I browsed through the FreeSwitch sources from GIT and I found the module 'mod_snapshot'. Would this module be the best start/base for the functionality I am looking for resp. are there other modules/scripts that I should better check first?
-> I tried to build the module in MSVC Express 2010 but I get errors -> Anyone was recently successful building it?
Thx in advance, P.
_______________________________________________ Join us at ClueCon 2011, Aug 9-11, Chicago http://www.cluecon.com 877-7-4ACLUE
FreeSWITCH-dev mailing list FreeSWITCH-dev@lists.freeswitch.org http://lists.freeswitch.org/mailman/listinfo/freeswitch-dev UNSUBSCRIBE:http://lists.freeswitch.org/mailman/options/freeswitch-dev http://www.freeswitch.org
_______________________________________________ Join us at ClueCon 2011, Aug 9-11, Chicago http://www.cluecon.com 877-7-4ACLUE
FreeSWITCH-dev mailing list FreeSWITCH-dev@lists.freeswitch.org http://lists.freeswitch.org/mailman/listinfo/freeswitch-dev UNSUBSCRIBE:http://lists.freeswitch.org/mailman/options/freeswitch-dev http://www.freeswitch.org
_______________________________________________ Join us at ClueCon 2011, Aug 9-11, Chicago http://www.cluecon.com 877-7-4ACLUE
FreeSWITCH-dev mailing list FreeSWITCH-dev@lists.freeswitch.org http://lists.freeswitch.org/mailman/listinfo/freeswitch-dev UNSUBSCRIBE:http://lists.freeswitch.org/mailman/options/freeswitch-dev http://www.freeswitch.org
-- Eliot Gable
"We do not inherit the Earth from our ancestors: we borrow it from our children." ~David Brower
"I decided the words were too conservative for me. We're not borrowing from our children, we're stealing from them--and it's not even considered to be a crime." ~David Brower
"Esse oportet ut vivas, non vivere ut edas." (Thou shouldst eat to live; not live to eat.) ~Marcus Tullius Cicero
_______________________________________________ Join us at ClueCon 2011, Aug 9-11, Chicago http://www.cluecon.com 877-7-4ACLUE
FreeSWITCH-dev mailing list FreeSWITCH-dev@lists.freeswitch.org http://lists.freeswitch.org/mailman/listinfo/freeswitch-dev UNSUBSCRIBE:http://lists.freeswitch.org/mailman/options/freeswitch-dev http://www.freeswitch.org
Before you go the route of hacking modules be sure to examine the extensive list of dialplan tools and FS cmd line APIs. Personally, I would experiment with the sched_api and uuid_broadcast API's. You could create a generic dialplan extension and then have the sched_api perform a uuid_broadcast that does an execute_extension on the uuid of the call leg. The (generic) extension you execute can stop the current recording, start up a new recording, and schedule another uuid_broadcast for 30 seconds later. It should be a fun exercise! :) -MC On Wed, Nov 2, 2011 at 7:56 AM, P. Broennimann <peter@enovatiq.com> wrote:
Thx Eliot 4 ur answer
Unfortunately post-processing in not an option -> This needs to happen on-the-fly.
I am not scared of work and I have time so I will dig deep and try to figure out how to write/modify FreeSwitch C modules...
Thanks & cheers, P.
2011/11/2 Eliot Gable <egable+freeswitch@gmail.com>
Maybe just record the entire call and then split it up afterwards using a wav-file post-processing program. Maybe sox or ffmpeg or something similar might work? Alternatively, you could use the API in FreeSWITCH to start and stop and start and stop the recording every 30 seconds, but that seems like overkill and lots of extra work compared to just using post-processing software. Plus, you'll miss bits of the recording between when you stop one segment and start the next. Is there some reason you need to be doing this on the fly versus post-processing? Alternatively, you could write a module in C for FreeSWITCH which taps the audio and you could buffer it internally in your module and then save out 30-second segments. This would let you get all of the audio with micro-second precision splits so you wouldn't loose any audio between segments, but it's an awful lot of work to go through compared to post-processing.
On Tue, Nov 1, 2011 at 6:50 PM, P. Broennimann <peter@enovatiq.com>wrote:
Hi Michael
Thx for answering. Sorry next time I'll post on the other list...
Basically I am looking for a solution to split "on-the-fly" recordings on answer. The result for each call should be a consecutive/sequential set of wav files of each X seconds (saved on-the-fly in a specific directory and using a specific filename stucture)...
I don't want to reinvent the wheel so that's why I asked if something similar already exists. Performance is quiet important here (small latency).
P.S: I bought the FreeSwitch book and I am making progress learning :)
Thx & cheers, P.
2011/11/1 Michael Collins <msc@freeswitch.org>
Welcome to FreeSWITCH!
First off, let me just mention that this question is probably better suited to our -users list. (This is the -dev list which has a smaller audience and is reserved for more intense discussions.) If you don't get a satisfactory answer here then re-post on freeswitch-users list.
Now, as far as your question goes... you have different options available to you but it really depends on how you are generating your calls. Also, do you want the call to last more than 30 seconds and have only the recording be 30 seconds? Do you want recording to start on early media or on answer?
As an example of how to do a simple 30-second recording here's one that when you call it, it will start recording, play music for 30 sec, then end the recording and disconnect:
<extension name="record 30 sec of MOH"> <condition field="destination_number" expression="^732664$"> <action application="answer"/> <action application="record_session" data="$${recordings_dir}/${uuid}.wav"/> <action application="sched_hangup" data="+30"/> <action application="playback" data="${hold_music}"/> </condition> </extension>
Dial 732664 (i.e. "REC MOH" :) and just wait. You'll hear music and then at 30 seconds it will stop recording.
Happy FreeSWITCHing!
-MC
On Tue, Nov 1, 2011 at 1:27 PM, P. Broennimann <peter@enovatiq.com>wrote:
Hi there
I am new to FreeSwitch and I have a question...
I'd like to record a call/session outputing same length .wav files (all .wav files to be exactly 30 seconds long).
I browsed through the FreeSwitch sources from GIT and I found the module 'mod_snapshot'. Would this module be the best start/base for the functionality I am looking for resp. are there other modules/scripts that I should better check first?
-> I tried to build the module in MSVC Express 2010 but I get errors -> Anyone was recently successful building it?
Thx in advance, P.
_______________________________________________ Join us at ClueCon 2011, Aug 9-11, Chicago http://www.cluecon.com 877-7-4ACLUE
FreeSWITCH-dev mailing list FreeSWITCH-dev@lists.freeswitch.org http://lists.freeswitch.org/mailman/listinfo/freeswitch-dev UNSUBSCRIBE:http://lists.freeswitch.org/mailman/options/freeswitch-dev http://www.freeswitch.org
_______________________________________________ Join us at ClueCon 2011, Aug 9-11, Chicago http://www.cluecon.com 877-7-4ACLUE
FreeSWITCH-dev mailing list FreeSWITCH-dev@lists.freeswitch.org http://lists.freeswitch.org/mailman/listinfo/freeswitch-dev UNSUBSCRIBE:http://lists.freeswitch.org/mailman/options/freeswitch-dev http://www.freeswitch.org
_______________________________________________ Join us at ClueCon 2011, Aug 9-11, Chicago http://www.cluecon.com 877-7-4ACLUE
FreeSWITCH-dev mailing list FreeSWITCH-dev@lists.freeswitch.org http://lists.freeswitch.org/mailman/listinfo/freeswitch-dev UNSUBSCRIBE:http://lists.freeswitch.org/mailman/options/freeswitch-dev http://www.freeswitch.org
-- Eliot Gable
"We do not inherit the Earth from our ancestors: we borrow it from our children." ~David Brower
"I decided the words were too conservative for me. We're not borrowing from our children, we're stealing from them--and it's not even considered to be a crime." ~David Brower
"Esse oportet ut vivas, non vivere ut edas." (Thou shouldst eat to live; not live to eat.) ~Marcus Tullius Cicero
_______________________________________________ Join us at ClueCon 2011, Aug 9-11, Chicago http://www.cluecon.com 877-7-4ACLUE
FreeSWITCH-dev mailing list FreeSWITCH-dev@lists.freeswitch.org http://lists.freeswitch.org/mailman/listinfo/freeswitch-dev UNSUBSCRIBE:http://lists.freeswitch.org/mailman/options/freeswitch-dev http://www.freeswitch.org
_______________________________________________ Join us at ClueCon 2011, Aug 9-11, Chicago http://www.cluecon.com 877-7-4ACLUE
FreeSWITCH-dev mailing list FreeSWITCH-dev@lists.freeswitch.org http://lists.freeswitch.org/mailman/listinfo/freeswitch-dev UNSUBSCRIBE:http://lists.freeswitch.org/mailman/options/freeswitch-dev http://www.freeswitch.org
participants (3)
-
Eliot Gable
-
Michael Collins
-
P. Broennimann