All pastes #2538 Raw Edit

Kims

public text v1 · immutable
#2538 ·published 2004-12-01 16:24 UTC
rendered paste body
this patch allows the compilation of chan_capi-0.3.5 against current CVS-HEAD of asterisk.
this patch is underlies the GPL.

it works with chan_capi of Klaus-Peter Junghanns
 http://www.junghanns.net/asterisk/downloads/chan_capi.0.3.5.tar.gz
and asterisk CVS-HEAD as of 2004-11-17

it also incorporates the capiAnswerFax patch of Carl Sempla / Cedrik Hans
 http://www.mlkj.net/asterisk/chan_capi-0.3.5-patch.tar.bz2

* wget http://www.junghanns.net/asterisk/downloads/chan_capi.0.3.5.tar.gz
* copy the file 'chan_capi-0.3.5-patch.diff' into your chan_capi-0.3.5 directory
* run 'patch -p1 <chan_capi-0.3.5-patch.diff'
* checkout the asterisk, libpri and zaptel sources from cvs-HEAD
* 'make install' libpri, zaptel and asterisk
* 'make install' chan_capi
* restart asterisk 'etc/init.d/asterisk stop; sleep 1; /etc/init.d/asterisk start; sleep 2; asterisk -rcvvvvv'


bugs can be reported to
 f.dot.sautter.at.levigo.dot.de
or
 asterisk.at.sautter.dot.com

i hope this patch fits your needs!
 Frank Sautter


this is the short HOWTO of 'capiAnswerFax':
For those of you who have a CAPI card with an on-board DSP (like some Eicon
Diva Server), this patch allows you to receive faxes.
If you want to answer a channel in fax mode, use capiAnswerFax() instead of
Answer()
If you use Answer(), you will be in voice mode. If the hardware DSP detects
a fax tone, you can switch from voice to fax mode by calling
capiAnswerFax().

Example of use :
line number 123, play something, if a fax tone is detected, handle it
line number 124, answer directly in fax mode

[incoming]
exten => 123,1,Answer()
exten => 123,2,BackGround(jpop)
exten => 124,1,Goto(handle_fax,s,1)
exten => fax,1,Goto(handle_fax,s,1)

[handle_fax]
exten => s,1,capiAnswerFax(/tmp/${UNIQUEID})
exten => s,2,Hangup()
exten => h,1,deadagi,fax.php // Run sfftobmp and mail it.

The output of capiAnswerFax is a SFF file. Use sfftobmp to convert it.
With a Diva Server, theses features are allowed : fax up to 33600, high
resolution. Color Fax /JPEG Compression is disabled (I can't test it).

A fix for a dead lock issue is also included (Oct 22 18:06:00
WARNING[11275]: channel.c:472 ast_channel_walk_locked: Avoided initial
deadlock for 'CAPI[contr1/173720007]/7', 10 retries!)