summaryrefslogtreecommitdiff
path: root/channels
diff options
context:
space:
mode:
authorJoshua Colp <jcolp@digium.com>2012-10-09 21:35:53 +0000
committerJoshua Colp <jcolp@digium.com>2012-10-09 21:35:53 +0000
commit766d133c622fe34358e35231b0cb60c3283a68f9 (patch)
tree38a20989fef30dc556c9d1fa9c12e41c35be9bfd /channels
parent3e1d2917bbb8d307f3b0c99c5a6c35c33bcfba41 (diff)
Improve logging for DTLS-SRTP failure situations.
(closes issue ASTERISK-20487) Reported by: mjordan ........ Merged revisions 374756 from http://svn.asterisk.org/svn/asterisk/branches/11 git-svn-id: https://origsvn.digium.com/svn/asterisk/trunk@374757 65c4cc65-6c06-0410-ace0-fbb531ad65f3
Diffstat (limited to 'channels')
-rw-r--r--channels/chan_sip.c18
1 files changed, 15 insertions, 3 deletions
diff --git a/channels/chan_sip.c b/channels/chan_sip.c
index b938d2d81..09fef2c99 100644
--- a/channels/chan_sip.c
+++ b/channels/chan_sip.c
@@ -5574,9 +5574,21 @@ static int dialog_initialize_dtls_srtp(const struct sip_pvt *dialog, struct ast_
return -1;
}
- if (!(dtls = ast_rtp_instance_get_dtls(rtp)) ||
- dtls->set_configuration(rtp, &dialog->dtls_cfg) ||
- !(*srtp = sip_srtp_alloc())) {
+ if (!(dtls = ast_rtp_instance_get_dtls(rtp))) {
+ ast_log(LOG_ERROR, "No DTLS-SRTP support present on engine for RTP instance '%p', was it compiled with support for it?\n",
+ rtp);
+ return -1;
+ }
+
+ if (dtls->set_configuration(rtp, &dialog->dtls_cfg)) {
+ ast_log(LOG_ERROR, "Attempted to set an invalid DTLS-SRTP configuration on RTP instance '%p'\n",
+ rtp);
+ return -1;
+ }
+
+ if (!(*srtp = sip_srtp_alloc())) {
+ ast_log(LOG_ERROR, "Failed to create required SRTP structure on RTP instance '%p'\n",
+ rtp);
return -1;
}