How to stop a Recording when the user presses "#" on C# project?
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 * *
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@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
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@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@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@lists.freeswitch.org http://lists.freeswitch.org/mailman/listinfo/freeswitch-users UNSUBSCRIBE:http://lists.freeswitch.org/mailman/options/freeswitch-users http://www.freeswitch.org
participants (3)
-
Bob Coleman
-
Frankie Yiu
-
Yitzchok