[Freeswitch-users] serious problem in record_session

covici at ccs.covici.com covici at ccs.covici.com
Sat Sep 25 16:14:58 PDT 2010


OK, I had the following problems executing your idea -- I am sure its
because I don't know what I am doing, but only way to learn!  When I did
the bind_meta_app to the start_recording_extension it worked after a
fashioni.e. it started a new file, but kept the old one going.  Now what
I tried after that was I figured if I could execute record_session with
the same file name again it would close the file and all things would be
good.  In order to do this, I tried to set a variable to false
record_in_progress and execute an extension in that one which would set
it to true and if I hit the key again the variable would be true and
then it would close the file.  However what I ran into was that from the
extension called stop_recording where I have a condition for the
variable to be true, and an anti-application to set it to true if it
were false the set takes place, but the variable never actually gets
set.  I see the set, but if I log the variable its still false.  So what
am I doing wrong here?

Here are the two extensions I wrote:
<extension name="start_recording">
<condition field="destination_number" expression="^start_recording$">
<action application="execute_extension" data="stop_recording"/>
<action application="set"
data="record_fn=$${recordings_dir}/${caller_id_number}.${real_destination_number}.${strftime(%Y-%m-%d-%H-%M-%S)}.wav"
/>
<action application="record_session" data="${record_fn}"/>
</condition>
</extension>
<extension name="stop_recording">
<condition field="destination_number" expression="^stop_recording$" />
<condition field="record_in_progress" expression="^true$">
<action application="record_session" data="${record_fn}"/>
<action application="set" data="record_in_progress=false"/>
<anti-action application="set" data="record_in_progress=true"/>
</condition>
</extension>
with a meta_bind_app bound to start_recording.

Any ideas would be appreciated.

covici at ccs.covici.com wrote:

> Sounds like a plan.
> 
> Thanks.
> 
> Anthony Minessale <anthony.minessale at gmail.com> wrote:
> 
> > the easy way would be to bind to execute_extension instead of record
> > and make up an exten like start_record, then make an extension that
> > tests for destination_number to be "start_record" and do it from
> > there.
> > 
> > 
> > On Thu, Sep 23, 2010 at 9:34 AM,  <covici at ccs.covici.com> wrote:
> > > That would append to the same file -- I would like to have the time
> > > string be the current time, evaluated in real time -- is this possible?
> > >
> > > Brian West <brian at freeswitch.org> wrote:
> > >
> > >> Set RECORD_APPEND=true variable.
> > >>
> > >> /b
> > >>
> > >> On Sep 23, 2010, at 8:57 AM, covici at ccs.covici.com wrote:
> > >>
> > >> > Hi.  I am having a serious problem making record_session work properly
> > >> > in my dialplan -- it records fine using meta-app, but if I turn it off
> > >> > and on, it overwrites the previous file with the same time and date when
> > >> > the meta-app was invoked.  Is there anyway to make the time the current
> > >> > time so it would give another file?
> > >> >
> > >> > Thanks for any ideas.
> > >> >
> > >> > --
> > >> > Your life is like a penny.  You're going to lose it.  The question is:
> > >> > How do
> > >> > you spend it?
> > >> >
> > >> >         John Covici
> > >> >         covici at ccs.covici.com
> > >> >
> > >> > _______________________________________________
> > >> > FreeSWITCH-users mailing list
> > >> > FreeSWITCH-users at lists.freeswitch.org
> > >> > http://lists.freeswitch.org/mailman/listinfo/freeswitch-users
> > >> > UNSUBSCRIBE:http://lists.freeswitch.org/mailman/options/freeswitch-users
> > >> > http://www.freeswitch.org
> > >>
> > >>
> > >> _______________________________________________
> > >> FreeSWITCH-users mailing list
> > >> FreeSWITCH-users at lists.freeswitch.org
> > >> http://lists.freeswitch.org/mailman/listinfo/freeswitch-users
> > >> UNSUBSCRIBE:http://lists.freeswitch.org/mailman/options/freeswitch-users
> > >> http://www.freeswitch.org
> > >
> > > --
> > > Your life is like a penny.  You're going to lose it.  The question is:
> > > How do
> > > you spend it?
> > >
> > >         John Covici
> > >         covici at ccs.covici.com
> > >
> > > _______________________________________________
> > > FreeSWITCH-users mailing list
> > > FreeSWITCH-users at lists.freeswitch.org
> > > http://lists.freeswitch.org/mailman/listinfo/freeswitch-users
> > > UNSUBSCRIBE:http://lists.freeswitch.org/mailman/options/freeswitch-users
> > > http://www.freeswitch.org
> > >
> > 
> > 
> > 
> > -- 
> > Anthony Minessale II
> > 
> > FreeSWITCH http://www.freeswitch.org/
> > ClueCon http://www.cluecon.com/
> > Twitter: http://twitter.com/FreeSWITCH_wire
> > 
> > AIM: anthm
> > MSN:anthony_minessale at hotmail.com
> > GTALK/JABBER/PAYPAL:anthony.minessale at gmail.com
> > IRC: irc.freenode.net #freeswitch
> > 
> > FreeSWITCH Developer Conference
> > sip:888 at conference.freeswitch.org
> > googletalk:conf+888 at conference.freeswitch.org
> > pstn:+19193869900
> > 
> > _______________________________________________
> > FreeSWITCH-users mailing list
> > FreeSWITCH-users at lists.freeswitch.org
> > http://lists.freeswitch.org/mailman/listinfo/freeswitch-users
> > UNSUBSCRIBE:http://lists.freeswitch.org/mailman/options/freeswitch-users
> > http://www.freeswitch.org
> 
> -- 
> Your life is like a penny.  You're going to lose it.  The question is:
> How do
> you spend it?
> 
>          John Covici
>          covici at ccs.covici.com
> 
> _______________________________________________
> FreeSWITCH-users mailing list
> FreeSWITCH-users at lists.freeswitch.org
> http://lists.freeswitch.org/mailman/listinfo/freeswitch-users
> UNSUBSCRIBE:http://lists.freeswitch.org/mailman/options/freeswitch-users
> http://www.freeswitch.org

-- 
Your life is like a penny.  You're going to lose it.  The question is:
How do
you spend it?

         John Covici
         covici at ccs.covici.com



More information about the FreeSWITCH-users mailing list