[Freeswitch-users] How to stop a Recording when the user presses "#" on C# project?

Yitzchok adminjew at gmail.com
Tue Jun 7 07:55:51 MSD 2011


session.SetVariable("playback_terminators", "#");
session.RecordFile(fileName, 7000, 1000, 5);

This should also work if you need something more advanced.

var receivedFunction = (c, t) => (c == '#') ? "break" : "";
session.DtmfReceivedFunction += receivedFunction;
session.RecordFile(fileName, 7000, 1000, 5);
session.DtmfReceivedFunction -= receivedFunction;


Yitzchok


On Mon, Jun 6, 2011 at 9:31 PM, Bob Coleman <bobc at devassert.com> wrote:

> Hi,
>
> You just set the playback_terminators to a # before you issue the record
>
> Cheers
>
> Bob
>
> On Tue, Jun 7, 2011 at 11:29 AM, Frankie Yiu <frankie.k.yiu at gmail.com>
> wrote:
> > Hi there,
> >
> > I am working on a C# project and would like to record a message when the
> > user is ready to record.  Here is the API for C#:
> >  public int RecordFile(string file_name, int time_limit, int
> > silence_threshold, int silence_hits);
> >
> > This API will stop the call only on timeout or when there is seconds of
> > silence.  What I want to do is to let the user decide when to end the
> > recording by pressing a "#" key.  So how can I do that?  Do I have to use
> C
> > code to do that? (by sending event to C code side?)
> >
> > Thanks,
> > Frankie
> >
>
> _______________________________________________
> 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
>
-------------- next part --------------
An HTML attachment was scrubbed...
URL: http://lists.freeswitch.org/pipermail/freeswitch-users/attachments/20110606/2f411707/attachment-0001.html 


More information about the FreeSWITCH-users mailing list