mirror of
https://github.com/signalwire/freeswitch.git
synced 2026-10-29 22:54:18 +00:00
add timout to record and time tables to all the channel events
git-svn-id: http://svn.freeswitch.org/svn/freeswitch/trunk@5236 d0543943-73ff-0310-b7d9-9358b9ac24b2
This commit is contained in:
1 parent
1730f202dd
commit
a1d4140ce6
9 files changed
+55
-14
No files matched your search
@@ -550,6 +550,7 @@ SWITCH_STANDARD_API(session_record_function)
|
||||
char *mycmd = NULL, *argv[4] = { 0 };
|
||||
char *uuid = NULL, *action = NULL, *path = NULL;
|
||||
int argc = 0;
|
||||
uint32_t limit = 0;
|
||||
|
||||
if (session) {
|
||||
return SWITCH_STATUS_FALSE;
|
||||
@@ -570,7 +571,8 @@ SWITCH_STANDARD_API(session_record_function)
|
||||
uuid = argv[0];
|
||||
action = argv[1];
|
||||
path = argv[2];
|
||||
|
||||
limit = argv[3] ? atoi(argv[3]) : 0;
|
||||
|
||||
if (!(rsession = switch_core_session_locate(uuid))) {
|
||||
stream->write_function(stream, "-Error Cannot locate session!\n");
|
||||
return SWITCH_STATUS_SUCCESS;
|
||||
@@ -581,7 +583,7 @@ SWITCH_STANDARD_API(session_record_function)
|
||||
}
|
||||
|
||||
if (!strcasecmp(action, "start")) {
|
||||
switch_ivr_record_session(rsession, path, NULL);
|
||||
switch_ivr_record_session(rsession, path, limit, NULL);
|
||||
} else if (!strcasecmp(action, "stop")) {
|
||||
switch_ivr_stop_record_session(rsession, path);
|
||||
} else {
|
||||
@@ -1230,7 +1232,7 @@ static switch_api_interface_t session_record_api_interface = {
|
||||
/*.interface_name */ "session_record",
|
||||
/*.desc */ "session record",
|
||||
/*.function */ session_record_function,
|
||||
/*.syntax */ "<uuid> [start|stop] <path>",
|
||||
/*.syntax */ "<uuid> [start|stop] <path> [<limit>]",
|
||||
/*.next */ &broadcast_api_interface
|
||||
};
|
||||
|
||||
|
||||
@@ -142,6 +142,11 @@ static void record_function(switch_core_session_t *session, char *data)
|
||||
|
||||
path = switch_core_session_strdup(session, data);
|
||||
if ((p = strchr(path, '+'))) {
|
||||
char *q = p - 1;
|
||||
while(q && *q == ' ') {
|
||||
*q = '\0';
|
||||
q--;
|
||||
}
|
||||
*p++ = '\0';
|
||||
limit = atoi(p);
|
||||
}
|
||||
@@ -158,10 +163,24 @@ static void record_function(switch_core_session_t *session, char *data)
|
||||
static void record_session_function(switch_core_session_t *session, char *data)
|
||||
{
|
||||
switch_channel_t *channel;
|
||||
char *p, *path = NULL;
|
||||
uint32_t limit = 0;
|
||||
|
||||
channel = switch_core_session_get_channel(session);
|
||||
assert(channel != NULL);
|
||||
|
||||
switch_ivr_record_session(session, data, NULL);
|
||||
path = switch_core_session_strdup(session, data);
|
||||
if ((p = strchr(path, '+'))) {
|
||||
char *q = p - 1;
|
||||
while(q && *q == ' ') {
|
||||
*q = '\0';
|
||||
q--;
|
||||
}
|
||||
*p++ = '\0';
|
||||
limit = atoi(p);
|
||||
}
|
||||
|
||||
switch_ivr_record_session(session, path, limit, NULL);
|
||||
}
|
||||
|
||||
|
||||
|
||||
Reference in new issue
Block a user