Send a Fax during a call

Is it possible to send a fax during an call on a DAHDI Channel, at the moment when sendFAX starts to send, the Dahdi channel hangs up.

this is the dial plan

exten => _555170,1,Answer()
exten => _555170,n,Playback(tt-weasels)
exten => _555170,n,Wait(7)
exten => _555170,n,GoTo(Send-fax,s,1)                                                                            
;exten => _555170,n,AGI(sendfax.php) ;<< (not used) does the same as send fax
exten => _555170,n,Hangup()

[Send-fax]
exten => s,1,NoOp(send a fax)
exten => s,n,Set(FAXOPT(ecm)=yes)
exten => s,n,Set(FAXOPT(headerinfo)=Faxy fax team)
exten => s,n,Set(FAXOPT(localstationid)=15555551212)
exten => s,n,Set(FAXOPT(maxrate)=14400)
exten=> s,n,Set(FAXOPT(minrate)=2400)                                                                                                 
exten => s,n,SendFAX(/fax/faxtext.tiff,d)
exten => h,1,NoOp(FAXOPT(ecm) : ${FAXOPT(ecm)})

In chan_dahdi.conf I have
faxdetect=yes
faxbuffers=>12,half , tried with and with out this enabled.

The call comes in plays tt-weasles , waits 7 seconds during this time I press ready on the fax machine and walk back to my desk. Then sendFAX starts, but asterisk hangs up the calls, here is copy of the debug with fax debug on and pri span debug set to 2.

one handling message for SAPI/TEI=0/0
    -- Executing [555170@from-pstn:4] Goto("DAHDI/1-1", "Send-fax,s,1") in new stack
    -- Goto (Send-fax,s,1)
    -- Executing [s@Send-fax:1] NoOp("DAHDI/1-1", "send a fax") in new stack
    -- Executing [s@Send-fax:2] Set("DAHDI/1-1", "FAXOPT(filename)=") in new stack
[Nov 15 11:09:30] WARNING[25612]: res_fax.c:2660 acf_faxopt_write: channel 'DAHDI/1-1' set FAXOPT(filename) to '' is unhandled!
    -- Executing [s@Send-fax:3] Set("DAHDI/1-1", "FAXOPT(ecm)=yes") in new stack
    -- Executing [s@Send-fax:4] Set("DAHDI/1-1", "FAXOPT(headerinfo)=Faxy fax team") in new stack
    -- Executing [s@Send-fax:5] Set("DAHDI/1-1", "FAXOPT(localstationid)=15555551212") in new stack
    -- Executing [s@Send-fax:6] Set("DAHDI/1-1", "FAXOPT(maxrate)=14400") in new stack
    -- Executing [s@Send-fax:7] Set("DAHDI/1-1", "FAXOPT(minrate)=2400") in new stack
    -- Executing [s@Send-fax:8] SendFAX("DAHDI/1-1", "/fax/faxtext.tiff,d") in new stack
    -- Channel 'DAHDI/1-1' sending FAX:
    --    /fax/faxtext.tiff
    -- Channel 'DAHDI/1-1' FAX session '24' started
    -- FAX handle 0: [ 000.000075 ], STAT_EVT_STRT_TX       st: IDLE         rt: IDLENSTX
    -- FAX handle 0: [ 000.000116 ], STAT_EVT_TX_HW_RDY     st: WT_TX_HW_RDY rt: TRDYNHTY
    -- FAX handle 0: [ 000.000136 ], P30EVN_SEND_STARTED
       > Channel 'DAHDI/1-1' fax session '24', [ 000.304310 ], channel sent 15 frames (300 ms) of silence.
       > Channel 'DAHDI/1-1' fax session '24', [ 000.504323 ], channel sent 10 frames (200 ms) of energy.

< TEI: 0 State 7(Multi-frame established)
< V(A)=11, V(S)=11, V(R)=14
< K=7, RC=1, l3_initiated=0, reject_except=0, ack_pend=0
< T200_id=0, N200=3, T203_id=32768
< [ 02 01 1c 16 08 02 00 01 45 08 02 80 90 ]
< Informational frame:
< SAPI: 00  C/R: 1 EA: 0
<  TEI: 000        EA: 1
< N(S): 014   0: 0
< N(R): 011   P: 0
< 9 bytes of data
< Protocol Discriminator: Q.931 (8)  len=9
< TEI=0 Call Ref: len= 2 (reference 1/0x1) (Sent from originator)
< Message Type: DISCONNECT (69)
< [08 02 80 90]
< Cause (len= 4) [ Ext: 1  Coding: CCITT (ITU) standard (0)  Spare: 0  Location: User (0)
<                  Ext: 1  Cause: Normal Clearing (16), class = Normal Event (1) ]
-- Got ACK for N(S)=11 to (but not including) N(S)=11
-- T200 requested to stop when not started
T203 requested to start without stopping first
-- Starting T203 timer
Received message for call 0x5fe7d00 on link 0x6050670 TEI/SAPI 0/0
-- Processing IE 8 (cs0, Cause)
-- Found active call: 0x5fe7d00 cref:1
q931.c:8707 post_handle_q931_message: Call 1 enters state 12 (Disconnect Indication).  Hold state: Idle

> TEI: 0 State 7(Multi-frame established)
> V(A)=11, V(S)=11, V(R)=15
> K=7, RC=1, l3_initiated=0, reject_except=0, ack_pend=0
> T200_id=0, N200=3, T203_id=32768
> [ 02 01 01 1e ]
> Supervisory frame:
> SAPI: 00  C/R: 1 EA: 0
>  TEI: 000        EA: 1
> Zero: 0     S: 0 01: 1  [ RR (receive ready) ]
> N(R): 015 P/F: 0
> 0 bytes of data
Done handling message for SAPI/TEI=0/0
    -- Span 1: Channel 0/1 got hangup request, cause 16
    -- FAX handle 0: [ 000.523699 ], STAT_EVT_TMR_INT_EXP   st: WT_DIS       rt: XXXXNTIX
    -- FAX handle 0: [ 003.025213 ], STAT_EVT_HW_CLOSE      st: WT_HW_CLS    rt: WCLSNCLS
    -- FAX handle 0: [ 003.025263 ], STAT_SES_COMPLETE
    -- FAX handle 0: [ 003.025283 ], P30EVN_COMPLETE

< TEI: 0 State 7(Multi-frame established)
< V(A)=11, V(S)=11, V(R)=15
< K=7, RC=1, l3_initiated=0, reject_except=0, ack_pend=0
< T200_id=0, N200=3, T203_id=32768
< [ 02 01 01 17 ]
< Supervisory frame:
< SAPI: 00  C/R: 1 EA: 0
<  TEI: 000        EA: 1
< Zero: 0     S: 0 01: 1  [ RR (receive ready) ]
< N(R): 011 P/F: 1
< 0 bytes of data

Sending faxes using call files work, but I want to be able to send a fax during a call if possible.

Regards
Mick

Hi there!
Have a look at this info concerning Asterisk 11

[code]* For DAHDI channels, the CHANNEL() dialplan function now allows
the dialplan to request changes in the configuration of the active
echo canceller on the channel (if any), for the current call only.
The syntax is:

exten => s,n,Set(CHANNEL(echocan_mode)=off)

The possible values are:

on - normal mode (the echo canceller is actually reinitialized)
off - disabled
fax - FAX/data mode (NLP disabled if possible, otherwise completely disabled)
voice - voice mode (returns from FAX mode, reverting the changes that
were made when FAX mode was requested)[/code]

Thank you, looks like I will have to upgrade to 1.8 + to get it work :mrgreen:

Please notice that this information is suitable for Asterisk 11 only.

Hi bichara, its the same for 1.8 , I have it now working, thank you for your help.