chan_pjsip: fix switching sending codec when asymmetric_rtp_codec=no
authorAlexei Gradinari <alex2grad@gmail.com>
Tue, 15 Nov 2016 21:01:27 +0000 (16:01 -0500)
committerGeorge Joseph <gjoseph@digium.com>
Wed, 30 Nov 2016 12:55:24 +0000 (07:55 -0500)
commite5e887be53ceb0b3ae4c0aa5a5cd055bd524fbde
tree94586b4e80b7ed5f105027ef0ea4290d6ce62df1
parentfdf4355bd054ce3a264f3d7a83725259b8acb32f
chan_pjsip: fix switching sending codec when asymmetric_rtp_codec=no

The sending codec is switched to the receiving codec and then
is switched back to the best native codec on EVERY receiving RTP packets.
This is because after call of ast_channel_set_rawwriteformat there is call
of ast_set_write_format which calls set_format which sets rawwriteformat
to the best native format.

This patch adds a new function ast_set_write_format_path which set
specific write path on channel and uses this function to switch
the sending codec.

ASTERISK-26603 #close

Change-Id: I5b7d098f8b254ce8f45546e6c36e5d324737f71d
channels/chan_pjsip.c
include/asterisk/channel.h
main/channel.c