Bug#303903: chan_modem.c should set default read & write format

Simon Peter Simon Peter <dn.tlp@gmx.net>, 303903@bugs.debian.org
Sat, 9 Apr 2005 17:19:33 +0200


This is a multi-part message in MIME format.

--Multipart=_Sat__9_Apr_2005_17_19_33_+0200_W7u0vKj7z8N_Hi23
Content-Type: text/plain; charset=US-ASCII
Content-Transfer-Encoding: 7bit

Package: asterisk
Version: 1.0.7.dfsg.1-2
Tags: patch

I kept getting error messages from the RxFAX() function (of package
asterisk-app-fax), like the following:

Apr  5 22:10:26 NOTICE[31327]: Unable to find a path from slin to
unknown
Apr  5 22:10:26 WARNING[31327]: Unable to restore read format on
'Modem[i4l]/ttyI2'
Apr  5 22:10:26 NOTICE[31327]: Unable to find a path from unknown to
slin
Apr  5 22:10:26 WARNING[31327]: Unable to restore write format on
'Modem[i4l]/ttyI2'

I saw from the source that RxFAX() is trying to restore the previous
read & write formats of the channel after fax reception. However, these
are never set for a modem channel.

I don't know why they're not set, as all other channel drivers set
default read & write formats. Also, SLINEAR seems to be the only
supported format, so it shouldn't harm setting these to that value. I
attached a small patch that does this and fixes my problem without harm.

Simon

--Multipart=_Sat__9_Apr_2005_17_19_33_+0200_W7u0vKj7z8N_Hi23
Content-Type: application/octet-stream;
 name="chan_modem.patch"
Content-Disposition: attachment;
 filename="chan_modem.patch"
Content-Transfer-Encoding: base64

ZGlmZiAtdSAtciBhc3Rlcmlzay0xLjAuNy5kZnNnLjEvY2hhbm5lbHMvY2hhbl9tb2RlbS5jIGFz
dGVyaXNrLWZpeC9jaGFubmVscy9jaGFuX21vZGVtLmMKLS0tIGFzdGVyaXNrLTEuMC43LmRmc2cu
MS9jaGFubmVscy9jaGFuX21vZGVtLmMJMjAwNC0xMC0yNCAyMzoxNToyMy4wMDAwMDAwMDAgKzAy
MDAKKysrIGFzdGVyaXNrLWZpeC9jaGFubmVscy9jaGFuX21vZGVtLmMJMjAwNS0wNC0wOSAxNzow
MzowNC4wMDAwMDAwMDAgKzAyMDAKQEAgLTUyNCwx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