[Freeswitch-users] possibly fixed: fax files not saved

Madovsky infos at madovsky.org
Sun Dec 12 19:27:46 MSK 2010


I think the api_hangup_hook can't come before if you don't answer ;)

----- Original Message ----- 
From: <pbdlists at pinboard.com>
To: "FreeSWITCH Users Help" <freeswitch-users at lists.freeswitch.org>
Sent: Saturday, December 11, 2010 5:53 PM
Subject: [Freeswitch-users] possibly fixed: fax files not saved


> Today I spent a couple of hours testing various things in regard to this
> problem. As far as I can tell, the files do not go missing if I have
>    <action application="answer" />
>    <action application="playback" data="silence_stream://2000"/>
> coming before
>    <action application="set" data="api_hangup_hook=system ...
>
> But if the api_hangup_hook comes before answer, then it happens. Why?
> Well, that's beyond me.
>
> Hope this info helps others too.
>
> Kurt
>
>
> On Thu, Dec 09, 2010 at 08:06:13PM -0500, Madovsky wrote:
>> do you have any function or command that delete your fax after sent email 
>> ?
>> if not, maybe try to delay the hangup...
>>
>>
>> ----- Original Message ----- 
>> From: <pbdlists at pinboard.com>
>> To: "FreeSWITCH Users Help" <freeswitch-users at lists.freeswitch.org>
>> Sent: Thursday, December 09, 2010 2:57 PM
>> Subject: Re: [Freeswitch-users] fax files not saved
>>
>>
>> > Oops, didn't catch the double underbar (the called script is not
>> > evaluating that parameter). Thanks, fixed it.
>> >
>> > You got me puzzled with your remark about session_in_hangup_hook. Had
>> > to look it up on the wiki. My guess is that with session_in_hangup_hook
>> > the variables get exported into the environment of the called
>> > script/application and can be queried there directly. But I'm calling
>> > the script with all the variables as parameters; the called script is
>> > not evaluating the environment, but the command line parameters it was
>> > passed.
>> >
>> > Meanwhile, anybody any idea about why the fax file is only written to
>> > disk sometimes?
>> >
>> > Cheers,
>> >
>> > Kurt
>> >
>> > On Wed, Dec 08, 2010 at 11:30:34AM -0500, Madovsky wrote:
>> >> you have first a typo
>> >> fax__image_resolution
>> >>
>> >> the thing I don't understand is you didn't
>> >> set session_in hangup_hook=true and
>> >> you can retrieve the channel vars at api_hangup_hook...
>> >>
>> >>
>> >>
>> >> ----- Original Message ----- 
>> >> From: <pbdlists at pinboard.com>
>> >> To: "freeswitch-users" <FreeSWITCH-users at lists.freeswitch.org>
>> >> Sent: Wednesday, December 08, 2010 10:30 AM
>> >> Subject: [Freeswitch-users] fax files not saved
>> >>
>> >>
>> >> > Hello!
>> >> >
>> >> > I managed to solve most of my other problems sofar, but with this 
>> >> > one I
>> >> > have no clue at all. Has anybody an idea what is happening here?
>> >> >
>> >> > 1 an inbound call to a number which is registered as fax 
>> >> > (mod_spandsp)
>> >> > 2 fax is detected and received according to the log (log entries see
>> >> > below)
>> >> > 3 but _sometimes_ the tiff file is never written to disk (post
>> >> > processing
>> >> >   script can't find it and it is really not there)
>> >> >
>> >> > The destination filesystem has enough free space and free inodes,
>> >> > permissions for writing are ok, the system is not under any kind of
>> >> > heavy load, no other calls going on at the same time...
>> >> >
>> >> > I don't have much data to test this (using www.freepopfax.com for
>> >> > testing and they have a daily limit on faxes I can send), but it 
>> >> > seems
>> >> > to happen roughly for 30-50% of the incoming fax messages. From the
>> >> > same
>> >> > fax provider it works fine one time, then not a couple of minutes
>> >> > later,
>> >> > another couple of minutes later it may work again, all while nothing 
>> >> > at
>> >> > all is being changed on the freeswitch server. If it was something 
>> >> > like
>> >> > a dropped line or anything I could understand it, but the logs say
>> >> > everything is ok and still _sometimes_ the fax is not written to
>> >> > disk...
>> >> >
>> >> > Cheers,
>> >> >
>> >> > Kurt
>> >> >
>> >> > =======================================================================
>> >> > entries in fax.conf.xml
>> >> > =======================================================================
>> >> > <configuration name="fax.conf" description="FAX application
>> >> > configuration">
>> >> >    <settings>
>> >> >        <param name="use-ecm"           value="true"/>
>> >> >        <param name="verbose"           value="false"/>
>> >> >        <param name="disable-v17"       value="false"/>
>> >> >        <param name="ident"             value="SpanDSP Fax Ident"/>
>> >> >        <param name="header"            value="SpanDSP Fax Header"/>
>> >> >
>> >> >        <param name="spool-dir"         value="/tmp"/>
>> >> >        <param name="file-prefix"       value="faxrx"/>
>> >> >    </settings>
>> >> > </configuration>
>> >> >
>> >> >
>> >> > =======================================================================
>> >> > the part from default.xml
>> >> > =======================================================================
>> >> >    <extension name="fax_receive">
>> >> >        <condition field="destination_number" expression="^(1111)$">
>> >> >            <action application="set" data="api_hangup_hook=system
>> >> > ${base_dir}/scripts/emailfax.sh $1 /tmp/FAX-${uuid}.tiff
>> >> > '\\\${fax_success}' '\\\${fax_result_code}' '\\\${fax_result_text}'
>> >> > '\\\${fax_local_station_id}' '\\\${fax_remote_station_id}'
>> >> > '\\\${fax_document_transferred_pages}' 
>> >> > '\\\${fax_document_total_pages}'
>> >> > '\\\${fax__image_resolution}' '\\\${fax_image_size}'
>> >> > '\\\${fax_bad_rows}'
>> >> > '\\\${fax_transfer_rate}' '\\\${fax_v17_disabled}'
>> >> > '\\\${fax_ecm_requested}' '\\\${fax_filename}' "/>
>> >> >            <action application="answer" />
>> >> >            <action application="playback"
>> >> > data="silence_stream://2000"/>
>> >> > <!--
>> >> >            <action application="set"
>> >> > data="fax_enable_t38_request=true"/>
>> >> >            <action application="set" data="fax_enable_t38=true"/>
>> >> > -->
>> >> >            <action application="set" data="fax_ident=+41xxxxxxxxx"/>
>> >> >            <action application="set" data="fax_disable_v17=1"/>
>> >> >            <action application="set" data="fax_verbose=0"/>
>> >> >            <action application="rxfax" 
>> >> > data="/tmp/FAX-${uuid}.tiff"/>
>> >> >            <action application="hangup"/>
>> >> >        </condition>
>> >> >    </extension>
>> >> >
>> >> >
>> >> > =======================================================================
>> >> > log entry from an unsuccessful incoming fax:
>> >> > =======================================================================
>> >> >
>> >> > 2010-12-07 23:33:51.157588 [DEBUG] sofia_glue.c:182
>> >> > sofia/external/Anonymous at anonymous.invalid image media sdp:
>> >> > v=0
>> >> > o=FreeSWITCH 1291733462 1291733465 IN IP4 xxx.xxx.xxx.xxx
>> >> > s=FreeSWITCH
>> >> > c=IN IP4 xxx.xxx.xxx.xxx
>> >> > t=0 0
>> >> > m=image 31358 udptl t38
>> >> > a=T38FaxVersion:0
>> >> > a=T38MaxBitRate:9600
>> >> > a=T38FaxFillBitRemoval
>> >> > a=T38FaxRateManagement:transferredTCF
>> >> > a=T38FaxMaxBuffer:2000
>> >> > a=T38FaxMaxDatagram:400
>> >> > a=T38FaxUdpEC:t38UDPRedundancy
>> >> >
>> >> > 2010-12-07 23:33:51.157588 [DEBUG] sofia.c:4597 Channel
>> >> > sofia/external/Anonymous at anonymous.invalid entering state
>> >> > [completed][200]
>> >> > 2010-12-07 23:33:51.157588 [DEBUG] sofia.c:4597 Channel
>> >> > sofia/external/Anonymous at anonymous.invalid entering state 
>> >> > [ready][200]
>> >> > 2010-12-07 23:33:58.814979 [DEBUG] switch_rtp.c:2544 Correct ip/port
>> >> > confirmed.
>> >> > 2010-12-07 23:35:09.772752 [DEBUG] switch_channel.c:2457
>> >> > (sofia/external/Anonymous at anonymous.invalid) Callstate Change 
>> >> > ACTIVE ->
>> >> > HANGUP
>> >> > 2010-12-07 23:35:09.772752 [NOTICE] sofia.c:528 Hangup
>> >> > sofia/external/Anonymous at anonymous.invalid [CS_EXECUTE]
>> >> > [NORMAL_CLEARING]
>> >> > 2010-12-07 23:35:09.772752 [DEBUG] switch_channel.c:2473 Send signal
>> >> > sofia/external/Anonymous at anonymous.invalid [KILL]
>> >> > 2010-12-07 23:35:09.772752 [DEBUG] switch_core_session.c:1057 Send
>> >> > signal
>> >> > sofia/external/Anonymous at anonymous.invalid [BREAK]
>> >> > 2010-12-07 23:35:09.772752 [DEBUG] mod_spandsp_fax.c:323
>> >> > ==============================================================================
>> >> > 2010-12-07 23:35:09.772752 [DEBUG] mod_spandsp_fax.c:329 Fax
>> >> > successfully
>> >> > received.
>> >> > 2010-12-07 23:35:09.772752 [DEBUG] mod_spandsp_fax.c:340 Remote 
>> >> > station
>> >> > id:
>> >> > 2010-12-07 23:35:09.772752 [DEBUG] mod_spandsp_fax.c:341 Local 
>> >> > station
>> >> > id:
>> >> > +41xxxxxxxxx
>> >> > 2010-12-07 23:35:09.772752 [DEBUG] mod_spandsp_fax.c:342 Pages
>> >> > transferred: 2
>> >> > 2010-12-07 23:35:09.772752 [DEBUG] mod_spandsp_fax.c:344 Total fax
>> >> > pages:
>> >> > 2
>> >> > 2010-12-07 23:35:09.772752 [DEBUG] mod_spandsp_fax.c:345 Image
>> >> > resolution:
>> >> > 8031x7700
>> >> > 2010-12-07 23:35:09.772752 [DEBUG] mod_spandsp_fax.c:346 Transfer 
>> >> > Rate:
>> >> > 9600
>> >> > 2010-12-07 23:35:09.772752 [DEBUG] mod_spandsp_fax.c:348 ECM status
>> >> > on
>> >> > 2010-12-07 23:35:09.772752 [DEBUG] mod_spandsp_fax.c:349 remote
>> >> > country:
>> >> > 2010-12-07 23:35:09.772752 [DEBUG] mod_spandsp_fax.c:350 remote 
>> >> > vendor:
>> >> > 2010-12-07 23:35:09.772752 [DEBUG] mod_spandsp_fax.c:351 remote 
>> >> > model:
>> >> > 2010-12-07 23:35:09.772752 [DEBUG] mod_spandsp_fax.c:353
>> >> > ==============================================================================
>> >> > 2010-12-07 23:35:09.772752 [DEBUG] switch_core_codec.c:141
>> >> > sofia/external/Anonymous at anonymous.invalid Restore previous codec
>> >> > PCMA:8.
>> >> > 2010-12-07 23:35:09.772752 [DEBUG] switch_core_session.c:1933
>> >> > sofia/external/Anonymous at anonymous.invalid skip receive message
>> >> > [APPLICATION_EXEC_COMPLETE] (channel is hungup already)
>> >> > 2010-12-07 23:35:09.772752 [DEBUG] switch_core_state_machine.c:366
>> >> > (sofia/external/Anonymous at anonymous.invalid) State EXECUTE going to
>> >> > sleep
>> >> > 2010-12-07 23:35:09.772752 [DEBUG] switch_core_state_machine.c:320
>> >> > (sofia/external/Anonymous at anonymous.invalid) Running State Change
>> >> > CS_HANGUP
>> >> > 2010-12-07 23:35:09.772752 [DEBUG] switch_core_state_machine.c:553
>> >> > (sofia/external/Anonymous at anonymous.invalid) State HANGUP
>> >> > 2010-12-07 23:35:09.772752 [DEBUG] mod_sofia.c:453
>> >> > sofia/external/Anonymous at anonymous.invalid Overriding SIP cause 480
>> >> > with
>> >> > 200 from the other leg
>> >> > 2010-12-07 23:35:09.772752 [DEBUG] mod_sofia.c:459 Channel
>> >> > sofia/external/Anonymous at anonymous.invalid hanging up, cause:
>> >> > NORMAL_CLEARING
>> >> > 2010-12-07 23:35:09.821455 [DEBUG] switch_core_state_machine.c:46
>> >> > sofia/external/Anonymous at anonymous.invalid Standard HANGUP, cause:
>> >> > NORMAL_CLEARING
>> >> > 2010-12-07 23:35:09.821455 [DEBUG] switch_core_state_machine.c:553
>> >> > (sofia/external/Anonymous at anonymous.invalid) State HANGUP going to
>> >> > sleep
>> >> > 2010-12-07 23:35:09.822803 [NOTICE] mod_commands.c:4187 Executing
>> >> > command:
>> >> > /usr/local/freeswitch/scripts/emailfax.sh 1111
>> >> > /tmp/FAX-6bf84d88-025a-11e0-b236-7391745d448b.tiff '1' '0' 'OK'
>> >> > '+41xxxxxxxxx' '' '2' '2
>> >> > ' '' '0' '0' '9600' '1' '1'
>> >> > '/tmp/FAX-6bf84d88-025a-11e0-b236-7391745d448b.tiff'
>> >> > 2010-12-07 23:35:10.076623 [DEBUG] switch_core_state_machine.c:488
>> >> > Hangup
>> >> > Command with no Session
>> >> > system(/usr/local/freeswitch/scripts/emailfax.sh
>> >> > 1111 /tmp/FAX-6bf84d88-025a-11e0-b236-7391745d448b.tiff '1' '0'
>> >> > 'OK' '+41xxxxxxxxx' '' '2' '2' '' '0' '0' '9600' '1' '1'
>> >> > '/tmp/FAX-6bf84d88-025a-11e0-b236-7391745d448b.tiff' ):
>> >> > +OK
>> >> >
>> >> >
>> >> > =======================================================================
>> >> > log entry from a successful incoming fax:
>> >> > =======================================================================
>> >> >
>> >> > 2010-12-07 23:54:59.082301 [DEBUG] sofia_glue.c:182
>> >> > sofia/external/Anonymous at anonymous.invalid image media sdp:
>> >> > v=0
>> >> > o=FreeSWITCH 1291735801 1291735804 IN IP4 xxx.xxx.xxx.xxx
>> >> > s=FreeSWITCH
>> >> > c=IN IP4 xxx.xxx.xxx.xxx
>> >> > t=0 0
>> >> > m=image 30280 udptl t38
>> >> > a=T38FaxVersion:0
>> >> > a=T38MaxBitRate:9600
>> >> > a=T38FaxFillBitRemoval
>> >> > a=T38FaxRateManagement:transferredTCF
>> >> > a=T38FaxMaxBuffer:2000
>> >> > a=T38FaxMaxDatagram:400
>> >> > a=T38FaxUdpEC:t38UDPRedundancy
>> >> >
>> >> > 2010-12-07 23:54:59.082301 [DEBUG] sofia.c:4597 Channel
>> >> > sofia/external/Anonymous at anonymous.invalid entering state
>> >> > [completed][200]
>> >> > 2010-12-07 23:54:59.100811 [DEBUG] sofia.c:4597 Channel
>> >> > sofia/external/Anonymous at anonymous.invalid entering state 
>> >> > [ready][200]
>> >> > 2010-12-07 23:55:06.783427 [DEBUG] switch_rtp.c:2544 Correct ip/port
>> >> > confirmed.
>> >> > 2010-12-07 23:55:31.563208 [DEBUG] mod_spandsp_fax.c:323
>> >> > ==============================================================================
>> >> > 2010-12-07 23:55:31.563208 [DEBUG] mod_spandsp_fax.c:329 Fax
>> >> > successfully
>> >> > received.
>> >> > 2010-12-07 23:55:31.563208 [DEBUG] mod_spandsp_fax.c:340 Remote 
>> >> > station
>> >> > id:
>> >> > 2010-12-07 23:55:31.563208 [DEBUG] mod_spandsp_fax.c:341 Local 
>> >> > station
>> >> > id:
>> >> > +41xxxxxxxxx
>> >> > 2010-12-07 23:55:31.563208 [DEBUG] mod_spandsp_fax.c:342 Pages
>> >> > transferred: 1
>> >> > 2010-12-07 23:55:31.563208 [DEBUG] mod_spandsp_fax.c:344 Total fax
>> >> > pages:
>> >> > 1
>> >> > 2010-12-07 23:55:31.563208 [DEBUG] mod_spandsp_fax.c:345 Image
>> >> > resolution:
>> >> > 8031x7700
>> >> > 2010-12-07 23:55:31.563208 [DEBUG] mod_spandsp_fax.c:346 Transfer 
>> >> > Rate:
>> >> > 9600
>> >> > 2010-12-07 23:55:31.563208 [DEBUG] mod_spandsp_fax.c:348 ECM status
>> >> > on
>> >> > 2010-12-07 23:55:31.563208 [DEBUG] mod_spandsp_fax.c:349 remote
>> >> > country:
>> >> > 2010-12-07 23:55:31.563208 [DEBUG] mod_spandsp_fax.c:350 remote 
>> >> > vendor:
>> >> > 2010-12-07 23:55:31.563208 [DEBUG] mod_spandsp_fax.c:351 remote 
>> >> > model:
>> >> > 2010-12-07 23:55:31.563208 [DEBUG] mod_spandsp_fax.c:353
>> >> > ==============================================================================
>> >> > 2010-12-07 23:55:31.616038 [DEBUG] switch_channel.c:2457
>> >> > (sofia/external/Anonymous at anonymous.invalid) Callstate Change 
>> >> > ACTIVE ->
>> >> > HANGUP
>> >> > 2010-12-07 23:55:31.616038 [NOTICE] sofia.c:528 Hangup
>> >> > sofia/external/Anonymous at anonymous.invalid [CS_EXECUTE]
>> >> > [NORMAL_CLEARING]
>> >> > 2010-12-07 23:55:31.616038 [DEBUG] switch_channel.c:2473 Send signal
>> >> > sofia/external/Anonymous at anonymous.invalid [KILL]
>> >> > 2010-12-07 23:55:31.616038 [DEBUG] switch_core_session.c:1057 Send
>> >> > signal
>> >> > sofia/external/Anonymous at anonymous.invalid [BREAK]
>> >> > 2010-12-07 23:55:31.617356 [DEBUG] switch_core_codec.c:141
>> >> > sofia/external/Anonymous at anonymous.invalid Restore previous codec
>> >> > PCMA:8.
>> >> > 2010-12-07 23:55:31.617356 [DEBUG] switch_core_session.c:1933
>> >> > sofia/external/Anonymous at anonymous.invalid skip receive message
>> >> > [APPLICATION_EXEC_COMPLETE] (channel is hungup already)
>> >> > 2010-12-07 23:55:31.617356 [DEBUG] switch_core_state_machine.c:366
>> >> > (sofia/external/Anonymous at anonymous.invalid) State EXECUTE going to
>> >> > sleep
>> >> > 2010-12-07 23:55:31.617356 [DEBUG] switch_core_state_machine.c:320
>> >> > (sofia/external/Anonymous at anonymous.invalid) Running State Change
>> >> > CS_HANGUP
>> >> > 2010-12-07 23:55:31.618542 [DEBUG] switch_core_state_machine.c:553
>> >> > (sofia/external/Anonymous at anonymous.invalid) State HANGUP
>> >> > 2010-12-07 23:55:31.618542 [DEBUG] mod_sofia.c:453
>> >> > sofia/external/Anonymous at anonymous.invalid Overriding SIP cause 480
>> >> > with
>> >> > 200 from the other leg
>> >> > 2010-12-07 23:55:31.618542 [DEBUG] mod_sofia.c:459 Channel
>> >> > sofia/external/Anonymous at anonymous.invalid hanging up, cause:
>> >> > NORMAL_CLEARING
>> >> > 2010-12-07 23:55:31.721993 [DEBUG] switch_core_state_machine.c:46
>> >> > sofia/external/Anonymous at anonymous.invalid Standard HANGUP, cause:
>> >> > NORMAL_CLEARING
>> >> > 2010-12-07 23:55:31.721993 [DEBUG] switch_core_state_machine.c:553
>> >> > (sofia/external/Anonymous at anonymous.invalid) State HANGUP going to
>> >> > sleep
>> >> > 2010-12-07 23:55:31.721993 [NOTICE] mod_commands.c:4187 Executing
>> >> > command:
>> >> > /usr/local/freeswitch/scripts/emailfax.sh 1111
>> >> > /tmp/FAX-5bd5649c-025d-11e0-b242-7391745d448b.tiff '1' '0' 'OK'
>> >> > '+41xxxxxxxxx' '' '1' '1' '' '0' '0' '9600' '1' '1'
>> >> > '/tmp/FAX-5bd5649c-025d-11e0-b242-7391745d448b.tiff'
>> >> > 2010-12-07 23:55:31.904090 [DEBUG] switch_core_state_machine.c:488
>> >> > Hangup
>> >> > Command with no Session
>> >> > system(/usr/local/freeswitch/scripts/emailfax.sh
>> >> > 1111 /tmp/FAX-5bd5649c-025d-11e0-b242-7391745d448b.tiff '1' '0' 'OK'
>> >> > '+41xxxxxxxxx' '' '1' '1' '' '0' '0' '9600' '1' '1'
>> >> > '/tmp/FAX-5bd5649c-025d-11e0-b242-7391745d448b.tiff' ):
>> >> > +OK
>> >> >
>> >
>> > _______________________________________________
>> > FreeSWITCH-users mailing list
>> > FreeSWITCH-users at lists.freeswitch.org
>> > http://lists.freeswitch.org/mailman/listinfo/freeswitch-users
>> > UNSUBSCRIBE:http://lists.freeswitch.org/mailman/options/freeswitch-users
>> > http://www.freeswitch.org
>>
>>
>> _______________________________________________
>> FreeSWITCH-users mailing list
>> FreeSWITCH-users at lists.freeswitch.org
>> http://lists.freeswitch.org/mailman/listinfo/freeswitch-users
>> UNSUBSCRIBE:http://lists.freeswitch.org/mailman/options/freeswitch-users
>> http://www.freeswitch.org
>
> _______________________________________________
> FreeSWITCH-users mailing list
> FreeSWITCH-users at lists.freeswitch.org
> http://lists.freeswitch.org/mailman/listinfo/freeswitch-users
> UNSUBSCRIBE:http://lists.freeswitch.org/mailman/options/freeswitch-users
> http://www.freeswitch.org 




More information about the FreeSWITCH-users mailing list