diff options
Diffstat (limited to 'res')
-rw-r--r-- | res/res_pjsip_rfc3326.c | 41 | ||||
-rw-r--r-- | res/res_srtp.c | 1 | ||||
-rw-r--r-- | res/stasis_recording/stored.c | 11 |
3 files changed, 23 insertions, 30 deletions
diff --git a/res/res_pjsip_rfc3326.c b/res/res_pjsip_rfc3326.c index 5ac16f024..76b0d08b0 100644 --- a/res/res_pjsip_rfc3326.c +++ b/res/res_pjsip_rfc3326.c @@ -35,32 +35,35 @@ static void rfc3326_use_reason_header(struct ast_sip_session *session, struct pjsip_rx_data *rdata) { - const pj_str_t str_reason = { "Reason", 6 }; - pjsip_generic_string_hdr *header = pjsip_msg_find_hdr_by_name(rdata->msg_info.msg, &str_reason, NULL); - char buf[20], *cause, *text; + static const pj_str_t str_reason = { "Reason", 6 }; + pjsip_generic_string_hdr *header; + char buf[20]; + char *cause; + char *text; int code; - if (!header) { - return; - } + header = pjsip_msg_find_hdr_by_name(rdata->msg_info.msg, &str_reason, NULL); + for (; header; + header = pjsip_msg_find_hdr_by_name(rdata->msg_info.msg, &str_reason, header->next)) { + ast_copy_pj_str(buf, &header->hvalue, sizeof(buf)); + cause = ast_skip_blanks(buf); - ast_copy_pj_str(buf, &header->hvalue, sizeof(buf)); - cause = ast_skip_blanks(buf); + if (strncasecmp(cause, "Q.850", 5) || !(cause = strstr(cause, "cause="))) { + continue; + } - if (strncasecmp(cause, "Q.850", 5) || !(cause = strstr(cause, "cause="))) { - return; - } + /* If text is present get rid of it */ + if ((text = strstr(cause, ";"))) { + *text = '\0'; + } - /* If text is present get rid of it */ - if ((text = strstr(cause, ";"))) { - *text = '\0'; - } + if (sscanf(cause, "cause=%30d", &code) != 1) { + continue; + } - if (sscanf(cause, "cause=%30d", &code) != 1) { - return; + ast_channel_hangupcause_set(session->channel, code & 0x7f); + break; } - - ast_channel_hangupcause_set(session->channel, code & 0x7f); } static int rfc3326_incoming_request(struct ast_sip_session *session, struct pjsip_rx_data *rdata) diff --git a/res/res_srtp.c b/res/res_srtp.c index 1077f2337..cda1291fa 100644 --- a/res/res_srtp.c +++ b/res/res_srtp.c @@ -41,7 +41,6 @@ #if HAVE_SRTP_VERSION > 1 # include <srtp2/srtp.h> -# include <srtp2/crypto_types.h> # include "srtp/srtp_compat.h" # include <openssl/rand.h> #else diff --git a/res/stasis_recording/stored.c b/res/stasis_recording/stored.c index ac216ff8c..909524e8f 100644 --- a/res/stasis_recording/stored.c +++ b/res/stasis_recording/stored.c @@ -123,18 +123,9 @@ static int split_path(const char *path, char **dir, char **file) return -1; } -#if defined(__AST_DEBUG_MALLOC) *dir = ast_strdup(real_dir); /* Dupe so we can ast_free() */ -#else - /* - * ast_std_free() and ast_free() are the same thing at this time - * so we don't need to dupe. - */ - *dir = real_dir; - real_dir = NULL; -#endif /* defined(__AST_DEBUG_MALLOC) */ *file = ast_strdup(file_portion); - return 0; + return (*dir && *file) ? 0 : -1; } struct match_recording_data { |