mirror of
https://github.com/signalwire/freeswitch.git
synced 2026-11-08 20:43:51 +00:00
add timelimit to record
git-svn-id: http://svn.freeswitch.org/svn/freeswitch/trunk@3475 d0543943-73ff-0310-b7d9-9358b9ac24b2
This commit is contained in:
1 parent
fe376294fc
commit
d288ae58a8
10 files changed
+148
-120
No files matched your search
@@ -132,10 +132,20 @@ static void record_function(switch_core_session_t *session, char *data)
|
||||
{
|
||||
switch_channel_t *channel;
|
||||
switch_status_t status;
|
||||
uint32_t limit = 0;
|
||||
char *path;
|
||||
char *p;
|
||||
|
||||
channel = switch_core_session_get_channel(session);
|
||||
assert(channel != NULL);
|
||||
|
||||
status = switch_ivr_record_file(session, NULL, data, on_dtmf, NULL, 0);
|
||||
path = switch_core_session_strdup(session, data);
|
||||
if ((p = strchr(path, '+'))) {
|
||||
*p++ = '\0';
|
||||
limit = atoi(p);
|
||||
}
|
||||
|
||||
status = switch_ivr_record_file(session, NULL, path, on_dtmf, NULL, 0, limit);
|
||||
|
||||
if (!switch_channel_ready(channel) || (status != SWITCH_STATUS_SUCCESS && !SWITCH_STATUS_IS_BREAK(status))) {
|
||||
switch_channel_hangup(channel, SWITCH_CAUSE_DESTINATION_OUT_OF_ORDER);
|
||||
|
||||
Reference in new issue
Block a user