mirror of
https://github.com/signalwire/freeswitch.git
synced 2026-07-23 20:51:58 +00:00
BOUNTY-9 (Thank you Xpander Communications)
git-svn-id: http://svn.freeswitch.org/svn/freeswitch/trunk@14889 d0543943-73ff-0310-b7d9-9358b9ac24b2
This commit is contained in:
@@ -333,6 +333,8 @@ struct switch_file_handle {
|
||||
const char *file;
|
||||
const char *func;
|
||||
int line;
|
||||
char *file_path;
|
||||
char *spool_path;
|
||||
};
|
||||
|
||||
/*! \brief Abstract interface to an asr module */
|
||||
|
||||
@@ -110,6 +110,7 @@ SWITCH_BEGIN_EXTERN_C
|
||||
#define SWITCH_PATH_SEPARATOR "/"
|
||||
#endif
|
||||
#define SWITCH_URL_SEPARATOR "://"
|
||||
#define SWITCH_AUDIO_SPOOL_PATH_VARIABLE "audio_spool_path"
|
||||
#define SWITCH_BRIDGE_HANGUP_CAUSE_VARIABLE "bridge_hangup_cause"
|
||||
#define SWITCH_READ_TERMINATOR_USED_VARIABLE "read_terminator_used"
|
||||
#define SWITCH_SEND_SILENCE_WHEN_IDLE_VARIABLE "send_silence_when_idle"
|
||||
|
||||
@@ -66,11 +66,9 @@ SWITCH_DECLARE(int) switch_isxdigit(int c);
|
||||
codec->implementation->iananame, \
|
||||
codec->implementation->samples_per_second, \
|
||||
codec->implementation->microseconds_per_packet / 1000)
|
||||
#ifdef WIN32
|
||||
#define switch_is_file_path(file) (file && (*file == '\\' || *(file +1) == ':' || *file == '/' || strstr(file, SWITCH_URL_SEPARATOR)))
|
||||
#else
|
||||
#define switch_is_file_path(file) (file && ((*file == '/') || strstr(file, SWITCH_URL_SEPARATOR)))
|
||||
#endif
|
||||
|
||||
|
||||
|
||||
/*!
|
||||
\brief Test for NULL or zero length string
|
||||
\param s the string to test
|
||||
@@ -553,6 +551,30 @@ SWITCH_DECLARE(char *) switch_url_decode(char *s);
|
||||
SWITCH_DECLARE(switch_bool_t) switch_simple_email(const char *to, const char *from, const char *headers, const char *body, const char *file);
|
||||
SWITCH_DECLARE(char *) switch_find_end_paren(const char *s, char open, char close);
|
||||
|
||||
|
||||
static inline switch_bool_t switch_is_file_path(const char *file)
|
||||
{
|
||||
const char *e;
|
||||
int r;
|
||||
|
||||
if (*file == '[' && *(file + 1) == *SWITCH_PATH_SEPARATOR) {
|
||||
if ((e = switch_find_end_paren(file, '[', ']'))) {
|
||||
file = e + 1;
|
||||
}
|
||||
}
|
||||
|
||||
#ifdef WIN32
|
||||
r = (file && (*file == '\\' || *(file +1) == ':' || *file == '/' || strstr(file, SWITCH_URL_SEPARATOR)));
|
||||
#else
|
||||
r = (file && ((*file == '/') || strstr(file, SWITCH_URL_SEPARATOR)));
|
||||
#endif
|
||||
|
||||
return r ? SWITCH_TRUE : SWITCH_FALSE;
|
||||
|
||||
}
|
||||
|
||||
|
||||
|
||||
SWITCH_DECLARE(int) switch_parse_cidr(const char *string, uint32_t *ip, uint32_t *mask, uint32_t *bitp);
|
||||
SWITCH_DECLARE(switch_status_t) switch_network_list_create(switch_network_list_t **list, const char *name, switch_bool_t default_type, switch_memory_pool_t *pool);
|
||||
SWITCH_DECLARE(switch_status_t) switch_network_list_add_cidr_token(switch_network_list_t *list, const char *cidr_str, switch_bool_t ok, const char *token);
|
||||
|
||||
Reference in New Issue
Block a user