|
|
@ -1445,7 +1445,7 @@ int ast_rtp_early_bridge(struct ast_channel *dest, struct ast_channel *src)
|
|
|
|
struct ast_rtp_protocol *destpr = NULL, *srcpr = NULL;
|
|
|
|
struct ast_rtp_protocol *destpr = NULL, *srcpr = NULL;
|
|
|
|
enum ast_rtp_get_result audio_dest_res = AST_RTP_GET_FAILED, video_dest_res = AST_RTP_GET_FAILED;
|
|
|
|
enum ast_rtp_get_result audio_dest_res = AST_RTP_GET_FAILED, video_dest_res = AST_RTP_GET_FAILED;
|
|
|
|
enum ast_rtp_get_result audio_src_res = AST_RTP_GET_FAILED, video_src_res = AST_RTP_GET_FAILED;
|
|
|
|
enum ast_rtp_get_result audio_src_res = AST_RTP_GET_FAILED, video_src_res = AST_RTP_GET_FAILED;
|
|
|
|
int srccodec, nat_active = 0;
|
|
|
|
int srccodec, destcodec, nat_active = 0;
|
|
|
|
|
|
|
|
|
|
|
|
/* Lock channels */
|
|
|
|
/* Lock channels */
|
|
|
|
ast_channel_lock(dest);
|
|
|
|
ast_channel_lock(dest);
|
|
|
@ -1498,6 +1498,17 @@ int ast_rtp_early_bridge(struct ast_channel *dest, struct ast_channel *src)
|
|
|
|
srccodec = srcpr->get_codec(src);
|
|
|
|
srccodec = srcpr->get_codec(src);
|
|
|
|
else
|
|
|
|
else
|
|
|
|
srccodec = 0;
|
|
|
|
srccodec = 0;
|
|
|
|
|
|
|
|
if (audio_dest_res == AST_RTP_TRY_NATIVE && destpr->get_codec)
|
|
|
|
|
|
|
|
destcodec = destpr->get_codec(dest);
|
|
|
|
|
|
|
|
else
|
|
|
|
|
|
|
|
destcodec = 0;
|
|
|
|
|
|
|
|
/* Ensure we have at least one matching codec */
|
|
|
|
|
|
|
|
if (!(srccodec & destcodec)) {
|
|
|
|
|
|
|
|
ast_channel_unlock(dest);
|
|
|
|
|
|
|
|
if (src)
|
|
|
|
|
|
|
|
ast_channel_unlock(src);
|
|
|
|
|
|
|
|
return 0;
|
|
|
|
|
|
|
|
}
|
|
|
|
/* Consider empty media as non-existant */
|
|
|
|
/* Consider empty media as non-existant */
|
|
|
|
if (audio_src_res == AST_RTP_TRY_NATIVE && !srcp->them.sin_addr.s_addr)
|
|
|
|
if (audio_src_res == AST_RTP_TRY_NATIVE && !srcp->them.sin_addr.s_addr)
|
|
|
|
srcp = NULL;
|
|
|
|
srcp = NULL;
|
|
|
|