add bridged timestamp and hangup_complete_with_xml=true to add xml_cdr to the body of hangup_complete events

This commit is contained in:
Anthony Minessale
2011-04-28 13:46:39 -05:00
parent a391d82b57
commit bd471fc6a9
6 changed files with 97 additions and 26 deletions
+22 -17
View File
@@ -239,20 +239,23 @@ SWITCH_DECLARE(switch_size_t) switch_fd_read_line(int fd, char *buf, switch_size
SWITCH_DECLARE(switch_status_t) switch_frame_alloc(switch_frame_t **frame, switch_size_t size);
SWITCH_DECLARE(switch_status_t) switch_frame_dup(switch_frame_t *orig, switch_frame_t **clone);
SWITCH_DECLARE(switch_status_t) switch_frame_free(switch_frame_t **frame);
SWITCH_DECLARE(switch_bool_t) switch_is_number(const char *str);
/*!
\brief Evaluate the truthfullness of a string expression
\param expr a string expression
\return true or false
*/
#define switch_true(expr)\
((expr && ( !strcasecmp(expr, "yes") ||\
!strcasecmp(expr, "on") ||\
!strcasecmp(expr, "true") ||\
!strcasecmp(expr, "enabled") ||\
!strcasecmp(expr, "active") ||\
!strcasecmp(expr, "allow") ||\
(switch_is_number(expr) && atoi(expr)))) ? SWITCH_TRUE : SWITCH_FALSE)
static inline int switch_true(const char *expr)
{
return ((expr && ( !strcasecmp(expr, "yes") ||
!strcasecmp(expr, "on") ||
!strcasecmp(expr, "true") ||
!strcasecmp(expr, "enabled") ||
!strcasecmp(expr, "active") ||
!strcasecmp(expr, "allow") ||
(switch_is_number(expr) && atoi(expr)))) ? SWITCH_TRUE : SWITCH_FALSE);
}
#define switch_true_buf(expr)\
((( !strcasecmp(expr, "yes") ||\
@@ -268,14 +271,16 @@ SWITCH_DECLARE(switch_status_t) switch_frame_free(switch_frame_t **frame);
\param expr a string expression
\return true or false
*/
#define switch_false(expr)\
((expr && ( !strcasecmp(expr, "no") ||\
!strcasecmp(expr, "off") ||\
!strcasecmp(expr, "false") ||\
!strcasecmp(expr, "disabled") ||\
!strcasecmp(expr, "inactive") ||\
!strcasecmp(expr, "disallow") ||\
(switch_is_number(expr) && !atoi(expr)))) ? SWITCH_TRUE : SWITCH_FALSE)
static inline int switch_false(const char *expr)
{
return ((expr && ( !strcasecmp(expr, "no") ||
!strcasecmp(expr, "off") ||
!strcasecmp(expr, "false") ||
!strcasecmp(expr, "disabled") ||
!strcasecmp(expr, "inactive") ||
!strcasecmp(expr, "disallow") ||
(switch_is_number(expr) && !atoi(expr)))) ? SWITCH_TRUE : SWITCH_FALSE);
}
SWITCH_DECLARE(switch_status_t) switch_resolve_host(const char *host, char *buf, size_t buflen);
@@ -670,7 +675,7 @@ SWITCH_DECLARE(switch_time_t) switch_str_time(const char *in);
SWITCH_DECLARE(unsigned int) switch_separate_string(_In_ char *buf, char delim, _Post_count_(return) char **array, unsigned int arraylen);
SWITCH_DECLARE(unsigned int) switch_separate_string_string(char *buf, char *delim, _Post_count_(return) char **array, unsigned int arraylen);
SWITCH_DECLARE(switch_bool_t) switch_is_number(const char *str);
SWITCH_DECLARE(char *) switch_strip_spaces(char *str, switch_bool_t dup);
SWITCH_DECLARE(char *) switch_strip_whitespace(const char *str);
SWITCH_DECLARE(char *) switch_strip_commas(char *in, char *out, switch_size_t len);