mirror of
https://github.com/signalwire/freeswitch.git
synced 2025-05-31 18:55:49 +00:00
avoid seg on invalid params to record app.(MODAPP-63)
git-svn-id: http://svn.freeswitch.org/svn/freeswitch/trunk@7026 d0543943-73ff-0310-b7d9-9358b9ac24b2
This commit is contained in:
parent
7347719339
commit
33bd22a308
@ -115,6 +115,7 @@ EndProject
|
|||||||
Project("{2150E333-8FDC-42A3-9474-1A3956D46DE8}") = "dialplan", "dialplan", "{C7E2382E-2C22-4D18-BF93-80C6A1FFA7AC}"
|
Project("{2150E333-8FDC-42A3-9474-1A3956D46DE8}") = "dialplan", "dialplan", "{C7E2382E-2C22-4D18-BF93-80C6A1FFA7AC}"
|
||||||
ProjectSection(SolutionItems) = preProject
|
ProjectSection(SolutionItems) = preProject
|
||||||
conf\dialplan\default.xml = conf\dialplan\default.xml
|
conf\dialplan\default.xml = conf\dialplan\default.xml
|
||||||
|
conf\dialplan\public.xml = conf\dialplan\public.xml
|
||||||
EndProjectSection
|
EndProjectSection
|
||||||
EndProject
|
EndProject
|
||||||
Project("{2150E333-8FDC-42A3-9474-1A3956D46DE8}") = "directory", "directory", "{FC71C66E-E268-4EAD-B1F5-F008DC382E83}"
|
Project("{2150E333-8FDC-42A3-9474-1A3956D46DE8}") = "directory", "directory", "{FC71C66E-E268-4EAD-B1F5-F008DC382E83}"
|
||||||
|
@ -1126,7 +1126,7 @@ SWITCH_DECLARE(void) switch_core_db_test_reactive(switch_core_db_t *db, char *te
|
|||||||
\note the loadable module used is chosen based on the file extension
|
\note the loadable module used is chosen based on the file extension
|
||||||
*/
|
*/
|
||||||
SWITCH_DECLARE(switch_status_t) switch_core_file_open(switch_file_handle_t *fh,
|
SWITCH_DECLARE(switch_status_t) switch_core_file_open(switch_file_handle_t *fh,
|
||||||
const char *file_path, uint8_t channels, uint32_t rate, unsigned int flags, switch_memory_pool_t *pool);
|
_In_z_ const char *file_path, uint8_t channels, uint32_t rate, unsigned int flags, switch_memory_pool_t *pool);
|
||||||
/*!
|
/*!
|
||||||
\brief Read media from a file handle
|
\brief Read media from a file handle
|
||||||
\param fh the file handle to read from (must be initilized by you memset all 0 for read, fill in channels and rate for write)
|
\param fh the file handle to read from (must be initilized by you memset all 0 for read, fill in channels and rate for write)
|
||||||
|
@ -298,8 +298,11 @@ SWITCH_DECLARE(switch_status_t) switch_ivr_gentones(switch_core_session_t *sessi
|
|||||||
\param limit max limit to record for (0 for infinite)
|
\param limit max limit to record for (0 for infinite)
|
||||||
\return SWITCH_STATUS_SUCCESS if all is well
|
\return SWITCH_STATUS_SUCCESS if all is well
|
||||||
*/
|
*/
|
||||||
SWITCH_DECLARE(switch_status_t) switch_ivr_record_file(switch_core_session_t *session,
|
SWITCH_DECLARE(switch_status_t) switch_ivr_record_file(_In_ switch_core_session_t *session,
|
||||||
switch_file_handle_t *fh, char *file, switch_input_args_t *args, uint32_t limit);
|
_In_ switch_file_handle_t *fh,
|
||||||
|
_In_z_ const char *file,
|
||||||
|
_In_opt_ switch_input_args_t *args,
|
||||||
|
_In_ uint32_t limit);
|
||||||
|
|
||||||
|
|
||||||
/*!
|
/*!
|
||||||
|
@ -1253,7 +1253,7 @@ SWITCH_STANDARD_APP(record_function)
|
|||||||
int rate;
|
int rate;
|
||||||
|
|
||||||
channel = switch_core_session_get_channel(session);
|
channel = switch_core_session_get_channel(session);
|
||||||
assert(channel != NULL);
|
switch_assert(channel != NULL);
|
||||||
|
|
||||||
if (data && (mydata = switch_core_session_strdup(session, data))) {
|
if (data && (mydata = switch_core_session_strdup(session, data))) {
|
||||||
argc = switch_separate_string(mydata, ' ', argv, (sizeof(argv) / sizeof(argv[0])));
|
argc = switch_separate_string(mydata, ' ', argv, (sizeof(argv) / sizeof(argv[0])));
|
||||||
|
@ -42,6 +42,11 @@ SWITCH_DECLARE(switch_status_t) switch_core_file_open(switch_file_handle_t *fh,
|
|||||||
char stream_name[128] = "";
|
char stream_name[128] = "";
|
||||||
char *rhs = NULL;
|
char *rhs = NULL;
|
||||||
|
|
||||||
|
if (switch_strlen_zero(file_path)) {
|
||||||
|
switch_log_printf(SWITCH_CHANNEL_LOG, SWITCH_LOG_ERROR, "Invalid Filename\n");
|
||||||
|
return SWITCH_STATUS_FALSE;
|
||||||
|
}
|
||||||
|
|
||||||
if ((rhs = strstr(file_path, SWITCH_URL_SEPARATOR))) {
|
if ((rhs = strstr(file_path, SWITCH_URL_SEPARATOR))) {
|
||||||
switch_copy_string(stream_name, file_path, (rhs + 1) - file_path);
|
switch_copy_string(stream_name, file_path, (rhs + 1) - file_path);
|
||||||
ext = stream_name;
|
ext = stream_name;
|
||||||
|
@ -335,7 +335,7 @@ SWITCH_DECLARE(switch_status_t) switch_ivr_phrase_macro(switch_core_session_t *s
|
|||||||
}
|
}
|
||||||
|
|
||||||
SWITCH_DECLARE(switch_status_t) switch_ivr_record_file(switch_core_session_t *session,
|
SWITCH_DECLARE(switch_status_t) switch_ivr_record_file(switch_core_session_t *session,
|
||||||
switch_file_handle_t *fh, char *file, switch_input_args_t *args, uint32_t limit)
|
switch_file_handle_t *fh, const char *file, switch_input_args_t *args, uint32_t limit)
|
||||||
{
|
{
|
||||||
switch_channel_t *channel;
|
switch_channel_t *channel;
|
||||||
switch_dtmf_t dtmf = {0};
|
switch_dtmf_t dtmf = {0};
|
||||||
|
Loading…
x
Reference in New Issue
Block a user