[Asterisk-Users] Application Faxing using SIP

Lee Howard faxguy at howardsilvan.com
Mon Feb 20 08:14:24 MST 2006


Phil Blundell wrote:

>I suspect that the
>datapath through our regular network switches is probably close enough
>to lossless for this purpose as well.
>

You could be surprised.  I know that I have been suprised by how easy it 
is for a UDP packet to get dropped or lost.  I've had a few customers 
approach me that had both an Asterisk server and a HylaFAX server 
running on separate networked systems and wanted to use iaxmodem 
(running on the HylaFAX box, channels from the Asterisk box)... and in 
tests after configuration it has never worked well enough for me to 
sign-off on it, audio packets were getting dropped, and we've always 
gone the route of using termnetd+ttyd to use the modems "remotely"... so 
iaxmodem would run on the Asterisk server and HylaFAX would use a 
ttyd-created remote modem device.  (I haven't completely enjoyed this, 
either, but it's more acceptable to me than the arrangement of dropping 
UDP audio packets.)

In fact, the only environment where I have seen a suitable arrangement 
where iaxmodem communicates with an Asterisk server that is not running 
on the same host is at my own home-office... and the traffic on my home 
network is certainly more than in some of my customers'... so I'm not so 
sure that it always has to do with traffic volume... and I'm more 
inclined to think that it either has to do with the hardware involved 
(the ethernet switches, for example) or it has to do with other 
specifics of the network configuration.

Losing an audio packet here or there wouldn't normally be so bad for 
fax.  Normally I would expect the fax protocol, especially ECM protocol, 
to be able to recover from it.  However, Asterisk seems to not work in 
an ideal fashion for this purpose.  Whenever Asterisk encounters a lost 
audio packet something called "packet loss concealment" is performed by 
placing a "PLC" frame there as a placeholder.  When the audio is 
retransmitted the PLC frame is supposed to be converted into synthesized 
audio.  Between what I have been told and from what I have observed, 
this conversion of PLC frames into synthesized audio does not happen 
with uLaw, alaw, or slinear codecs (the only codecs suitable for fax).  
Consequently the PLC frame is converted into zero-data... or 20 ms of 
silence... which is probably the worst-possible thing that could happen.

A 20 ms period of silence will make the modem detect "carrier loss".  In 
fax protocol carrier loss is used to synchronize the communications... 
when carrier loss is detected the fax device knows that it's time to 
move on to the next step in the protocol.  So, depending at the timing 
of the packet loss things can go awry enough to cause the fax session to 
fail outright.

So... because a mere 20 ms gap in audio can cause so much trouble for 
faxing, it's very important to make sure that the lossless communication 
medium between Asterisk and the fax device is truly lossless.

Lee.




More information about the asterisk-users mailing list