res_fax_spandsp: Fix crash when passing ulaw/alaw data to spandsp
authorMatthew Jordan <mjordan@digium.com>
Thu, 6 Mar 2014 02:22:59 +0000 (02:22 +0000)
committerMatthew Jordan <mjordan@digium.com>
Thu, 6 Mar 2014 02:22:59 +0000 (02:22 +0000)
commit38da8d2fdad47e378ec54af692d28cc6e55db5bd
tree8a50f7f9333b3fec70959b4b3628678b160ad24d
parent77ad5ec2e30a7fab0779288426c20de048332ea2
res_fax_spandsp: Fix crash when passing ulaw/alaw data to spandsp

When acting as a T.38 fax gateway, res_fax_spandsp would at times cause a crash
in libspandsp. This would occur when, during fax tone detection, a ulaw/alaw
frame would be passed to modem_connect_tones_rx. That particular routine
expects the data to be in slin format. This patch looks at the frame type and,
if the data is ulaw/alaw, converts the format to slin before passing it to
modem_connect_tones_rx.

Review: https://reviewboard.asterisk.org/r/3296

(closes issue ASTERISK-20149)
Reported by: Alexandr Gordeev
Tested by: Michal Rybarik
patches:
  spandsp_g711decode.diff uploaded by Michal Rybarik (license 6578)
........

Merged revisions 409990 from http://svn.asterisk.org/svn/asterisk/branches/11
........

Merged revisions 409991 from http://svn.asterisk.org/svn/asterisk/branches/12

git-svn-id: https://origsvn.digium.com/svn/asterisk/trunk@409996 65c4cc65-6c06-0410-ace0-fbb531ad65f3
res/res_fax_spandsp.c