[Asterisk-Users] FAX and AGI

Daniel Grad dg at online-business.ro
Wed Aug 31 02:44:55 MST 2005



Florian Overkamp wrote:

> Hi,
>
> Daniel Grad wrote:
>
>> I am writing a script (php script that runs via fastAGI) that takes 
>> incoming calls and processes them in various ways depending on 
>> settings from a database.
>> At some point, I need the script to receive an incoming fax. But the 
>> problem is that if I run NVFaxDetect from the script, then asterisk 
>> crashes. If I run rxFax without NVFaxDetect, then I get errors when 
>> sending the fax.
>>
>> What can I do? How can I receive a fax with a PHP fastAGI script?
>
>
> You could use a goto to exit the AGI script first and jump to a fax 
> reception context/extension.
>
> Florian


OK. I use a goto in the script, then exit the script. But, I get an 
error when sending the fax....

I finally brought down the problem to setting a variable before calling 
NVFaxDetect. So, if I have this in my dialplan:

[incoming]
...
exten => 
0800****888,1,Setvar(FAXFILE=/var/spool/asterisk/fax/${UNIQUEID}.tif)
exten => 0800****888,2,Goto(fax,2201,1)
...
[fax]
exten => 2201,1,NVFaxDetect()
exten => 2201,2,Hangup
exten => fax,1,RxFax(${FAXFILE}.tif)
...

Then I get an error when sending the fax. Here is the fax log:

...
efax: 14:34 remote has no document(s) to send, and can receive
efax: 14:34 local   196lpi 14.4kbps 8.5"/215mm  any   1D    -     -  0ms
efax: 14:34 remote  196lpi  9600bps 8.5"/215mm 11"/A4 2D    -     -  0ms
efax: 14:34 session 196lpi  9600bps 8.5"/215mm  any   1D    -     -  0ms
efax: 14:34 sent TSI - caller ID
efax: 14:36 sent DCS - session format
efax: 14:38 sent TCF - channel check of 1800 bytes
efax: 14:39 received DCN - disconnect
efax: 14:39 Error: invalid response to DCS (0x5f)
efax: 14:40 sent DCN - disconnect
efax: 14:41 failed -> /tmp/kde-root/kdeprintfax_VK9nvHmo.001
efax: 14:43 done, returning 3 (invalid modem response)

If I skip the Setvar part in the dialplan, everything works fine:

[incoming]
...
exten => 0800****888,1,Goto(fax,2201,1)
...
[fax]
exten => 2201,1,NVFaxDetect()
exten => 2201,2,Hangup
exten => fax,1,RxFax(/var/spool/asterisk/fax/${UNIQUEID}.tif)
...


Any ideas?


-------------- next part --------------
A non-text attachment was scrubbed...
Name: dg.vcf
Type: text/x-vcard
Size: 328 bytes
Desc: not available
Url : http://lists.digium.com/pipermail/asterisk-users/attachments/20050831/6d5a0c7b/dg.vcf


More information about the asterisk-users mailing list