summaryrefslogtreecommitdiff
path: root/channels
diff options
context:
space:
mode:
authorRichard Mudgett <rmudgett@digium.com>2014-08-20 22:49:32 +0000
committerRichard Mudgett <rmudgett@digium.com>2014-08-20 22:49:32 +0000
commite8b72c6f4b572e3e26d9ed60de5a0bda51aebd22 (patch)
tree781ef1c04fad9324d27c9d2e5effccb7d28ec37b /channels
parentab526502e6fbca26fc049d6a983620239f8ddb9c (diff)
chan_pjsip: Update media translation paths when new SDP negotiated.
On a SIP reinvite that changes media strams, the PJSIP channel driver was flooding the log with "Asked to transmit frame type %s, while native formats is %s" warnings. * Fixes PJSIP not setting up translation paths when the formats change on a reinvite. AFS-63 was effectively reintroduced because of the media formats work. res_pjsip_sdp_rtp.c:set_caps() * Improved the unexpected frame format WARNING message to include more information. * Added protective locking while altering formats on a channel. Reworked set_format() to simplify and protect the formats under manipulation. * Restored some code that got lost in the media_formats work. (channel.c:set_format() and res_pjsip_sdp_rtp.c:set_caps()) AFS-137 #close Reported by: Mark Michelson Review: https://reviewboard.asterisk.org/r/3906/ git-svn-id: https://origsvn.digium.com/svn/asterisk/branches/13@421645 65c4cc65-6c06-0410-ace0-fbb531ad65f3
Diffstat (limited to 'channels')
-rw-r--r--channels/chan_pjsip.c14
1 files changed, 11 insertions, 3 deletions
diff --git a/channels/chan_pjsip.c b/channels/chan_pjsip.c
index 0c535d703..7680aec54 100644
--- a/channels/chan_pjsip.c
+++ b/channels/chan_pjsip.c
@@ -58,6 +58,7 @@ ASTERISK_FILE_VERSION(__FILE__, "$Revision$")
#include "asterisk/stasis_channels.h"
#include "asterisk/indications.h"
#include "asterisk/format_cache.h"
+#include "asterisk/translate.h"
#include "asterisk/threadstorage.h"
#include "asterisk/features_config.h"
#include "asterisk/pickup.h"
@@ -654,14 +655,21 @@ static int chan_pjsip_write(struct ast_channel *ast, struct ast_frame *frame)
return 0;
}
if (ast_format_cap_iscompatible_format(ast_channel_nativeformats(ast), frame->subclass.format) == AST_FORMAT_CMP_NOT_EQUAL) {
- struct ast_str *cap_buf = ast_str_alloca(64);
+ struct ast_str *cap_buf = ast_str_alloca(128);
+ struct ast_str *write_transpath = ast_str_alloca(256);
+ struct ast_str *read_transpath = ast_str_alloca(256);
ast_log(LOG_WARNING,
- "Asked to transmit frame type %s, while native formats is %s (read/write = %s/%s)\n",
+ "Channel %s asked to send %s frame when native formats are %s (rd:%s->%s;%s wr:%s->%s;%s)\n",
+ ast_channel_name(ast),
ast_format_get_name(frame->subclass.format),
ast_format_cap_get_names(ast_channel_nativeformats(ast), &cap_buf),
+ ast_format_get_name(ast_channel_rawreadformat(ast)),
ast_format_get_name(ast_channel_readformat(ast)),
- ast_format_get_name(ast_channel_writeformat(ast)));
+ ast_translate_path_to_str(ast_channel_readtrans(ast), &read_transpath),
+ ast_format_get_name(ast_channel_writeformat(ast)),
+ ast_format_get_name(ast_channel_rawwriteformat(ast)),
+ ast_translate_path_to_str(ast_channel_writetrans(ast), &write_transpath));
return 0;
}
if (media->rtp) {